Skip to content

Commit 69509c9

Browse files
committed
Build with Go 1.19
- Update Go to 1.19 in CI - Use Go 1.19 in base image - Update controller-gen v0.8.0 (v0.7 fails with Go 1.19) and regenerate manifests Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
1 parent 503686e commit 69509c9

9 files changed

Lines changed: 34 additions & 36 deletions

File tree

.github/workflows/cifuzz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Go
1717
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.18.x
19+
go-version: 1.19.x
2020
- id: go-env
2121
run: |
2222
echo "::set-output name=go-mod-cache::$(go env GOMODCACHE)"

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Go
4141
uses: actions/setup-go@v3
4242
with:
43-
go-version: 1.18.x
43+
go-version: 1.19.x
4444
- name: Setup Kubernetes
4545
uses: engineerd/setup-kind@v0.5.0
4646
with:

.github/workflows/scan.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
steps:
3232
- name: Checkout repository
3333
uses: actions/checkout@v3
34+
- name: Setup Go
35+
uses: actions/setup-go@v3
36+
with:
37+
go-version: 1.19.x
3438
- name: Initialize CodeQL
3539
uses: github/codeql-action/init@v2
3640
with:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_VERSION=1.18
1+
ARG GO_VERSION=1.19
22
ARG XX_VERSION=1.1.0
33

44
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
@@ -29,7 +29,7 @@ COPY internal/ internal/
2929

3030
# build
3131
ENV CGO_ENABLED=0
32-
RUN xx-go build -a -o kustomize-controller main.go
32+
RUN xx-go build -trimpath -a -o kustomize-controller main.go
3333

3434
FROM alpine:3.16
3535

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ api-docs: gen-crd-api-reference-docs
104104

105105
# Run go mod tidy
106106
tidy:
107-
cd api; rm -f go.sum; go mod tidy -compat=1.18
108-
rm -f go.sum; go mod tidy -compat=1.18
107+
cd api; rm -f go.sum; go mod tidy -compat=1.19
108+
rm -f go.sum; go mod tidy -compat=1.19
109109

110110
# Run go fmt against code
111111
fmt:
@@ -140,7 +140,7 @@ docker-deploy:
140140
CONTROLLER_GEN = $(GOBIN)/controller-gen
141141
.PHONY: controller-gen
142142
controller-gen: ## Download controller-gen locally if necessary.
143-
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
143+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0)
144144

145145
# Find or download gen-crd-api-reference-docs
146146
GEN_CRD_API_REFERENCE_DOCS = $(GOBIN)/gen-crd-api-reference-docs

config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.7.0
6+
controller-gen.kubebuilder.io/version: v0.8.0
87
creationTimestamp: null
98
name: kustomizations.kustomize.toolkit.fluxcd.io
109
spec:
@@ -441,14 +440,12 @@ spec:
441440
description: "Condition contains details for one aspect of the current
442441
state of this API Resource. --- This struct is intended for direct
443442
use as an array at the field path .status.conditions. For example,
444-
\n \ttype FooStatus struct{ \t // Represents the observations
445-
of a foo's current state. \t // Known .status.conditions.type
446-
are: \"Available\", \"Progressing\", and \"Degraded\" \t //
447-
+patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map
448-
\t // +listMapKey=type \t Conditions []metav1.Condition
443+
\n type FooStatus struct{ // Represents the observations of a
444+
foo's current state. // Known .status.conditions.type are: \"Available\",
445+
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
446+
// +listType=map // +listMapKey=type Conditions []metav1.Condition
449447
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
450-
protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields
451-
\t}"
448+
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
452449
properties:
453450
lastTransitionTime:
454451
description: lastTransitionTime is the last time the condition
@@ -1003,14 +1000,12 @@ spec:
10031000
description: "Condition contains details for one aspect of the current
10041001
state of this API Resource. --- This struct is intended for direct
10051002
use as an array at the field path .status.conditions. For example,
1006-
\n \ttype FooStatus struct{ \t // Represents the observations
1007-
of a foo's current state. \t // Known .status.conditions.type
1008-
are: \"Available\", \"Progressing\", and \"Degraded\" \t //
1009-
+patchMergeKey=type \t // +patchStrategy=merge \t // +listType=map
1010-
\t // +listMapKey=type \t Conditions []metav1.Condition
1003+
\n type FooStatus struct{ // Represents the observations of a
1004+
foo's current state. // Known .status.conditions.type are: \"Available\",
1005+
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
1006+
// +listType=map // +listMapKey=type Conditions []metav1.Condition
10111007
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
1012-
protobuf:\"bytes,1,rep,name=conditions\"` \n \t // other fields
1013-
\t}"
1008+
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
10141009
properties:
10151010
lastTransitionTime:
10161011
description: lastTransitionTime is the last time the condition

config/rbac/role.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: rbac.authorization.k8s.io/v1
43
kind: ClusterRole

controllers/kustomization_generator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,10 @@ func adaptSelector(selector *kustomize.Selector) (output *kustypes.Selector) {
244244
var kustomizeBuildMutex sync.Mutex
245245

246246
// secureBuildKustomization wraps krusty.MakeKustomizer with the following settings:
247-
// - secure on-disk FS denying operations outside root
248-
// - load files from outside the kustomization dir path
249-
// (but not outside root)
250-
// - disable plugins except for the builtin ones
247+
// - secure on-disk FS denying operations outside root
248+
// - load files from outside the kustomization dir path
249+
// (but not outside root)
250+
// - disable plugins except for the builtin ones
251251
func secureBuildKustomization(root, dirPath string, allowRemoteBases bool) (_ resmap.ResMap, err error) {
252252
var fs filesys.FileSystem
253253

internal/sops/azkv/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ type AZConfig struct {
5252
// TokenFromAADConfig attempts to construct a Token using the AADConfig values.
5353
// It detects credentials in the following order:
5454
//
55-
// - azidentity.ClientSecretCredential when `tenantId`, `clientId` and
56-
// `clientSecret` fields are found.
57-
// - azidentity.ClientCertificateCredential when `tenantId`,
58-
// `clientCertificate` (and optionally `clientCertificatePassword`) fields
59-
// are found.
60-
// - azidentity.ClientSecretCredential when AZConfig fields are found.
61-
// - azidentity.ManagedIdentityCredential for a User ID, when a `clientId`
62-
// field but no `tenantId` is found.
55+
// - azidentity.ClientSecretCredential when `tenantId`, `clientId` and
56+
// `clientSecret` fields are found.
57+
// - azidentity.ClientCertificateCredential when `tenantId`,
58+
// `clientCertificate` (and optionally `clientCertificatePassword`) fields
59+
// are found.
60+
// - azidentity.ClientSecretCredential when AZConfig fields are found.
61+
// - azidentity.ManagedIdentityCredential for a User ID, when a `clientId`
62+
// field but no `tenantId` is found.
6363
//
6464
// If no set of credentials is found or the azcore.TokenCredential can not be
6565
// created, an error is returned.

0 commit comments

Comments
 (0)