File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 push :
77 branches : [ main ]
88
9+ # CI only builds and tests — no writes to the repo, releases, or packages.
10+ permissions :
11+ contents : read
12+
913jobs :
1014 image-multiarch :
1115 # Build-only assertion that the operator image builds for every published
Original file line number Diff line number Diff line change @@ -43,23 +43,28 @@ jobs:
4343 run : make manifests
4444
4545 - name : Resolve chart versions from tag
46+ env :
47+ REF_NAME : ${{ github.ref_name }}
4648 run : |
47- TAG=${{ github.ref_name }}
48- echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
49+ TAG="$REF_NAME"
50+ echo "RELEASE_TAG=${TAG}" >> " $GITHUB_ENV"
4951 # Chart version is semver without the leading v; appVersion keeps it.
50- echo "RELEASE_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV
52+ echo "RELEASE_TAG_TRIMMED_V=${TAG#v}" >> " $GITHUB_ENV"
5153
5254 - name : Helm registry login
55+ env :
56+ ACTOR : ${{ github.actor }}
57+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
5358 run : |
5459 helm registry login \
55- --username ${{ github.actor }} \
56- --password ${{ secrets.GITHUB_TOKEN }} \
57- ${{ env.REGISTRY }}
60+ --username "$ACTOR" \
61+ --password "$TOKEN" \
62+ " ${{ env.REGISTRY }}"
5863
5964 - name : Package chart
6065 working-directory : charts
6166 run : |
62- helm package ${{ env.CHART_NAME }} \
67+ helm package " ${{ env.CHART_NAME }}" \
6368 --version "${RELEASE_TAG_TRIMMED_V}" \
6469 --app-version "${RELEASE_TAG}"
6570
Original file line number Diff line number Diff line change @@ -36,10 +36,12 @@ jobs:
3636 version : ' v3.16.4'
3737
3838 - name : Resolve release tag
39- run : echo "RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
39+ env :
40+ REF_NAME : ${{ github.ref_name }}
41+ run : echo "RELEASE_TAG=$REF_NAME" >> "$GITHUB_ENV"
4042
4143 - name : Render install manifests
42- run : make build-dist-manifests IMG=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${RELEASE_TAG}
44+ run : make build-dist-manifests IMG=" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${RELEASE_TAG}"
4345
4446 - uses : svenstaro/upload-release-action@2.9.0
4547 with :
@@ -82,10 +84,12 @@ jobs:
8284 cache : true
8385
8486 - name : Resolve release tag
85- run : echo "RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
87+ env :
88+ REF_NAME : ${{ github.ref_name }}
89+ run : echo "RELEASE_TAG=$REF_NAME" >> "$GITHUB_ENV"
8690
8791 - name : Cross-compile CLIs
88- run : make dist-cli VERSION=${RELEASE_TAG}
92+ run : make dist-cli VERSION=" ${RELEASE_TAG}"
8993
9094 - name : Upload etcd-migrate binaries
9195 uses : svenstaro/upload-release-action@2.9.0
Original file line number Diff line number Diff line change 2727 # code under it is the canonical fork-to-RCE pattern. release-drafter
2828 # touches no repo code, so this job stays safe as long as nothing here
2929 # checks out untrusted refs.
30- - uses : release-drafter/release-drafter@v6.0.0
30+ - uses : release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0
3131 with :
3232 disable-releaser : ${{ github.ref != 'refs/heads/main' }}
3333 config-name : release-drafter.yml
Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ app.kubernetes.io/instance: {{ .Release.Name }}
4242{{- if .Values.serviceAccount.create -}}
4343{{- include " etcd-operator.fullname" . -}}
4444{{- else -}}
45- default
45+ {{- /* Don't silently fall back to the namespace "default" SA: rbac.yaml binds
46+ the operator's broad ClusterRole to this name, and binding it to "default"
47+ would hand those permissions to every workload using the default SA. */ -}}
48+ {{- required " serviceAccount.name is required when serviceAccount.create is false" .Values.serviceAccount.name -}}
4649{{- end -}}
4750{{- end -}}
4851
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ fullnameOverride: ""
4343serviceAccount :
4444 # -- Create the operator ServiceAccount.
4545 create : true
46+ # -- Name of an existing ServiceAccount to use when create is false. Required
47+ # in that case — the operator's ClusterRole is bound to this name.
48+ name : " "
4649 # -- Extra annotations for the ServiceAccount.
4750 annotations : {}
4851
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ explicit --skip-backup.`,
7777 Short : "Print the etcd-migrate binary version" ,
7878 Args : cobra .NoArgs ,
7979 Run : func (cmd * cobra.Command , _ []string ) {
80- fmt .Fprintln (cmd .OutOrStdout (), version )
80+ _ , _ = fmt .Fprintln (cmd .OutOrStdout (), version )
8181 },
8282 })
8383 if err := rootCmd .Execute (); err != nil {
You can’t perform that action at this time.
0 commit comments