Skip to content

Commit 41f8e26

Browse files
dhaiducekopenshift-merge-bot[bot]
authored andcommitted
Sync common Makefile
Signed-off-by: Dale Haiducek <[email protected]>
1 parent 1b40a76 commit 41f8e26

8 files changed

+28
-22
lines changed

build/common/Makefile.common.mk

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@
33

44
## CLI versions (with links to the latest releases)
55
# https://github.com/kubernetes-sigs/controller-tools/releases/latest
6-
CONTROLLER_GEN_VERSION := v0.16.3
6+
CONTROLLER_GEN_VERSION := v0.19.0
77
# https://github.com/kubernetes-sigs/kustomize/releases/latest
8-
KUSTOMIZE_VERSION := v5.6.0
8+
KUSTOMIZE_VERSION := v5.7.1
99
# https://github.com/golangci/golangci-lint/releases/latest
1010
GOLANGCI_VERSION := v1.64.8
1111
# https://github.com/mvdan/gofumpt/releases/latest
12-
GOFUMPT_VERSION := v0.7.0
12+
GOFUMPT_VERSION := v0.9.1
1313
# https://github.com/daixiang0/gci/releases/latest
14-
GCI_VERSION := v0.13.5
14+
GCI_VERSION := v0.13.7
1515
# https://github.com/securego/gosec/releases/latest
16-
GOSEC_VERSION := v2.22.2
16+
GOSEC_VERSION := v2.22.9
1717
# https://github.com/kubernetes-sigs/kubebuilder/releases/latest
18-
KBVERSION := 3.15.1
19-
# https://github.com/kubernetes/kubernetes/releases/latest
20-
ENVTEST_K8S_VERSION := 1.30.x
18+
KBVERSION := 4.9.0
19+
# https://github.com/alexfalkowski/gocovmerge/releases/latest
20+
GOCOVMERGE_VERSION := v2.16.0
21+
# ref: https://book.kubebuilder.io/reference/envtest.html?highlight=setup-envtest#installation
22+
# Parse the controller-runtime version from go.mod and parse to its release-X.Y git branch
23+
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
24+
# Parse the Kubernetes API version from go.mod (which is v0.Y.Z) and convert to the corresponding v1.Y.Z format
25+
ENVTEST_K8S_VERSION := $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
2126

2227
LOCAL_BIN ?= $(error LOCAL_BIN is not set.)
2328
ifneq ($(findstring $(LOCAL_BIN), $(PATH)), $(LOCAL_BIN))
@@ -112,7 +117,8 @@ kubebuilder:
112117

113118
.PHONY: envtest
114119
envtest:
115-
$(call go-get-tool,sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
120+
# Installing setup-envtest using the release-X.Y branch from the version specified in go.mod
121+
$(call go-get-tool,sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION))
116122

117123
.PHONY: gosec
118124
gosec:
@@ -180,4 +186,4 @@ e2e-dependencies:
180186
GOCOVMERGE = $(LOCAL_BIN)/gocovmerge
181187
.PHONY: coverage-dependencies
182188
coverage-dependencies:
183-
$(call go-get-tool,github.com/wadey/gocovmerge@v0.0.0-20160331181800-b5bfa59ec0ad)
189+
$(call go-get-tool,github.com/alexfalkowski/gocovmerge/v2@$(GOCOVMERGE_VERSION))

controllers/configurationpolicy_controller.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ func (r *ConfigurationPolicyReconciler) determineDesiredObjects(
17001700
"expected one optional boolean argument but received %d arguments", len(skips))
17011701
}
17021702

1703-
return
1703+
return empty, err
17041704
},
17051705
}
17061706

@@ -2356,7 +2356,7 @@ func (r *ConfigurationPolicyReconciler) handleSingleObj(
23562356
}
23572357
}
23582358

2359-
return
2359+
return result, objectProperties
23602360
}
23612361

23622362
if exists && !obj.shouldExist {
@@ -2373,15 +2373,15 @@ func (r *ConfigurationPolicyReconciler) handleSingleObj(
23732373
result.events = append(result.events, objectTmplEvalEvent{false, reasonWantNotFoundExists, ""})
23742374
}
23752375

2376-
return
2376+
return result, objectProperties
23772377
}
23782378

23792379
if !exists && !obj.shouldExist {
23802380
log.V(1).Info("The object does not exist and is compliant with the mustnothave compliance type")
23812381
// it is a must not have and it does not exist, so it is compliant
23822382
result.events = append(result.events, objectTmplEvalEvent{true, reasonWantNotFoundDNE, ""})
23832383

2384-
return
2384+
return result, objectProperties
23852385
}
23862386

23872387
// object exists and the template requires it, so we need to check specific fields to see if we have a match
@@ -2458,7 +2458,7 @@ func (r *ConfigurationPolicyReconciler) handleSingleObj(
24582458
}
24592459
}
24602460

2461-
return
2461+
return result, objectProperties
24622462
}
24632463

24642464
// getMapping takes in a raw object, decodes it, and maps it to an existing group/kind
@@ -3565,7 +3565,7 @@ func handleKeys(
35653565
}
35663566
}
35673567

3568-
return
3568+
return throwSpecViolation, message, updateNeeded, statusMismatch, missingKey
35693569
}
35703570

35713571
func removeFieldsForComparison(obj *unstructured.Unstructured) {

controllers/configurationpolicy_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ func createStatus(
617617
compliancyDetailsMsg = getCombinedCompliancyDetailsMsg(msgMap, resourceName, compliancyDetailsMsg)
618618
}
619619

620-
return
620+
return compliant, compliancyDetailsReason, compliancyDetailsMsg
621621
}
622622

623623
func setCompliancyDetailsMsgEnd(compliancyDetailsMsg string) string {

deploy/crds/kustomize_configurationpolicy/policy.open-cluster-management.io_configurationpolicies.yaml

Lines changed: 1 addition & 1 deletion
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.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
name: configurationpolicies.policy.open-cluster-management.io
88
spec:
99
group: policy.open-cluster-management.io

deploy/crds/kustomize_operatorpolicy/policy.open-cluster-management.io_operatorpolicies.yaml

Lines changed: 1 addition & 1 deletion
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.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
name: operatorpolicies.policy.open-cluster-management.io
88
spec:
99
group: policy.open-cluster-management.io

deploy/crds/policy.open-cluster-management.io_configurationpolicies.yaml

Lines changed: 1 addition & 1 deletion
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.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
labels:
88
policy.open-cluster-management.io/policy-type: template
99
name: configurationpolicies.policy.open-cluster-management.io

deploy/crds/policy.open-cluster-management.io_operatorpolicies.yaml

Lines changed: 1 addition & 1 deletion
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.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
labels:
88
policy.open-cluster-management.io/policy-type: template
99
name: operatorpolicies.policy.open-cluster-management.io

pkg/dryrun/policy.open-cluster-management.io_configurationpolicies.yaml

Lines changed: 1 addition & 1 deletion
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.16.3
6+
controller-gen.kubebuilder.io/version: v0.19.0
77
labels:
88
policy.open-cluster-management.io/policy-type: template
99
name: configurationpolicies.policy.open-cluster-management.io

0 commit comments

Comments
 (0)