Skip to content

Commit 408c805

Browse files
committed
Update controller-gen and conversion-gen to latest tags
Fixes conversion-gen to use a version tag instead of using latest Also adds superficial changes that have been made to generated code as a result of this update: - removes +build tag (deprecated as of Go 1.18) - documents in the config/webhook/manifests.yaml files have only been reordered
1 parent 7d393cd commit 408c805

7 files changed

+178
-152
lines changed

Makefile

+6-10
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ endif
3939

4040
HACK_BIN=$(shell pwd)/hack/bin
4141

42-
# Set --output-base for conversion-gen if we are not within GOPATH
43-
ifneq ($(abspath $(ROOT_DIR)),$(shell go env GOPATH)/src/sigs.k8s.io/cluster-api-ipam-provider-in-cluster)
44-
OUTPUT_BASE := --output-base=$(ROOT_DIR)
45-
endif
46-
4742
# Setting SHELL to bash allows bash commands to be executed by recipes.
4843
# This is a requirement for 'setup-envtest.sh' in the test target.
4944
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
@@ -79,9 +74,10 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
7974
.PHONY: generate
8075
generate: controller-gen conversion-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
8176
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
82-
$(CONVERSION_GEN) --input-dirs=./api/v1alpha1 \
83-
--output-file-base=zz_generated.conversion $(OUTPUT_BASE) \
84-
--go-header-file=./hack/boilerplate.go.txt
77+
$(CONVERSION_GEN) \
78+
--output-file=zz_generated.conversion.go $(OUTPUT_BASE) \
79+
--go-header-file=./hack/boilerplate.go.txt \
80+
./api/v1alpha1
8581

