diff --git a/build/Dockerfile b/build/Dockerfile index e5b87aba..8465f571 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,7 @@ # Copyright Contributors to the Open Cluster Management project # Stage 1: Use image builder to build the target binaries -FROM registry.ci.openshift.org/stolostron/builder:go1.23-linux AS builder +FROM registry.ci.openshift.org/stolostron/builder:go1.24-linux AS builder ENV COMPONENT=config-policy-controller ENV REPO_PATH=/go/src/github.com/open-cluster-management/${COMPONENT} diff --git a/controllers/configurationpolicy_controller_test.go b/controllers/configurationpolicy_controller_test.go index 777576db..4d744357 100644 --- a/controllers/configurationpolicy_controller_test.go +++ b/controllers/configurationpolicy_controller_test.go @@ -4,7 +4,6 @@ package controllers import ( - "context" "fmt" "reflect" "sync" @@ -72,7 +71,7 @@ func TestReconcile(t *testing.T) { }, } - res, err := r.Reconcile(context.TODO(), req) + res, err := r.Reconcile(t.Context(), req) if err != nil { t.Fatalf("reconcile: (%v)", err) } diff --git a/controllers/encryption_test.go b/controllers/encryption_test.go index 6b9bd039..7e69ceb9 100644 --- a/controllers/encryption_test.go +++ b/controllers/encryption_test.go @@ -4,7 +4,6 @@ package controllers import ( - "context" "crypto/rand" "testing" @@ -75,7 +74,7 @@ func TestGetEncryptionConfig(t *testing.T) { policy := getEmptyPolicy() - config, err := r.getEncryptionConfig(context.TODO(), &policy) + config, err := r.getEncryptionConfig(t.Context(), &policy) Expect(err).ToNot(HaveOccurred()) Expect(config).ToNot(BeNil()) Expect(config.AESKey).ToNot(BeNil()) @@ -100,7 +99,7 @@ func TestGetEncryptionConfigInvalidIV(t *testing.T) { }, } - _, err := r.getEncryptionConfig(context.TODO(), &policy) + _, err := r.getEncryptionConfig(t.Context(), &policy) Expect(err.Error()).To( Equal( "the policy annotation of \"policy.open-cluster-management.io/encryption-iv\" is not Base64: illegal " + @@ -117,7 +116,7 @@ func TestGetEncryptionConfigNoSecret(t *testing.T) { policy := getEmptyPolicy() - _, err := r.getEncryptionConfig(context.TODO(), &policy) + _, err := r.getEncryptionConfig(t.Context(), &policy) Expect(err.Error()).To( Equal( `failed to get the encryption key from Secret local-cluster/policy-encryption-key: secrets ` + diff --git a/go.mod b/go.mod index 61c18280..8445169a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module open-cluster-management.io/config-policy-controller -go 1.23.0 +go 1.24.0 require ( github.com/Masterminds/sprig/v3 v3.2.3