Skip to content

Commit

Permalink
Regenerate manifests using the latest controller-gen (#3650)
Browse files Browse the repository at this point in the history
* Regenerate manifests using the latest controller-gen

This change regenerates the crd manifests using the latest controller-gen
shipped in calico/go-build:v0.95.

* Increase CRD load test time limit to 0.3s
  • Loading branch information
hjiawei authored Dec 13, 2024
1 parent 4cb796d commit b284f58
Show file tree
Hide file tree
Showing 42 changed files with 1,882 additions and 2,083 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ endif
REPO?=tigera/operator
PACKAGE_NAME?=github.com/tigera/operator
LOCAL_USER_ID?=$(shell id -u $$USER)
GO_BUILD_VER?=v0.94
GO_BUILD_VER?=v0.95
CALICO_BUILD?=calico/go-build:$(GO_BUILD_VER)-$(BUILDARCH)
SRC_FILES=$(shell find ./pkg -name '*.go')
SRC_FILES+=$(shell find ./api -name '*.go')
Expand Down Expand Up @@ -762,7 +762,6 @@ help: # Some kind of magic from https://gist.github.com/rcmachado/af3db315e31383
#####################################
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
CONTROLLER_GEN_VERSION ?= v0.14.0

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet manifests
Expand All @@ -783,11 +782,8 @@ deploy: manifests kustomize

# Generate manifests e.g. CRD
# Can also generate RBAC and webhooks but that is not enabled currently.
# We use the upstream latest release of controller-gen as this is compatible with golang 1.19+ and we have no need
# for custom projectcalico.org types.
manifests:
$(DOCKER_RUN) sh -c 'go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) && \
controller-gen crd paths="./api/..." output:crd:artifacts:config=config/crd/bases'
$(DOCKER_RUN) sh -c 'controller-gen crd paths="./api/..." output:crd:artifacts:config=config/crd/bases'
for x in $$(find config/crd/bases/*); do sed -i -e '/creationTimestamp: null/d' -e '/^---/d' -e '/^\s*$$/d' $$x; done

# Run go fmt against code
Expand All @@ -806,8 +802,7 @@ vet:
# We use the upstream latest release of controller-gen as this is compatible with golang 1.19+ and we have no need
# for custom projectcalico.org types.
generate:
$(DOCKER_RUN) sh -c 'go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_GEN_VERSION) && \
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./api/..." && \
$(DOCKER_RUN) sh -c 'controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./api/..." && \
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./pkg/..." && \
controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./internal/controller/..."'
-# Run fix because generate was removing `//go:build !ignore_autogenerated` from the generated files
Expand Down
102 changes: 50 additions & 52 deletions pkg/crds/calico/crd.projectcalico.org_bgpconfigurations.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: bgpconfigurations.crd.projectcalico.org
spec:
group: crd.projectcalico.org
Expand All @@ -18,14 +20,19 @@ spec:
description: BGPConfiguration contains the configuration for any BGP routing.
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 @@ -38,10 +45,10 @@ spec:
format: int32
type: integer
bindMode:
description: BindMode indicates whether to listen for BGP connections
on all addresses (None) or only on the node's canonical IP address
Node.Spec.BGP.IPvXAddress (NodeIP). Default behaviour is to listen
for BGP connections on all addresses.
description: |-
BindMode indicates whether to listen for BGP connections on all addresses (None)
or only on the node's canonical IP address Node.Spec.BGP.IPvXAddress (NodeIP).
Default behaviour is to listen for BGP connections on all addresses.
type: string
communities:
description: Communities is a list of BGP community values and their
Expand All @@ -54,11 +61,11 @@ spec:
description: Name given to community value.
type: string
value:
description: Value must be of format `aa:nn` or `aa:nn:mm`.
For standard community use `aa:nn` format, where `aa` and
`nn` are 16 bit number. For large community use `aa:nn:mm`
format, where `aa`, `nn` and `mm` are 32 bit number. Where,
`aa` is an AS Number, `nn` and `mm` are per-AS identifier.
description: |-
Value must be of format `aa:nn` or `aa:nn:mm`.
For standard community use `aa:nn` format, where `aa` and `nn` are 16 bit number.
For large community use `aa:nn:mm` format, where `aa`, `nn` and `mm` are 32 bit number.
Where, `aa` is an AS Number, `nn` and `mm` are per-AS identifier.
pattern: ^(\d+):(\d+)$|^(\d+):(\d+):(\d+)$
type: string
type: object
Expand All @@ -80,16 +87,15 @@ spec:
are sent to the stdout. [Default: INFO]'
type: string
nodeMeshMaxRestartTime:
description: Time to allow for software restart for node-to-mesh peerings. When
specified, this is configured as the graceful restart timeout. When
not specified, the BIRD default of 120s is used. This field can
only be set on the default BGPConfiguration instance and requires
that NodeMesh is enabled
description: |-
Time to allow for software restart for node-to-mesh peerings. When specified, this is configured
as the graceful restart timeout. When not specified, the BIRD default of 120s is used.
This field can only be set on the default BGPConfiguration instance and requires that NodeMesh is enabled
type: string
nodeMeshPassword:
description: Optional BGP password for full node-to-mesh peerings.
This field can only be set on the default BGPConfiguration instance
and requires that NodeMesh is enabled
description: |-
Optional BGP password for full node-to-mesh peerings.
This field can only be set on the default BGPConfiguration instance and requires that NodeMesh is enabled
properties:
secretKeyRef:
description: Selects a key of a secret in the node pod's namespace.
Expand All @@ -100,13 +106,12 @@ spec:
type: string
name:
default: ""
description: 'Name of the referent. This field is effectively
required, but due to backwards compatibility is allowed
to be empty. Instances of this type with an empty value
here are almost certainly wrong. TODO: Add other useful
fields. apiVersion, kind, uid? More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Drop `kubebuilder:default` when controller-gen doesn''t
need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.'
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
optional:
description: Specify whether the Secret or its key must be
Expand All @@ -115,6 +120,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
nodeToNodeMeshEnabled:
description: 'NodeToNodeMeshEnabled sets whether full node to node
Expand All @@ -131,22 +137,20 @@ spec:
description: CIDR for which properties should be advertised.
type: string
communities:
description: Communities can be list of either community names
already defined in `Specs.Communities` or community value
of format `aa:nn` or `aa:nn:mm`. For standard community use
`aa:nn` format, where `aa` and `nn` are 16 bit number. For
large community use `aa:nn:mm` format, where `aa`, `nn` and
`mm` are 32 bit number. Where,`aa` is an AS Number, `nn` and
`mm` are per-AS identifier.
description: |-
Communities can be list of either community names already defined in `Specs.Communities` or community value of format `aa:nn` or `aa:nn:mm`.
For standard community use `aa:nn` format, where `aa` and `nn` are 16 bit number.
For large community use `aa:nn:mm` format, where `aa`, `nn` and `mm` are 32 bit number.
Where,`aa` is an AS Number, `nn` and `mm` are per-AS identifier.
items:
type: string
type: array
type: object
type: array
serviceClusterIPs:
description: ServiceClusterIPs are the CIDR blocks from which service
cluster IPs are allocated. If specified, Calico will advertise these
blocks, as well as any cluster IPs within them.
description: |-
ServiceClusterIPs are the CIDR blocks from which service cluster IPs are allocated.
If specified, Calico will advertise these blocks, as well as any cluster IPs within them.
items:
description: ServiceClusterIPBlock represents a single allowed ClusterIP
CIDR block.
Expand All @@ -156,9 +160,9 @@ spec:
type: object
type: array
serviceExternalIPs:
description: ServiceExternalIPs are the CIDR blocks for Kubernetes
Service External IPs. Kubernetes Service ExternalIPs will only be
advertised if they are within one of these blocks.
description: |-
ServiceExternalIPs are the CIDR blocks for Kubernetes Service External IPs.
Kubernetes Service ExternalIPs will only be advertised if they are within one of these blocks.
items:
description: ServiceExternalIPBlock represents a single allowed
External IP CIDR block.
Expand All @@ -168,9 +172,9 @@ spec:
type: object
type: array
serviceLoadBalancerIPs:
description: ServiceLoadBalancerIPs are the CIDR blocks for Kubernetes
Service LoadBalancer IPs. Kubernetes Service status.LoadBalancer.Ingress
IPs will only be advertised if they are within one of these blocks.
description: |-
ServiceLoadBalancerIPs are the CIDR blocks for Kubernetes Service LoadBalancer IPs.
Kubernetes Service status.LoadBalancer.Ingress IPs will only be advertised if they are within one of these blocks.
items:
description: ServiceLoadBalancerIPBlock represents a single allowed
LoadBalancer IP CIDR block.
Expand All @@ -183,9 +187,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
27 changes: 13 additions & 14 deletions pkg/crds/calico/crd.projectcalico.org_bgpfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: (devel)
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.16.5
name: bgpfilters.crd.projectcalico.org
spec:
group: crd.projectcalico.org
Expand All @@ -12,21 +11,27 @@ spec:
listKind: BGPFilterList
plural: bgpfilters
singular: bgpfilter
preserveUnknownFields: false
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
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 Down Expand Up @@ -174,9 +179,3 @@ spec:
type: object
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit b284f58

Please sign in to comment.