8682
.PHONY: fmt
8783
fmt: ## Run go fmt against code.
@@ -223,7 +219,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
223219
CONTROLLER_GEN = $(HACK_BIN)/controller-gen
224220
.PHONY: controller-gen
225221
controller-gen: ## Download controller-gen locally if necessary.
226-
env GOBIN=$(HACK_BIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0
222+
env GOBIN=$(HACK_BIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0
227223

228224
KUSTOMIZE = $(HACK_BIN)/kustomize
229225
.PHONY: kustomize
@@ -247,4 +243,4 @@ verify-boilerplate: ## Verifies all sources have appropriate boilerplate
247243
CONVERSION_GEN = $(HACK_BIN)/conversion-gen
248244
.PHONY: conversion-gen
249245
conversion-gen: ## Download conversion-gen locally if necessary.
250-
env GOBIN=$(HACK_BIN) go install k8s.io/code-generator/cmd/conversion-gen@latest
246+
env GOBIN=$(HACK_BIN) go install k8s.io/code-generator/cmd/conversion-gen@v0.30.1

api/v1alpha1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha2/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/ipam.cluster.x-k8s.io_globalinclusterippools.yaml

+84-64
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.7.0
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.15.0
97
name: globalinclusterippools.ipam.cluster.x-k8s.io
108
spec:
119
group: ipam.cluster.x-k8s.io
@@ -47,52 +45,63 @@ spec:
4745
name: v1alpha1
4846
schema:
4947
openAPIV3Schema:
50-
description: GlobalInClusterIPPool is the Schema for the global inclusterippools
51-
API. This pool type is cluster scoped. IPAddressClaims can reference pools
52-
of this type from any any namespace.
48+
description: |-
49+
GlobalInClusterIPPool is the Schema for the global inclusterippools API.
50+
This pool type is cluster scoped. IPAddressClaims can reference
51+
pools of this type from any any namespace.
5352
properties:
5453
apiVersion:
55-
description: 'APIVersion defines the versioned schema of this representation
56-
of an object. Servers should convert recognized schemas to the latest
57-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
54+
description: |-
55+
APIVersion defines the versioned schema of this representation of an object.
56+
Servers should convert recognized schemas to the latest internal value, and
57+
may reject unrecognized values.
58+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
5859
type: string
5960
kind:
60-
description: 'Kind is a string value representing the REST resource this
61-
object represents. Servers may infer this from the endpoint the client
62-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
61+
description: |-
62+
Kind is a string value representing the REST resource this object represents.
63+
Servers may infer this from the endpoint the client submits requests to.
64+
Cannot be updated.
65+
In CamelCase.
66+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
6367
type: string
6468
metadata:
6569
type: object
6670
spec:
6771
description: InClusterIPPoolSpec defines the desired state of InClusterIPPool.
6872
properties:
6973
addresses:
70-
description: Addresses is a list of IP addresses that can be assigned.
71-
This set of addresses can be non-contiguous. Can be omitted if subnet,
72-
or first and last is set.
74+
description: |-
75+
Addresses is a list of IP addresses that can be assigned. This set of
76+
addresses can be non-contiguous. Can be omitted if subnet, or first and
77+
last is set.
7378
items:
7479
type: string
7580
type: array
7681
end:
77-
description: Last is the last address that can be assigned. Must come
78-
after first and needs to fit into a common subnet. If unset, the
79-
second last address of subnet will be used.
82+
description: |-
83+
Last is the last address that can be assigned.
84+
Must come after first and needs to fit into a common subnet.
85+
If unset, the second last address of subnet will be used.
8086
type: string
8187
gateway:
8288
description: Gateway
8389
type: string
8490
prefix:
85-
description: Prefix is the network prefix to use. If unset the prefix
86-
from the subnet will be used.
91+
description: |-
92+
Prefix is the network prefix to use.
93+
If unset the prefix from the subnet will be used.
8794
maximum: 128
8895
type: integer
8996
start:
90-
description: First is the first address that can be assigned. If unset,
91-
the second address of subnet will be used.
97+
description: |-
98+
First is the first address that can be assigned.
99+
If unset, the second address of subnet will be used.
92100
type: string
93101
subnet:
94-
description: Subnet is the subnet to assign IP addresses from. Can
95-
be omitted if addresses or first, last and prefix are set.
102+
description: |-
103+
Subnet is the subnet to assign IP addresses from.
104+
Can be omitted if addresses or first, last and prefix are set.
96105
type: string
97106
type: object
98107
status:
@@ -103,21 +112,25 @@ spec:
103112
IPs in the pool.
104113
properties:
105114
free:
106-
description: Free is the count of unallocated IPs in the pool.
115+
description: |-
116+
Free is the count of unallocated IPs in the pool.
107117
Counts greater than int can contain will report as math.MaxInt.
108118
type: integer
109119
outOfRange:
110-
description: Out of Range is the count of allocated IPs in the
111-
pool that is not contained within spec.Addresses. Counts greater
112-
than int can contain will report as math.MaxInt.
120+
description: |-
121+
Out of Range is the count of allocated IPs in the pool that is not
122+
contained within spec.Addresses.
123+
Counts greater than int can contain will report as math.MaxInt.
113124
type: integer
114125
total:
115-
description: Total is the total number of IPs configured for the
116-
pool. Counts greater than int can contain will report as math.MaxInt.
126+
description: |-
127+
Total is the total number of IPs configured for the pool.
128+
Counts greater than int can contain will report as math.MaxInt.
117129
type: integer
118130
used:
119-
description: Used is the count of allocated IPs in the pool. Counts
120-
greater than int can contain will report as math.MaxInt.
131+
description: |-
132+
Used is the count of allocated IPs in the pool.
133+
Counts greater than int can contain will report as math.MaxInt.
121134
type: integer
122135
required:
123136
- free
@@ -151,41 +164,50 @@ spec:
151164
name: v1alpha2
152165
schema:
153166
openAPIV3Schema:
154-
description: GlobalInClusterIPPool is the Schema for the global inclusterippools
155-
API. This pool type is cluster scoped. IPAddressClaims can reference pools
156-
of this type from any any namespace.
167+
description: |-
168+
GlobalInClusterIPPool is the Schema for the global inclusterippools API.
169+
This pool type is cluster scoped. IPAddressClaims can reference
170+
pools of this type from any any namespace.
157171
properties:
158172
apiVersion:
159-
description: 'APIVersion defines the versioned schema of this representation
160-
of an object. Servers should convert recognized schemas to the latest
161-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
173+
description: |-
174+
APIVersion defines the versioned schema of this representation of an object.
175+
Servers should convert recognized schemas to the latest internal value, and
176+
may reject unrecognized values.
177+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
162178
type: string
163179
kind:
164-
description: 'Kind is a string value representing the REST resource this
165-
object represents. Servers may infer this from the endpoint the client
166-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
180+
description: |-
181+
Kind is a string value representing the REST resource this object represents.
182+
Servers may infer this from the endpoint the client submits requests to.
183+
Cannot be updated.
184+
In CamelCase.
185+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
167186
type: string
168187
metadata:
169188
type: object
170189
spec:
171190
description: InClusterIPPoolSpec defines the desired state of InClusterIPPool.
172191
properties:
173192
addresses:
174-
description: Addresses is a list of IP addresses that can be assigned.
175-
This set of addresses can be non-contiguous.
193+
description: |-
194+
Addresses is a list of IP addresses that can be assigned. This set of
195+
addresses can be non-contiguous.
176196
items:
177197
type: string
178198
type: array
179199
allocateReservedIPAddresses:
180-
description: AllocateReservedIPAddresses causes the provider to allocate
181-
the network address (the first address in the inferred subnet) and
182-
broadcast address (the last address in the inferred subnet) when
183-
IPv4. The provider will allocate the anycast address address (the
184-
first address in the inferred subnet) when IPv6.
200+
description: |-
201+
AllocateReservedIPAddresses causes the provider to allocate the network
202+
address (the first address in the inferred subnet) and broadcast address
203+
(the last address in the inferred subnet) when IPv4. The provider will
204+
allocate the anycast address address (the first address in the inferred
205+
subnet) when IPv6.
185206
type: boolean
186207
excludedAddresses:
187-
description: ExcludedAddresses is a list of IP addresses, which will
188-
be excluded from the set of assignable IP addresses.
208+
description: |-
209+
ExcludedAddresses is a list of IP addresses, which will be excluded from
210+
the set of assignable IP addresses.
189211
items:
190212
type: string
191213
type: array
@@ -208,21 +230,25 @@ spec:
208230
IPs in the pool.
209231
properties:
210232
free:
211-
description: Free is the count of unallocated IPs in the pool.
233+
description: |-
234+
Free is the count of unallocated IPs in the pool.
212235
Counts greater than int can contain will report as math.MaxInt.
213236
type: integer
214237
outOfRange:
215-
description: Out of Range is the count of allocated IPs in the
216-
pool that is not contained within spec.Addresses. Counts greater
217-
than int can contain will report as math.MaxInt.
238+
description: |-
239+
Out of Range is the count of allocated IPs in the pool that is not
240+
contained within spec.Addresses.
241+
Counts greater than int can contain will report as math.MaxInt.
218242
type: integer
219243
total:
220-
description: Total is the total number of IPs configured for the
221-
pool. Counts greater than int can contain will report as math.MaxInt.
244+
description: |-
245+
Total is the total number of IPs configured for the pool.
246+
Counts greater than int can contain will report as math.MaxInt.
222247
type: integer
223248
used:
224-
description: Used is the count of allocated IPs in the pool. Counts
225-
greater than int can contain will report as math.MaxInt.
249+
description: |-
250+
Used is the count of allocated IPs in the pool.
251+
Counts greater than int can contain will report as math.MaxInt.
226252
type: integer
227253
required:
228254
- free
@@ -236,9 +262,3 @@ spec:
236262
storage: true
237263
subresources:
238264
status: {}
239-
status:
240-
acceptedNames:
241-
kind: ""
242-
plural: ""
243-
conditions: []
244-
storedVersions: []

0 commit comments

Comments
 (0)