Skyhook Libs
This package contains shared libraries for Crossplane Skyhook.
Recent Changes
YAML Parsing in pkg/node/process.go
The code now properly parses the .yarnrc.yml
file using the sigs.k8s.io/yaml
library instead of string manipulation.
Direct Yarn Execution
We've improved the yarn installation process by directly executing the yarn binary from the path specified in the .yarnrc.yml
file. This approach:
- Extracts the
yarnPath
from the .yarnrc.yml
file
- Constructs the absolute path to the yarn executable
- Executes it directly with Node.js
Implementation Details
The Go code now:
- Parses the
.yarnrc.yml
file to extract the yarnPath
value
- Falls back to a default path if not found
- Executes the yarn binary directly:
var yarnPath string
if yarnConfig != nil {
if path, ok := yarnConfig["yarnPath"].(string); ok {
yarnPath = path
}
}
if yarnPath == "" {
yarnPath = ".yarn/releases/yarn-4.7.0.cjs"
}
yarnExecPath := filepath.Join("/app", yarnPath)
yarnCmd := exec.Command("node", yarnExecPath, "install")
yarnCmd.Dir = uniqueDirPath
This approach ensures that the yarn installation process runs in a separate process and doesn't block the main Node.js process, while also being more robust by using the exact yarn executable specified in the project configuration.