Skip to content

Commit

Permalink
update controller-gen
Browse files Browse the repository at this point in the history
controller-gen 0.13.0 panics on go1.22 - updating to 0.14.0 resolves it
This is a known issue #kubernetes-sigs/controller-tools/issues/880

Signed-off-by: Etai Lev Ran <elevran@gmail.com>
  • Loading branch information
elevran committed Apr 4, 2024
1 parent 0034561 commit 72cfa61
Show file tree
Hide file tree
Showing 8 changed files with 357 additions and 320 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/dev/post-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/mfridman/tparse@latest
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
go install mvdan.cc/gofumpt@v0.6.0
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif

# Controller Gen for crds
CONTROLLER_GEN ?= $(GOBIN)/controller-gen
CONTROLLER_TOOLS_VERSION ?= v0.13.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
Expand Down
102 changes: 53 additions & 49 deletions config/crds/clusterlink.net_accesspolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: accesspolicies.clusterlink.net
spec:
group: clusterlink.net
Expand All @@ -17,20 +17,26 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: AccessPolicy defines whether a group of potential connections
should be allowed or denied. If multiple AccessPolicy objects match a given
connection, privileged policies take precedence over non-privileged, and
within each tier deny policies take precedence over allow policies.
description: |-
AccessPolicy defines whether a group of potential connections should be allowed or denied.
If multiple AccessPolicy objects match a given connection, privileged policies
take precedence over non-privileged, and within each tier deny policies take
precedence over allow policies.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand All @@ -45,9 +51,9 @@ spec:
description: From specifies the set of source workload to which this
policy refers.
items:
description: WorkloadSetOrSelector describes a set of workloads,
based on their attributes (labels). Exactly one of the two fields
should be non-empty.
description: |-
WorkloadSetOrSelector describes a set of workloads, based on their attributes (labels).
Exactly one of the two fields should be non-empty.
properties:
workloadSelector:
description: WorkloadSelector is a K8s-style label selector,
Expand All @@ -57,25 +63,25 @@ spec:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty. This
array is replaced during a strategic merge patch.
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
Expand All @@ -87,11 +93,10 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
Expand All @@ -107,9 +112,9 @@ spec:
description: To specifies the set of destination services to which
this policy refers.
items:
description: WorkloadSetOrSelector describes a set of workloads,
based on their attributes (labels). Exactly one of the two fields
should be non-empty.
description: |-
WorkloadSetOrSelector describes a set of workloads, based on their attributes (labels).
Exactly one of the two fields should be non-empty.
properties:
workloadSelector:
description: WorkloadSelector is a K8s-style label selector,
Expand All @@ -119,25 +124,25 @@ spec:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
description: |-
A label selector requirement is a selector that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
description: |-
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists or
DoesNotExist, the values array must be empty. This
array is replaced during a strategic merge patch.
description: |-
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
items:
type: string
type: array
Expand All @@ -149,11 +154,10 @@ spec:
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is
"key", the operator is "In", and the values array contains
only "value". The requirements are ANDed.
description: |-
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
type: object
type: object
x-kubernetes-map-type: atomic
Expand Down
Loading

0 comments on commit 72cfa61

Please sign in to comment.