diff --git a/pkg/kubernetes/boom.go b/pkg/kubernetes/boom.go index b57b4d446..7ca13a5ec 100644 --- a/pkg/kubernetes/boom.go +++ b/pkg/kubernetes/boom.go @@ -85,11 +85,11 @@ func EnsureBoomArtifacts( k8sPodSelector := labels.MustK8sMap(labels.DeriveNameSelector(nameLabels, false)) if !gitops { - crd := `apiVersion: apiextensions.k8s.io/v1beta1 + crd := `apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.2.2 + controller-gen.kubebuilder.io/version: v0.7.0 creationTimestamp: null name: booms.caos.ch spec: @@ -99,36 +99,75 @@ spec: listKind: BoomList plural: booms singular: boom - scope: "" - validation: - 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' - 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' - type: string - metadata: - type: object - spec: - type: object - status: - type: object - type: object - version: v1 + scope: Namespaced 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' + 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' + type: string + metadata: + type: object + spec: + type: object + status: + type: object + type: object served: true storage: true - name: v1beta1 + 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' + 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' + type: string + metadata: + type: object + spec: + type: object + status: + type: object + type: object served: true storage: false - name: v1beta2 + 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' + 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' + type: string + metadata: + type: object + spec: + type: object + status: + type: object + type: object served: true storage: false status: diff --git a/pkg/kubernetes/networking.go b/pkg/kubernetes/networking.go index fa3eddef8..ddbb53791 100644 --- a/pkg/kubernetes/networking.go +++ b/pkg/kubernetes/networking.go @@ -81,11 +81,11 @@ func EnsureNetworkingArtifacts( } if !gitops { - crd := `apiVersion: apiextensions.k8s.io/v1beta1 + crd := `apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.2.2 + controller-gen.kubebuilder.io/version: v0.7.0 creationTimestamp: null name: networkings.caos.ch spec: @@ -95,103 +95,106 @@ spec: listKind: NetworkingList plural: networkings singular: networking - scope: "" - validation: - 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' - 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' - type: string - metadata: - type: object - spec: - properties: - kind: - type: string - networking: - type: object - spec: - properties: - customImageRegistry: - description: 'Use this registry to pull the Networking-operator - image from @default: ghcr.io' - type: string - gitOps: - type: boolean - nodeSelector: - additionalProperties: - type: string - type: object - selfReconciling: - type: boolean - tolerations: - items: - description: The pod this Toleration is attached to tolerates - any taint that matches the triple using the - matching operator . - properties: - effect: - description: Effect indicates the taint effect to match. Empty - means match all taint effects. When specified, allowed values - are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Key is the taint key that the toleration applies - to. Empty means match all taint keys. If the key is empty, - operator must be Exists; this combination means to match - all values and all keys. - type: string - operator: - description: Operator represents a key's relationship to the - value. Valid operators are Exists and Equal. Defaults to - Equal. Exists is equivalent to wildcard for value, so that - a pod can tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: TolerationSeconds represents the period of time - the toleration (which must be of effect NoExecute, otherwise - this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do - not evict). Zero and negative values will be treated as - 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: Value is the taint value the toleration matches - to. If the operator is Exists, the value should be empty, - otherwise just a regular string. - type: string - type: object - type: array - verbose: - type: boolean - version: - type: string - required: - - selfReconciling - - verbose - type: object - version: - type: string - required: - - kind - - networking - - spec - - version - type: object - status: - type: object - type: object - version: v1 + scope: Namespaced 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' + 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' + type: string + metadata: + type: object + spec: + properties: + apiVersion: + description: Don't access X_ApiVersion, it is only exported for (de-)serialization. + Use Version and OverwriteVersion methods instead. + type: string + kind: + type: string + networking: + type: object + spec: + properties: + customImageRegistry: + description: 'Use this registry to pull the Networking-operator + image from @default: ghcr.io' + type: string + nodeSelector: + additionalProperties: + type: string + type: object + selfReconciling: + type: boolean + tolerations: + items: + description: The pod this Toleration is attached to tolerates + any taint that matches the triple using + the matching operator . + properties: + effect: + description: Effect indicates the taint effect to match. + Empty means match all taint effects. When specified, allowed + values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies + to. Empty means match all taint keys. If the key is empty, + operator must be Exists; this combination means to match + all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to + the value. Valid operators are Exists and Equal. Defaults + to Equal. Exists is equivalent to wildcard for value, + so that a pod can tolerate all taints of a particular + category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of + time the toleration (which must be of effect NoExecute, + otherwise this field is ignored) tolerates the taint. + By default, it is not set, which means tolerate the taint + forever (do not evict). Zero and negative values will + be treated as 0 (evict immediately) by the system. + format: int64 + type: integer + value: + description: Value is the taint value the toleration matches + to. If the operator is Exists, the value should be empty, + otherwise just a regular string. + type: string + type: object + type: array + verbose: + type: boolean + version: + type: string + required: + - selfReconciling + - verbose + type: object + version: + description: Don't access X_Version, it is only exported for (de-)serialization. + Use Version and OverwriteVersion methods instead. + type: string + required: + - kind + - networking + - spec + type: object + status: + type: object + type: object served: true storage: true status: diff --git a/scripts/generateCrd.sh b/scripts/generateCrd.sh index 1c14a569c..c6b04eff4 100755 --- a/scripts/generateCrd.sh +++ b/scripts/generateCrd.sh @@ -1,3 +1,3 @@ -controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." +controller-gen crd paths="./..." output:crd:artifacts:config=test controller-gen "crd:trivialVersions=true" crd paths="./..." output:crd:artifacts:config=test