Skip to content

Commit 248008a

Browse files
committed
Update dependencies and fix multi-arch image support
1 parent 0c24174 commit 248008a

13 files changed

+280
-957
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,40 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717
- name: Restore Go cache
18-
uses: actions/cache@v1
18+
uses: actions/cache@v3
1919
with:
2020
path: ~/go/pkg/mod
2121
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
2222
restore-keys: |
2323
${{ runner.os }}-go-
2424
- name: Setup Go
25-
uses: actions/setup-go@v2
25+
uses: actions/setup-go@v3
2626
with:
27-
go-version: 1.18.x
27+
go-version: 1.19.x
2828
- name: Setup Kubernetes
29-
uses: engineerd/setup-kind@v0.5.0
29+
uses: helm/kind-action@v1.5.0
3030
with:
31-
version: "v0.12.0"
32-
image: "kindest/node:v1.23.4@sha256:0e34f0d0fd448aa2f2819cfd74e99fe5793a6e4938b328f657c8e3f81ee0dfb9"
31+
version: v0.17.0 # https://github.com/kubernetes-sigs/kind/releases
32+
node_image: "kindest/node:v1.25.3@sha256:f52781bc0d7a19fb6c405c2af83abfeb311f130707a0e219175677e366cc45d1"
33+
cluster_name: kind
3334
- name: Setup Helm
3435
uses: fluxcd/pkg/actions/helm@main
3536
with:
36-
version: "3.8.1"
37+
version: "3.10.0"
3738
- name: Setup Kustomize
3839
uses: fluxcd/pkg/actions/kustomize@main
3940
with:
40-
version: "4.5.4"
41+
version: "4.5.7"
4142
- name: Setup Kubebuilder
4243
uses: RyanSiu1995/[email protected]
4344
with:
44-
version: "3.3.0"
45+
version: "3.9.0"
4546
- name: Setup Kubectl
4647
uses: fluxcd/pkg/actions/kubectl@main
4748
with:
48-
version: "1.23.4"
49+
version: "1.26.0"
4950
- name: Run tests
5051
run: make test
5152
env:

