@@ -18,11 +18,18 @@ K0S_BINARY_SOURCE_OVERRIDE =
1818TROUBLESHOOT_VERSION = v0.117.0
1919
2020KOTS_VERSION = v$(shell awk '/^version/{print $$2}' pkg/addons/adminconsole/static/metadata.yaml | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+) .*/\1/')
21- # When updating KOTS_BINARY_URL_OVERRIDE, also update the KOTS_VERSION above or
22- # scripts/ci-upload-binaries.sh may find the version in the cache and not upload the overridden binary.
21+ # If KOTS_BINARY_URL_OVERRIDE is set to a ttl.sh artifact, there's NO need to update the KOTS_VERSION above as it will be dynamically generated
2322KOTS_BINARY_URL_OVERRIDE =
23+ # If KOTS_BINARY_FILE_OVERRIDE is set, there's NO need to update the KOTS_VERSION above as it will be dynamically generated
2424# For dev env, build the kots binary in the kots repo with "make kots-linux-arm64" and set this to "../kots/bin/kots"
2525KOTS_BINARY_FILE_OVERRIDE =
26+
27+ ifeq ($(findstring ttl.sh,$(KOTS_BINARY_URL_OVERRIDE ) ) ,ttl.sh)
28+ KOTS_VERSION = kots-dev-$(shell oras manifest fetch $(KOTS_BINARY_URL_OVERRIDE ) | jq '.layers[0].digest' | cut -c9-15)
29+ else ifdef KOTS_BINARY_FILE_OVERRIDE
30+ KOTS_VERSION = kots-dev-$(shell shasum -a 256 $(KOTS_BINARY_FILE_OVERRIDE ) | cut -c1-8)
31+ endif
32+
2633# TODO: move this to a manifest file
2734LOCAL_ARTIFACT_MIRROR_IMAGE ?= proxy.replicated.com/anonymous/replicated/embedded-cluster-local-artifact-mirror:$(VERSION )
2835# These are used to override the binary urls in dev and e2e tests
@@ -38,10 +45,6 @@ else ifeq ($(K0S_VERSION),v1.28.14+k0s.0-ec.0)
3845K0S_BINARY_SOURCE_OVERRIDE = https://tf-staging-embedded-cluster-bin.s3.amazonaws.com/custom-k0s-binaries/k0s-v1.28.14%2Bk0s.0-ec.0-$(ARCH )
3946endif
4047
41- ifneq ($(KOTS_BINARY_FILE_OVERRIDE ) ,)
42- KOTS_VERSION = kots-dev-$(shell shasum -a 256 $(KOTS_BINARY_FILE_OVERRIDE ) | cut -c1-8)
43- endif
44-
4548LD_FLAGS = \
4649 -X github.com/replicatedhq/embedded-cluster/pkg/versions.K0sVersion=$(K0S_VERSION ) \
4750 -X github.com/replicatedhq/embedded-cluster/pkg/versions.Version=$(VERSION ) \
@@ -173,7 +176,11 @@ output/bins/kubectl-kots-%:
173176output/bins/kubectl-kots-override :
174177 mkdir -p output/bins
175178 mkdir -p output/tmp
176- curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz " $( KOTS_BINARY_URL_OVERRIDE) "
179+ if [[ " $( KOTS_BINARY_URL_OVERRIDE) " == ttl.sh* ]]; then \
180+ oras pull " $( KOTS_BINARY_URL_OVERRIDE) " --output output/tmp ; \
181+ else \
182+ curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz " $( KOTS_BINARY_URL_OVERRIDE) " ; \
183+ fi
177184 tar -xzf output/tmp/kots.tar.gz -C output/tmp
178185 mv output/tmp/kots $@
179186 touch $@
0 commit comments