Skip to content

Commit 543bcfb

Browse files
committed
merge main
2 parents dff3369 + 1cd37cf commit 543bcfb

File tree

205 files changed

+3175
-863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+3175
-863
lines changed

.github/actions/e2e-troubleshoot/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ runs:
5656
echo -e "\e[1;33m \e[0m"
5757
echo -e "\e[1;33m 3- From inside the extracted directory, run: \e[0m"
5858
echo -e "\e[1;33m \e[0m"
59-
echo -e "\e[1;32m sbctl serve -s . \e[0m"
59+
echo -e "\e[1;32m sbctl shell . \e[0m"
6060
echo -e "\e[1;33m \e[0m"
61-
echo -e "\e[1;33m 4- Export the printed kubeconfig to interact with the cluster. \e[0m"
61+
echo -e "\e[1;33m 4- Run kubectl commands in the new shell and run `exit` once done \e[0m"
6262
echo -e "\e[1;33m \e[0m"
6363
echo -e "\e[1;33m└──────────────────────────────────────────────────────────────────────────────────────────────────────┘\e[0m"
6464
shell: bash

.github/workflows/ci.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
- name: Lint
4242
uses: golangci/golangci-lint-action@v6
4343
with:
44-
version: v1.60.3
4544
args: --build-tags exclude_graphdriver_btrfs
4645

4746
test:
@@ -102,6 +101,8 @@ jobs:
102101
./dev/.gomodcache
103102
key: dryrun-tests-go-cache
104103
- name: Dryrun tests
104+
env:
105+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105106
run: |
106107
make dryrun-tests
107108
@@ -169,6 +170,8 @@ jobs:
169170
go-version-file: go.mod
170171
cache-dependency-path: "**/*.sum"
171172

173+
- uses: oras-project/setup-oras@v1
174+
172175
- name: Install dagger
173176
run: |
174177
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
@@ -239,6 +242,8 @@ jobs:
239242
go-version-file: go.mod
240243
cache-dependency-path: "**/*.sum"
241244

245+
- uses: oras-project/setup-oras@v1
246+
242247
- name: Install dagger
243248
run: |
244249
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
@@ -344,6 +349,8 @@ jobs:
344349
go-version-file: go.mod
345350
cache-dependency-path: "**/*.sum"
346351

352+
- uses: oras-project/setup-oras@v1
353+
347354
- name: Install dagger
348355
run: |
349356
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
@@ -621,6 +628,7 @@ jobs:
621628
matrix:
622629
test:
623630
- TestPreflights
631+
- TestPreflightsNoexec
624632
- TestMaterialize
625633
- TestHostPreflightCustomSpec
626634
- TestHostPreflightInBuiltSpec

.github/workflows/image-deps-updater.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
INPUT_VELERO_VERSION: ${{ github.event.inputs.velero_version }}
7979
INPUT_VELERO_AWS_PLUGIN_VERSION: ${{ github.event.inputs.velero_aws_plugin_version }}
8080
INPUT_KUBECTL_VERSION: ${{ github.event.inputs.kubectl_version }}
81-
INPUT_SEAWEEDFS_VERSION: ${{ github.event.inputs.seaweedfs_version || '3.79' }}
81+
INPUT_SEAWEEDFS_VERSION: ${{ github.event.inputs.seaweedfs_version }}
8282
ARCHS: "amd64,arm64"
8383
run: |
8484
chmod +x ./output/bin/buildtools

.github/workflows/release-prod.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ jobs:
148148
go-version-file: go.mod
149149
cache-dependency-path: "**/*.sum"
150150

151+
- uses: oras-project/setup-oras@v1
152+
151153
- name: Download buildtools artifact
152154
uses: actions/download-artifact@v4
153155
with:
@@ -463,6 +465,7 @@ jobs:
463465
matrix:
464466
test:
465467
- TestPreflights
468+
- TestPreflightsNoexec
466469
- TestMaterialize
467470
- TestHostPreflightCustomSpec
468471
- TestHostPreflightInBuiltSpec

.github/workflows/update-addons.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
CHARTS_DESTINATION: registry.replicated.com/ec-charts
6868
INPUT_OPENEBS_CHART_VERSION: ${{ github.event.inputs.openebs_chart_version }}
6969
INPUT_VELERO_CHART_VERSION: ${{ github.event.inputs.velero_chart_version }}
70-
INPUT_SEAWEEDFS_CHART_VERSION: ${{ github.event.inputs.seaweedfs_chart_version || '4.0.379' }}
70+
INPUT_SEAWEEDFS_CHART_VERSION: ${{ github.event.inputs.seaweedfs_chart_version }}
7171
ARCHS: "amd64,arm64"
7272
run: |
7373
chmod 755 ./output/bin/buildtools

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ hack/release
2727

2828
# Test binary, built with `go test -c`
2929
*.test
30+
31+
# helm charts dependencies
32+
*.tgz

Makefile

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ K0S_BINARY_SOURCE_OVERRIDE =
1818
TROUBLESHOOT_VERSION = v0.117.0
1919

2020
KOTS_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
2322
KOTS_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"
2525
KOTS_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
2734
LOCAL_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)
3845
K0S_BINARY_SOURCE_OVERRIDE = https://tf-staging-embedded-cluster-bin.s3.amazonaws.com/custom-k0s-binaries/k0s-v1.28.14%2Bk0s.0-ec.0-$(ARCH)
3946
endif
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-
4548
LD_FLAGS = \
4649
-X github.com/replicatedhq/embedded-cluster/pkg/versions.K0sVersion=$(K0S_VERSION) \
4750
-X github.com/replicatedhq/embedded-cluster/pkg/versions.Version=$(VERSION) \
@@ -69,30 +72,39 @@ random-string = $(shell LC_ALL=C tr -dc 'A-Za-z0-9' < /dev/urandom | head -c6)
6972

7073
.PHONY: cmd/installer/goods/bins/k0s
7174
cmd/installer/goods/bins/k0s:
72-
$(MAKE) output/bins/k0s-$(K0S_VERSION)-$(ARCH)
73-
mkdir -p cmd/installer/goods/bins
74-
cp output/bins/k0s-$(K0S_VERSION)-$(ARCH) $@
75-
76-
output/bins/k0s-%:
7775
mkdir -p output/bins
7876
if [ "$(K0S_BINARY_SOURCE_OVERRIDE)" != "" ]; then \
79-
curl --retry 5 --retry-all-errors -fL -o $@ "$(K0S_BINARY_SOURCE_OVERRIDE)" ; \
77+
$(MAKE) output/bins/k0s-override ; \
78+
cp output/bins/k0s-override $@ ; \
8079
else \
81-
curl --retry 5 --retry-all-errors -fL -o $@ "https://github.com/k0sproject/k0s/releases/download/$(call split-hyphen,$*,1)/k0s-$(call split-hyphen,$*,1)-$(call split-hyphen,$*,2)" ; \
80+
$(MAKE) output/bins/k0s-$(K0S_VERSION)-$(ARCH) ; \
81+
cp output/bins/k0s-$(K0S_VERSION)-$(ARCH) $@ ; \
8282
fi
83+
84+
output/bins/k0s-%:
85+
curl --retry 5 --retry-all-errors -fL -o $@ \
86+
"https://github.com/k0sproject/k0s/releases/download/$(call split-hyphen,$*,1)/k0s-$(call split-hyphen,$*,1)-$(call split-hyphen,$*,2)"
87+
chmod +x $@
88+
touch $@
89+
90+
.PHONY: output/bins/k0s-override
91+
output/bins/k0s-override:
92+
mkdir -p output/bins
93+
curl --retry 5 --retry-all-errors -fL -o $@ \
94+
"$(K0S_BINARY_SOURCE_OVERRIDE)"
8395
chmod +x $@
8496
touch $@
8597

8698
.PHONY: cmd/installer/goods/bins/kubectl-support_bundle
8799
cmd/installer/goods/bins/kubectl-support_bundle:
88100
$(MAKE) output/bins/kubectl-support_bundle-$(TROUBLESHOOT_VERSION)-$(ARCH)
89-
mkdir -p cmd/installer/goods/bins
90101
cp output/bins/kubectl-support_bundle-$(TROUBLESHOOT_VERSION)-$(ARCH) $@
91102

92103
output/bins/kubectl-support_bundle-%:
93104
mkdir -p output/bins
94105
mkdir -p output/tmp
95-
curl --retry 5 --retry-all-errors -fL -o output/tmp/support-bundle.tar.gz "https://github.com/replicatedhq/troubleshoot/releases/download/$(call split-hyphen,$*,1)/support-bundle_$(OS)_$(call split-hyphen,$*,2).tar.gz"
106+
curl --retry 5 --retry-all-errors -fL -o output/tmp/support-bundle.tar.gz \
107+
"https://github.com/replicatedhq/troubleshoot/releases/download/$(call split-hyphen,$*,1)/support-bundle_$(OS)_$(call split-hyphen,$*,2).tar.gz"
96108
tar -xzf output/tmp/support-bundle.tar.gz -C output/tmp
97109
mv output/tmp/support-bundle $@
98110
rm -rf output/tmp
@@ -101,27 +113,26 @@ output/bins/kubectl-support_bundle-%:
101113
.PHONY: cmd/installer/goods/bins/kubectl-preflight
102114
cmd/installer/goods/bins/kubectl-preflight:
103115
$(MAKE) output/bins/kubectl-preflight-$(TROUBLESHOOT_VERSION)-$(ARCH)
104-
mkdir -p cmd/installer/goods/bins
105116
cp output/bins/kubectl-preflight-$(TROUBLESHOOT_VERSION)-$(ARCH) $@
106117

107118
output/bins/kubectl-preflight-%:
108119
mkdir -p output/bins
109120
mkdir -p output/tmp
110-
curl --retry 5 --retry-all-errors -fL -o output/tmp/preflight.tar.gz https://github.com/replicatedhq/troubleshoot/releases/download/$(call split-hyphen,$*,1)/preflight_$(OS)_$(call split-hyphen,$*,2).tar.gz
121+
curl --retry 5 --retry-all-errors -fL -o output/tmp/preflight.tar.gz \
122+
https://github.com/replicatedhq/troubleshoot/releases/download/$(call split-hyphen,$*,1)/preflight_$(OS)_$(call split-hyphen,$*,2).tar.gz
111123
tar -xzf output/tmp/preflight.tar.gz -C output/tmp
112124
mv output/tmp/preflight $@
113125
rm -rf output/tmp
114126
touch $@
115127

116128
.PHONY: cmd/installer/goods/bins/local-artifact-mirror
117129
cmd/installer/goods/bins/local-artifact-mirror:
118-
mkdir -p cmd/installer/goods/bins
119130
$(MAKE) -C local-artifact-mirror build OS=$(OS) ARCH=$(ARCH)
120131
cp local-artifact-mirror/bin/local-artifact-mirror-$(OS)-$(ARCH) $@
121132
touch $@
122133

123134
ifndef FIO_VERSION
124-
FIO_VERSION = $(shell curl --retry 5 --retry-all-errors -fsSL https://api.github.com/repos/axboe/fio/releases/latest | jq -r '.tag_name' | cut -d- -f2)
135+
FIO_VERSION = $(shell curl -fsSL --retry 5 --retry-all-errors $(GH_AUTH_HEADER) https://api.github.com/repos/axboe/fio/releases | jq -r '. | first | .tag_name' | cut -d- -f2)
125136
endif
126137

127138
output/bins/fio-%:
@@ -136,13 +147,11 @@ output/bins/fio-%:
136147
cmd/installer/goods/bins/fio:
137148
ifneq ($(DISABLE_FIO_BUILD),1)
138149
$(MAKE) output/bins/fio-$(FIO_VERSION)-$(ARCH)
139-
mkdir -p cmd/installer/goods/bins
140150
cp output/bins/fio-$(FIO_VERSION)-$(ARCH) $@
141151
endif
142152

143153
.PHONY: cmd/installer/goods/internal/bins/kubectl-kots
144154
cmd/installer/goods/internal/bins/kubectl-kots:
145-
mkdir -p cmd/installer/goods/internal/bins
146155
if [ "$(KOTS_BINARY_URL_OVERRIDE)" != "" ]; then \
147156
$(MAKE) output/bins/kubectl-kots-override ; \
148157
cp output/bins/kubectl-kots-override $@ ; \
@@ -157,7 +166,8 @@ cmd/installer/goods/internal/bins/kubectl-kots:
157166
output/bins/kubectl-kots-%:
158167
mkdir -p output/bins
159168
mkdir -p output/tmp
160-
curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz "https://github.com/replicatedhq/kots/releases/download/$(call split-hyphen,$*,1)/kots_$(OS)_$(call split-hyphen,$*,2).tar.gz"
169+
curl --retry 5 --retry-all-errors -fL -o output/tmp/kots.tar.gz \
170+
"https://github.com/replicatedhq/kots/releases/download/$(call split-hyphen,$*,1)/kots_$(OS)_$(call split-hyphen,$*,2).tar.gz"
161171
tar -xzf output/tmp/kots.tar.gz -C output/tmp
162172
mv output/tmp/kots $@
163173
touch $@
@@ -166,7 +176,11 @@ output/bins/kubectl-kots-%:
166176
output/bins/kubectl-kots-override:
167177
mkdir -p output/bins
168178
mkdir -p output/tmp
169-
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
170184
tar -xzf output/tmp/kots.tar.gz -C output/tmp
171185
mv output/tmp/kots $@
172186
touch $@
@@ -218,7 +232,6 @@ static: cmd/installer/goods/bins/k0s \
218232

219233
.PHONY: static-dryrun
220234
static-dryrun:
221-
@mkdir -p cmd/installer/goods/bins cmd/installer/goods/internal/bins
222235
@touch cmd/installer/goods/bins/k0s \
223236
cmd/installer/goods/bins/kubectl-preflight \
224237
cmd/installer/goods/bins/kubectl-support_bundle \
@@ -261,14 +274,12 @@ envtest:
261274

262275
.PHONY: unit-tests
263276
unit-tests: envtest
264-
mkdir -p cmd/installer/goods/bins cmd/installer/goods/internal/bins
265-
touch cmd/installer/goods/bins/BUILD cmd/installer/goods/internal/bins/BUILD # compilation will fail if no files are present
266277
KUBEBUILDER_ASSETS="$(shell ./operator/bin/setup-envtest use $(ENVTEST_K8S_VERSION) --bin-dir $(shell pwd)/operator/bin -p path)" \
267278
go test -tags exclude_graphdriver_btrfs -v ./pkg/... ./cmd/...
268279
$(MAKE) -C operator test
269280

270281
.PHONY: vet
271-
vet: static
282+
vet:
272283
go vet -tags exclude_graphdriver_btrfs ./...
273284

274285
.PHONY: e2e-tests
@@ -318,8 +329,6 @@ scan:
318329

319330
.PHONY: buildtools
320331
buildtools:
321-
mkdir -p cmd/installer/goods/bins cmd/installer/goods/internal/bins
322-
touch cmd/installer/goods/bins/BUILD cmd/installer/goods/internal/bins/BUILD # compilation will fail if no files are present
323332
go build -tags exclude_graphdriver_btrfs -o ./output/bin/buildtools ./cmd/buildtools
324333

325334
.PHONY: list-distros

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Additionally, it includes a Registry when deployed in air gap mode, and SeaweedF
2323
- Dagger
2424
- shasum
2525
- jq
26+
- oras
2627
- Kubectl (for integration tests)
2728
- Kind (for integration tests)
2829

0 commit comments

Comments
 (0)