.github/workflows/publish.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,65 +16,64 @@ jobs:
1616
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
20-
- name: DockerTag
21-
id: docker-tag
22-
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
19+
uses: actions/checkout@v3
20+
- name: Extract VERSION from GITHUB_REF
21+
run: TAG_NAME="${GITHUB_REF#refs/*/}"; echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
2322
- name: Set up QEMU
2423
id: qemu
25-
uses: docker/setup-qemu-action@v1
24+
uses: docker/setup-qemu-action@v2
2625
with:
2726
image: tonistiigi/binfmt:latest
2827
platforms: all
2928
- name: Available platforms
3029
run: echo ${{ steps.qemu.outputs.platforms }}
3130
- name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@v1
31+
uses: docker/setup-buildx-action@v2
3332
- name: Login to DockerHub
34-
uses: docker/login-action@v1
33+
uses: docker/login-action@v2
3534
with:
3635
username: ${{ secrets.DOCKERHUB_USERNAME }}
3736
password: ${{ secrets.DOCKERHUB_TOKEN }}
3837
- name: Build and push
3938
id: docker_build
40-
uses: docker/build-push-action@v2
39+
uses: docker/build-push-action@v3
4140
with:
4241
context: .
4342
file: Dockerfile
4443
platforms: linux/amd64,linux/arm64
4544
push: true
4645
tags: |
47-
rustrial/k8s-gitops-secrets-controller:${{ steps.docker-tag.outputs.tag }}
46+
rustrial/k8s-gitops-secrets-controller:${{env.VERSION}}
4847
test-chart:
4948
name: install-chart
5049
runs-on: ubuntu-latest
5150
needs:
5251
- publish-oci-images
5352
strategy:
5453
matrix:
55-
k8s:
56-
- v1.20.15
57-
- v1.21.2
58-
- v1.22.7
59-
- v1.23.4
54+
k8s: # Must be available from https://github.com/kubernetes-sigs/kind/releases
55+
- v1.22.15
56+
- v1.23.13
57+
- v1.24.7
58+
- v1.25.3
6059
steps:
6160
- name: Checkout
62-
uses: actions/checkout@v1
63-
- name: DockerTag
64-
id: docker-tag
65-
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
61+
uses: actions/checkout@v3
62+
- name: Extract VERSION from GITHUB_REF
63+
run: TAG_NAME="${GITHUB_REF#refs/*/}"; echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV
6664
- name: Set up Helm
6765
uses: azure/setup-helm@v1
6866
with:
69-
version: v3.8.1
67+
version: v3.10.0
7068
- name: Run chart-testing (lint)
7169
run: (cd charts/k8s-gitops-secrets-controller && helm lint .)
7270
- name: Create kind ${{ matrix.k8s }} cluster
73-
uses: helm/kind-action@v1.2.0
71+
uses: helm/kind-action@v1.5.0
7472
with:
73+
version: v0.17.0 # https://github.com/kubernetes-sigs/kind/releases
7574
node_image: kindest/node:${{ matrix.k8s }}
7675
- name: Install chart
77-
run: (cd charts/k8s-gitops-secrets-controller && helm install k8s-gitops-secrets-controller . -n k8s-gitops-secrets-system --create-namespace --wait --set fullnameOverride=k8s-gitops-secrets-controller-manager --set-string image.tag=${{ steps.docker-tag.outputs.tag }})
76+
run: (cd charts/k8s-gitops-secrets-controller && helm install k8s-gitops-secrets-controller . -n k8s-gitops-secrets-system --create-namespace --wait --set fullnameOverride=k8s-gitops-secrets-controller-manager --set-string image.tag=${{env.VERSION}})
7877
- name: Tests
7978
run: ./.github/e2e-tests.sh
8079
create-release:
@@ -85,7 +84,7 @@ jobs:
8584
runs-on: ubuntu-latest
8685
steps:
8786
- name: Checkout code
88-
uses: actions/checkout@v2
87+
uses: actions/checkout@v3
8988
with:
9089
fetch-depth: 0
9190
- name: "✏️ Generate release changelog"
@@ -97,19 +96,19 @@ jobs:
9796
#stripHeaders: "true"
9897
#stripGeneratorNotice: "true"
9998
- name: Restore Go cache
100-
uses: actions/cache@v1
99+
uses: actions/cache@v3
101100
with:
102101
path: ~/go/pkg/mod
103102
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
104103
restore-keys: |
105104
${{ runner.os }}-go-
106105
- name: Setup Go
107-
uses: actions/setup-go@v2
106+
uses: actions/setup-go@v3
108107
with:
109-
go-version: 1.18.x
108+
go-version: 1.19.x
110109
- name: Build seals CLI
111110
run: make cli
112-
- name: Set TAG_NAME
111+
- name: Extract TAG_NAME from GITHUB_REF
113112
run: echo "TAG_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
114113
- name: "🚀 Create GitHub release"
115114
id: create_release
@@ -185,7 +184,7 @@ jobs:
185184
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
186185
steps:
187186
- name: Checkout
188-
uses: actions/checkout@v2
187+
uses: actions/checkout@v3
189188
with:
190189
fetch-depth: 0
191190
- name: Configure Git
@@ -195,7 +194,7 @@ jobs:
195194
- name: Install Helm
196195
uses: azure/setup-helm@v1
197196
with:
198-
version: v3.8.1
197+
version: v3.10.0
199198
- name: Install CR
200199
run: .github/install-cr.sh
201200
- name: Update Helm Chart versions

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ testbin/*
2626
*~
2727

2828
.kube-config
29-
.dccache
29+
.dccache
30+
.vscode/configurationCache.log
31+
.vscode/dryrun.log
32+
.vscode/settings.json
33+
.vscode/targets.log

Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Build the manager binary
2-
FROM golang:1.18 as builder
2+
FROM golang:1.19 as builder
3+
4+
ARG TARGETARCH
5+
6+
ARG TARGETOS
7+
8+
ENV GOARCH=${TARGETARCH}
9+
10+
ENV GOOS=${TARGETOS}
311

412
WORKDIR /workspace
513
# Copy the Go Modules manifests
@@ -16,7 +24,7 @@ COPY controllers/ controllers/
1624
COPY internal/ internal/
1725

1826
# Build
19-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
27+
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -o manager main.go
2028

2129
# Use distroless as minimal base image to package the manager binary
2230
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ all: manager api-docs seals charts
1717
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
1818
test: generate fmt vet manifests
1919
mkdir -p ${ENVTEST_ASSETS_DIR}
20-
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.9.5/hack/setup-envtest.sh
20+
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.14.1/hack/setup-envtest.sh
2121
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out
2222

2323
# Build manager binary
@@ -96,7 +96,7 @@ ifeq (, $(shell which controller-gen))
9696
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
9797
cd $$CONTROLLER_GEN_TMP_DIR ;\
9898
go mod init tmp ;\
99-
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0 ;\
99+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1 ;\
100100
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
101101
}
102102
CONTROLLER_GEN=$(GOBIN)/controller-gen
@@ -110,7 +110,7 @@ endif
110110
# Download kustomize locally if necessary
111111
KUSTOMIZE = $(shell pwd)/bin/kustomize
112112
kustomize:
113-
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
113+
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.10.0)
114114

115115
charts: manifests
116116
cp config/crd/bases/* charts/k8s-gitops-secrets-controller/crds

apis/secrets/v1beta1/groupversion_info.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ limitations under the License.
1515
*/
1616

