diff --git a/Makefile b/Makefile index 6184d2980f..45379d9110 100644 --- a/Makefile +++ b/Makefile @@ -151,7 +151,6 @@ E2E_NO_ARTIFACT_TEMPLATES_DIR=test/e2e/data/infrastructure-openstack-no-artifact .PHONY: e2e-templates e2e-templates: ## Generate cluster templates for e2e tests e2e-templates: $(addprefix $(E2E_NO_ARTIFACT_TEMPLATES_DIR)/, \ - cluster-template-v1alpha6.yaml \ cluster-template-v1alpha7.yaml \ cluster-template-md-remediation.yaml \ cluster-template-kcp-remediation.yaml \ diff --git a/api/v1alpha6/openstackcluster_types.go b/api/v1alpha6/openstackcluster_types.go index e3a0d82a42..ebf66da3f2 100644 --- a/api/v1alpha6/openstackcluster_types.go +++ b/api/v1alpha6/openstackcluster_types.go @@ -215,6 +215,7 @@ type OpenStackClusterStatus struct { // +genclient // +genclient:Namespaced // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion:warning="The v1alpha6 version of OpenStackCluster has been deprecated and will be removed in a future release of the API. Please upgrade." // +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc // +kubebuilder:subresource:status @@ -238,6 +239,7 @@ type OpenStackCluster struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // OpenStackClusterList contains a list of OpenStackCluster. // diff --git a/api/v1alpha6/openstackclustertemplate_types.go b/api/v1alpha6/openstackclustertemplate_types.go index 8e5115a793..50f2a576f8 100644 --- a/api/v1alpha6/openstackclustertemplate_types.go +++ b/api/v1alpha6/openstackclustertemplate_types.go @@ -33,6 +33,7 @@ type OpenStackClusterTemplateSpec struct { // +genclient // +genclient:Namespaced // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion:warning="The v1alpha6 version of OpenStackClusterTemplate has been deprecated and will be removed in a future release of the API. Please upgrade." // +kubebuilder:resource:path=openstackclustertemplates,scope=Namespaced,categories=cluster-api,shortName=osct @@ -47,6 +48,7 @@ type OpenStackClusterTemplate struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // OpenStackClusterTemplateList contains a list of OpenStackClusterTemplate. // diff --git a/api/v1alpha6/openstackmachine_types.go b/api/v1alpha6/openstackmachine_types.go index 9f306cba1d..f2d2d271e2 100644 --- a/api/v1alpha6/openstackmachine_types.go +++ b/api/v1alpha6/openstackmachine_types.go @@ -139,6 +139,7 @@ type OpenStackMachineStatus struct { // +genclient // +genclient:Namespaced // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion:warning="The v1alpha6 version of OpenStackMachine has been deprecated and will be removed in a future release of the API. Please upgrade." // +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm // +kubebuilder:subresource:status @@ -161,6 +162,7 @@ type OpenStackMachine struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // OpenStackMachineList contains a list of OpenStackMachine. // diff --git a/api/v1alpha6/openstackmachinetemplate_types.go b/api/v1alpha6/openstackmachinetemplate_types.go index d1fd2f0895..66b905ea9b 100644 --- a/api/v1alpha6/openstackmachinetemplate_types.go +++ b/api/v1alpha6/openstackmachinetemplate_types.go @@ -28,6 +28,7 @@ type OpenStackMachineTemplateSpec struct { // +genclient // +genclient:Namespaced // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // +kubebuilder:deprecatedversion:warning="The v1alpha6 version of OpenStackMachineTemplate has been deprecated and will be removed in a future release of the API. Please upgrade." // +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt @@ -42,6 +43,7 @@ type OpenStackMachineTemplate struct { } // +kubebuilder:object:root=true +// +kubebuilder:unservedversion // OpenStackMachineTemplateList contains a list of OpenStackMachineTemplate. // diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml index 383fcb8021..68a0f0f254 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml @@ -1938,7 +1938,7 @@ spec: - ready type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml index 7778494f26..332c7a7edb 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml @@ -786,7 +786,7 @@ spec: - template type: object type: object - served: true + served: false storage: false - name: v1alpha7 schema: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml index 84368f2326..7e20d81aef 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml @@ -597,7 +597,7 @@ spec: type: boolean type: object type: object - served: true + served: false storage: false subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml index 6028e6b5ce..a9e4bf2315 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml @@ -495,7 +495,7 @@ spec: - template type: object type: object - served: true + served: false storage: false - name: v1alpha7 schema: diff --git a/kustomize/v1alpha6/default/cluster-template.yaml b/kustomize/v1alpha6/default/cluster-template.yaml deleted file mode 100644 index bd7c4e5769..0000000000 --- a/kustomize/v1alpha6/default/cluster-template.yaml +++ /dev/null @@ -1,184 +0,0 @@ ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. - serviceDomain: "cluster.local" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 - kind: OpenStackCluster - name: ${CLUSTER_NAME} - controlPlaneRef: - kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - name: ${CLUSTER_NAME}-control-plane ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret - apiServerLoadBalancer: - enabled: true - managedSecurityGroups: true - nodeCidr: 10.6.0.0/24 - dnsNameservers: - - ${OPENSTACK_DNS_NAMESERVERS} - externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID} ---- -kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - machineTemplate: - infrastructureRef: - kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 - name: "${CLUSTER_NAME}-control-plane" - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - extraVolumes: - - name: cloud - hostPath: /etc/kubernetes/cloud.conf - mountPath: /etc/kubernetes/cloud.conf - readOnly: true - controllerManager: - extraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - extraVolumes: - - name: cloud - hostPath: /etc/kubernetes/cloud.conf - mountPath: /etc/kubernetes/cloud.conf - readOnly: true - - name: cacerts - hostPath: /etc/certs/cacert - mountPath: /etc/certs/cacert - readOnly: true - joinConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack - files: - - path: /etc/kubernetes/cloud.conf - owner: root - permissions: "0600" - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} - encoding: base64 - - path: /etc/certs/cacert - owner: root - permissions: "0600" - content: ${OPENSTACK_CLOUD_CACERT_B64} - encoding: base64 - version: "${KUBERNETES_VERSION}" ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} - image: ${OPENSTACK_IMAGE_NAME} - sshKeyName: ${OPENSTACK_SSH_KEY_NAME} - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: "${CLUSTER_NAME}-md-0" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: - template: - spec: - clusterName: "${CLUSTER_NAME}" - version: "${KUBERNETES_VERSION}" - failureDomain: ${OPENSTACK_FAILURE_DOMAIN} - bootstrap: - configRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - infrastructureRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 - kind: OpenStackMachineTemplate ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret - flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} - image: ${OPENSTACK_IMAGE_NAME} - sshKeyName: ${OPENSTACK_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: - - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} - encoding: base64 - owner: root - path: /etc/kubernetes/cloud.conf - permissions: "0600" - - content: ${OPENSTACK_CLOUD_CACERT_B64} - encoding: base64 - owner: root - path: /etc/certs/cacert - permissions: "0600" - joinConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack ---- -apiVersion: v1 -kind: Secret -metadata: - name: ${CLUSTER_NAME}-cloud-config - labels: - clusterctl.cluster.x-k8s.io/move: "true" -data: - clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64} - cacert: ${OPENSTACK_CLOUD_CACERT_B64} diff --git a/kustomize/v1alpha6/default/kustomization.yaml b/kustomize/v1alpha6/default/kustomization.yaml deleted file mode 100644 index bc7ab04c05..0000000000 --- a/kustomize/v1alpha6/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- cluster-template.yaml diff --git a/kustomize/v1alpha6/external-cloud-provider-flatcar/kustomization.yaml b/kustomize/v1alpha6/external-cloud-provider-flatcar/kustomization.yaml deleted file mode 100644 index ffb622bfc9..0000000000 --- a/kustomize/v1alpha6/external-cloud-provider-flatcar/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-ccm.yaml -- path: patch-flatcar.yaml diff --git a/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-ccm.yaml b/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-ccm.yaml deleted file mode 100644 index 35ba1cdaf7..0000000000 --- a/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-ccm.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - controllerManager: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - files: [] ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: [] - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: diff --git a/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-flatcar.yaml b/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-flatcar.yaml deleted file mode 100644 index d6de831a3f..0000000000 --- a/kustomize/v1alpha6/external-cloud-provider-flatcar/patch-flatcar.yaml +++ /dev/null @@ -1,97 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - apiServerLoadBalancer: - $patch: delete ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - kubeadmConfigSpec: - joinConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - initConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - format: ignition - ignition: - containerLinuxConfig: - additionalConfig: | - systemd: - units: - - name: coreos-metadata-sshkeys@.service - enabled: true - - name: kubeadm.service - enabled: true - dropins: - - name: 10-flatcar.conf - contents: | - [Unit] - Requires=containerd.service coreos-metadata.service - After=containerd.service coreos-metadata.service - - [Service] - EnvironmentFile=/run/metadata/flatcar - preKubeadmCommands: - - export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} - - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp - - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - preKubeadmCommands: - - export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} - - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp - - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml - format: ignition - ignition: - containerLinuxConfig: - additionalConfig: | - systemd: - units: - - name: coreos-metadata-sshkeys@.service - enabled: true - - name: kubeadm.service - enabled: true - dropins: - - name: 10-flatcar.conf - contents: | - [Unit] - Requires=containerd.service coreos-metadata.service - After=containerd.service coreos-metadata.service - - [Service] - EnvironmentFile=/run/metadata/flatcar ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - image: ${OPENSTACK_FLATCAR_IMAGE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - image: ${OPENSTACK_FLATCAR_IMAGE_NAME} diff --git a/kustomize/v1alpha6/external-cloud-provider/kustomization.yaml b/kustomize/v1alpha6/external-cloud-provider/kustomization.yaml deleted file mode 100644 index f1239f1c40..0000000000 --- a/kustomize/v1alpha6/external-cloud-provider/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-ccm.yaml diff --git a/kustomize/v1alpha6/external-cloud-provider/patch-ccm.yaml b/kustomize/v1alpha6/external-cloud-provider/patch-ccm.yaml deleted file mode 100644 index 35ba1cdaf7..0000000000 --- a/kustomize/v1alpha6/external-cloud-provider/patch-ccm.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - controllerManager: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - files: [] ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: [] - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: diff --git a/kustomize/v1alpha6/flatcar/kustomization.yaml b/kustomize/v1alpha6/flatcar/kustomization.yaml deleted file mode 100644 index 7332b6b51f..0000000000 --- a/kustomize/v1alpha6/flatcar/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-flatcar.yaml diff --git a/kustomize/v1alpha6/flatcar/patch-flatcar.yaml b/kustomize/v1alpha6/flatcar/patch-flatcar.yaml deleted file mode 100644 index 30135c37d6..0000000000 --- a/kustomize/v1alpha6/flatcar/patch-flatcar.yaml +++ /dev/null @@ -1,117 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - apiServerLoadBalancer: - $patch: delete ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - kubeadmConfigSpec: - joinConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack - initConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - kubeletExtraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - format: ignition - ignition: - containerLinuxConfig: - additionalConfig: | - systemd: - units: - - name: coreos-metadata-sshkeys@.service - enabled: true - - name: kubeadm.service - enabled: true - dropins: - - name: 10-flatcar.conf - contents: | - [Unit] - Requires=containerd.service coreos-metadata.service - After=containerd.service coreos-metadata.service - - [Service] - EnvironmentFile=/run/metadata/flatcar - preKubeadmCommands: - - export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} - - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp - - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: - - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} - encoding: base64 - owner: root - path: /etc/kubernetes/cloud.conf - permissions: "0600" - - content: ${OPENSTACK_CLOUD_CACERT_B64} - encoding: base64 - owner: root - path: /etc/certs/cacert - permissions: "0600" - joinConfiguration: - nodeRegistration: - name: $${COREOS_OPENSTACK_HOSTNAME} - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack - preKubeadmCommands: - - export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*} - - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp - - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml - format: ignition - ignition: - containerLinuxConfig: - additionalConfig: | - systemd: - units: - - name: coreos-metadata-sshkeys@.service - enabled: true - - name: kubeadm.service - enabled: true - dropins: - - name: 10-flatcar.conf - contents: | - [Unit] - Requires=containerd.service coreos-metadata.service - After=containerd.service coreos-metadata.service - - [Service] - EnvironmentFile=/run/metadata/flatcar ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - image: ${OPENSTACK_FLATCAR_IMAGE_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - image: ${OPENSTACK_FLATCAR_IMAGE_NAME} diff --git a/kustomize/v1alpha6/without-lb/kustomization.yaml b/kustomize/v1alpha6/without-lb/kustomization.yaml deleted file mode 100644 index b12f7e5db4..0000000000 --- a/kustomize/v1alpha6/without-lb/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-without-lb.yaml diff --git a/kustomize/v1alpha6/without-lb/patch-without-lb.yaml b/kustomize/v1alpha6/without-lb/patch-without-lb.yaml deleted file mode 100644 index 9d006d2562..0000000000 --- a/kustomize/v1alpha6/without-lb/patch-without-lb.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - apiServerLoadBalancer: - $patch: delete ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: 1 diff --git a/test/e2e/data/kustomize/v1alpha6/bastion.yaml b/test/e2e/data/kustomize/v1alpha6/bastion.yaml deleted file mode 100644 index 45c9e0f508..0000000000 --- a/test/e2e/data/kustomize/v1alpha6/bastion.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- op: add - path: /spec/bastion - value: - enabled: true - instance: - flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR} - image: ${OPENSTACK_BASTION_IMAGE_NAME} - sshKeyName: ${OPENSTACK_SSH_KEY_NAME} diff --git a/test/e2e/data/kustomize/v1alpha6/kustomization.yaml b/test/e2e/data/kustomize/v1alpha6/kustomization.yaml deleted file mode 100644 index f2035ba071..0000000000 --- a/test/e2e/data/kustomize/v1alpha6/kustomization.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../../../../../kustomize/v1alpha6/external-cloud-provider - -components: -- ../common-patches/cluster-prev1beta1 -- ../common-patches/cni -- ../common-patches/ccm - -patches: -- patch: |- - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha6 - kind: OpenStackMachineTemplate - metadata: - name: ignored - spec: - template: - spec: - networks: - - {} - target: - kind: OpenStackMachineTemplate -- path: bastion.yaml - target: - kind: OpenStackCluster - name: \${CLUSTER_NAME} -- patch: |- - - op: "remove" - path: "/spec/externalNetworkId" - target: - kind: OpenStackCluster diff --git a/test/e2e/shared/defaults.go b/test/e2e/shared/defaults.go index 5caa6eb8e1..6a42596e71 100644 --- a/test/e2e/shared/defaults.go +++ b/test/e2e/shared/defaults.go @@ -50,7 +50,6 @@ const ( FlavorWithoutLB = "without-lb" FlavorMultiNetwork = "multi-network" FlavorMultiAZ = "multi-az" - FlavorV1alpha6 = "v1alpha6" FlavorV1alpha7 = "v1alpha7" FlavorMDRemediation = "md-remediation" FlavorKCPRemediation = "kcp-remediation" diff --git a/test/e2e/suites/apivalidations/openstackcluster_test.go b/test/e2e/suites/apivalidations/openstackcluster_test.go index 9af5a730b1..bcf4d36655 100644 --- a/test/e2e/suites/apivalidations/openstackcluster_test.go +++ b/test/e2e/suites/apivalidations/openstackcluster_test.go @@ -25,7 +25,6 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6" infrav1alpha7 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7" infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) @@ -216,41 +215,4 @@ var _ = Describe("OpenStackCluster API validations", func() { Expect(cluster.Spec.IdentityRef.Kind).To(Equal("FakeKind"), "IdentityRef.Kind should be restored") }) }) - - Context("v1alpha6", func() { - var cluster *infrav1alpha6.OpenStackCluster //nolint:staticcheck - - BeforeEach(func() { - // Initialise a basic cluster object in the correct namespace - cluster = &infrav1alpha6.OpenStackCluster{} //nolint:staticcheck - cluster.Namespace = namespace.Name - cluster.GenerateName = clusterNamePrefix - }) - - It("should restore cluster spec idempotently after controller writes to controlPlaneEndpoint", func() { - // Set identityRef.Kind, as it will be lost if the restorer does not execute - cluster.Spec.IdentityRef = &infrav1alpha6.OpenStackIdentityReference{ - Kind: "FakeKind", - Name: "identity-ref", - } - Expect(create(cluster)).To(Succeed(), "OpenStackCluster creation should succeed") - - // Fetch the infrav1 version of the cluster - infrav1Cluster := &infrav1.OpenStackCluster{} - Expect(k8sClient.Get(ctx, types.NamespacedName{Name: cluster.Name, Namespace: cluster.Namespace}, infrav1Cluster)).To(Succeed(), "OpenStackCluster fetch should succeed") - - // Update the infrav1 cluster to set the control plane endpoint - infrav1Cluster.Spec.ControlPlaneEndpoint = &clusterv1.APIEndpoint{ - Host: "foo", - Port: 1234, - } - Expect(k8sClient.Update(ctx, infrav1Cluster)).To(Succeed(), "Setting control plane endpoint should succeed") - - // Fetch the v1alpha6 version of the cluster and ensure that both the new control plane endpoint and the identityRef.Kind are present - cluster = &infrav1alpha6.OpenStackCluster{} //nolint:staticcheck - Expect(k8sClient.Get(ctx, types.NamespacedName{Name: infrav1Cluster.Name, Namespace: infrav1Cluster.Namespace}, cluster)).To(Succeed(), "OpenStackCluster fetch should succeed") - Expect(cluster.Spec.ControlPlaneEndpoint).To(Equal(*infrav1Cluster.Spec.ControlPlaneEndpoint), "Control plane endpoint should be restored") - Expect(cluster.Spec.IdentityRef.Kind).To(Equal("FakeKind"), "IdentityRef.Kind should be restored") - }) - }) }) diff --git a/test/e2e/suites/apivalidations/suite_test.go b/test/e2e/suites/apivalidations/suite_test.go index b104a3ea46..043b74284e 100644 --- a/test/e2e/suites/apivalidations/suite_test.go +++ b/test/e2e/suites/apivalidations/suite_test.go @@ -40,7 +40,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" infrav1alpha1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1" - infrav1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6" infrav1alpha7 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7" infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/webhooks" @@ -70,7 +69,6 @@ var _ = BeforeSuite(func() { testScheme = scheme.Scheme for _, f := range []func(*runtime.Scheme) error{ infrav1alpha1.AddToScheme, - infrav1alpha6.AddToScheme, infrav1alpha7.AddToScheme, infrav1.AddToScheme, } { diff --git a/test/e2e/suites/e2e/clusterctl_upgrade_test.go b/test/e2e/suites/e2e/clusterctl_upgrade_test.go index 4b121d68c4..9c633aedc9 100644 --- a/test/e2e/suites/e2e/clusterctl_upgrade_test.go +++ b/test/e2e/suites/e2e/clusterctl_upgrade_test.go @@ -28,53 +28,7 @@ import ( "sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared" ) -const OldCAPIVersion = "v1.4.6" - -var _ = Describe("When testing clusterctl upgrades (v0.7=>current) [clusterctl-upgrade]", func() { - ctx := context.TODO() - shared.SetEnvVar("DOWNLOAD_E2E_IMAGE", "true", false) - - capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput { - return capi_e2e.ClusterctlUpgradeSpecInput{ - E2EConfig: e2eCtx.E2EConfig, - ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath, - BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy, - ArtifactFolder: e2eCtx.Settings.ArtifactFolder, - SkipCleanup: false, - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + OldCAPIVersion + "/clusterctl-{OS}-{ARCH}", - InitWithProvidersContract: "v1beta1", - InitWithInfrastructureProviders: []string{"openstack:v0.7.2"}, - InitWithCoreProvider: "cluster-api:" + OldCAPIVersion, - InitWithBootstrapProviders: []string{"kubeadm:" + OldCAPIVersion}, - InitWithControlPlaneProviders: []string{"kubeadm:" + OldCAPIVersion}, - MgmtFlavor: shared.FlavorDefault, - WorkloadFlavor: shared.FlavorV1alpha6, - } - }) -}) - -var _ = Describe("When testing clusterctl upgrades (v0.8=>current) [clusterctl-upgrade]", func() { - ctx := context.TODO() - shared.SetEnvVar("DOWNLOAD_E2E_IMAGE", "true", false) - - capi_e2e.ClusterctlUpgradeSpec(ctx, func() capi_e2e.ClusterctlUpgradeSpecInput { - return capi_e2e.ClusterctlUpgradeSpecInput{ - E2EConfig: e2eCtx.E2EConfig, - ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath, - BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy, - ArtifactFolder: e2eCtx.Settings.ArtifactFolder, - SkipCleanup: false, - InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + OldCAPIVersion + "/clusterctl-{OS}-{ARCH}", - InitWithProvidersContract: "v1beta1", - InitWithInfrastructureProviders: []string{"openstack:v0.8.0"}, - InitWithCoreProvider: "cluster-api:" + OldCAPIVersion, - InitWithBootstrapProviders: []string{"kubeadm:" + OldCAPIVersion}, - InitWithControlPlaneProviders: []string{"kubeadm:" + OldCAPIVersion}, - MgmtFlavor: shared.FlavorDefault, - WorkloadFlavor: shared.FlavorV1alpha7, - } - }) -}) +const OldCAPIVersion = "v1.6.0" var _ = Describe("When testing clusterctl upgrades (v0.9=>current) [clusterctl-upgrade]", func() { ctx := context.TODO()