Skip to content

Commit 61e1770

Browse files
authored
Merge branch 'rancher:main' into nullable-gitrepo-status
2 parents fde937b + f548931 commit 61e1770

File tree

23 files changed

+267
-168
lines changed

23 files changed

+267
-168
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
export PATH=$PATH:/home/runner/go/bin/
2929
3030
- name: golangci-lint
31-
uses: golangci/[email protected].0
31+
uses: golangci/[email protected].2
3232
with:
3333
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
3434
version: v1.61.0

.github/workflows/release.yml

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
- name: Install Cosign
8585
uses: sigstore/[email protected]
86-
- uses: rancherlabs/slsactl/actions/[email protected].8
86+
- uses: rancherlabs/slsactl/actions/[email protected].10
8787

8888
- name: "Read Vault Secrets"
8989
uses: rancher-eio/read-vault-secrets@main
@@ -141,35 +141,33 @@ jobs:
141141
- name: Create Docker manifest for Prime and sign it
142142
shell: bash
143143
run: |
144-
for IMAGE in fleet fleet-agent; do
145-
URL="${{ env.PRIME_REGISTRY }}/rancher/${IMAGE}:${{ github.ref_name }}"
146-
docker buildx imagetools create -t "${URL}" \
147-
"${URL}-linux-amd64" \
148-
"${URL}-linux-arm64"
144+
for IMAGE in fleet fleet-agent; do
145+
URL="${{ env.PRIME_REGISTRY }}/rancher/${IMAGE}:${{ github.ref_name }}"
146+
docker buildx imagetools create -t "${URL}" \
147+
"${URL}-linux-amd64" \
148+
"${URL}-linux-arm64"
149149
150-
cosign sign --oidc-provider=github-actions --yes "${URL}"
151-
done
150+
cosign sign --oidc-provider=github-actions --yes "${URL}"
151+
done
152152
153153
- name: Attest provenance
154154
shell: bash
155155
run: |
156156
for IMG_NAME in $(yq e '.dockers[].image_templates[0]' .goreleaser.yaml | grep PRIME_REGISTRY | sed "s/{{ .Env.PRIME_REGISTRY }}/${{ env.PRIME_REGISTRY }}/g" | sed "s/{{ .Tag }}/${{ github.ref_name }}/g"); do
157157
# Extract Docker image reference plus digest from local image
158-
URL=$(docker inspect --format='{{index .RepoDigests 0}}' ${IMG_NAME})
158+
URL=$(docker inspect --format='{{index .RepoDigests 0}}' "${IMG_NAME}")
159159
160160
max_retries=3
161161
retry_delay=5
162-
i=0
163162
164-
while [ "${i}" -lt "${max_retries}" ]; do
163+
for ((i=0; i<max_retries; i++)); do
165164
if slsactl download provenance --format=slsav1 "${URL}" > provenance-slsav1.json; then
166165
break
167166
fi
168167
if [ "${i}" -eq "$(( max_retries - 1 ))" ]; then
169168
echo "ERROR: Failed to generate slsav1 provenance. Check whether the image is present in the Prime registry."
170169
exit 1
171170
fi
172-
i=$(( i + 1 ))
173171
sleep "${retry_delay}"
174172
done
175173
@@ -181,25 +179,59 @@ jobs:
181179
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182180
repo: "rancher"
183181
run: |
184-
version=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.version')
185-
tag=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.tag')
182+
version=$(jq -r '.version' <<< '${{ steps.goreleaser.outputs.metadata }}')
183+
tag=$(jq -r '.tag' <<< '${{ steps.goreleaser.outputs.metadata }}')
186184
echo "publishing helm chart for (repo: $repo, tag: $tag, version: $version)"
187185
188186
# Replace rancher/fleet, rancher/fleet-agent and rancher/gitjob image names, but not eg. rancher/kubectl
189187
sed -i \
190-
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
191-
-e "s/tag:.*/tag: $tag/" \
192-
charts/fleet/values.yaml
188+
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
189+
-e "s/tag:.*/tag: $tag/" \
190+
charts/fleet/values.yaml
193191
194192
sed -i \
195-
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
196-
-e "s/tag: dev/tag: $tag/" \
197-
charts/fleet-agent/values.yaml
193+
-e "s@repository: rancher/\(fleet.*\|gitjob\).*@repository: $repo/\\1@" \
194+
-e "s/tag: dev/tag: $tag/" \
195+
charts/fleet-agent/values.yaml
198196
199-
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet
200-
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet-crd
201-
helm package --version="$version" --app-version="$version" -d ./dist ./charts/fleet-agent
197+
find charts/ -maxdepth 1 -mindepth 1 -type d -exec helm package --version="$version" --app-version="$version" -d ./dist {} \;
202198
203-
for f in $(find dist/ -name '*.tgz'); do
204-
gh release upload $tag $f
205-
done
199+
find dist/ -name '*.tgz' -exec gh release upload $tag {} +
200+
201+
- name: Add charts to branch
202+
env:
203+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
204+
run: |
205+
version=$(jq -r '.version' <<< '${{ steps.goreleaser.outputs.metadata }}')
206+
branch_version=v$(cut -d'.' -f1,2 <<< "$version")
207+
charts_branch=charts/$branch_version
208+
209+
if [ ! -e ~/.gitconfig ]; then
210+
git config --global user.name "fleet-bot"
211+
git config --global user.email [email protected]
212+
fi
213+
214+
echo "publishing helm chart in the branch $charts_branch"
215+
if ! git show-ref --quiet "refs/heads/$charts_branch"; then
216+
git checkout --orphan "$charts_branch"
217+
git rm -rf .
218+
219+
echo "# Fleet Helm Charts for $branch_version versions" > README.md
220+
echo "The documentation is centralized in a unique place, checkout https://fleet.rancher.io/." >> README.md
221+
222+
git checkout origin/main -- LICENSE .gitignore
223+
224+
git add README.md LICENSE .gitignore
225+
git commit -m "Initial commit for $charts_branch"
226+
else
227+
git checkout "$charts_branch"
228+
fi
229+
230+
mkdir charts
231+
find dist/ -name '*.tgz' -exec tar -xf {} -C charts/ \;
232+
233+
git add charts/**/*
234+
git commit -m "Update charts to version $version"
235+
236+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
237+
git push origin "$charts_branch"

.github/workflows/renovate.yml renamed to .github/workflows/renovate-vault.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ on:
1616
schedule:
1717
- cron: '30 4,6 * * *'
1818

19+
permissions:
20+
contents: read
21+
id-token: write
22+
1923
jobs:
2024
call-workflow:
21-
uses: rancher/renovate-config/.github/workflows/renovate.yml@release
25+
uses: rancher/renovate-config/.github/workflows/renovate-vault.yml@release
2226
with:
2327
logLevel: ${{ inputs.logLevel || 'info' }}
2428
overrideSchedule: ${{ github.event.inputs.overrideSchedule == 'true' && '{''schedule'':null}' || '' }}

charts/fleet-agent/Chart.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
annotations:
22
catalog.cattle.io/certified: rancher
33
catalog.cattle.io/hidden: "true"
4+
catalog.cattle.io/kube-version: '>= 1.28.0-0 < 1.33.0-0'
45
catalog.cattle.io/namespace: cattle-fleet-system
5-
catalog.cattle.io/release-name: fleet-agent
66
catalog.cattle.io/os: linux
77
catalog.cattle.io/permits-os: linux,windows
8+
catalog.cattle.io/rancher-version: '>= 2.11.0-0 < 2.12.0-0'
9+
catalog.cattle.io/release-name: fleet-agent
810
apiVersion: v2
911
appVersion: 0.0.0
1012
description: Fleet Agent - GitOps at Scale

charts/fleet-crd/templates/crds.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.5
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: bundledeployments.fleet.cattle.io
88
spec:
99
group: fleet.cattle.io
@@ -1118,7 +1118,7 @@ apiVersion: apiextensions.k8s.io/v1
11181118
kind: CustomResourceDefinition
11191119
metadata:
11201120
annotations:
1121-
controller-gen.kubebuilder.io/version: v0.16.5
1121+
controller-gen.kubebuilder.io/version: v0.17.2
11221122
name: bundlenamespacemappings.fleet.cattle.io
11231123
spec:
11241124
group: fleet.cattle.io
@@ -1298,7 +1298,7 @@ apiVersion: apiextensions.k8s.io/v1
12981298
kind: CustomResourceDefinition
12991299
metadata:
13001300
annotations:
1301-
controller-gen.kubebuilder.io/version: v0.16.5
1301+
controller-gen.kubebuilder.io/version: v0.17.2
13021302
name: bundles.fleet.cattle.io
13031303
spec:
13041304
group: fleet.cattle.io
@@ -3245,7 +3245,7 @@ apiVersion: apiextensions.k8s.io/v1
32453245
kind: CustomResourceDefinition
32463246
metadata:
32473247
annotations:
3248-
controller-gen.kubebuilder.io/version: v0.16.5
3248+
controller-gen.kubebuilder.io/version: v0.17.2
32493249
name: clustergroups.fleet.cattle.io
32503250
spec:
32513251
group: fleet.cattle.io
@@ -3672,7 +3672,7 @@ apiVersion: apiextensions.k8s.io/v1
36723672
kind: CustomResourceDefinition
36733673
metadata:
36743674
annotations:
3675-
controller-gen.kubebuilder.io/version: v0.16.5
3675+
controller-gen.kubebuilder.io/version: v0.17.2
36763676
name: clusterregistrations.fleet.cattle.io
36773677
spec:
36783678
group: fleet.cattle.io
@@ -3776,7 +3776,7 @@ apiVersion: apiextensions.k8s.io/v1
37763776
kind: CustomResourceDefinition
37773777
metadata:
37783778
annotations:
3779-
controller-gen.kubebuilder.io/version: v0.16.5
3779+
controller-gen.kubebuilder.io/version: v0.17.2
37803780
name: clusterregistrationtokens.fleet.cattle.io
37813781
spec:
37823782
group: fleet.cattle.io
@@ -3855,7 +3855,7 @@ apiVersion: apiextensions.k8s.io/v1
38553855
kind: CustomResourceDefinition
38563856
metadata:
38573857
annotations:
3858-
controller-gen.kubebuilder.io/version: v0.16.5
3858+
controller-gen.kubebuilder.io/version: v0.17.2
38593859
name: clusters.fleet.cattle.io
38603860
spec:
38613861
group: fleet.cattle.io
@@ -6065,7 +6065,7 @@ apiVersion: apiextensions.k8s.io/v1
60656065
kind: CustomResourceDefinition
60666066
metadata:
60676067
annotations:
6068-
controller-gen.kubebuilder.io/version: v0.16.5
6068+
controller-gen.kubebuilder.io/version: v0.17.2
60696069
name: contents.fleet.cattle.io
60706070
spec:
60716071
group: fleet.cattle.io
@@ -6133,7 +6133,7 @@ apiVersion: apiextensions.k8s.io/v1
61336133
kind: CustomResourceDefinition
61346134
metadata:
61356135
annotations:
6136-
controller-gen.kubebuilder.io/version: v0.16.5
6136+
controller-gen.kubebuilder.io/version: v0.17.2
61376137
name: gitreporestrictions.fleet.cattle.io
61386138
spec:
61396139
group: fleet.cattle.io
@@ -6239,7 +6239,7 @@ apiVersion: apiextensions.k8s.io/v1
62396239
kind: CustomResourceDefinition
62406240
metadata:
62416241
annotations:
6242-
controller-gen.kubebuilder.io/version: v0.16.5
6242+
controller-gen.kubebuilder.io/version: v0.17.2
62436243
name: gitrepos.fleet.cattle.io
62446244
spec:
62456245
group: fleet.cattle.io
@@ -7091,7 +7091,7 @@ apiVersion: apiextensions.k8s.io/v1
70917091
kind: CustomResourceDefinition
70927092
metadata:
70937093
annotations:
7094-
controller-gen.kubebuilder.io/version: v0.16.5
7094+
controller-gen.kubebuilder.io/version: v0.17.2
70957095
name: helmapps.fleet.cattle.io
70967096
spec:
70977097
group: fleet.cattle.io
@@ -8971,7 +8971,7 @@ apiVersion: apiextensions.k8s.io/v1
89718971
kind: CustomResourceDefinition
89728972
metadata:
89738973
annotations:
8974-
controller-gen.kubebuilder.io/version: v0.16.5
8974+
controller-gen.kubebuilder.io/version: v0.17.2
89758975
name: imagescans.fleet.cattle.io
89768976
spec:
89778977
group: fleet.cattle.io

charts/fleet/Chart.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ annotations:
33
catalog.cattle.io/certified: rancher
44
catalog.cattle.io/experimental: "true"
55
catalog.cattle.io/hidden: "true"
6+
catalog.cattle.io/kube-version: '>= 1.28.0-0 < 1.33.0-0'
67
catalog.cattle.io/namespace: cattle-fleet-system
78
catalog.cattle.io/os: linux
89
catalog.cattle.io/permits-os: linux,windows
910
catalog.cattle.io/provides-gvr: clusters.fleet.cattle.io/v1alpha1
11+
catalog.cattle.io/rancher-version: '>= 2.11.0-0 < 2.12.0-0'
1012
catalog.cattle.io/release-name: fleet
1113
apiVersion: v2
1214
appVersion: 0.0.0

go.mod

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ require (
3838
github.com/prometheus/client_model v0.6.1
3939
github.com/prometheus/common v0.62.0
4040
github.com/rancher/fleet/pkg/apis v0.11.3
41-
github.com/rancher/lasso v0.2.0
42-
github.com/rancher/wrangler/v3 v3.2.0-rc.2
41+
github.com/rancher/lasso v0.2.1
42+
github.com/rancher/wrangler/v3 v3.2.0-rc.3
4343
github.com/reugn/go-quartz v0.13.0
4444
github.com/sirupsen/logrus v1.9.3
4545
github.com/spf13/cobra v1.8.1
4646
github.com/stretchr/testify v1.10.0
4747
github.com/testcontainers/testcontainers-go v0.35.0
4848
go.uber.org/mock v0.5.0
4949
go.uber.org/zap v1.27.0
50-
golang.org/x/crypto v0.32.0
50+
golang.org/x/crypto v0.33.0
5151
golang.org/x/sync v0.11.0
5252
gonum.org/v1/gonum v0.15.1
5353
gopkg.in/go-playground/webhooks.v5 v5.17.0
5454
gopkg.in/yaml.v2 v2.4.0
5555
gotest.tools v2.2.0+incompatible
56-
helm.sh/helm/v3 v3.17.0
56+
helm.sh/helm/v3 v3.17.1
5757
k8s.io/api v0.32.1
5858
k8s.io/apiextensions-apiserver v0.32.1
5959
k8s.io/apimachinery v0.32.1
@@ -62,12 +62,12 @@ require (
6262
k8s.io/klog/v2 v2.130.1
6363
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f
6464
k8s.io/kubectl v0.32.1
65-
k8s.io/kubernetes v1.32.1
65+
k8s.io/kubernetes v1.32.2
6666
k8s.io/utils v0.0.0-20241210054802-24370beab758
6767
oras.land/oras-go/v2 v2.5.0
6868
sigs.k8s.io/cli-utils v0.37.2
69-
sigs.k8s.io/controller-runtime v0.19.3
70-
sigs.k8s.io/controller-tools v0.16.5
69+
sigs.k8s.io/controller-runtime v0.20.1
70+
sigs.k8s.io/controller-tools v0.17.2
7171
sigs.k8s.io/kustomize/api v0.18.0
7272
sigs.k8s.io/kustomize/kyaml v0.18.1
7373
sigs.k8s.io/yaml v1.4.0
@@ -117,6 +117,7 @@ require (
117117
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
118118
github.com/fatih/color v1.18.0 // indirect
119119
github.com/felixge/httpsnoop v1.0.4 // indirect
120+
github.com/fsnotify/fsnotify v1.7.0 // indirect
120121
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
121122
github.com/ghodss/yaml v1.0.0 // indirect
122123
github.com/go-errors/errors v1.4.2 // indirect
@@ -134,7 +135,7 @@ require (
134135
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
135136
github.com/golang/protobuf v1.5.4 // indirect
136137
github.com/gomodule/redigo v2.0.0+incompatible // indirect
137-
github.com/google/btree v1.1.2 // indirect
138+
github.com/google/btree v1.1.3 // indirect
138139
github.com/google/gnostic-models v0.6.9 // indirect
139140
github.com/google/gofuzz v1.2.0 // indirect
140141
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
@@ -204,7 +205,7 @@ require (
204205
github.com/shopspring/decimal v1.4.0 // indirect
205206
github.com/skeema/knownhosts v1.3.0 // indirect
206207
github.com/spf13/cast v1.7.0 // indirect
207-
github.com/spf13/pflag v1.0.5 // indirect
208+
github.com/spf13/pflag v1.0.6 // indirect
208209
github.com/tklauser/go-sysconf v0.3.12 // indirect
209210
github.com/tklauser/numcpus v0.6.1 // indirect
210211
github.com/ulikunitz/xz v0.5.10 // indirect
@@ -225,14 +226,14 @@ require (
225226
go.opentelemetry.io/otel/trace v1.33.0 // indirect
226227
go.uber.org/multierr v1.11.0 // indirect
227228
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
228-
golang.org/x/mod v0.22.0 // indirect
229-
golang.org/x/net v0.34.0 // indirect
229+
golang.org/x/mod v0.23.0 // indirect
230+
golang.org/x/net v0.35.0 // indirect
230231
golang.org/x/oauth2 v0.25.0 // indirect
231-
golang.org/x/sys v0.29.0 // indirect
232-
golang.org/x/term v0.28.0 // indirect
233-
golang.org/x/text v0.21.0 // indirect
232+
golang.org/x/sys v0.30.0 // indirect
233+
golang.org/x/term v0.29.0 // indirect
234+
golang.org/x/text v0.22.0 // indirect
234235
golang.org/x/time v0.7.0 // indirect
235-
golang.org/x/tools v0.29.0 // indirect
236+
golang.org/x/tools v0.30.0 // indirect
236237
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
237238
google.golang.org/api v0.155.0 // indirect
238239
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
@@ -249,7 +250,7 @@ require (
249250
k8s.io/component-base v0.32.1 // indirect
250251
k8s.io/component-helpers v0.32.1 // indirect
251252
k8s.io/controller-manager v0.32.1 // indirect
252-
k8s.io/gengo v0.0.0-20240911193312-2b36238f13e9 // indirect
253+
k8s.io/gengo v0.0.0-20250130153323-76c5745d3511 // indirect
253254
k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect
254255
k8s.io/helm v2.17.0+incompatible // indirect
255256
oras.land/oras-go v1.2.5 // indirect

0 commit comments

Comments
 (0)