1717
// Package v1beta1 contains API Schema definitions for the secrets v1beta1 API group
18-
//+kubebuilder:object:generate=true
19-
//+groupName=secrets.rustrial.org
18+
// +kubebuilder:object:generate=true
19+
// +groupName=secrets.rustrial.org
2020
package v1beta1
2121

2222
import (

charts/k8s-gitops-secrets-controller/crds/secrets.rustrial.org_keyencryptionkeypolicies.yaml

Lines changed: 1 addition & 7 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.8.0
6+
controller-gen.kubebuilder.io/version: v0.11.1
77
creationTimestamp: null
88
name: keyencryptionkeypolicies.secrets.rustrial.org
99
spec:
@@ -59,9 +59,3 @@ spec:
5959
storage: true
6060
subresources:
6161
status: {}
62-
status:
63-
acceptedNames:
64-
kind: ""
65-
plural: ""
66-
conditions: []
67-
storedVersions: []

charts/k8s-gitops-secrets-controller/crds/secrets.rustrial.org_sealedsecrets.yaml

Lines changed: 3 additions & 9 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.8.0
6+
controller-gen.kubebuilder.io/version: v0.11.1
77
creationTimestamp: null
88
name: sealedsecrets.secrets.rustrial.org
99
spec:
@@ -166,8 +166,8 @@ spec:
166166
description: "Condition contains details for one aspect of the current
167167
state of this API Resource. --- This struct is intended for direct
168168
use as an array at the field path .status.conditions. For example,
169-
type FooStatus struct{ // Represents the observations of a foo's
170-
current state. // Known .status.conditions.type are: \"Available\",
169+
\n type FooStatus struct{ // Represents the observations of a
170+
foo's current state. // Known .status.conditions.type are: \"Available\",
171171
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
172172
// +listType=map // +listMapKey=type Conditions []metav1.Condition
173173
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
@@ -235,9 +235,3 @@ spec:
235235
storage: true
236236
subresources:
237237
status: {}
238-
status:
239-
acceptedNames:
240-
kind: ""
241-
plural: ""
242-
conditions: []
243-
storedVersions: []

config/crd/bases/secrets.rustrial.org_keyencryptionkeypolicies.yaml

Lines changed: 1 addition & 7 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.8.0
6+
controller-gen.kubebuilder.io/version: v0.11.1
77
creationTimestamp: null
88
name: keyencryptionkeypolicies.secrets.rustrial.org
99
spec:
@@ -59,9 +59,3 @@ spec:
5959
storage: true
6060
subresources:
6161
status: {}
62-
status:
63-
acceptedNames:
64-
kind: ""
65-
plural: ""
66-
conditions: []
67-
storedVersions: []

config/crd/bases/secrets.rustrial.org_sealedsecrets.yaml

Lines changed: 3 additions & 9 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.8.0
6+
controller-gen.kubebuilder.io/version: v0.11.1
77
creationTimestamp: null
88
name: sealedsecrets.secrets.rustrial.org
99
spec:
@@ -166,8 +166,8 @@ spec:
166166
description: "Condition contains details for one aspect of the current
167167
state of this API Resource. --- This struct is intended for direct
168168
use as an array at the field path .status.conditions. For example,
169-
type FooStatus struct{ // Represents the observations of a foo's
170-
current state. // Known .status.conditions.type are: \"Available\",
169+
\n type FooStatus struct{ // Represents the observations of a
170+
foo's current state. // Known .status.conditions.type are: \"Available\",
171171
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
172172
// +listType=map // +listMapKey=type Conditions []metav1.Condition
173173
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
@@ -235,9 +235,3 @@ spec:
235235
storage: true
236236
subresources:
237237
status: {}
238-
status:
239-
acceptedNames:
240-
kind: ""
241-
plural: ""
242-
conditions: []
243-
storedVersions: []

controllers/secrets/suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"k8s.io/client-go/rest"
2727
"sigs.k8s.io/controller-runtime/pkg/client"
2828
"sigs.k8s.io/controller-runtime/pkg/envtest"
29-
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
29+
3030
logf "sigs.k8s.io/controller-runtime/pkg/log"
3131
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3232

@@ -46,7 +46,7 @@ func TestAPIs(t *testing.T) {
4646

4747
RunSpecsWithDefaultAndCustomReporters(t,
4848
"Controller Suite",
49-
[]Reporter{printer.NewlineReporter{}})
49+
[]Reporter{})
5050
}
5151

5252
var _ = BeforeSuite(func() {

0 commit comments

Comments
 (0)