Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: checkout addons in scripts/test if necessary
#708 moved pkg/config/templates/rancherd-22-addons.yaml to a separate "addons" repo, and added code to `scripts/build` to clone this repo during build and copy that yaml file to ./pkg/config/templates. So everything works fine if you run `make` or `make ci`. However, if you just run `make test` by itself (which you might do during development), rancherd-22-addons.yaml isn't available, and the tests fail with: ``` Running tests --- FAIL: TestConvertToCos_SSHKeysInYipNetworkStage (0.00s) cos_test.go:71: Error Trace: /go/src/github.com/harvester/harvester-installer/pkg/config/cos_test.go:71 Error: Received unexpected error: open templates/rancherd-22-addons.yaml: file does not exist Test: TestConvertToCos_SSHKeysInYipNetworkStage panic: runtime error: invalid memory address or nil pointer dereference [recovered] panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x731164] ``` We can fix this by duplicating the addons clone code from `scripts/build` into `scripts/test`. This has no impact on normal builds (`make` or `make ci`) because the addons repo has already been cloned by `scripts/build` in that case. Related issue: harvester/harvester#4937 Signed-off-by: Tim Serong <[email protected]>
- Loading branch information