Skip to content

Commit a1ccba4

Browse files
authored
Upgrade Go to v1.24 (#16)
1 parent aeefd17 commit a1ccba4

33 files changed

+666
-1021
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
golang 1.20.14
1+
golang 1.24.3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.20 as builder
2+
FROM golang:1.24 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests and all third-party libraries that are unlikely to change frequently

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ GOBIN ?= ${CURDIR}/bin
7878
KUSTOMIZE_VERSION ?= v5.3.0
7979
KUSTOMIZE ?= ${GOBIN}/kustomize
8080

81-
CONTROLLER_GEN_VERSION ?= v0.12.0
81+
CONTROLLER_GEN_VERSION ?= v0.17.3
8282
CONTROLLER_GEN ?= ${GOBIN}/controller-gen
8383

8484
STATICCHECK_VERSION ?= 2023.1

api/v1alpha2/zz_generated.deepcopy.go

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

cmd/manager/main.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ import (
3737
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
3838
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
3939
ctrl "sigs.k8s.io/controller-runtime"
40+
"sigs.k8s.io/controller-runtime/pkg/client"
4041
"sigs.k8s.io/controller-runtime/pkg/healthz"
4142
"sigs.k8s.io/controller-runtime/pkg/log/zap"
4243
"sigs.k8s.io/controller-runtime/pkg/metrics"
44+
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
45+
"sigs.k8s.io/controller-runtime/pkg/webhook"
4346

4447
// +kubebuilder:scaffold:imports
4548

@@ -273,13 +276,17 @@ func createManager() ctrl.Manager {
273276
// it turns out to be harmful.
274277
cfg.Burst = int(cfg.QPS * 1.5)
275278
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
276-
NewClient: config.NewClient(webhooksOnly),
279+
Client: client.Options{
280+
Cache: &client.CacheOptions{
281+
Unstructured: true,
282+
},
283+
},
277284
Scheme: scheme,
278-
MetricsBindAddress: metricsAddr,
285+
Metrics: server.Options{BindAddress: metricsAddr},
279286
HealthProbeBindAddress: probeAddr,
280287
LeaderElection: enableLeaderElection,
281288
LeaderElectionID: leaderElectionId,
282-
Port: webhookServerPort,
289+
WebhookServer: &webhook.DefaultServer{Options: webhook.Options{Port: webhookServerPort}},
283290
})
284291
if err != nil {
285292
setupLog.Error(err, "unable to create manager")

config/crd/bases/hnc.x-k8s.io_hierarchicalresourcequotas.yaml

Lines changed: 32 additions & 24 deletions
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.12.0
6+
controller-gen.kubebuilder.io/version: v0.17.3
77
name: hierarchicalresourcequotas.hnc.x-k8s.io
88
spec:
99
group: hnc.x-k8s.io
@@ -31,18 +31,24 @@ spec:
3131
name: v1alpha2
3232
schema:
3333
openAPIV3Schema:
34-
description: HierarchicalResourceQuota sets aggregate quota restrictions enforced
35-
for a namespace and descendant namespaces
34+
description: |-
35+
HierarchicalResourceQuota sets aggregate quota restrictions enforced for a
36+
namespace and descendant namespaces
3637
properties:
3738
apiVersion:
38-
description: 'APIVersion defines the versioned schema of this representation
39-
of an object. Servers should convert recognized schemas to the latest
40-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
39+
description: |-
40+
APIVersion defines the versioned schema of this representation of an object.
41+
Servers should convert recognized schemas to the latest internal value, and
42+
may reject unrecognized values.
43+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
4144
type: string
4245
kind:
43-
description: 'Kind is a string value representing the REST resource this
44-
object represents. Servers may infer this from the endpoint the client
45-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
46+
description: |-
47+
Kind is a string value representing the REST resource this object represents.
48+
Servers may infer this from the endpoint the client submits requests to.
49+
Cannot be updated.
50+
In CamelCase.
51+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
4652
type: string
4753
metadata:
4854
type: object
@@ -60,32 +66,33 @@ spec:
6066
resource
6167
type: object
6268
scopeSelector:
63-
description: ScopeSelector is also a collection of filters like Scopes
64-
that must match each object tracked by a quota but expressed using
65-
ScopeSelectorOperator in combination with possible values.
69+
description: |-
70+
ScopeSelector is also a collection of filters like Scopes that must match each object tracked by a quota
71+
but expressed using ScopeSelectorOperator in combination with possible values.
6672
properties:
6773
matchExpressions:
6874
description: A list of scope selector requirements by scope of
6975
the resources.
7076
items:
71-
description: A scoped-resource selector requirement is a selector
72-
that contains values, a scope name, and an operator that relates
73-
the scope name and values.
77+
description: |-
78+
A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator
79+
that relates the scope name and values.
7480
properties:
7581
operator:
76-
description: Represents a scope's relationship to a set
77-
of values. Valid operators are In, NotIn, Exists, DoesNotExist.
82+
description: |-
83+
Represents a scope's relationship to a set of values.
84+
Valid operators are In, NotIn, Exists, DoesNotExist.
7885
type: string
7986
scopeName:
8087
description: The name of the scope that the selector applies
8188
to.
8289
type: string
8390
values:
84-
description: An array of string values. If the operator
85-
is In or NotIn, the values array must be non-empty. If
86-
the operator is Exists or DoesNotExist, the values array
87-
must be empty. This array is replaced during a strategic
88-
merge patch.
91+
description: |-
92+
An array of string values. If the operator is In or NotIn,
93+
the values array must be non-empty. If the operator is Exists or DoesNotExist,
94+
the values array must be empty.
95+
This array is replaced during a strategic merge patch.
8996
items:
9097
type: string
9198
type: array
@@ -126,8 +133,9 @@ spec:
126133
- type: string
127134
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
128135
x-kubernetes-int-or-string: true
129-
description: Used is the current observed total usage of the resource
130-
in the namespace and its descendant namespaces.
136+
description: |-
137+
Used is the current observed total usage of the resource in the namespace
138+
and its descendant namespaces.
131139
type: object
132140
type: object
133141
type: object

config/crd/bases/hnc.x-k8s.io_hierarchyconfigurations.yaml

Lines changed: 56 additions & 60 deletions
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.12.0
6+
controller-gen.kubebuilder.io/version: v0.17.3
77
name: hierarchyconfigurations.hnc.x-k8s.io
88
spec:
99
group: hnc.x-k8s.io
@@ -20,14 +20,19 @@ spec:
2020
description: Hierarchy is the Schema for the hierarchies API
2121
properties:
2222
apiVersion:
23-
description: 'APIVersion defines the versioned schema of this representation
24-
of an object. Servers should convert recognized schemas to the latest
25-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
2628
type: string
2729
kind:
28-
description: 'Kind is a string value representing the REST resource this
29-
object represents. Servers may infer this from the endpoint the client
30-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3136
type: string
3237
metadata:
3338
# This is patched by hack/crd_patches/singleton-enum-patch.sh
@@ -41,51 +46,54 @@ spec:
4146
description: HierarchySpec defines the desired state of Hierarchy
4247
properties:
4348
allowCascadingDeletion:
44-
description: AllowCascadingDeletion indicates if the subnamespaces
45-
of this namespace are allowed to cascading delete.
49+
description: |-
50+
AllowCascadingDeletion indicates if the subnamespaces of this namespace are
51+
allowed to cascading delete.
4652
type: boolean
4753
annotations:
48-
description: Annotations is a list of annotations and values to apply
49-
to the current namespace and all of its descendants. All annotation
50-
keys must match a regex specified on the command line by --managed-namespace-annotation.
51-
A namespace cannot have a KVP that conflicts with one of its ancestors.
54+
description: |-
55+
Annotations is a list of annotations and values to apply to the current namespace and all of
56+
its descendants. All annotation keys must match a regex specified on the command line by
57+
--managed-namespace-annotation. A namespace cannot have a KVP that conflicts with one of its
58+
ancestors.
5259
items:
5360
description: MetaKVP represents a label or annotation
5461
properties:
5562
key:
56-
description: Key is the name of the label or annotation. It
57-
must conform to the normal rules for Kubernetes label/annotation
58-
keys.
63+
description: |-
64+
Key is the name of the label or annotation. It must conform to the normal rules for Kubernetes
65+
label/annotation keys.
5966
type: string
6067
value:
61-
description: Value is the value of the label or annotation.
62-
It must confirm to the normal rules for Kubernetes label or
63-
annoation values, which are far more restrictive for labels
64-
than for anntations.
68+
description: |-
69+
Value is the value of the label or annotation. It must confirm to the normal rules for
70+
Kubernetes label or annoation values, which are far more restrictive for labels than for
71+
anntations.
6572
type: string
6673
required:
6774
- key
6875
- value
6976
type: object
7077
type: array
7178
labels:
72-
description: Lables is a list of labels and values to apply to the
73-
current namespace and all of its descendants. All label keys must
74-
match a regex specified on the command line by --managed-namespace-label.
75-
A namespace cannot have a KVP that conflicts with one of its ancestors.
79+
description: |-
80+
Lables is a list of labels and values to apply to the current namespace and all of its
81+
descendants. All label keys must match a regex specified on the command line by
82+
--managed-namespace-label. A namespace cannot have a KVP that conflicts with one of its
83+
ancestors.
7684
items:
7785
description: MetaKVP represents a label or annotation
7886
properties:
7987
key:
80-
description: Key is the name of the label or annotation. It
81-
must conform to the normal rules for Kubernetes label/annotation
82-
keys.
88+
description: |-
89+
Key is the name of the label or annotation. It must conform to the normal rules for Kubernetes
90+
label/annotation keys.
8391
type: string
8492
value:
85-
description: Value is the value of the label or annotation.
86-
It must confirm to the normal rules for Kubernetes label or
87-
annoation values, which are far more restrictive for labels
88-
than for anntations.
93+
description: |-
94+
Value is the value of the label or annotation. It must confirm to the normal rules for
95+
Kubernetes label or annoation values, which are far more restrictive for labels than for
96+
anntations.
8997
type: string
9098
required:
9199
- key
@@ -108,43 +116,35 @@ spec:
108116
conditions:
109117
description: Conditions describes the errors, if any.
110118
items:
111-
description: "Condition contains details for one aspect of the current
112-
state of this API Resource. --- This struct is intended for direct
113-
use as an array at the field path .status.conditions. For example,
114-
type FooStatus struct{ // Represents the observations of a foo's
115-
current state. // Known .status.conditions.type are: \"Available\",
116-
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
117-
// +listType=map // +listMapKey=type Conditions []metav1.Condition
118-
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
119-
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
119+
description: Condition contains details for one aspect of the current
120+
state of this API Resource.
120121
properties:
121122
lastTransitionTime:
122-
description: lastTransitionTime is the last time the condition
123-
transitioned from one status to another. This should be when
124-
the underlying condition changed. If that is not known, then
125-
using the time when the API field changed is acceptable.
123+
description: |-
124+
lastTransitionTime is the last time the condition transitioned from one status to another.
125+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
126126
format: date-time
127127
type: string
128128
message:
129-
description: message is a human readable message indicating
130-
details about the transition. This may be an empty string.
129+
description: |-
130+
message is a human readable message indicating details about the transition.
131+
This may be an empty string.
131132
maxLength: 32768
132133
type: string
133134
observedGeneration:
134-
description: observedGeneration represents the .metadata.generation
135-
that the condition was set based upon. For instance, if .metadata.generation
136-
is currently 12, but the .status.conditions[x].observedGeneration
137-
is 9, the condition is out of date with respect to the current
138-
state of the instance.
135+
description: |-
136+
observedGeneration represents the .metadata.generation that the condition was set based upon.
137+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
138+
with respect to the current state of the instance.
139139
format: int64
140140
minimum: 0
141141
type: integer
142142
reason:
143-
description: reason contains a programmatic identifier indicating
144-
the reason for the condition's last transition. Producers
145-
of specific condition types may define expected values and
146-
meanings for this field, and whether the values are considered
147-
a guaranteed API. The value should be a CamelCase string.
143+
description: |-
144+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
145+
Producers of specific condition types may define expected values and meanings for this field,
146+
and whether the values are considered a guaranteed API.
147+
The value should be a CamelCase string.
148148
This field may not be empty.
149149
maxLength: 1024
150150
minLength: 1
@@ -159,10 +159,6 @@ spec:
159159
type: string
160160
type:
161161
description: type of condition in CamelCase or in foo.example.com/CamelCase.
162-
--- Many .condition.type values are consistent across resources
163-
like Available, but because arbitrary conditions can be useful
164-
(see .node.status.conditions), the ability to deconflict is
165-
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
166162
maxLength: 316
167163
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
168164
type: string

0 commit comments

Comments
 (0)