Skip to content

Commit 3ad4558

Browse files
authored
ACM-26610: Upgrade CAPI to v1.11.0 (#767)
* ACM-26610: Upgrade APIs to use new CAPI version Upgrade CAPI to v1.11.0 * ACM-26610: Upgrade CAPI to v1.11.0 * ACM-26610: Update controllers to use new import for CAPI * ACM-26610: Upgrade Docker base image to Go 1.24 * ACM-26610: Upgrade golangci-lint to v2.6.2 After the initial upgrade of CAPI to v1.11.0 there were a couple of lint errors that needed a new version of the linter. * ACM-26610: Fix linter errors after version upgrade * ACM-26610: Convert all conditions and objects to deprecated versions Since we're unable to test with the latest v1beta2 version of CAPI, we'll continue to use the deprecated version v1beta1 for now. * ACM-26610: Fix remaining linter errors after changes * ACM-26610: Upgrade controller-gen and regenerate files * ACM-26610: Fix unit tests after version change * ACM-26610: Add names to controllers Prevents duplicate naming that causes the application to crash with error: "Controller names must be unique to avoid multiple controllers reporting the same metric."
1 parent d1dfe0c commit 3ad4558

File tree

4,548 files changed

+703463
-209407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,548 files changed

+703463
-209407
lines changed

.golangci.yml

Lines changed: 48 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,63 @@
1-
# This file contains all available configuration options
2-
# with their default values.
3-
4-
# options for analysis running
5-
run:
6-
# default concurrency is a available CPU number
7-
concurrency: 4
8-
9-
# timeout for analysis, e.g. 30s, 5m, default is 1m
1+
version: 2
2+
run:
3+
go: "1.24"
104
timeout: 10m
5+
allow-parallel-runners: true
6+
concurrency: 4
117

12-
# exit code when at least one issue was found, default is 1
13-
issues-exit-code: 1
14-
15-
# include test files or not, default is true
16-
tests: true
8+
linters:
9+
default: none
10+
enable:
11+
- errcheck
12+
- govet
13+
- gocyclo
14+
- gosec
15+
- unconvert
16+
- ineffassign
17+
- misspell
18+
- unused
19+
settings:
20+
govet:
21+
enable:
22+
- shadow
23+
settings:
24+
printf:
25+
funcs:
26+
- Infof
27+
- Warnf
28+
- Errorf
29+
- Fatalf
1730

1831
# which dirs to skip: issues from them won't be reported;
1932
# can use regexp here: generated.*, regexp is applied on full path;
2033
# default value is empty list, but default dirs are skipped independently
2134
# from this option's value (see skip-dirs-use-default).
22-
skip-dirs:
23-
- build
24-
- client
25-
- docs
26-
- models
27-
- restapi
28-
- api
29-
30-
# output configuration options
31-
output:
32-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
33-
format: colored-line-number
34-
35-
# print lines of code with issue, default is true
36-
print-issued-lines: true
37-
38-
# print linter name in the end of issue text, default is true
39-
print-linter-name: true
40-
41-
# make issues output unique by line, default is true
42-
uniq-by-line: true
35+
exclusions:
36+
paths:
37+
- build
38+
- client
39+
- docs
40+
- models
41+
- restapi
42+
- api
4343

4444
issues:
45-
# List of regexps of issue texts to exclude, empty list by default.
46-
# But independently from this option we use default exclude patterns,
47-
# it can be disabled by `exclude-use-default: false`. To list all
48-
# excluded by default patterns execute `golangci-lint run --help`
49-
exclude:
50-
- G107
51-
- G402 # support object store DisableSSL
52-
- G108
45+
uniq-by-line: true
5346

54-
linters:
47+
formatters:
5548
enable:
56-
- megacheck
57-
- govet
58-
- gocyclo
5949
- gofmt
60-
- gosec
61-
- megacheck
62-
- unconvert
6350
- gci
6451
- goimports
65-
- exportloopref
52+
settings:
53+
gofmt:
54+
simplify: false
6655

67-
linters-settings:
68-
govet:
69-
check-shadowing: true
70-
71-
settings:
72-
printf:
73-
funcs:
74-
- Infof
75-
- Warnf
76-
- Errorf
77-
- Fatalf
56+
# output configuration options
57+
output:
58+
formats:
59+
text:
60+
path: stdout
61+
print-linter-name: true
62+
print-issued-lines: true
63+
colors: true

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM registry.access.redhat.com/ubi9/go-toolset:9.6-1755755147 as builder
2+
FROM registry.access.redhat.com/ubi9/go-toolset:1.24 AS builder
33

44
USER 0
55

@@ -11,7 +11,7 @@ RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
1111
# Extract the commit reference from which the image is built
1212
RUN git rev-parse --short HEAD > /commit-reference.txt
1313

14-
FROM quay-proxy.ci.openshift.org/openshift/ci:ocp_4.16_base-rhel9
14+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.6
1515

1616
# Copy the commit reference from the builder
1717
COPY --from=builder /commit-reference.txt /commit-reference.txt

Dockerfile.rhtap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Build the manager binary
2-
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.23 as builder
2+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24 as builder
33

44
WORKDIR /workspace
55
COPY . .
66
# Build
77
RUN CGO_ENABLED=1 go build -a -o manager main.go
88

9-
FROM registry.redhat.io/rhel9-2-els/rhel:9.2
9+
FROM registry.redhat.io/rhel9-6-els/rhel:9.6
1010

1111
ARG version=2.11
1212

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
147147

148148
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
149149
controller-gen: ## Download controller-gen locally if necessary.
150-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)
150+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.19.0)
151151

