-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Since charts-build-scripts directly exec the diff call, as seen here:
charts-build-scripts/pkg/diff/diff.go
Line 19 in aa49bb9
| pathToDiffCmd, err := exec.LookPath("diff") |
It doesn't have the same results on all machines since the version of diff used can be different.
To solve this, we should be using containerized rancher/charts-build-scripts runs instead of pulling in an appropriate charts-build-scripts binary to a machine (the current approach).
To do this, a couple of steps needs to be taken:
- We need to fix the Dockerfile to actually work: filed a PR in Fix Dockerfile to use SLES bci-base and include GNU patch #98 to resolve this
- Drone / GitHub workflows need to be set up to actually create the rancher/charts-build-scripts images and put them in a publicly accessible Docker repository
- make commands in https://github.com/rancher/charts-build-scripts/blob/master/templates/template/Makefile need to be modified to actually use this binary
- changes need to be made across relevant repos to use this appraoch
I pushed an image based on my current PR in https://github.com/rancher/charts-build-scripts/blob/master/templates/template/Makefile (based on v0.4.2) to my DockerHub fork for now, in case anyone wants to use it. To create your own, I ran REPO=arvindiyengar TAG=dev make build; REPO=arvindiyengar TAG=dev make package.
To run all the relevant commands in the containerized approach today, you can do that as follows:
# Assuming your current pwd is your charts directory (rancher/charts, rancher/rke2-charts, etc.)
PACKAGE=rancher-monitoring/rancher-monitoring
docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts prepare
docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts patch
docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts clean
docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts charts
docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts validate