Skip to content

Commit 7991d73

Browse files
authored
Merge pull request #248 from fluxcd/go-v1.17
Update Go to v1.17
2 parents 90dcdfd + 24594eb commit 7991d73

File tree

15 files changed

+880
-506
lines changed

15 files changed

+880
-506
lines changed

.github/actions/run-tests/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BASE_VARIANT=bullseye
2-
ARG GO_VERSION=1.16.8
3-
ARG XX_VERSION=1.0.0-rc.2
2+
ARG GO_VERSION=1.17
3+
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
66
ARG LIBGIT2_TAG=libgit2-1.1.1-1

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BASE_VARIANT=bullseye
2-
ARG GO_VERSION=1.16.8
3-
ARG XX_VERSION=1.0.0-rc.2
2+
ARG GO_VERSION=1.17
3+
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
66
ARG LIBGIT2_TAG=libgit2-1.1.1-1
@@ -9,7 +9,6 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2
1010

1111
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_VARIANT} as gostable
12-
FROM --platform=$BUILDPLATFORM golang:1.17rc1-${BASE_VARIANT} AS golatest
1312

1413
FROM gostable AS go-linux
1514

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ CACHE := cache
2121

2222
# Version of the source-controller from which to get the GitRepository CRD.
2323
# Change this if you bump the source-controller/api version in go.mod.
24-
SOURCE_VER ?= v0.19.0
24+
SOURCE_VER ?= v0.20.1
2525

2626
# Version of the image-reflector-controller from which to get the ImagePolicy CRD.
2727
# Change this if you bump the image-reflector-controller/api version in go.mod.
28-
REFLECTOR_VER ?= v0.14.0
28+
REFLECTOR_VER ?= v0.15.0
2929

3030
# Version of libgit2 the controller should depend on.
3131
LIBGIT2_VERSION ?= 1.1.1
@@ -203,7 +203,7 @@ ifeq (, $(shell which controller-gen))
203203
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
204204
cd $$CONTROLLER_GEN_TMP_DIR ;\
205205
go mod init tmp ;\
206-
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0 ;\
206+
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0 ;\
207207
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
208208
}
209209
CONTROLLER_GEN=$(GOBIN)/controller-gen

api/go.mod

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
module github.com/fluxcd/image-automation-controller/api
22

3-
go 1.16
3+
go 1.17
44

55
require (
6-
github.com/fluxcd/pkg/apis/meta v0.10.1
7-
github.com/fluxcd/source-controller/api v0.19.0
8-
k8s.io/apimachinery v0.22.2
9-
sigs.k8s.io/controller-runtime v0.10.2
6+
github.com/fluxcd/pkg/apis/meta v0.10.2
7+
github.com/fluxcd/source-controller/api v0.20.1
8+
k8s.io/apimachinery v0.23.1
9+
sigs.k8s.io/controller-runtime v0.11.0
10+
)
11+
12+
require (
13+
github.com/fluxcd/pkg/apis/acl v0.0.3 // indirect
14+
github.com/go-logr/logr v1.2.2 // indirect
15+
github.com/gogo/protobuf v1.3.2 // indirect
16+
github.com/google/go-cmp v0.5.6 // indirect
17+
github.com/google/gofuzz v1.2.0 // indirect
18+
github.com/json-iterator/go v1.1.12 // indirect
19+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
20+
github.com/modern-go/reflect2 v1.0.2 // indirect
21+
golang.org/x/net v0.0.0-20211215060638-4ddde0e984e9 // indirect
22+
golang.org/x/text v0.3.7 // indirect
23+
gopkg.in/inf.v0 v0.9.1 // indirect
24+
gopkg.in/yaml.v2 v2.4.0 // indirect
25+
k8s.io/klog/v2 v2.30.0 // indirect
26+
k8s.io/utils v0.0.0-20211208161948-7d6a63dca704 // indirect
27+
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
28+
sigs.k8s.io/structured-merge-diff/v4 v4.2.0 // indirect
1029
)

api/go.sum

Lines changed: 238 additions & 67 deletions
Large diffs are not rendered by default.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml

Lines changed: 279 additions & 92 deletions
Large diffs are not rendered by default.

controllers/imageupdateautomation_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ type ImageUpdateAutomationReconcilerOptions struct {
102102
// +kubebuilder:rbac:groups=source.toolkit.fluxcd.io,resources=gitrepositories,verbs=get;list;watch
103103

104104
func (r *ImageUpdateAutomationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
105-
log := logr.FromContext(ctx)
105+
log := ctrl.LoggerFrom(ctx)
106106
debuglog := log.V(logger.DebugLevel)
107107
tracelog := log.V(logger.TraceLevel)
108108
now := time.Now()
@@ -736,12 +736,12 @@ func (r *ImageUpdateAutomationReconciler) event(ctx context.Context, auto imagev
736736
if r.ExternalEventRecorder != nil {
737737
objRef, err := reference.GetReference(r.Scheme, &auto)
738738
if err != nil {
739-
logr.FromContext(ctx).Error(err, "unable to send event")
739+
ctrl.LoggerFrom(ctx).Error(err, "unable to send event")
740740
return
741741
}
742742

743743
if err := r.ExternalEventRecorder.Eventf(*objRef, nil, severity, severity, msg); err != nil {
744-
logr.FromContext(ctx).Error(err, "unable to send event")
744+
ctrl.LoggerFrom(ctx).Error(err, "unable to send event")
745745
return
746746
}
747747
}
@@ -754,7 +754,7 @@ func (r *ImageUpdateAutomationReconciler) recordReadinessMetric(ctx context.Cont
754754

755755
objRef, err := reference.GetReference(r.Scheme, auto)
756756
if err != nil {
757-
logr.FromContext(ctx).Error(err, "unable to record readiness metric")
757+
ctrl.LoggerFrom(ctx).Error(err, "unable to record readiness metric")
758758
return
759759
}
760760
if rc := apimeta.FindStatusCondition(auto.Status.Conditions, meta.ReadyCondition); rc != nil {
@@ -779,7 +779,7 @@ func (r *ImageUpdateAutomationReconciler) recordSuspension(ctx context.Context,
779779
if r.MetricsRecorder == nil {
780780
return
781781
}
782-
log := logr.FromContext(ctx)
782+
log := ctrl.LoggerFrom(ctx)
783783

784784
objRef, err := reference.GetReference(r.Scheme, &auto)
785785
if err != nil {

0 commit comments

Comments
 (0)