152152
KUSTOMIZE = $(shell pwd)/bin/kustomize
153153
kustomize: ## Download kustomize locally if necessary.
@@ -163,7 +163,7 @@ mockgen: ## Download mockgen locally if necessary.
163163

164164
GOLINT = $(shell pwd)/bin/golangci-lint
165165
golint: ## Download golangci-lint locally if necessary.
166-
$(call go-get-tool,$(GOLINT),github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0)
166+
$(call go-get-tool,$(GOLINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.2)
167167

168168
# go-get-tool will 'go get' any package $2 and install it to $1.
169169
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))

api/go.mod

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,62 @@
11
module github.com/openshift/cluster-api-provider-agent/api
22

3-
go 1.21
3+
go 1.24.0
4+
5+
toolchain go1.24.2
46

57
require (
68
github.com/openshift/api v0.0.0-20240830023148-b7d0481c9094
7-
k8s.io/apimachinery v0.29.9
8-
k8s.io/client-go v0.29.9
9-
sigs.k8s.io/cluster-api v1.7.6
10-
sigs.k8s.io/controller-runtime v0.17.6
9+
k8s.io/apimachinery v0.34.2
10+
k8s.io/client-go v0.34.2
11+
sigs.k8s.io/cluster-api v1.11.0
12+
sigs.k8s.io/controller-runtime v0.22.4
1113
)
1214

1315
require (
14-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
15-
github.com/go-logr/logr v1.4.1 // indirect
16-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
17-
github.com/go-openapi/jsonreference v0.20.2 // indirect
18-
github.com/go-openapi/swag v0.22.3 // indirect
16+
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
17+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
18+
github.com/go-logr/logr v1.4.3 // indirect
19+
github.com/go-openapi/jsonpointer v0.22.3 // indirect
20+
github.com/go-openapi/jsonreference v0.21.3 // indirect
21+
github.com/go-openapi/swag v0.25.3 // indirect
22+
github.com/go-openapi/swag/cmdutils v0.25.3 // indirect
23+
github.com/go-openapi/swag/conv v0.25.3 // indirect
24+
github.com/go-openapi/swag/fileutils v0.25.3 // indirect
25+
github.com/go-openapi/swag/jsonname v0.25.3 // indirect
26+
github.com/go-openapi/swag/jsonutils v0.25.3 // indirect
27+
github.com/go-openapi/swag/loading v0.25.3 // indirect
28+
github.com/go-openapi/swag/mangling v0.25.3 // indirect
29+
github.com/go-openapi/swag/netutils v0.25.3 // indirect
30+
github.com/go-openapi/swag/stringutils v0.25.3 // indirect
31+
github.com/go-openapi/swag/typeutils v0.25.3 // indirect
32+
github.com/go-openapi/swag/yamlutils v0.25.3 // indirect
1933
github.com/gogo/protobuf v1.3.2 // indirect
20-
github.com/golang/protobuf v1.5.4 // indirect
21-
github.com/google/gnostic-models v0.6.8 // indirect
22-
github.com/google/gofuzz v1.2.0 // indirect
23-
github.com/josharian/intern v1.0.0 // indirect
34+
github.com/google/gnostic-models v0.7.1 // indirect
35+
github.com/google/go-cmp v0.7.0 // indirect
2436
github.com/json-iterator/go v1.1.12 // indirect
25-
github.com/mailru/easyjson v0.7.7 // indirect
2637
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
27-
github.com/modern-go/reflect2 v1.0.2 // indirect
38+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
39+
github.com/onsi/gomega v1.38.2 // indirect
2840
github.com/pkg/errors v0.9.1 // indirect
29-
golang.org/x/net v0.23.0 // indirect
30-
golang.org/x/text v0.14.0 // indirect
31-
google.golang.org/protobuf v1.33.0 // indirect
41+
github.com/spf13/pflag v1.0.10 // indirect
42+
github.com/stretchr/testify v1.11.1 // indirect
43+
github.com/x448/float16 v0.8.4 // indirect
44+
go.yaml.in/yaml/v2 v2.4.3 // indirect
45+
go.yaml.in/yaml/v3 v3.0.4 // indirect
46+
golang.org/x/net v0.47.0 // indirect
47+
golang.org/x/text v0.31.0 // indirect
48+
golang.org/x/tools v0.39.0 // indirect
49+
google.golang.org/protobuf v1.36.10 // indirect
3250
gopkg.in/inf.v0 v0.9.1 // indirect
33-
gopkg.in/yaml.v2 v2.4.0 // indirect
34-
gopkg.in/yaml.v3 v3.0.1 // indirect
35-
k8s.io/api v0.29.9 // indirect
36-
k8s.io/apiextensions-apiserver v0.29.3 // indirect
37-
k8s.io/klog/v2 v2.110.1 // indirect
38-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
39-
k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect
40-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
41-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
42-
sigs.k8s.io/yaml v1.4.0 // indirect
51+
k8s.io/api v0.34.2 // indirect
52+
k8s.io/apiextensions-apiserver v0.34.2 // indirect
53+
k8s.io/klog/v2 v2.130.1 // indirect
54+
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect
55+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
56+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
57+
sigs.k8s.io/randfill v1.0.0 // indirect
58+
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
59+
sigs.k8s.io/yaml v1.6.0 // indirect
4360
)
61+
62+
replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.11.0

0 commit comments

Comments
 (0)