Skip to content

Commit 2e808e0

Browse files
dhaiducekopenshift-merge-bot[bot]
authored andcommitted
Bump to Go v1.23
Signed-off-by: Dale Haiducek <[email protected]>
1 parent d2150f9 commit 2e808e0

9 files changed

+18
-8
lines changed

build/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM registry.ci.openshift.org/stolostron/builder:go1.22-linux AS builder
2+
FROM registry.ci.openshift.org/stolostron/builder:go1.23-linux AS builder
33

44
ARG GOOS
55
ARG GOARCH

build/Dockerfile.rhtap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 AS builder
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.23 AS builder
33

44
ARG GOOS
55
ARG GOARCH

build/common/Makefile.common.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ CONTROLLER_GEN_VERSION := v0.16.3
77
# https://github.com/kubernetes-sigs/kustomize/releases/latest
88
KUSTOMIZE_VERSION := v5.4.3
99
# https://github.com/golangci/golangci-lint/releases/latest
10-
GOLANGCI_VERSION := v1.52.2
10+
GOLANGCI_VERSION := v1.60.3
1111
# https://github.com/mvdan/gofumpt/releases/latest
1212
GOFUMPT_VERSION := v0.7.0
1313
# https://github.com/daixiang0/gci/releases/latest

build/common/config/.golangci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ linters:
4343
- goerr113
4444
- golint # replaced by revive
4545
- gomnd
46+
- mnd
4647
- gomoddirectives
4748
- gosec
4849
- ifshort
@@ -55,6 +56,7 @@ linters:
5556
- nilnil # New linter to consider
5657
- nonamedreturns # New linter to consider
5758
- paralleltest
59+
- perfsprint
5860
- prealloc
5961
- revive
6062
- scopelint

controllers/gatekeeper_controller.go

+1
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,7 @@ func updateContainerArg(
15121512
isMultiArg := slices.Contains(multiArgFlags, argName)
15131513

15141514
index := -1
1515+
15151516
for i, arg := range args {
15161517
n, v := util.FromArg(arg)
15171518
if n == argName && (!isMultiArg || isMultiArg && v == argValue) {

controllers/gatekeeper_controller_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ func TestSetCommonConfig(t *testing.T) {
291291
} {
292292
for testName, test := range testcases {
293293
testName := fmt.Sprintf("%s:%s", component, testName)
294-
test := test
295294

296295
// Fetch relevant component object (audit or webhook)
297296
obj, err := util.GetManifestObject(file)
@@ -906,6 +905,7 @@ func assertFailurePolicy(
906905
current, found, err := unstructured.NestedString(webhook, "failurePolicy")
907906
g.Expect(err).ToNot(HaveOccurred())
908907
g.Expect(found).To(BeTrue())
908+
909909
if expected == nil {
910910
g.Expect(test.DefaultDeployment.FailurePolicy).To(BeEquivalentTo(current))
911911
} else {
@@ -988,6 +988,7 @@ func assertNamespaceSelector(
988988
if webhook["name"] == webhookName {
989989
current, found, err := unstructured.NestedFieldCopy(webhook, "namespaceSelector")
990990
g.Expect(err).ToNot(HaveOccurred())
991+
991992
if expected == nil {
992993
// ValidatingWebhookConfiguration and
993994
// MutatingWebhookConfiguration have the same defaults.

controllers/merge/merge.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,20 @@ func retainSecretFields(desiredObj, clusterObj *unstructured.Unstructured) error
9393
func retainWebhookConfigurationFields(desiredObj, clusterObj *unstructured.Unstructured) error {
9494
// Retain each webhook's CABundle
9595
clusterWebhooks, ok, err := unstructured.NestedSlice(clusterObj.Object, "webhooks")
96-
if err != nil {
96+
97+
switch {
98+
case err != nil:
9799
return errors.Wrapf(err, "Error retrieving webhooks from cluster object %s", clusterObj.GetKind())
98-
} else if ok && len(clusterWebhooks) == 0 {
100+
101+
case ok && len(clusterWebhooks) == 0:
99102
err = unstructured.SetNestedSlice(desiredObj.Object, nil, "webhooks")
100103
if err != nil {
101104
return errors.Wrapf(err, "Error setting webhooks for desired object %s", desiredObj.GetKind())
102105
}
103106

104107
return nil
105-
} else if !ok {
108+
109+
case !ok:
106110
return nil
107111
}
108112

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/stolostron/gatekeeper-operator
22

3-
go 1.22.0
3+
go 1.23.6
44

55
require (
66
github.com/go-bindata/go-bindata v3.1.2+incompatible

test/e2e/gatekeeper_controller_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ func assertResources(expected, current corev1.ResourceRequirements) {
985985
func byCheckingValidation(ctx SpecContext, mode v1alpha1.Mode) {
986986
By("Checking validation is "+string(mode), func() {
987987
validatingWebhookConfiguration := &admregv1.ValidatingWebhookConfiguration{}
988+
988989
Eventually(func() error {
989990
err := K8sClient.Get(ctx, validatingWebhookName, validatingWebhookConfiguration)
990991
if !mode.ToBool() && apierrors.IsNotFound(err) {
@@ -1041,6 +1042,7 @@ func byCheckingMutation(ctx SpecContext, mode v1alpha1.Mode) {
10411042

10421043
By("Checking MutatingWebhookConfiguration is "+msgNegation+"deployed", func() {
10431044
mutatingWebhookConfiguration := &admregv1.MutatingWebhookConfiguration{}
1045+
10441046
Eventually(func() error {
10451047
err := K8sClient.Get(ctx, mutatingWebhookName, mutatingWebhookConfiguration)
10461048
if !mode.ToBool() && apierrors.IsNotFound(err) {

0 commit comments

Comments
 (0)