diff --git a/openapi/generated_openapi/zz_generated.openapi.go b/openapi/generated_openapi/zz_generated.openapi.go index 716ae1470c9..8a307a9387c 100644 --- a/openapi/generated_openapi/zz_generated.openapi.go +++ b/openapi/generated_openapi/zz_generated.openapi.go @@ -1167,6 +1167,10 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/openshift/api/operator/v1.UpstreamResolvers": schema_openshift_api_operator_v1_UpstreamResolvers(ref), "github.com/openshift/api/operator/v1.VSphereCSIDriverConfigSpec": schema_openshift_api_operator_v1_VSphereCSIDriverConfigSpec(ref), "github.com/openshift/api/operator/v1alpha1.BackupJobReference": schema_openshift_api_operator_v1alpha1_BackupJobReference(ref), + "github.com/openshift/api/operator/v1alpha1.ClusterAPI": schema_openshift_api_operator_v1alpha1_ClusterAPI(ref), + "github.com/openshift/api/operator/v1alpha1.ClusterAPIList": schema_openshift_api_operator_v1alpha1_ClusterAPIList(ref), + "github.com/openshift/api/operator/v1alpha1.ClusterAPISpec": schema_openshift_api_operator_v1alpha1_ClusterAPISpec(ref), + "github.com/openshift/api/operator/v1alpha1.ClusterAPIStatus": schema_openshift_api_operator_v1alpha1_ClusterAPIStatus(ref), "github.com/openshift/api/operator/v1alpha1.ClusterVersionOperator": schema_openshift_api_operator_v1alpha1_ClusterVersionOperator(ref), "github.com/openshift/api/operator/v1alpha1.ClusterVersionOperatorList": schema_openshift_api_operator_v1alpha1_ClusterVersionOperatorList(ref), "github.com/openshift/api/operator/v1alpha1.ClusterVersionOperatorSpec": schema_openshift_api_operator_v1alpha1_ClusterVersionOperatorSpec(ref), @@ -59506,6 +59510,193 @@ func schema_openshift_api_operator_v1alpha1_BackupJobReference(ref common.Refere } } +func schema_openshift_api_operator_v1alpha1_ClusterAPI(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterAPI provides configuration for the capi-operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the specification of the desired behavior of the capi-operator.", + Ref: ref("github.com/openshift/api/operator/v1alpha1.ClusterAPISpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status defines the observed status of the capi-operator.", + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1alpha1.ClusterAPIStatus"), + }, + }, + }, + Required: []string{"metadata"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1alpha1.ClusterAPISpec", "github.com/openshift/api/operator/v1alpha1.ClusterAPIStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_openshift_api_operator_v1alpha1_ClusterAPIList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterAPIList contains a list of ClusterAPI configurations\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items contains the items", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("github.com/openshift/api/operator/v1alpha1.ClusterAPI"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "github.com/openshift/api/operator/v1alpha1.ClusterAPI", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_openshift_api_operator_v1alpha1_ClusterAPISpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterAPISpec defines the desired configuration of the capi-operator.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unmanagedCustomResourceDefinitions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) names that should not be managed by the capi-operator installer controller. This allows external actors to own specific CRDs while capi-operator manages others.\n\nEach CRD name must be a valid DNS-1123 subdomain consisting of lowercase alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character, with a maximum length of 253 characters. Example: \"clusters.cluster.x-k8s.io\"\n\nItems cannot be removed from this list once added.\n\nThe maximum number of unmanagedCustomResourceDefinitions is 128.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_openshift_api_operator_v1alpha1_ClusterAPIStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterAPIStatus describes the current state of the capi-operator.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "targetConfigMaps": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "targetConfigMaps is a list of ConfigMap names that the staging controller has validated and approved for reconciliation. The installer controller will reconcile these ConfigMaps.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the staging controller and is updated atomically to a consistent set of transport ConfigMaps that have passed validation checks.\n\nThe maximum number of targetConfigMaps is 128.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "activeConfigMaps": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "activeConfigMaps is a list of ConfigMap names that the installer controller has successfully reconciled. This represents the currently deployed CAPI provider components.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the installer controller and is updated atomically after a successful reconciliation.\n\nThe maximum number of activeConfigMaps is 128.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_openshift_api_operator_v1alpha1_ClusterVersionOperator(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/openapi/openapi.json b/openapi/openapi.json index 5a493e31d73..3acbb62eb13 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -34613,6 +34613,109 @@ } } }, + "com.github.openshift.api.operator.v1alpha1.ClusterAPI": { + "description": "ClusterAPI provides configuration for the capi-operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "type": "object", + "required": [ + "metadata", + "spec" + ], + "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": { + "description": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta" + }, + "spec": { + "description": "spec is the specification of the desired behavior of the capi-operator.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.ClusterAPISpec" + }, + "status": { + "description": "status defines the observed status of the capi-operator.", + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.ClusterAPIStatus" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.ClusterAPIList": { + "description": "ClusterAPIList contains a list of ClusterAPI configurations\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "type": "object", + "required": [ + "metadata", + "items" + ], + "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" + }, + "items": { + "description": "items contains the items", + "type": "array", + "items": { + "default": {}, + "$ref": "#/definitions/com.github.openshift.api.operator.v1alpha1.ClusterAPI" + } + }, + "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": { + "description": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "default": {}, + "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.ClusterAPISpec": { + "description": "ClusterAPISpec defines the desired configuration of the capi-operator.", + "type": "object", + "properties": { + "unmanagedCustomResourceDefinitions": { + "description": "unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) names that should not be managed by the capi-operator installer controller. This allows external actors to own specific CRDs while capi-operator manages others.\n\nEach CRD name must be a valid DNS-1123 subdomain consisting of lowercase alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character, with a maximum length of 253 characters. Example: \"clusters.cluster.x-k8s.io\"\n\nItems cannot be removed from this list once added.\n\nThe maximum number of unmanagedCustomResourceDefinitions is 128.", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "set" + } + } + }, + "com.github.openshift.api.operator.v1alpha1.ClusterAPIStatus": { + "description": "ClusterAPIStatus describes the current state of the capi-operator.", + "type": "object", + "properties": { + "activeConfigMaps": { + "description": "activeConfigMaps is a list of ConfigMap names that the installer controller has successfully reconciled. This represents the currently deployed CAPI provider components.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the installer controller and is updated atomically after a successful reconciliation.\n\nThe maximum number of activeConfigMaps is 128.", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + }, + "targetConfigMaps": { + "description": "targetConfigMaps is a list of ConfigMap names that the staging controller has validated and approved for reconciliation. The installer controller will reconcile these ConfigMaps.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the staging controller and is updated atomically to a consistent set of transport ConfigMaps that have passed validation checks.\n\nThe maximum number of targetConfigMaps is 128.", + "type": "array", + "items": { + "type": "string", + "default": "" + }, + "x-kubernetes-list-type": "atomic" + } + } + }, "com.github.openshift.api.operator.v1alpha1.ClusterVersionOperator": { "description": "ClusterVersionOperator holds cluster-wide information about the Cluster Version Operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "type": "object", @@ -49833,6 +49936,77 @@ "description": "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", "type": "string", "format": "int-or-string" + }, + "io.k8s.apimachinery.pkg.version.Info": { + "description": "Info contains versioning information. how we'll want to distribute that information.", + "type": "object", + "required": [ + "major", + "minor", + "gitVersion", + "gitCommit", + "gitTreeState", + "buildDate", + "goVersion", + "compiler", + "platform" + ], + "properties": { + "buildDate": { + "type": "string", + "default": "" + }, + "compiler": { + "type": "string", + "default": "" + }, + "emulationMajor": { + "description": "EmulationMajor is the major version of the emulation version", + "type": "string" + }, + "emulationMinor": { + "description": "EmulationMinor is the minor version of the emulation version", + "type": "string" + }, + "gitCommit": { + "type": "string", + "default": "" + }, + "gitTreeState": { + "type": "string", + "default": "" + }, + "gitVersion": { + "type": "string", + "default": "" + }, + "goVersion": { + "type": "string", + "default": "" + }, + "major": { + "description": "Major is the major version of the binary version", + "type": "string", + "default": "" + }, + "minCompatibilityMajor": { + "description": "MinCompatibilityMajor is the major version of the minimum compatibility version", + "type": "string" + }, + "minCompatibilityMinor": { + "description": "MinCompatibilityMinor is the minor version of the minimum compatibility version", + "type": "string" + }, + "minor": { + "description": "Minor is the minor version of the binary version", + "type": "string", + "default": "" + }, + "platform": { + "type": "string", + "default": "" + } + } } } } diff --git a/operator/v1alpha1/register.go b/operator/v1alpha1/register.go index 3e9b09ccede..ec19cba3a94 100644 --- a/operator/v1alpha1/register.go +++ b/operator/v1alpha1/register.go @@ -41,6 +41,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &EtcdBackupList{}, &ClusterVersionOperator{}, &ClusterVersionOperatorList{}, + &ClusterAPI{}, + &ClusterAPIList{}, ) return nil diff --git a/operator/v1alpha1/tests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml b/operator/v1alpha1/tests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml new file mode 100644 index 00000000000..b9b37c947cd --- /dev/null +++ b/operator/v1alpha1/tests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml @@ -0,0 +1,261 @@ +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this +name: "ClusterAPI" +crdName: clusterapis.operator.openshift.io +featureGate: ClusterAPIMachineManagement +tests: + onCreate: + - name: Should be able to create a minimal ClusterAPI + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + + - name: Should be able to create ClusterAPI with unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machines.cluster.x-k8s.io + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machines.cluster.x-k8s.io + + - name: Should reject empty string in unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - "" + expectedError: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters" + + - name: Should reject CRD name which is not a valid DNS-1123 subdomain in unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - Clusters.cluster.x-k8s.io + expectedError: "a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters" + + - name: Should accept valid CRD names with hyphens and dots in unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - a.b.c.d + - name-with-hyphens.domain-with-hyphens.io + - valid-name.example.io + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - a.b.c.d + - name-with-hyphens.domain-with-hyphens.io + - valid-name.example.io + + onUpdate: + - name: Should not allow removing items from unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machines.cluster.x-k8s.io + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + expectedError: "items cannot be removed from unmanagedCustomResourceDefinitions list" + + - name: Should not allow unsetting unmanagedCustomResourceDefinitions once set + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machines.cluster.x-k8s.io + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + expectedError: "unmanagedCustomResourceDefinitions cannot be unset once set" + + - name: Should allow adding items to unmanagedCustomResourceDefinitions + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machinehealthchecks.cluster.x-k8s.io + - machines.cluster.x-k8s.io + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: + - clusters.cluster.x-k8s.io + - machinehealthchecks.cluster.x-k8s.io + - machines.cluster.x-k8s.io + + - name: Should reject invalid ConfigMap name in targetConfigMaps + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + targetConfigMaps: + - invalid.name.with.dots + expectedStatusError: "each ConfigMap name must be a valid DNS1123 label" + + - name: Should accept valid ConfigMap names in targetConfigMaps + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + targetConfigMaps: + - valid-configmap-name + - another-valid-name + - name123 + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + targetConfigMaps: + - valid-configmap-name + - another-valid-name + - name123 + + - name: Should reject invalid ConfigMap name in activeConfigMaps + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + activeConfigMaps: + - valid-configmap-name + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + activeConfigMaps: + - invalid.name.with.dots + expectedStatusError: "each ConfigMap name must be a valid DNS1123 label" + + - name: Should accept valid ConfigMap names in activeConfigMaps + initial: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + activeConfigMaps: + - oldname + updated: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + activeConfigMaps: + - valid-configmap-name + - another-valid-name + - name123 + expected: | + apiVersion: operator.openshift.io/v1alpha1 + kind: ClusterAPI + metadata: + name: cluster + spec: + unmanagedCustomResourceDefinitions: [] + status: + activeConfigMaps: + - valid-configmap-name + - another-valid-name + - name123 \ No newline at end of file diff --git a/operator/v1alpha1/types_clusterapi.go b/operator/v1alpha1/types_clusterapi.go new file mode 100644 index 00000000000..c7d06270a0a --- /dev/null +++ b/operator/v1alpha1/types_clusterapi.go @@ -0,0 +1,123 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusterapis,scope=Cluster +// +kubebuilder:subresource:status +// +openshift:api-approved.openshift.io=https://github.com/openshift/api/pull/2564 +// +openshift:file-pattern=cvoRunLevel=0000_30,operatorName=cluster-api,operatorOrdering=01 +// +openshift:enable:FeatureGate=ClusterAPIMachineManagement + +// ClusterAPI provides configuration for the capi-operator. +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 +// +kubebuilder:validation:XValidation:rule="!has(oldSelf.spec) || !has(oldSelf.spec.unmanagedCustomResourceDefinitions) || has(self.spec.unmanagedCustomResourceDefinitions)",message="unmanagedCustomResourceDefinitions cannot be unset once set" +type ClusterAPI struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +required + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the specification of the desired behavior of the capi-operator. + // +optional + Spec *ClusterAPISpec `json:"spec,omitempty"` + + // status defines the observed status of the capi-operator. + // +optional + Status ClusterAPIStatus `json:"status,omitzero"` +} + +// ClusterAPISpec defines the desired configuration of the capi-operator. +type ClusterAPISpec struct { + // unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) + // names that should not be managed by the capi-operator installer + // controller. This allows external actors to own specific CRDs while + // capi-operator manages others. + // + // Each CRD name must be a valid DNS-1123 subdomain consisting of lowercase + // alphanumeric characters, '-' or '.', and must start and end with an + // alphanumeric character, with a maximum length of 253 characters. + // Example: "clusters.cluster.x-k8s.io" + // + // Items cannot be removed from this list once added. + // + // The maximum number of unmanagedCustomResourceDefinitions is 128. + // + // +optional + // +listType=set + // +kubebuilder:validation:MaxItems=128 + // +kubebuilder:validation:XValidation:rule="oldSelf.all(item, item in self)",message="items cannot be removed from unmanagedCustomResourceDefinitions list" + // +kubebuilder:validation:items:XValidation:rule="!format.dns1123Subdomain().validate(self).hasValue()",message="a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character." + // +kubebuilder:validation:items:MaxLength=253 + UnmanagedCustomResourceDefinitions []string `json:"unmanagedCustomResourceDefinitions,omitempty"` +} + +// ClusterAPIStatus describes the current state of the capi-operator. +// +kubebuilder:validation:MinProperties=1 +type ClusterAPIStatus struct { + // targetConfigMaps is a list of ConfigMap names that the staging controller + // has validated and approved for reconciliation. The installer controller + // will reconcile these ConfigMaps. + // + // Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + // alphanumeric characters or hyphens, starting and ending with an alphanumeric + // character, with a maximum length of 63 characters. + // + // This field is owned by the staging controller and is updated atomically to a + // consistent set of transport ConfigMaps that have passed validation checks. + // + // The maximum number of targetConfigMaps is 128. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=128 + // +kubebuilder:validation:items:MaxLength=63 + // +kubebuilder:validation:items:XValidation:rule="!format.dns1123Label().validate(self).hasValue()",message="each ConfigMap name must be a valid DNS1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character" + TargetConfigMaps []string `json:"targetConfigMaps,omitempty"` + + // activeConfigMaps is a list of ConfigMap names that the installer + // controller has successfully reconciled. This represents the currently + // deployed CAPI provider components. + // + // Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + // alphanumeric characters or hyphens, starting and ending with an alphanumeric + // character, with a maximum length of 63 characters. + // + // This field is owned by the installer controller and is updated atomically after + // a successful reconciliation. + // + // The maximum number of activeConfigMaps is 128. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=128 + // +kubebuilder:validation:items:MaxLength=63 + // +kubebuilder:validation:items:XValidation:rule="!format.dns1123Label().validate(self).hasValue()",message="each ConfigMap name must be a valid DNS1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character" + ActiveConfigMaps []string `json:"activeConfigMaps,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterAPIList contains a list of ClusterAPI configurations +// +// Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. +// +openshift:compatibility-gen:level=4 +type ClusterAPIList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + metav1.ListMeta `json:"metadata"` + + // items contains the items + Items []ClusterAPI `json:"items"` +} diff --git a/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-CustomNoUpgrade.crd.yaml b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-CustomNoUpgrade.crd.yaml new file mode 100644 index 00000000000..9b29dcc991c --- /dev/null +++ b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-CustomNoUpgrade.crd.yaml @@ -0,0 +1,145 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2564 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: CustomNoUpgrade + name: clusterapis.operator.openshift.io +spec: + group: operator.openshift.io + names: + kind: ClusterAPI + listKind: ClusterAPIList + plural: clusterapis + singular: clusterapi + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ClusterAPI provides configuration for the capi-operator. + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + 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: + description: spec is the specification of the desired behavior of the + capi-operator. + properties: + unmanagedCustomResourceDefinitions: + description: |- + unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) + names that should not be managed by the capi-operator installer + controller. This allows external actors to own specific CRDs while + capi-operator manages others. + + Each CRD name must be a valid DNS-1123 subdomain consisting of lowercase + alphanumeric characters, '-' or '.', and must start and end with an + alphanumeric character, with a maximum length of 253 characters. + Example: "clusters.cluster.x-k8s.io" + + Items cannot be removed from this list once added. + + The maximum number of unmanagedCustomResourceDefinitions is 128. + items: + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: set + x-kubernetes-validations: + - message: items cannot be removed from unmanagedCustomResourceDefinitions + list + rule: oldSelf.all(item, item in self) + type: object + status: + description: status defines the observed status of the capi-operator. + minProperties: 1 + properties: + activeConfigMaps: + description: |- + activeConfigMaps is a list of ConfigMap names that the installer + controller has successfully reconciled. This represents the currently + deployed CAPI provider components. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the installer controller and is updated atomically after + a successful reconciliation. + + The maximum number of activeConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + targetConfigMaps: + description: |- + targetConfigMaps is a list of ConfigMap names that the staging controller + has validated and approved for reconciliation. The installer controller + will reconcile these ConfigMaps. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the staging controller and is updated atomically to a + consistent set of transport ConfigMaps that have passed validation checks. + + The maximum number of targetConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + type: object + required: + - metadata + type: object + x-kubernetes-validations: + - message: unmanagedCustomResourceDefinitions cannot be unset once set + rule: '!has(oldSelf.spec) || !has(oldSelf.spec.unmanagedCustomResourceDefinitions) + || has(self.spec.unmanagedCustomResourceDefinitions)' + served: true + storage: true + subresources: + status: {} diff --git a/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-DevPreviewNoUpgrade.crd.yaml b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-DevPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..e1b1ab3f02c --- /dev/null +++ b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-DevPreviewNoUpgrade.crd.yaml @@ -0,0 +1,145 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2564 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: DevPreviewNoUpgrade + name: clusterapis.operator.openshift.io +spec: + group: operator.openshift.io + names: + kind: ClusterAPI + listKind: ClusterAPIList + plural: clusterapis + singular: clusterapi + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ClusterAPI provides configuration for the capi-operator. + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + 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: + description: spec is the specification of the desired behavior of the + capi-operator. + properties: + unmanagedCustomResourceDefinitions: + description: |- + unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) + names that should not be managed by the capi-operator installer + controller. This allows external actors to own specific CRDs while + capi-operator manages others. + + Each CRD name must be a valid DNS-1123 subdomain consisting of lowercase + alphanumeric characters, '-' or '.', and must start and end with an + alphanumeric character, with a maximum length of 253 characters. + Example: "clusters.cluster.x-k8s.io" + + Items cannot be removed from this list once added. + + The maximum number of unmanagedCustomResourceDefinitions is 128. + items: + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: set + x-kubernetes-validations: + - message: items cannot be removed from unmanagedCustomResourceDefinitions + list + rule: oldSelf.all(item, item in self) + type: object + status: + description: status defines the observed status of the capi-operator. + minProperties: 1 + properties: + activeConfigMaps: + description: |- + activeConfigMaps is a list of ConfigMap names that the installer + controller has successfully reconciled. This represents the currently + deployed CAPI provider components. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the installer controller and is updated atomically after + a successful reconciliation. + + The maximum number of activeConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + targetConfigMaps: + description: |- + targetConfigMaps is a list of ConfigMap names that the staging controller + has validated and approved for reconciliation. The installer controller + will reconcile these ConfigMaps. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the staging controller and is updated atomically to a + consistent set of transport ConfigMaps that have passed validation checks. + + The maximum number of targetConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + type: object + required: + - metadata + type: object + x-kubernetes-validations: + - message: unmanagedCustomResourceDefinitions cannot be unset once set + rule: '!has(oldSelf.spec) || !has(oldSelf.spec.unmanagedCustomResourceDefinitions) + || has(self.spec.unmanagedCustomResourceDefinitions)' + served: true + storage: true + subresources: + status: {} diff --git a/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-TechPreviewNoUpgrade.crd.yaml b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-TechPreviewNoUpgrade.crd.yaml new file mode 100644 index 00000000000..cc683f0b6fa --- /dev/null +++ b/operator/v1alpha1/zz_generated.crd-manifests/0000_30_cluster-api_01_clusterapis-TechPreviewNoUpgrade.crd.yaml @@ -0,0 +1,145 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2564 + api.openshift.io/merged-by-featuregates: "true" + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + release.openshift.io/feature-set: TechPreviewNoUpgrade + name: clusterapis.operator.openshift.io +spec: + group: operator.openshift.io + names: + kind: ClusterAPI + listKind: ClusterAPIList + plural: clusterapis + singular: clusterapi + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ClusterAPI provides configuration for the capi-operator. + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + 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: + description: spec is the specification of the desired behavior of the + capi-operator. + properties: + unmanagedCustomResourceDefinitions: + description: |- + unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) + names that should not be managed by the capi-operator installer + controller. This allows external actors to own specific CRDs while + capi-operator manages others. + + Each CRD name must be a valid DNS-1123 subdomain consisting of lowercase + alphanumeric characters, '-' or '.', and must start and end with an + alphanumeric character, with a maximum length of 253 characters. + Example: "clusters.cluster.x-k8s.io" + + Items cannot be removed from this list once added. + + The maximum number of unmanagedCustomResourceDefinitions is 128. + items: + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: set + x-kubernetes-validations: + - message: items cannot be removed from unmanagedCustomResourceDefinitions + list + rule: oldSelf.all(item, item in self) + type: object + status: + description: status defines the observed status of the capi-operator. + minProperties: 1 + properties: + activeConfigMaps: + description: |- + activeConfigMaps is a list of ConfigMap names that the installer + controller has successfully reconciled. This represents the currently + deployed CAPI provider components. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the installer controller and is updated atomically after + a successful reconciliation. + + The maximum number of activeConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + targetConfigMaps: + description: |- + targetConfigMaps is a list of ConfigMap names that the staging controller + has validated and approved for reconciliation. The installer controller + will reconcile these ConfigMaps. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the staging controller and is updated atomically to a + consistent set of transport ConfigMaps that have passed validation checks. + + The maximum number of targetConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + type: object + required: + - metadata + type: object + x-kubernetes-validations: + - message: unmanagedCustomResourceDefinitions cannot be unset once set + rule: '!has(oldSelf.spec) || !has(oldSelf.spec.unmanagedCustomResourceDefinitions) + || has(self.spec.unmanagedCustomResourceDefinitions)' + served: true + storage: true + subresources: + status: {} diff --git a/operator/v1alpha1/zz_generated.deepcopy.go b/operator/v1alpha1/zz_generated.deepcopy.go index de4c0712815..1292d97497b 100644 --- a/operator/v1alpha1/zz_generated.deepcopy.go +++ b/operator/v1alpha1/zz_generated.deepcopy.go @@ -26,6 +26,118 @@ func (in *BackupJobReference) DeepCopy() *BackupJobReference { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterAPI) DeepCopyInto(out *ClusterAPI) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(ClusterAPISpec) + (*in).DeepCopyInto(*out) + } + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAPI. +func (in *ClusterAPI) DeepCopy() *ClusterAPI { + if in == nil { + return nil + } + out := new(ClusterAPI) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterAPI) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterAPIList) DeepCopyInto(out *ClusterAPIList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterAPI, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAPIList. +func (in *ClusterAPIList) DeepCopy() *ClusterAPIList { + if in == nil { + return nil + } + out := new(ClusterAPIList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterAPIList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterAPISpec) DeepCopyInto(out *ClusterAPISpec) { + *out = *in + if in.UnmanagedCustomResourceDefinitions != nil { + in, out := &in.UnmanagedCustomResourceDefinitions, &out.UnmanagedCustomResourceDefinitions + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAPISpec. +func (in *ClusterAPISpec) DeepCopy() *ClusterAPISpec { + if in == nil { + return nil + } + out := new(ClusterAPISpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterAPIStatus) DeepCopyInto(out *ClusterAPIStatus) { + *out = *in + if in.TargetConfigMaps != nil { + in, out := &in.TargetConfigMaps, &out.TargetConfigMaps + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ActiveConfigMaps != nil { + in, out := &in.ActiveConfigMaps, &out.ActiveConfigMaps + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAPIStatus. +func (in *ClusterAPIStatus) DeepCopy() *ClusterAPIStatus { + if in == nil { + return nil + } + out := new(ClusterAPIStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterVersionOperator) DeepCopyInto(out *ClusterVersionOperator) { *out = *in diff --git a/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml b/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml index 0d595be801b..2385e592dd7 100644 --- a/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml +++ b/operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml @@ -1,3 +1,26 @@ +clusterapis.operator.openshift.io: + Annotations: {} + ApprovedPRNumber: https://github.com/openshift/api/pull/2564 + CRDName: clusterapis.operator.openshift.io + Capability: "" + Category: "" + FeatureGates: + - ClusterAPIMachineManagement + FilenameOperatorName: cluster-api + FilenameOperatorOrdering: "01" + FilenameRunLevel: "0000_30" + GroupName: operator.openshift.io + HasStatus: true + KindName: ClusterAPI + Labels: {} + PluralName: clusterapis + PrinterColumns: [] + Scope: Cluster + ShortNames: null + TopLevelFeatureGates: + - ClusterAPIMachineManagement + Version: v1alpha1 + clusterversionoperators.operator.openshift.io: Annotations: {} ApprovedPRNumber: https://github.com/openshift/api/pull/2044 diff --git a/operator/v1alpha1/zz_generated.featuregated-crd-manifests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml b/operator/v1alpha1/zz_generated.featuregated-crd-manifests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml new file mode 100644 index 00000000000..dc9028f3c57 --- /dev/null +++ b/operator/v1alpha1/zz_generated.featuregated-crd-manifests/clusterapis.operator.openshift.io/ClusterAPIMachineManagement.yaml @@ -0,0 +1,145 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.openshift.io: https://github.com/openshift/api/pull/2564 + api.openshift.io/filename-cvo-runlevel: "0000_30" + api.openshift.io/filename-operator: cluster-api + api.openshift.io/filename-ordering: "01" + feature-gate.release.openshift.io/ClusterAPIMachineManagement: "true" + name: clusterapis.operator.openshift.io +spec: + group: operator.openshift.io + names: + kind: ClusterAPI + listKind: ClusterAPIList + plural: clusterapis + singular: clusterapi + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ClusterAPI provides configuration for the capi-operator. + + Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support. + 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: + description: spec is the specification of the desired behavior of the + capi-operator. + properties: + unmanagedCustomResourceDefinitions: + description: |- + unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) + names that should not be managed by the capi-operator installer + controller. This allows external actors to own specific CRDs while + capi-operator manages others. + + Each CRD name must be a valid DNS-1123 subdomain consisting of lowercase + alphanumeric characters, '-' or '.', and must start and end with an + alphanumeric character, with a maximum length of 253 characters. + Example: "clusters.cluster.x-k8s.io" + + Items cannot be removed from this list once added. + + The maximum number of unmanagedCustomResourceDefinitions is 128. + items: + maxLength: 253 + type: string + x-kubernetes-validations: + - message: a lowercase RFC 1123 subdomain must consist of lower + case alphanumeric characters, '-' or '.', and must start and + end with an alphanumeric character. + rule: '!format.dns1123Subdomain().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: set + x-kubernetes-validations: + - message: items cannot be removed from unmanagedCustomResourceDefinitions + list + rule: oldSelf.all(item, item in self) + type: object + status: + description: status defines the observed status of the capi-operator. + minProperties: 1 + properties: + activeConfigMaps: + description: |- + activeConfigMaps is a list of ConfigMap names that the installer + controller has successfully reconciled. This represents the currently + deployed CAPI provider components. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the installer controller and is updated atomically after + a successful reconciliation. + + The maximum number of activeConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + targetConfigMaps: + description: |- + targetConfigMaps is a list of ConfigMap names that the staging controller + has validated and approved for reconciliation. The installer controller + will reconcile these ConfigMaps. + + Each ConfigMap name must be a valid DNS-1123 label consisting of lowercase + alphanumeric characters or hyphens, starting and ending with an alphanumeric + character, with a maximum length of 63 characters. + + This field is owned by the staging controller and is updated atomically to a + consistent set of transport ConfigMaps that have passed validation checks. + + The maximum number of targetConfigMaps is 128. + items: + maxLength: 63 + type: string + x-kubernetes-validations: + - message: each ConfigMap name must be a valid DNS1123 label consisting + of lowercase alphanumeric characters or hyphens, starting and + ending with an alphanumeric character + rule: '!format.dns1123Label().validate(self).hasValue()' + maxItems: 128 + type: array + x-kubernetes-list-type: atomic + type: object + required: + - metadata + type: object + x-kubernetes-validations: + - message: unmanagedCustomResourceDefinitions cannot be unset once set + rule: '!has(oldSelf.spec) || !has(oldSelf.spec.unmanagedCustomResourceDefinitions) + || has(self.spec.unmanagedCustomResourceDefinitions)' + served: true + storage: true + subresources: + status: {} diff --git a/operator/v1alpha1/zz_generated.swagger_doc_generated.go b/operator/v1alpha1/zz_generated.swagger_doc_generated.go index 9060bf99815..cea407c77b2 100644 --- a/operator/v1alpha1/zz_generated.swagger_doc_generated.go +++ b/operator/v1alpha1/zz_generated.swagger_doc_generated.go @@ -135,6 +135,46 @@ func (VersionAvailability) SwaggerDoc() map[string]string { return map_VersionAvailability } +var map_ClusterAPI = map[string]string{ + "": "ClusterAPI provides configuration for the capi-operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "spec": "spec is the specification of the desired behavior of the capi-operator.", + "status": "status defines the observed status of the capi-operator.", +} + +func (ClusterAPI) SwaggerDoc() map[string]string { + return map_ClusterAPI +} + +var map_ClusterAPIList = map[string]string{ + "": "ClusterAPIList contains a list of ClusterAPI configurations\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", + "metadata": "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + "items": "items contains the items", +} + +func (ClusterAPIList) SwaggerDoc() map[string]string { + return map_ClusterAPIList +} + +var map_ClusterAPISpec = map[string]string{ + "": "ClusterAPISpec defines the desired configuration of the capi-operator.", + "unmanagedCustomResourceDefinitions": "unmanagedCustomResourceDefinitions is a list of ClusterResourceDefinition (CRD) names that should not be managed by the capi-operator installer controller. This allows external actors to own specific CRDs while capi-operator manages others.\n\nEach CRD name must be a valid DNS-1123 subdomain consisting of lowercase alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character, with a maximum length of 253 characters. Example: \"clusters.cluster.x-k8s.io\"\n\nItems cannot be removed from this list once added.\n\nThe maximum number of unmanagedCustomResourceDefinitions is 128.", +} + +func (ClusterAPISpec) SwaggerDoc() map[string]string { + return map_ClusterAPISpec +} + +var map_ClusterAPIStatus = map[string]string{ + "": "ClusterAPIStatus describes the current state of the capi-operator.", + "targetConfigMaps": "targetConfigMaps is a list of ConfigMap names that the staging controller has validated and approved for reconciliation. The installer controller will reconcile these ConfigMaps.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the staging controller and is updated atomically to a consistent set of transport ConfigMaps that have passed validation checks.\n\nThe maximum number of targetConfigMaps is 128.", + "activeConfigMaps": "activeConfigMaps is a list of ConfigMap names that the installer controller has successfully reconciled. This represents the currently deployed CAPI provider components.\n\nEach ConfigMap name must be a valid DNS-1123 label consisting of lowercase alphanumeric characters or hyphens, starting and ending with an alphanumeric character, with a maximum length of 63 characters.\n\nThis field is owned by the installer controller and is updated atomically after a successful reconciliation.\n\nThe maximum number of activeConfigMaps is 128.", +} + +func (ClusterAPIStatus) SwaggerDoc() map[string]string { + return map_ClusterAPIStatus +} + var map_ClusterVersionOperator = map[string]string{ "": "ClusterVersionOperator holds cluster-wide information about the Cluster Version Operator.\n\nCompatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support.", "metadata": "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata",