From 71acf236b9dc2fb7153a6f1b1ea85be100589e97 Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Tue, 14 Dec 2021 16:31:40 -0500 Subject: [PATCH 1/4] bump capo version to main --- go.mod | 2 +- go.sum | 4 +- vendor/modules.txt | 4 +- .../api/v1alpha4/conversion.go | 109 -- .../api/v1alpha4/doc.go | 18 - .../api/v1alpha4/groupversion_info.go | 38 - .../api/v1alpha4/identity_types.go | 33 - .../v1alpha4/openstackcluster_conversion.go | 33 - .../api/v1alpha4/openstackcluster_types.go | 237 --- .../api/v1alpha4/openstackcluster_webhook.go | 130 -- .../v1alpha4/openstackclusterlist_webhook.go | 32 - .../openstackclustertemplate_types.go | 55 - .../openstackclustertemplate_webhook.go | 84 - .../api/v1alpha4/openstackmachine_types.go | 160 -- .../api/v1alpha4/openstackmachine_webhook.go | 113 -- .../v1alpha4/openstackmachinelist_webhook.go | 32 - .../openstackmachinetemplate_types.go | 50 - .../openstackmachinetemplate_webhook.go | 75 - .../openstackmachinetemplatelist_webhook.go | 32 - .../api/v1alpha4/types.go | 308 --- .../api/v1alpha4/webhooks.go | 35 - .../api/v1alpha4/zz_generated.conversion.go | 1562 --------------- .../api/v1alpha4/zz_generated.deepcopy.go | 1005 ---------- .../api/v1beta1/filter_convert.go | 53 + .../api/v1beta1/openstackcluster_types.go | 2 +- .../api/v1beta1/types.go | 47 +- .../api/v1beta1/zz_generated.deepcopy.go | 75 +- .../pkg/cloud/services/compute/instance.go | 25 +- .../pkg/cloud/services/networking/port.go | 32 +- .../pkg/cloud/services/networking/router.go | 2 +- .../api/v1alpha4/cluster_phase_types.go | 55 - .../cluster-api/api/v1alpha4/cluster_types.go | 434 ----- .../api/v1alpha4/clusterclass_types.go | 132 -- .../cluster-api/api/v1alpha4/common_types.go | 188 -- .../api/v1alpha4/condition_consts.go | 253 --- .../api/v1alpha4/condition_types.go | 97 - .../cluster-api/api/v1alpha4/conversion.go | 172 -- .../cluster-api/api/v1alpha4/doc.go | 19 - .../api/v1alpha4/groupversion_info.go | 38 - .../api/v1alpha4/machine_phase_types.go | 64 - .../cluster-api/api/v1alpha4/machine_types.go | 275 --- .../api/v1alpha4/machinedeployment_types.go | 314 --- .../api/v1alpha4/machinehealthcheck_types.go | 169 -- .../api/v1alpha4/machineset_types.go | 236 --- .../api/v1alpha4/zz_generated.conversion.go | 1733 ----------------- .../api/v1alpha4/zz_generated.deepcopy.go | 1257 ------------ 46 files changed, 159 insertions(+), 9664 deletions(-) delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/conversion.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/doc.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/groupversion_info.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/identity_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_conversion.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclusterlist_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinelist_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplatelist_webhook.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/webhooks.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.conversion.go delete mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.deepcopy.go create mode 100644 vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/filter_convert.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_phase_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/clusterclass_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/common_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_consts.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/conversion.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/doc.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/groupversion_info.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_phase_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinedeployment_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinehealthcheck_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machineset_types.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.conversion.go delete mode 100644 vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.deepcopy.go diff --git a/go.mod b/go.mod index 5561dd6f1..7f106ca4e 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( k8s.io/klog v1.0.0 k8s.io/klog/v2 v2.9.0 sigs.k8s.io/cluster-api v1.0.2 - sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211208064945-172c23f148b0 + sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211214023603-b936d98a83d6 sigs.k8s.io/controller-runtime v0.10.3 sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index abfce37cf..a3b41b144 100644 --- a/go.sum +++ b/go.sum @@ -1732,8 +1732,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.21/go.mod h1:LEScyz sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/cluster-api v1.0.2 h1:V2pzMUfyVv29vf6q5RVLuPIp8PAcnLYcBcH9bzoMDLY= sigs.k8s.io/cluster-api v1.0.2/go.mod h1:/LkJXtsvhxTV4U0z1Y2Y1Gr2xebJ0/ce09Ab2M0XU/U= -sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211208064945-172c23f148b0 h1:+haTo0D3bJzbTG0bTA3Hcyv8aNVfMYh186SO7Xyc1eU= -sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211208064945-172c23f148b0/go.mod h1:DjUUwFBscjYRihaHOXVMtNlBBazsstagsGO72TrqUik= +sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211214023603-b936d98a83d6 h1:Yw23vTEMI9fjxC+rMaYlzP3TImDf7HQb8r3qy0ol4Vg= +sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211214023603-b936d98a83d6/go.mod h1:DjUUwFBscjYRihaHOXVMtNlBBazsstagsGO72TrqUik= sigs.k8s.io/cluster-api/test v1.0.1-0.20211028151834-d72fd59c8483/go.mod h1:NISRUeCxvEa6qUhVtfWt0t/C9ljTzGT9joft0YeN+3s= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= sigs.k8s.io/controller-runtime v0.10.3-0.20211011182302-43ea648ec318/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= diff --git a/vendor/modules.txt b/vendor/modules.txt index 5422daf5f..50b9ae20d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -663,15 +663,13 @@ k8s.io/utils/pointer k8s.io/utils/trace # sigs.k8s.io/cluster-api v1.0.2 => sigs.k8s.io/cluster-api v1.0.2 ## explicit -sigs.k8s.io/cluster-api/api/v1alpha4 sigs.k8s.io/cluster-api/api/v1beta1 sigs.k8s.io/cluster-api/errors sigs.k8s.io/cluster-api/feature sigs.k8s.io/cluster-api/util sigs.k8s.io/cluster-api/util/version -# sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211208064945-172c23f148b0 +# sigs.k8s.io/cluster-api-provider-openstack v0.5.1-0.20211214023603-b936d98a83d6 ## explicit -sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4 sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/compute sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/conversion.go deleted file mode 100644 index b07a788b4..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/conversion.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - // corev1 "k8s.io/api/core/v1" - // conversion "k8s.io/apimachinery/pkg/conversion" - ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion" - - "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" -) - -var _ ctrlconversion.Convertible = &OpenStackCluster{} - -func (r *OpenStackCluster) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackCluster) - - return Convert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(r, dst, nil) -} - -func (r *OpenStackCluster) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackCluster) - - return Convert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackClusterList{} - -func (r *OpenStackClusterList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackClusterList) - - return Convert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList(r, dst, nil) -} - -func (r *OpenStackClusterList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackClusterList) - - return Convert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachine{} - -func (r *OpenStackMachine) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackMachine) - - return Convert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine(r, dst, nil) -} - -func (r *OpenStackMachine) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackMachine) - - return Convert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineList{} - -func (r *OpenStackMachineList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackMachineList) - - return Convert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList(r, dst, nil) -} - -func (r *OpenStackMachineList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackMachineList) - - return Convert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineTemplate{} - -func (r *OpenStackMachineTemplate) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackMachineTemplate) - - return Convert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(r, dst, nil) -} - -func (r *OpenStackMachineTemplate) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackMachineTemplate) - - return Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineTemplateList{} - -func (r *OpenStackMachineTemplateList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1beta1.OpenStackMachineTemplateList) - - return Convert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(r, dst, nil) -} - -func (r *OpenStackMachineTemplateList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1beta1.OpenStackMachineTemplateList) - - return Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(src, r, nil) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/doc.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/doc.go deleted file mode 100644 index 3a92324cb..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 -package v1alpha4 diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 0986718ae..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/identity_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/identity_types.go deleted file mode 100644 index 0b73bfe23..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/identity_types.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -const defaultIdentityRefKind = "Secret" - -// OpenStackIdentityReference is a reference to an infrastructure -// provider identity to be used to provision cluster resources. -type OpenStackIdentityReference struct { - // Kind of the identity. Must be supported by the infrastructure - // provider and may be either cluster or namespace-scoped. - // +kubebuilder:validation:MinLength=1 - Kind string `json:"kind"` - - // Name of the infrastructure identity to be used. - // Must be either a cluster-scoped resource, or namespaced-scoped - // resource the same namespace as the resource(s) being provisioned. - Name string `json:"name"` -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_conversion.go deleted file mode 100644 index 3689949ac..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_conversion.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" -) - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *apiv1alpha4.APIEndpoint, out *apiv1beta1.APIEndpoint, s apiconversion.Scope) error { - return apiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *apiv1beta1.APIEndpoint, out *apiv1alpha4.APIEndpoint, s apiconversion.Scope) error { - return apiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_types.go deleted file mode 100644 index e06241196..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_types.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // ClusterFinalizer allows ReconcileOpenStackCluster to clean up OpenStack resources associated with OpenStackCluster before - // removing it from the apiserver. - ClusterFinalizer = "openstackcluster.infrastructure.cluster.x-k8s.io" -) - -// OpenStackClusterSpec defines the desired state of OpenStackCluster. -type OpenStackClusterSpec struct { - // The name of the cloud to use from the clouds secret - // +optional - CloudName string `json:"cloudName"` - - // NodeCIDR is the OpenStack Subnet to be created. Cluster actuator will create a - // network, a subnet with NodeCIDR, and a router connected to this subnet. - // If you leave this empty, no network will be created. - NodeCIDR string `json:"nodeCidr,omitempty"` - - // If NodeCIDR cannot be set this can be used to detect an existing network. - Network Filter `json:"network,omitempty"` - - // If NodeCIDR cannot be set this can be used to detect an existing subnet. - Subnet SubnetFilter `json:"subnet,omitempty"` - - // DNSNameservers is the list of nameservers for OpenStack Subnet being created. - // Set this value when you need create a new network/subnet while the access - // through DNS is required. - DNSNameservers []string `json:"dnsNameservers,omitempty"` - // ExternalRouterIPs is an array of externalIPs on the respective subnets. - // This is necessary if the router needs a fixed ip in a specific subnet. - ExternalRouterIPs []ExternalRouterIPParam `json:"externalRouterIPs,omitempty"` - // ExternalNetworkID is the ID of an external OpenStack Network. This is necessary - // to get public internet to the VMs. - // +optional - ExternalNetworkID string `json:"externalNetworkId,omitempty"` - - // ManagedAPIServerLoadBalancer defines whether a LoadBalancer for the - // APIServer should be created. - // +optional - ManagedAPIServerLoadBalancer bool `json:"managedAPIServerLoadBalancer"` - - // DisableAPIServerFloatingIP determines whether or not to attempt to attach a floating - // IP to the API server. This allows for the creation of clusters when attaching a floating - // IP to the API server (and hence, in many cases, exposing the API server to the internet) - // is not possible or desirable, e.g. if using a shared VLAN for communication between - // management and workload clusters or when the management cluster is inside the - // project network. - // This option requires that the API server use a VIP on the cluster network so that the - // underlying machines can change without changing ControlPlaneEndpoint.Host. - // When using a managed load balancer, this VIP will be managed automatically. - // If not using a managed load balancer, cluster configuration will fail without additional - // configuration to manage the VIP on the control plane machines, which falls outside of - // the scope of this controller. - // +optional - DisableAPIServerFloatingIP bool `json:"disableAPIServerFloatingIP"` - - // APIServerFloatingIP is the floatingIP which will be associated with the API server. - // The floatingIP will be created if it does not already exist. - // If not specified, a new floatingIP is allocated. - // This field is not used if DisableAPIServerFloatingIP is set to true. - APIServerFloatingIP string `json:"apiServerFloatingIP,omitempty"` - - // APIServerFixedIP is the fixed IP which will be associated with the API server. - // In the case where the API server has a floating IP but not a managed load balancer, - // this field is not used. - // If a managed load balancer is used and this field is not specified, a fixed IP will - // be dynamically allocated for the load balancer. - // If a managed load balancer is not used AND the API server floating IP is disabled, - // this field MUST be specified and should correspond to a pre-allocated port that - // holds the fixed IP to be used as a VIP. - APIServerFixedIP string `json:"apiServerFixedIP,omitempty"` - - // APIServerPort is the port on which the listener on the APIServer - // will be created - APIServerPort int `json:"apiServerPort,omitempty"` - - // APIServerLoadBalancerAdditionalPorts adds additional ports to the APIServerLoadBalancer - APIServerLoadBalancerAdditionalPorts []int `json:"apiServerLoadBalancerAdditionalPorts,omitempty"` - - // ManagedSecurityGroups determines whether OpenStack security groups for the cluster - // will be managed by the OpenStack provider or whether pre-existing security groups will - // be specified as part of the configuration. - // By default, the managed security groups have rules that allow the Kubelet, etcd, the - // Kubernetes API server and the Calico CNI plugin to function correctly. - // +optional - ManagedSecurityGroups bool `json:"managedSecurityGroups"` - - // AllowAllInClusterTraffic is only used when managed security groups are in use. - // If set to true, the rules for the managed security groups are configured so that all - // ingress and egress between cluster nodes is permitted, allowing CNIs other than - // Calico to be used. - // +optional - AllowAllInClusterTraffic bool `json:"allowAllInClusterTraffic"` - - // DisablePortSecurity disables the port security of the network created for the - // Kubernetes cluster, which also disables SecurityGroups - DisablePortSecurity bool `json:"disablePortSecurity,omitempty"` - - // Tags for all resources in cluster - Tags []string `json:"tags,omitempty"` - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` - - // ControlPlaneAvailabilityZones is the az to deploy control plane to - ControlPlaneAvailabilityZones []string `json:"controlPlaneAvailabilityZones,omitempty"` - - // Bastion is the OpenStack instance to login the nodes - //+optional - Bastion *Bastion `json:"bastion,omitempty"` - - // IdentityRef is a reference to a identity to be used when reconciling this cluster - // +optional - IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"` -} - -// OpenStackClusterStatus defines the observed state of OpenStackCluster. -type OpenStackClusterStatus struct { - Ready bool `json:"ready"` - - // Network contains all information about the created OpenStack Network. - // It includes Subnets and Router. - Network *Network `json:"network,omitempty"` - - // External Network contains information about the created OpenStack external network. - ExternalNetwork *Network `json:"externalNetwork,omitempty"` - - // FailureDomains represent OpenStack availability zones - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - - // ControlPlaneSecurityGroups contains all the information about the OpenStack - // Security Group that needs to be applied to control plane nodes. - // TODO: Maybe instead of two properties, we add a property to the group? - ControlPlaneSecurityGroup *SecurityGroup `json:"controlPlaneSecurityGroup,omitempty"` - - // WorkerSecurityGroup contains all the information about the OpenStack Security - // Group that needs to be applied to worker nodes. - WorkerSecurityGroup *SecurityGroup `json:"workerSecurityGroup,omitempty"` - - BastionSecurityGroup *SecurityGroup `json:"bastionSecurityGroup,omitempty"` - - Bastion *Instance `json:"bastion,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the OpenStackCluster and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the OpenStackCluster's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // OpenStackClusters can be added as events to the OpenStackCluster object - // and/or logged in the controller's output. - // +optional - FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the OpenStackCluster and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the OpenStackCluster's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // OpenStackClusters can be added as events to the OpenStackCluster object - // and/or logged in the controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackCluster belongs" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for OpenStack instances" -// +kubebuilder:printcolumn:name="Network",type="string",JSONPath=".status.network.id",description="Network the cluster is using" -// +kubebuilder:printcolumn:name="Subnet",type="string",JSONPath=".status.network.subnet.id",description="Subnet the cluster is using" -// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1 -// +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.floatingIP",description="Bastion address for breakglass access" - -// OpenStackCluster is the Schema for the openstackclusters API. -type OpenStackCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec OpenStackClusterSpec `json:"spec,omitempty"` - Status OpenStackClusterStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// OpenStackClusterList contains a list of OpenStackCluster. -type OpenStackClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []OpenStackCluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&OpenStackCluster{}, &OpenStackClusterList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_webhook.go deleted file mode 100644 index e939c2ab9..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackcluster_webhook.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/controller-runtime/pkg/builder" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("openstackcluster-resource") - -func (r *OpenStackCluster) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclusters,versions=v1alpha4,name=validation.openstackcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclusters,versions=v1alpha4,name=default.openstackcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -var ( - _ webhook.Defaulter = &OpenStackCluster{} - _ webhook.Validator = &OpenStackCluster{} -) - -// Default satisfies the defaulting webhook interface. -func (r *OpenStackCluster) Default() { - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind == "" { - r.Spec.IdentityRef.Kind = defaultIdentityRefKind - } -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackCluster) ValidateCreate() error { - var allErrs field.ErrorList - - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind != defaultIdentityRefKind { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "identityRef", "kind"), "must be a Secret")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackCluster) ValidateUpdate(oldRaw runtime.Object) error { - var allErrs field.ErrorList - old, ok := oldRaw.(*OpenStackCluster) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an OpenStackCluster but got a %T", oldRaw)) - } - - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind != defaultIdentityRefKind { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "identityRef", "kind"), - r.Spec.IdentityRef, "must be a Secret"), - ) - } - - // Allow changes to Spec.IdentityRef.Name. - if old.Spec.IdentityRef != nil && r.Spec.IdentityRef != nil { - old.Spec.IdentityRef.Name = "" - r.Spec.IdentityRef.Name = "" - } - - // Allow changes to Spec.IdentityRef if it was unset. - if old.Spec.IdentityRef == nil && r.Spec.IdentityRef != nil { - old.Spec.IdentityRef = &OpenStackIdentityReference{} - r.Spec.IdentityRef = &OpenStackIdentityReference{} - } - - if old.Spec.IdentityRef != nil && r.Spec.IdentityRef == nil { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "identityRef"), - r.Spec.IdentityRef, "field cannot be set to nil"), - ) - } - - // Allow change only for the first time. - if old.Spec.ControlPlaneEndpoint.Host == "" { - old.Spec.ControlPlaneEndpoint = clusterv1.APIEndpoint{} - r.Spec.ControlPlaneEndpoint = clusterv1.APIEndpoint{} - } - - // Allow changes to the bastion spec only if no bastion host is deployed (i.e. Spec.Bastion.Enabled=false). - if old.Status.Bastion == nil { - old.Spec.Bastion = &Bastion{} - r.Spec.Bastion = &Bastion{} - } - - // Allow toggling the bastion enabled flag. - if old.Spec.Bastion != nil && r.Spec.Bastion != nil { - old.Spec.Bastion.Enabled = true - r.Spec.Bastion.Enabled = true - } - - if !reflect.DeepEqual(old.Spec, r.Spec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "cannot be modified")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackCluster) ValidateDelete() error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclusterlist_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclusterlist_webhook.go deleted file mode 100644 index 01cdfe6b9..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclusterlist_webhook.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "sigs.k8s.io/controller-runtime/pkg/builder" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("openstackclusterlist-resource") - -func (r *OpenStackClusterList) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_types.go deleted file mode 100644 index 413bef096..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// OpenStackClusterTemplateResource describes the data needed to create a OpenStackCluster from a template. -type OpenStackClusterTemplateResource struct { - Spec OpenStackClusterSpec `json:"spec"` -} - -// OpenStackClusterTemplateSpec defines the desired state of OpenStackClusterTemplate. -type OpenStackClusterTemplateSpec struct { - Template OpenStackClusterTemplateResource `json:"template"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=openstackclustertemplates,scope=Namespaced,categories=cluster-api,shortName=osct - -// OpenStackClusterTemplate is the Schema for the openstackclustertemplates API. -type OpenStackClusterTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec OpenStackClusterTemplateSpec `json:"spec,omitempty"` -} - -//+kubebuilder:object:root=true - -// OpenStackClusterTemplateList contains a list of OpenStackClusterTemplate. -type OpenStackClusterTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []OpenStackClusterTemplate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&OpenStackClusterTemplate{}, &OpenStackClusterTemplateList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_webhook.go deleted file mode 100644 index acc848a08..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackclustertemplate_webhook.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -const openStackClusterTemplateImmutableMsg = "OpenStackClusterTemplate spec.template.spec field is immutable. Please create new resource instead." - -func (r *OpenStackClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclustertemplates,versions=v1alpha4,name=default.openstackclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclustertemplates,versions=v1alpha4,name=validation.openstackclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -var ( - _ webhook.Defaulter = &OpenStackClusterTemplate{} - _ webhook.Validator = &OpenStackClusterTemplate{} -) - -// Default implements webhook.Defaulter so a webhook will be registered for the type. -func (r *OpenStackClusterTemplate) Default() { - if r.Spec.Template.Spec.IdentityRef != nil && r.Spec.Template.Spec.IdentityRef.Kind == "" { - r.Spec.Template.Spec.IdentityRef.Kind = defaultIdentityRefKind - } -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackClusterTemplate) ValidateCreate() error { - var allErrs field.ErrorList - - if r.Spec.Template.Spec.IdentityRef != nil && r.Spec.Template.Spec.IdentityRef.Kind != defaultIdentityRefKind { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "identityRef", "kind"), "must be a Secret")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackClusterTemplate) ValidateUpdate(oldRaw runtime.Object) error { - var allErrs field.ErrorList - old, ok := oldRaw.(*OpenStackClusterTemplate) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an OpenStackClusterTemplate but got a %T", oldRaw)) - } - - if !reflect.DeepEqual(r.Spec.Template.Spec, old.Spec.Template.Spec) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("OpenStackClusterTemplate", "spec", "template", "spec"), r, openStackClusterTemplateImmutableMsg), - ) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackClusterTemplate) ValidateDelete() error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_types.go deleted file mode 100644 index d98051cc0..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_types.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineFinalizer allows ReconcileOpenStackMachine to clean up OpenStack resources associated with OpenStackMachine before - // removing it from the apiserver. - MachineFinalizer = "openstackmachine.infrastructure.cluster.x-k8s.io" -) - -// OpenStackMachineSpec defines the desired state of OpenStackMachine. -type OpenStackMachineSpec struct { - // ProviderID is the unique identifier as specified by the cloud provider. - ProviderID *string `json:"providerID,omitempty"` - - // InstanceID is the OpenStack instance ID for this machine. - InstanceID *string `json:"instanceID,omitempty"` - - // The name of the cloud to use from the clouds secret - // +optional - CloudName string `json:"cloudName"` - - // The flavor reference for the flavor for your server instance. - Flavor string `json:"flavor"` - - // The name of the image to use for your server instance. - // If the RootVolume is specified, this will be ignored and use rootVolume directly. - Image string `json:"image,omitempty"` - - // The ssh key to inject in the instance - SSHKeyName string `json:"sshKeyName,omitempty"` - - // A networks object. Required parameter when there are multiple networks defined for the tenant. - // When you do not specify both networks and ports parameters, the server attaches to the only network created for the current tenant. - Networks []NetworkParam `json:"networks,omitempty"` - - // Ports to be attached to the server instance. They are created if a port with the given name does not already exist. - // When you do not specify both networks and ports parameters, the server attaches to the only network created for the current tenant. - Ports []PortOpts `json:"ports,omitempty"` - - // UUID, IP address of a port from this subnet will be marked as AccessIPv4 on the created compute instance - Subnet string `json:"subnet,omitempty"` - - // The floatingIP which will be associated to the machine, only used for master. - // The floatingIP should have been created and haven't been associated. - FloatingIP string `json:"floatingIP,omitempty"` - - // The names of the security groups to assign to the instance - SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"` - - // Whether the server instance is created on a trunk port or not. - Trunk bool `json:"trunk,omitempty"` - - // Machine tags - // Requires Nova api 2.52 minimum! - Tags []string `json:"tags,omitempty"` - - // Metadata mapping. Allows you to create a map of key value pairs to add to the server instance. - ServerMetadata map[string]string `json:"serverMetadata,omitempty"` - - // Config Drive support - ConfigDrive *bool `json:"configDrive,omitempty"` - - // The volume metadata to boot from - RootVolume *RootVolume `json:"rootVolume,omitempty"` - - // The server group to assign the machine to - ServerGroupID string `json:"serverGroupID,omitempty"` - - // IdentityRef is a reference to a identity to be used when reconciling this cluster - // +optional - IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"` -} - -// OpenStackMachineStatus defines the observed state of OpenStackMachine. -type OpenStackMachineStatus struct { - - // Ready is true when the provider resource is ready. - // +optional - Ready bool `json:"ready"` - - // Addresses contains the OpenStack instance associated addresses. - Addresses []corev1.NodeAddress `json:"addresses,omitempty"` - - // InstanceState is the state of the OpenStack instance for this machine. - // +optional - InstanceState *InstanceState `json:"instanceState,omitempty"` - - FailureReason *errors.MachineStatusError `json:"errorReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"errorMessage,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackMachine belongs" -// +kubebuilder:printcolumn:name="InstanceState",type="string",JSONPath=".status.instanceState",description="OpenStack instance state" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="OpenStack instance ID" -// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this OpenStackMachine" - -// OpenStackMachine is the Schema for the openstackmachines API. -type OpenStackMachine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec OpenStackMachineSpec `json:"spec,omitempty"` - Status OpenStackMachineStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// OpenStackMachineList contains a list of OpenStackMachine. -type OpenStackMachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []OpenStackMachine `json:"items"` -} - -func init() { - SchemeBuilder.Register(&OpenStackMachine{}, &OpenStackMachineList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_webhook.go deleted file mode 100644 index 079e9e509..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachine_webhook.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "reflect" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/controller-runtime/pkg/builder" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("openstackmachine-resource") - -func (r *OpenStackMachine) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachines,versions=v1alpha4,name=validation.openstackmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackmachine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachines,versions=v1alpha4,name=default.openstackmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -var ( - _ webhook.Defaulter = &OpenStackMachine{} - _ webhook.Validator = &OpenStackMachine{} -) - -// Default satisfies the defaulting webhook interface. -func (r *OpenStackMachine) Default() { - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind == "" { - r.Spec.IdentityRef.Kind = defaultIdentityRefKind - } -} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachine) ValidateCreate() error { - var allErrs field.ErrorList - - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind != defaultIdentityRefKind { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "identityRef", "kind"), "must be a Secret")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachine) ValidateUpdate(old runtime.Object) error { - newOpenStackMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) - if err != nil { - return apierrors.NewInvalid(GroupVersion.WithKind("OpenStackMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert new OpenStackMachine to unstructured object")), - }) - } - oldOpenStackMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(old) - if err != nil { - return apierrors.NewInvalid(GroupVersion.WithKind("OpenStackMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert old OpenStackMachine to unstructured object")), - }) - } - - var allErrs field.ErrorList - - if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind != defaultIdentityRefKind { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "identityRef", "kind"), "must be a Secret")) - } - - newOpenStackMachineSpec := newOpenStackMachine["spec"].(map[string]interface{}) - oldOpenStackMachineSpec := oldOpenStackMachine["spec"].(map[string]interface{}) - - // allow changes to providerID once - if oldOpenStackMachineSpec["providerID"] == nil { - delete(oldOpenStackMachineSpec, "providerID") - delete(newOpenStackMachineSpec, "providerID") - } - - // allow changes to instanceID once - if oldOpenStackMachineSpec["instanceID"] == nil { - delete(oldOpenStackMachineSpec, "instanceID") - delete(newOpenStackMachineSpec, "instanceID") - } - - if !reflect.DeepEqual(oldOpenStackMachineSpec, newOpenStackMachineSpec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "cannot be modified")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachine) ValidateDelete() error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinelist_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinelist_webhook.go deleted file mode 100644 index cf7763edf..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinelist_webhook.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "sigs.k8s.io/controller-runtime/pkg/builder" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("openstackmachinelist-resource") - -func (r *OpenStackMachineList) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_types.go deleted file mode 100644 index 50815d54c..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_types.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// OpenStackMachineTemplateSpec defines the desired state of OpenStackMachineTemplate. -type OpenStackMachineTemplateSpec struct { - Template OpenStackMachineTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt - -// OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API. -type OpenStackMachineTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec OpenStackMachineTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// OpenStackMachineTemplateList contains a list of OpenStackMachineTemplate. -type OpenStackMachineTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []OpenStackMachineTemplate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&OpenStackMachineTemplate{}, &OpenStackMachineTemplateList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_webhook.go deleted file mode 100644 index 6aea3242c..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplate_webhook.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "sigs.k8s.io/controller-runtime/pkg/builder" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// OpenStackMachineTemplateImmutableMsg ... -const OpenStackMachineTemplateImmutableMsg = "OpenStackMachineTemplate spec.template.spec field is immutable. Please create a new resource instead. Ref doc: https://cluster-api.sigs.k8s.io/tasks/change-machine-template.html" - -func (r *OpenStackMachineTemplate) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-openstackmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachinetemplates,versions=v1alpha4,name=validation.openstackmachinetemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 - -var _ webhook.Validator = &OpenStackMachineTemplate{} - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachineTemplate) ValidateCreate() error { - var allErrs field.ErrorList - - if r.Spec.Template.Spec.ProviderID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "providerID"), "cannot be set in templates")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachineTemplate) ValidateUpdate(oldRaw runtime.Object) error { - var allErrs field.ErrorList - old, ok := oldRaw.(*OpenStackMachineTemplate) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an OpenStackMachineTemplate but got a %T", oldRaw)) - } - - if !reflect.DeepEqual(r.Spec.Template.Spec, old.Spec.Template.Spec) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "template", "spec"), r, OpenStackMachineTemplateImmutableMsg), - ) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type. -func (r *OpenStackMachineTemplate) ValidateDelete() error { - return nil -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplatelist_webhook.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplatelist_webhook.go deleted file mode 100644 index a10fbd167..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/openstackmachinetemplatelist_webhook.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "sigs.k8s.io/controller-runtime/pkg/builder" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("openstackmachinetemplatelist-resource") - -func (r *OpenStackMachineTemplateList) SetupWebhookWithManager(mgr manager.Manager) error { - return builder.WebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/types.go deleted file mode 100644 index 3f36fc00e..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/types.go +++ /dev/null @@ -1,308 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// OpenStackMachineTemplateResource describes the data needed to create a OpenStackMachine from a template. -type OpenStackMachineTemplateResource struct { - // Spec is the specification of the desired behavior of the machine. - Spec OpenStackMachineSpec `json:"spec"` -} - -type ExternalRouterIPParam struct { - // The FixedIP in the corresponding subnet - FixedIP string `json:"fixedIP,omitempty"` - // The subnet in which the FixedIP is used for the Gateway of this router - Subnet SubnetParam `json:"subnet"` -} - -type SecurityGroupParam struct { - // Security Group UID - UUID string `json:"uuid,omitempty"` - // Security Group name - Name string `json:"name,omitempty"` - // Filters used to query security groups in openstack - Filter SecurityGroupFilter `json:"filter,omitempty"` -} - -type SecurityGroupFilter struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - TenantID string `json:"tenantId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - Limit int `json:"limit,omitempty"` - Marker string `json:"marker,omitempty"` - SortKey string `json:"sortKey,omitempty"` - SortDir string `json:"sortDir,omitempty"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` -} - -type NetworkParam struct { - // Optional UUID of the network. - // If specified this will not be validated prior to server creation. - // Required if `Subnets` specifies a subnet by UUID. - UUID string `json:"uuid,omitempty"` - // A fixed IPv4 address for the NIC. - FixedIP string `json:"fixedIP,omitempty"` - // Filters for optional network query - Filter Filter `json:"filter,omitempty"` - // Subnet within a network to use - Subnets []SubnetParam `json:"subnets,omitempty"` -} - -type Filter struct { - Status string `json:"status,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - AdminStateUp *bool `json:"adminStateUp,omitempty"` - TenantID string `json:"tenantId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - Shared *bool `json:"shared,omitempty"` - ID string `json:"id,omitempty"` - Marker string `json:"marker,omitempty"` - Limit int `json:"limit,omitempty"` - SortKey string `json:"sortKey,omitempty"` - SortDir string `json:"sortDir,omitempty"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` -} - -type SubnetParam struct { - // Optional UUID of the subnet. - // If specified this will not be validated prior to server creation. - // If specified, the enclosing `NetworkParam` must also be specified by UUID. - UUID string `json:"uuid,omitempty"` - - // Filters for optional subnet query - Filter SubnetFilter `json:"filter,omitempty"` -} - -type SubnetFilter struct { - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - EnableDHCP *bool `json:"enableDhcp,omitempty"` - NetworkID string `json:"networkId,omitempty"` - TenantID string `json:"tenantId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - IPVersion int `json:"ipVersion,omitempty"` - GatewayIP string `json:"gateway_ip,omitempty"` - CIDR string `json:"cidr,omitempty"` - IPv6AddressMode string `json:"ipv6AddressMode,omitempty"` - IPv6RAMode string `json:"ipv6RaMode,omitempty"` - ID string `json:"id,omitempty"` - SubnetPoolID string `json:"subnetpoolId,omitempty"` - Limit int `json:"limit,omitempty"` - Marker string `json:"marker,omitempty"` - SortKey string `json:"sortKey,omitempty"` - SortDir string `json:"sortDir,omitempty"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` -} - -type PortOpts struct { - // ID of the OpenStack network on which to create the port. If unspecified, create the port on the default cluster network. - NetworkID string `json:"networkId,omitempty"` - // Used to make the name of the port unique. If unspecified, instead the 0-based index of the port in the list is used. - NameSuffix string `json:"nameSuffix,omitempty"` - Description string `json:"description,omitempty"` - AdminStateUp *bool `json:"adminStateUp,omitempty"` - MACAddress string `json:"macAddress,omitempty"` - // Specify pairs of subnet and/or IP address. These should be subnets of the network with the given NetworkID. - FixedIPs []FixedIP `json:"fixedIPs,omitempty"` - TenantID string `json:"tenantId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - SecurityGroups *[]string `json:"securityGroups,omitempty"` - AllowedAddressPairs []AddressPair `json:"allowedAddressPairs,omitempty"` - // Enables and disables trunk at port level. If not provided, openStackMachine.Spec.Trunk is inherited. - Trunk *bool `json:"trunk,omitempty"` - - // The ID of the host where the port is allocated - HostID string `json:"hostId,omitempty"` - - // The virtual network interface card (vNIC) type that is bound to the neutron port. - VNICType string `json:"vnicType,omitempty"` - - // A dictionary that enables the application running on the specified - // host to pass and receive virtual network interface (VIF) port-specific - // information to the plug-in. - Profile map[string]string `json:"profile,omitempty"` - - // DisablePortSecurity enables or disables the port security when set. - // When not set, it takes the value of the corresponding field at the network level. - DisablePortSecurity *bool `json:"disablePortSecurity,omitempty"` - - // Tags applied to the port (and corresponding trunk, if a trunk is configured.) - // These tags are applied in addition to the instance's tags, which will also be applied to the port. - Tags []string `json:"tags,omitempty"` -} - -type FixedIP struct { - SubnetID string `json:"subnetId"` - IPAddress string `json:"ipAddress,omitempty"` -} - -type AddressPair struct { - IPAddress string `json:"ipAddress,omitempty"` - MACAddress string `json:"macAddress,omitempty"` -} - -type Instance struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Trunk bool `json:"trunk,omitempty"` - FailureDomain string `json:"failureDomain,omitempty"` - SecurityGroups *[]string `json:"securigyGroups,omitempty"` - Networks *[]Network `json:"networks,omitempty"` - Subnet string `json:"subnet,omitempty"` - Tags []string `json:"tags,omitempty"` - Image string `json:"image,omitempty"` - Flavor string `json:"flavor,omitempty"` - SSHKeyName string `json:"sshKeyName,omitempty"` - UserData string `json:"userData,omitempty"` - Metadata map[string]string `json:"metadata,omitempty"` - ConfigDrive *bool `json:"configDrive,omitempty"` - RootVolume *RootVolume `json:"rootVolume,omitempty"` - ServerGroupID string `json:"serverGroupID,omitempty"` - State InstanceState `json:"state,omitempty"` - IP string `json:"ip,omitempty"` - FloatingIP string `json:"floatingIP,omitempty"` -} - -type RootVolume struct { - SourceType string `json:"sourceType,omitempty"` - SourceUUID string `json:"sourceUUID,omitempty"` - DeviceType string `json:"deviceType,omitempty"` - Size int `json:"diskSize,omitempty"` -} - -// Network represents basic information about an OpenStack Neutron Network associated with an instance's port. -type Network struct { - Name string `json:"name"` - ID string `json:"id"` - - //+optional - Tags []string `json:"tags,omitempty"` - - Subnet *Subnet `json:"subnet,omitempty"` - PortOpts *PortOpts `json:"port,omitempty"` - Router *Router `json:"router,omitempty"` - - // Be careful when using APIServerLoadBalancer, because this field is optional and therefore not - // set in all cases - APIServerLoadBalancer *LoadBalancer `json:"apiServerLoadBalancer,omitempty"` -} - -// Subnet represents basic information about the associated OpenStack Neutron Subnet. -type Subnet struct { - Name string `json:"name"` - ID string `json:"id"` - - CIDR string `json:"cidr"` - - //+optional - Tags []string `json:"tags,omitempty"` -} - -// Router represents basic information about the associated OpenStack Neutron Router. -type Router struct { - Name string `json:"name"` - ID string `json:"id"` - //+optional - Tags []string `json:"tags,omitempty"` -} - -// LoadBalancer represents basic information about the associated OpenStack LoadBalancer. -type LoadBalancer struct { - Name string `json:"name"` - ID string `json:"id"` - IP string `json:"ip"` - InternalIP string `json:"internalIP"` -} - -// SecurityGroup represents the basic information of the associated -// OpenStack Neutron Security Group. -type SecurityGroup struct { - Name string `json:"name"` - ID string `json:"id"` - Rules []SecurityGroupRule `json:"rules"` -} - -// SecurityGroupRule represent the basic information of the associated OpenStack -// Security Group Role. -type SecurityGroupRule struct { - Description string `json:"description"` - ID string `json:"name"` - Direction string `json:"direction"` - EtherType string `json:"etherType"` - SecurityGroupID string `json:"securityGroupID"` - PortRangeMin int `json:"portRangeMin"` - PortRangeMax int `json:"portRangeMax"` - Protocol string `json:"protocol"` - RemoteGroupID string `json:"remoteGroupID"` - RemoteIPPrefix string `json:"remoteIPPrefix"` -} - -// Equal checks if two SecurityGroupRules are the same. -func (r SecurityGroupRule) Equal(x SecurityGroupRule) bool { - return (r.Direction == x.Direction && - r.Description == x.Description && - r.EtherType == x.EtherType && - r.PortRangeMin == x.PortRangeMin && - r.PortRangeMax == x.PortRangeMax && - r.Protocol == x.Protocol && - r.RemoteGroupID == x.RemoteGroupID && - r.RemoteIPPrefix == x.RemoteIPPrefix) -} - -// InstanceState describes the state of an OpenStack instance. -type InstanceState string - -var ( - // InstanceStateActive is the string representing an instance in an active state. - InstanceStateActive = InstanceState("ACTIVE") - - // InstanceStateError is the string representing an instance in an error state. - InstanceStateError = InstanceState("ERROR") - - // InstanceStateStopped is the string representing an instance in a stopped state. - InstanceStateStopped = InstanceState("STOPPED") - - // InstanceStateShutoff is the string representing an instance in a shutoff state. - InstanceStateShutoff = InstanceState("SHUTOFF") - - // InstanceStateDeleted is the string representing an instance in a deleted state. - InstanceStateDeleted = InstanceState("DELETED") -) - -// Bastion represents basic information about the bastion node. -type Bastion struct { - //+optional - Enabled bool `json:"enabled"` - - // Instance for the bastion itself - Instance OpenStackMachineSpec `json:"instance,omitempty"` - - //+optional - AvailabilityZone string `json:"availabilityZone,omitempty"` -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/webhooks.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/webhooks.go deleted file mode 100644 index ca0a158e6..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/webhooks.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -func aggregateObjErrors(gk schema.GroupKind, name string, allErrs field.ErrorList) error { - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - gk, - name, - allErrs, - ) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 50bd804f1..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,1562 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - v1beta1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - errors "sigs.k8s.io/cluster-api/errors" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AddressPair)(nil), (*v1beta1.AddressPair)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AddressPair_To_v1beta1_AddressPair(a.(*AddressPair), b.(*v1beta1.AddressPair), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.AddressPair)(nil), (*AddressPair)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_AddressPair_To_v1alpha4_AddressPair(a.(*v1beta1.AddressPair), b.(*AddressPair), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bastion_To_v1beta1_Bastion(a.(*Bastion), b.(*v1beta1.Bastion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Bastion_To_v1alpha4_Bastion(a.(*v1beta1.Bastion), b.(*Bastion), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1beta1.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(a.(*ExternalRouterIPParam), b.(*v1beta1.ExternalRouterIPParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ExternalRouterIPParam)(nil), (*ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(a.(*v1beta1.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta1.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Filter_To_v1beta1_Filter(a.(*Filter), b.(*v1beta1.Filter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Filter_To_v1alpha4_Filter(a.(*v1beta1.Filter), b.(*Filter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FixedIP)(nil), (*v1beta1.FixedIP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FixedIP_To_v1beta1_FixedIP(a.(*FixedIP), b.(*v1beta1.FixedIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FixedIP)(nil), (*FixedIP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FixedIP_To_v1alpha4_FixedIP(a.(*v1beta1.FixedIP), b.(*FixedIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Instance_To_v1beta1_Instance(a.(*Instance), b.(*v1beta1.Instance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Instance_To_v1alpha4_Instance(a.(*v1beta1.Instance), b.(*Instance), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1beta1.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LoadBalancer_To_v1beta1_LoadBalancer(a.(*LoadBalancer), b.(*v1beta1.LoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LoadBalancer_To_v1alpha4_LoadBalancer(a.(*v1beta1.LoadBalancer), b.(*LoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1beta1.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Network_To_v1beta1_Network(a.(*Network), b.(*v1beta1.Network), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Network_To_v1alpha4_Network(a.(*v1beta1.Network), b.(*Network), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkParam)(nil), (*v1beta1.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkParam_To_v1beta1_NetworkParam(a.(*NetworkParam), b.(*v1beta1.NetworkParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkParam)(nil), (*NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkParam_To_v1alpha4_NetworkParam(a.(*v1beta1.NetworkParam), b.(*NetworkParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1beta1.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(a.(*OpenStackCluster), b.(*v1beta1.OpenStackCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackCluster)(nil), (*OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster(a.(*v1beta1.OpenStackCluster), b.(*OpenStackCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterList)(nil), (*v1beta1.OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList(a.(*OpenStackClusterList), b.(*v1beta1.OpenStackClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterList)(nil), (*OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(a.(*v1beta1.OpenStackClusterList), b.(*OpenStackClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterSpec)(nil), (*v1beta1.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1beta1.OpenStackClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(a.(*v1beta1.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterStatus)(nil), (*v1beta1.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1beta1.OpenStackClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(a.(*v1beta1.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplate)(nil), (*v1beta1.OpenStackClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(a.(*OpenStackClusterTemplate), b.(*v1beta1.OpenStackClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterTemplate)(nil), (*OpenStackClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate(a.(*v1beta1.OpenStackClusterTemplate), b.(*OpenStackClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateList)(nil), (*v1beta1.OpenStackClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(a.(*OpenStackClusterTemplateList), b.(*v1beta1.OpenStackClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterTemplateList)(nil), (*OpenStackClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha4_OpenStackClusterTemplateList(a.(*v1beta1.OpenStackClusterTemplateList), b.(*OpenStackClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateResource)(nil), (*v1beta1.OpenStackClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(a.(*OpenStackClusterTemplateResource), b.(*v1beta1.OpenStackClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterTemplateResource)(nil), (*OpenStackClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource(a.(*v1beta1.OpenStackClusterTemplateResource), b.(*OpenStackClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplateSpec)(nil), (*v1beta1.OpenStackClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(a.(*OpenStackClusterTemplateSpec), b.(*v1beta1.OpenStackClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterTemplateSpec)(nil), (*OpenStackClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec(a.(*v1beta1.OpenStackClusterTemplateSpec), b.(*OpenStackClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackIdentityReference)(nil), (*v1beta1.OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(a.(*OpenStackIdentityReference), b.(*v1beta1.OpenStackIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackIdentityReference)(nil), (*OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackIdentityReference_To_v1alpha4_OpenStackIdentityReference(a.(*v1beta1.OpenStackIdentityReference), b.(*OpenStackIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1beta1.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine(a.(*OpenStackMachine), b.(*v1beta1.OpenStackMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachine)(nil), (*OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine(a.(*v1beta1.OpenStackMachine), b.(*OpenStackMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineList)(nil), (*v1beta1.OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList(a.(*OpenStackMachineList), b.(*v1beta1.OpenStackMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineList)(nil), (*OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(a.(*v1beta1.OpenStackMachineList), b.(*OpenStackMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineSpec)(nil), (*v1beta1.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1beta1.OpenStackMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(a.(*v1beta1.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1beta1.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1beta1.OpenStackMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(a.(*v1beta1.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplate)(nil), (*v1beta1.OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(a.(*OpenStackMachineTemplate), b.(*v1beta1.OpenStackMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplate)(nil), (*OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(a.(*v1beta1.OpenStackMachineTemplate), b.(*OpenStackMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateList)(nil), (*v1beta1.OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(a.(*OpenStackMachineTemplateList), b.(*v1beta1.OpenStackMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateList)(nil), (*OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(a.(*v1beta1.OpenStackMachineTemplateList), b.(*OpenStackMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateResource)(nil), (*v1beta1.OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(a.(*OpenStackMachineTemplateResource), b.(*v1beta1.OpenStackMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateResource)(nil), (*OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(a.(*v1beta1.OpenStackMachineTemplateResource), b.(*OpenStackMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateSpec)(nil), (*v1beta1.OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(a.(*OpenStackMachineTemplateSpec), b.(*v1beta1.OpenStackMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateSpec)(nil), (*OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(a.(*v1beta1.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PortOpts)(nil), (*v1beta1.PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_PortOpts_To_v1beta1_PortOpts(a.(*PortOpts), b.(*v1beta1.PortOpts), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.PortOpts)(nil), (*PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PortOpts_To_v1alpha4_PortOpts(a.(*v1beta1.PortOpts), b.(*PortOpts), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RootVolume)(nil), (*v1beta1.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RootVolume_To_v1beta1_RootVolume(a.(*RootVolume), b.(*v1beta1.RootVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RootVolume_To_v1alpha4_RootVolume(a.(*v1beta1.RootVolume), b.(*RootVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1beta1.Router)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Router_To_v1beta1_Router(a.(*Router), b.(*v1beta1.Router), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Router)(nil), (*Router)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Router_To_v1alpha4_Router(a.(*v1beta1.Router), b.(*Router), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1beta1.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(a.(*SecurityGroup), b.(*v1beta1.SecurityGroup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(a.(*v1beta1.SecurityGroup), b.(*SecurityGroup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecurityGroupFilter)(nil), (*v1beta1.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1beta1.SecurityGroupFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(a.(*v1beta1.SecurityGroupFilter), b.(*SecurityGroupFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecurityGroupParam)(nil), (*v1beta1.SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupParam_To_v1beta1_SecurityGroupParam(a.(*SecurityGroupParam), b.(*v1beta1.SecurityGroupParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupParam)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(a.(*v1beta1.SecurityGroupParam), b.(*SecurityGroupParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecurityGroupRule)(nil), (*v1beta1.SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupRule_To_v1beta1_SecurityGroupRule(a.(*SecurityGroupRule), b.(*v1beta1.SecurityGroupRule), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupRule)(nil), (*SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(a.(*v1beta1.SecurityGroupRule), b.(*SecurityGroupRule), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1beta1.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Subnet_To_v1beta1_Subnet(a.(*Subnet), b.(*v1beta1.Subnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Subnet_To_v1alpha4_Subnet(a.(*v1beta1.Subnet), b.(*Subnet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SubnetFilter)(nil), (*v1beta1.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(a.(*SubnetFilter), b.(*v1beta1.SubnetFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(a.(*v1beta1.SubnetFilter), b.(*SubnetFilter), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SubnetParam)(nil), (*v1beta1.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam(a.(*SubnetParam), b.(*v1beta1.SubnetParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetParam)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam(a.(*v1beta1.SubnetParam), b.(*SubnetParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1beta1.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1beta1.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_AddressPair_To_v1beta1_AddressPair(in *AddressPair, out *v1beta1.AddressPair, s conversion.Scope) error { - out.IPAddress = in.IPAddress - out.MACAddress = in.MACAddress - return nil -} - -// Convert_v1alpha4_AddressPair_To_v1beta1_AddressPair is an autogenerated conversion function. -func Convert_v1alpha4_AddressPair_To_v1beta1_AddressPair(in *AddressPair, out *v1beta1.AddressPair, s conversion.Scope) error { - return autoConvert_v1alpha4_AddressPair_To_v1beta1_AddressPair(in, out, s) -} - -func autoConvert_v1beta1_AddressPair_To_v1alpha4_AddressPair(in *v1beta1.AddressPair, out *AddressPair, s conversion.Scope) error { - out.IPAddress = in.IPAddress - out.MACAddress = in.MACAddress - return nil -} - -// Convert_v1beta1_AddressPair_To_v1alpha4_AddressPair is an autogenerated conversion function. -func Convert_v1beta1_AddressPair_To_v1alpha4_AddressPair(in *v1beta1.AddressPair, out *AddressPair, s conversion.Scope) error { - return autoConvert_v1beta1_AddressPair_To_v1alpha4_AddressPair(in, out, s) -} - -func autoConvert_v1alpha4_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { - out.Enabled = in.Enabled - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { - return err - } - out.AvailabilityZone = in.AvailabilityZone - return nil -} - -// Convert_v1alpha4_Bastion_To_v1beta1_Bastion is an autogenerated conversion function. -func Convert_v1alpha4_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { - return autoConvert_v1alpha4_Bastion_To_v1beta1_Bastion(in, out, s) -} - -func autoConvert_v1beta1_Bastion_To_v1alpha4_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { - out.Enabled = in.Enabled - if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { - return err - } - out.AvailabilityZone = in.AvailabilityZone - return nil -} - -// Convert_v1beta1_Bastion_To_v1alpha4_Bastion is an autogenerated conversion function. -func Convert_v1beta1_Bastion_To_v1alpha4_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { - return autoConvert_v1beta1_Bastion_To_v1alpha4_Bastion(in, out, s) -} - -func autoConvert_v1alpha4_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { - out.FixedIP = in.FixedIP - if err := Convert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1alpha4_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1alpha4_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in, out, s) -} - -func autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { - out.FixedIP = in.FixedIP - if err := Convert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1beta1_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in, out, s) -} - -func autoConvert_v1alpha4_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { - out.Status = in.Status - out.Name = in.Name - out.Description = in.Description - out.AdminStateUp = (*bool)(unsafe.Pointer(in.AdminStateUp)) - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.Shared = (*bool)(unsafe.Pointer(in.Shared)) - out.ID = in.ID - out.Marker = in.Marker - out.Limit = in.Limit - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1alpha4_Filter_To_v1beta1_Filter is an autogenerated conversion function. -func Convert_v1alpha4_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { - return autoConvert_v1alpha4_Filter_To_v1beta1_Filter(in, out, s) -} - -func autoConvert_v1beta1_Filter_To_v1alpha4_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { - out.Status = in.Status - out.Name = in.Name - out.Description = in.Description - out.AdminStateUp = (*bool)(unsafe.Pointer(in.AdminStateUp)) - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.Shared = (*bool)(unsafe.Pointer(in.Shared)) - out.ID = in.ID - out.Marker = in.Marker - out.Limit = in.Limit - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1beta1_Filter_To_v1alpha4_Filter is an autogenerated conversion function. -func Convert_v1beta1_Filter_To_v1alpha4_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { - return autoConvert_v1beta1_Filter_To_v1alpha4_Filter(in, out, s) -} - -func autoConvert_v1alpha4_FixedIP_To_v1beta1_FixedIP(in *FixedIP, out *v1beta1.FixedIP, s conversion.Scope) error { - out.SubnetID = in.SubnetID - out.IPAddress = in.IPAddress - return nil -} - -// Convert_v1alpha4_FixedIP_To_v1beta1_FixedIP is an autogenerated conversion function. -func Convert_v1alpha4_FixedIP_To_v1beta1_FixedIP(in *FixedIP, out *v1beta1.FixedIP, s conversion.Scope) error { - return autoConvert_v1alpha4_FixedIP_To_v1beta1_FixedIP(in, out, s) -} - -func autoConvert_v1beta1_FixedIP_To_v1alpha4_FixedIP(in *v1beta1.FixedIP, out *FixedIP, s conversion.Scope) error { - out.SubnetID = in.SubnetID - out.IPAddress = in.IPAddress - return nil -} - -// Convert_v1beta1_FixedIP_To_v1alpha4_FixedIP is an autogenerated conversion function. -func Convert_v1beta1_FixedIP_To_v1alpha4_FixedIP(in *v1beta1.FixedIP, out *FixedIP, s conversion.Scope) error { - return autoConvert_v1beta1_FixedIP_To_v1alpha4_FixedIP(in, out, s) -} - -func autoConvert_v1alpha4_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Trunk = in.Trunk - out.FailureDomain = in.FailureDomain - out.SecurityGroups = (*[]string)(unsafe.Pointer(in.SecurityGroups)) - out.Networks = (*[]v1beta1.Network)(unsafe.Pointer(in.Networks)) - out.Subnet = in.Subnet - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Image = in.Image - out.Flavor = in.Flavor - out.SSHKeyName = in.SSHKeyName - out.UserData = in.UserData - out.Metadata = *(*map[string]string)(unsafe.Pointer(&in.Metadata)) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - out.RootVolume = (*v1beta1.RootVolume)(unsafe.Pointer(in.RootVolume)) - out.ServerGroupID = in.ServerGroupID - out.State = v1beta1.InstanceState(in.State) - out.IP = in.IP - out.FloatingIP = in.FloatingIP - return nil -} - -// Convert_v1alpha4_Instance_To_v1beta1_Instance is an autogenerated conversion function. -func Convert_v1alpha4_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { - return autoConvert_v1alpha4_Instance_To_v1beta1_Instance(in, out, s) -} - -func autoConvert_v1beta1_Instance_To_v1alpha4_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Trunk = in.Trunk - out.FailureDomain = in.FailureDomain - out.SecurityGroups = (*[]string)(unsafe.Pointer(in.SecurityGroups)) - out.Networks = (*[]Network)(unsafe.Pointer(in.Networks)) - out.Subnet = in.Subnet - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Image = in.Image - out.Flavor = in.Flavor - out.SSHKeyName = in.SSHKeyName - out.UserData = in.UserData - out.Metadata = *(*map[string]string)(unsafe.Pointer(&in.Metadata)) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - out.RootVolume = (*RootVolume)(unsafe.Pointer(in.RootVolume)) - out.ServerGroupID = in.ServerGroupID - out.State = InstanceState(in.State) - out.IP = in.IP - out.FloatingIP = in.FloatingIP - return nil -} - -// Convert_v1beta1_Instance_To_v1alpha4_Instance is an autogenerated conversion function. -func Convert_v1beta1_Instance_To_v1alpha4_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { - return autoConvert_v1beta1_Instance_To_v1alpha4_Instance(in, out, s) -} - -func autoConvert_v1alpha4_LoadBalancer_To_v1beta1_LoadBalancer(in *LoadBalancer, out *v1beta1.LoadBalancer, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.IP = in.IP - out.InternalIP = in.InternalIP - return nil -} - -// Convert_v1alpha4_LoadBalancer_To_v1beta1_LoadBalancer is an autogenerated conversion function. -func Convert_v1alpha4_LoadBalancer_To_v1beta1_LoadBalancer(in *LoadBalancer, out *v1beta1.LoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha4_LoadBalancer_To_v1beta1_LoadBalancer(in, out, s) -} - -func autoConvert_v1beta1_LoadBalancer_To_v1alpha4_LoadBalancer(in *v1beta1.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.IP = in.IP - out.InternalIP = in.InternalIP - return nil -} - -// Convert_v1beta1_LoadBalancer_To_v1alpha4_LoadBalancer is an autogenerated conversion function. -func Convert_v1beta1_LoadBalancer_To_v1alpha4_LoadBalancer(in *v1beta1.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { - return autoConvert_v1beta1_LoadBalancer_To_v1alpha4_LoadBalancer(in, out, s) -} - -func autoConvert_v1alpha4_Network_To_v1beta1_Network(in *Network, out *v1beta1.Network, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Subnet = (*v1beta1.Subnet)(unsafe.Pointer(in.Subnet)) - out.PortOpts = (*v1beta1.PortOpts)(unsafe.Pointer(in.PortOpts)) - out.Router = (*v1beta1.Router)(unsafe.Pointer(in.Router)) - out.APIServerLoadBalancer = (*v1beta1.LoadBalancer)(unsafe.Pointer(in.APIServerLoadBalancer)) - return nil -} - -// Convert_v1alpha4_Network_To_v1beta1_Network is an autogenerated conversion function. -func Convert_v1alpha4_Network_To_v1beta1_Network(in *Network, out *v1beta1.Network, s conversion.Scope) error { - return autoConvert_v1alpha4_Network_To_v1beta1_Network(in, out, s) -} - -func autoConvert_v1beta1_Network_To_v1alpha4_Network(in *v1beta1.Network, out *Network, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Subnet = (*Subnet)(unsafe.Pointer(in.Subnet)) - out.PortOpts = (*PortOpts)(unsafe.Pointer(in.PortOpts)) - out.Router = (*Router)(unsafe.Pointer(in.Router)) - out.APIServerLoadBalancer = (*LoadBalancer)(unsafe.Pointer(in.APIServerLoadBalancer)) - return nil -} - -// Convert_v1beta1_Network_To_v1alpha4_Network is an autogenerated conversion function. -func Convert_v1beta1_Network_To_v1alpha4_Network(in *v1beta1.Network, out *Network, s conversion.Scope) error { - return autoConvert_v1beta1_Network_To_v1alpha4_Network(in, out, s) -} - -func autoConvert_v1alpha4_NetworkParam_To_v1beta1_NetworkParam(in *NetworkParam, out *v1beta1.NetworkParam, s conversion.Scope) error { - out.UUID = in.UUID - out.FixedIP = in.FixedIP - if err := Convert_v1alpha4_Filter_To_v1beta1_Filter(&in.Filter, &out.Filter, s); err != nil { - return err - } - out.Subnets = *(*[]v1beta1.SubnetParam)(unsafe.Pointer(&in.Subnets)) - return nil -} - -// Convert_v1alpha4_NetworkParam_To_v1beta1_NetworkParam is an autogenerated conversion function. -func Convert_v1alpha4_NetworkParam_To_v1beta1_NetworkParam(in *NetworkParam, out *v1beta1.NetworkParam, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkParam_To_v1beta1_NetworkParam(in, out, s) -} - -func autoConvert_v1beta1_NetworkParam_To_v1alpha4_NetworkParam(in *v1beta1.NetworkParam, out *NetworkParam, s conversion.Scope) error { - out.UUID = in.UUID - out.FixedIP = in.FixedIP - if err := Convert_v1beta1_Filter_To_v1alpha4_Filter(&in.Filter, &out.Filter, s); err != nil { - return err - } - out.Subnets = *(*[]SubnetParam)(unsafe.Pointer(&in.Subnets)) - return nil -} - -// Convert_v1beta1_NetworkParam_To_v1alpha4_NetworkParam is an autogenerated conversion function. -func Convert_v1beta1_NetworkParam_To_v1alpha4_NetworkParam(in *v1beta1.NetworkParam, out *NetworkParam, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkParam_To_v1alpha4_NetworkParam(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(in, out, s) -} - -func autoConvert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster is an autogenerated conversion function. -func Convert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackCluster_To_v1alpha4_OpenStackCluster(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in *OpenStackClusterList, out *v1beta1.OpenStackClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.OpenStackCluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in *OpenStackClusterList, out *v1beta1.OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in *v1beta1.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]OpenStackCluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in *v1beta1.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1beta1.OpenStackClusterSpec, s conversion.Scope) error { - out.CloudName = in.CloudName - out.NodeCIDR = in.NodeCIDR - if err := Convert_v1alpha4_Filter_To_v1beta1_Filter(&in.Network, &out.Network, s); err != nil { - return err - } - if err := Convert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - out.DNSNameservers = *(*[]string)(unsafe.Pointer(&in.DNSNameservers)) - out.ExternalRouterIPs = *(*[]v1beta1.ExternalRouterIPParam)(unsafe.Pointer(&in.ExternalRouterIPs)) - out.ExternalNetworkID = in.ExternalNetworkID - out.ManagedAPIServerLoadBalancer = in.ManagedAPIServerLoadBalancer - out.DisableAPIServerFloatingIP = in.DisableAPIServerFloatingIP - out.APIServerFloatingIP = in.APIServerFloatingIP - out.APIServerFixedIP = in.APIServerFixedIP - out.APIServerPort = in.APIServerPort - out.APIServerLoadBalancerAdditionalPorts = *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancerAdditionalPorts)) - out.ManagedSecurityGroups = in.ManagedSecurityGroups - out.AllowAllInClusterTraffic = in.AllowAllInClusterTraffic - out.DisablePortSecurity = in.DisablePortSecurity - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - out.ControlPlaneAvailabilityZones = *(*[]string)(unsafe.Pointer(&in.ControlPlaneAvailabilityZones)) - out.Bastion = (*v1beta1.Bastion)(unsafe.Pointer(in.Bastion)) - out.IdentityRef = (*v1beta1.OpenStackIdentityReference)(unsafe.Pointer(in.IdentityRef)) - return nil -} - -// Convert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1beta1.OpenStackClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in *v1beta1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { - out.CloudName = in.CloudName - out.NodeCIDR = in.NodeCIDR - if err := Convert_v1beta1_Filter_To_v1alpha4_Filter(&in.Network, &out.Network, s); err != nil { - return err - } - if err := Convert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - out.DNSNameservers = *(*[]string)(unsafe.Pointer(&in.DNSNameservers)) - out.ExternalRouterIPs = *(*[]ExternalRouterIPParam)(unsafe.Pointer(&in.ExternalRouterIPs)) - out.ExternalNetworkID = in.ExternalNetworkID - out.ManagedAPIServerLoadBalancer = in.ManagedAPIServerLoadBalancer - out.DisableAPIServerFloatingIP = in.DisableAPIServerFloatingIP - out.APIServerFloatingIP = in.APIServerFloatingIP - out.APIServerFixedIP = in.APIServerFixedIP - out.APIServerPort = in.APIServerPort - out.APIServerLoadBalancerAdditionalPorts = *(*[]int)(unsafe.Pointer(&in.APIServerLoadBalancerAdditionalPorts)) - out.ManagedSecurityGroups = in.ManagedSecurityGroups - out.AllowAllInClusterTraffic = in.AllowAllInClusterTraffic - out.DisablePortSecurity = in.DisablePortSecurity - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - out.ControlPlaneAvailabilityZones = *(*[]string)(unsafe.Pointer(&in.ControlPlaneAvailabilityZones)) - out.Bastion = (*Bastion)(unsafe.Pointer(in.Bastion)) - out.IdentityRef = (*OpenStackIdentityReference)(unsafe.Pointer(in.IdentityRef)) - return nil -} - -// Convert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in *v1beta1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1beta1.OpenStackClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Network = (*v1beta1.Network)(unsafe.Pointer(in.Network)) - out.ExternalNetwork = (*v1beta1.Network)(unsafe.Pointer(in.ExternalNetwork)) - out.FailureDomains = *(*apiv1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.ControlPlaneSecurityGroup = (*v1beta1.SecurityGroup)(unsafe.Pointer(in.ControlPlaneSecurityGroup)) - out.WorkerSecurityGroup = (*v1beta1.SecurityGroup)(unsafe.Pointer(in.WorkerSecurityGroup)) - out.BastionSecurityGroup = (*v1beta1.SecurityGroup)(unsafe.Pointer(in.BastionSecurityGroup)) - out.Bastion = (*v1beta1.Instance)(unsafe.Pointer(in.Bastion)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1beta1.OpenStackClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in *v1beta1.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Network = (*Network)(unsafe.Pointer(in.Network)) - out.ExternalNetwork = (*Network)(unsafe.Pointer(in.ExternalNetwork)) - out.FailureDomains = *(*apiv1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.ControlPlaneSecurityGroup = (*SecurityGroup)(unsafe.Pointer(in.ControlPlaneSecurityGroup)) - out.WorkerSecurityGroup = (*SecurityGroup)(unsafe.Pointer(in.WorkerSecurityGroup)) - out.BastionSecurityGroup = (*SecurityGroup)(unsafe.Pointer(in.BastionSecurityGroup)) - out.Bastion = (*Instance)(unsafe.Pointer(in.Bastion)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in *v1beta1.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in *OpenStackClusterTemplate, out *v1beta1.OpenStackClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in *OpenStackClusterTemplate, out *v1beta1.OpenStackClusterTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate(in *v1beta1.OpenStackClusterTemplate, out *OpenStackClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate(in *v1beta1.OpenStackClusterTemplate, out *OpenStackClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplate_To_v1alpha4_OpenStackClusterTemplate(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in *OpenStackClusterTemplateList, out *v1beta1.OpenStackClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.OpenStackClusterTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in *OpenStackClusterTemplateList, out *v1beta1.OpenStackClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateList_To_v1alpha4_OpenStackClusterTemplateList(in *v1beta1.OpenStackClusterTemplateList, out *OpenStackClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]OpenStackClusterTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha4_OpenStackClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha4_OpenStackClusterTemplateList(in *v1beta1.OpenStackClusterTemplateList, out *OpenStackClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateList_To_v1alpha4_OpenStackClusterTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in *OpenStackClusterTemplateResource, out *v1beta1.OpenStackClusterTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in *OpenStackClusterTemplateResource, out *v1beta1.OpenStackClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource(in *v1beta1.OpenStackClusterTemplateResource, out *OpenStackClusterTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource(in *v1beta1.OpenStackClusterTemplateResource, out *OpenStackClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in *OpenStackClusterTemplateSpec, out *v1beta1.OpenStackClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in *OpenStackClusterTemplateSpec, out *v1beta1.OpenStackClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec(in *v1beta1.OpenStackClusterTemplateSpec, out *OpenStackClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha4_OpenStackClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec(in *v1beta1.OpenStackClusterTemplateSpec, out *OpenStackClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha4_OpenStackClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in *OpenStackIdentityReference, out *v1beta1.OpenStackIdentityReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_v1alpha4_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in *OpenStackIdentityReference, out *v1beta1.OpenStackIdentityReference, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in, out, s) -} - -func autoConvert_v1beta1_OpenStackIdentityReference_To_v1alpha4_OpenStackIdentityReference(in *v1beta1.OpenStackIdentityReference, out *OpenStackIdentityReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_v1beta1_OpenStackIdentityReference_To_v1alpha4_OpenStackIdentityReference is an autogenerated conversion function. -func Convert_v1beta1_OpenStackIdentityReference_To_v1alpha4_OpenStackIdentityReference(in *v1beta1.OpenStackIdentityReference, out *OpenStackIdentityReference, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackIdentityReference_To_v1alpha4_OpenStackIdentityReference(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachine_To_v1beta1_OpenStackMachine(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachine_To_v1alpha4_OpenStackMachine(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in *OpenStackMachineList, out *v1beta1.OpenStackMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.OpenStackMachine)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in *OpenStackMachineList, out *v1beta1.OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in *v1beta1.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]OpenStackMachine)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in *v1beta1.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1beta1.OpenStackMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - out.CloudName = in.CloudName - out.Flavor = in.Flavor - out.Image = in.Image - out.SSHKeyName = in.SSHKeyName - out.Networks = *(*[]v1beta1.NetworkParam)(unsafe.Pointer(&in.Networks)) - out.Ports = *(*[]v1beta1.PortOpts)(unsafe.Pointer(&in.Ports)) - out.Subnet = in.Subnet - out.FloatingIP = in.FloatingIP - out.SecurityGroups = *(*[]v1beta1.SecurityGroupParam)(unsafe.Pointer(&in.SecurityGroups)) - out.Trunk = in.Trunk - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.ServerMetadata = *(*map[string]string)(unsafe.Pointer(&in.ServerMetadata)) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - out.RootVolume = (*v1beta1.RootVolume)(unsafe.Pointer(in.RootVolume)) - out.ServerGroupID = in.ServerGroupID - out.IdentityRef = (*v1beta1.OpenStackIdentityReference)(unsafe.Pointer(in.IdentityRef)) - return nil -} - -// Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1beta1.OpenStackMachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in *v1beta1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - out.CloudName = in.CloudName - out.Flavor = in.Flavor - out.Image = in.Image - out.SSHKeyName = in.SSHKeyName - out.Networks = *(*[]NetworkParam)(unsafe.Pointer(&in.Networks)) - out.Ports = *(*[]PortOpts)(unsafe.Pointer(&in.Ports)) - out.Subnet = in.Subnet - out.FloatingIP = in.FloatingIP - out.SecurityGroups = *(*[]SecurityGroupParam)(unsafe.Pointer(&in.SecurityGroups)) - out.Trunk = in.Trunk - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.ServerMetadata = *(*map[string]string)(unsafe.Pointer(&in.ServerMetadata)) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - out.RootVolume = (*RootVolume)(unsafe.Pointer(in.RootVolume)) - out.ServerGroupID = in.ServerGroupID - out.IdentityRef = (*OpenStackIdentityReference)(unsafe.Pointer(in.IdentityRef)) - return nil -} - -// Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in *v1beta1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1beta1.OpenStackMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*v1beta1.InstanceState)(unsafe.Pointer(in.InstanceState)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1beta1.OpenStackMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in *v1beta1.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*InstanceState)(unsafe.Pointer(in.InstanceState)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in *v1beta1.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1beta1.OpenStackMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.OpenStackMachineTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1beta1.OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in *v1beta1.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]OpenStackMachineTemplate)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in *v1beta1.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in, out, s) -} - -func autoConvert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_PortOpts_To_v1beta1_PortOpts(in *PortOpts, out *v1beta1.PortOpts, s conversion.Scope) error { - out.NetworkID = in.NetworkID - out.NameSuffix = in.NameSuffix - out.Description = in.Description - out.AdminStateUp = (*bool)(unsafe.Pointer(in.AdminStateUp)) - out.MACAddress = in.MACAddress - out.FixedIPs = *(*[]v1beta1.FixedIP)(unsafe.Pointer(&in.FixedIPs)) - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.SecurityGroups = (*[]string)(unsafe.Pointer(in.SecurityGroups)) - out.AllowedAddressPairs = *(*[]v1beta1.AddressPair)(unsafe.Pointer(&in.AllowedAddressPairs)) - out.Trunk = (*bool)(unsafe.Pointer(in.Trunk)) - out.HostID = in.HostID - out.VNICType = in.VNICType - out.Profile = *(*map[string]string)(unsafe.Pointer(&in.Profile)) - out.DisablePortSecurity = (*bool)(unsafe.Pointer(in.DisablePortSecurity)) - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1alpha4_PortOpts_To_v1beta1_PortOpts is an autogenerated conversion function. -func Convert_v1alpha4_PortOpts_To_v1beta1_PortOpts(in *PortOpts, out *v1beta1.PortOpts, s conversion.Scope) error { - return autoConvert_v1alpha4_PortOpts_To_v1beta1_PortOpts(in, out, s) -} - -func autoConvert_v1beta1_PortOpts_To_v1alpha4_PortOpts(in *v1beta1.PortOpts, out *PortOpts, s conversion.Scope) error { - out.NetworkID = in.NetworkID - out.NameSuffix = in.NameSuffix - out.Description = in.Description - out.AdminStateUp = (*bool)(unsafe.Pointer(in.AdminStateUp)) - out.MACAddress = in.MACAddress - out.FixedIPs = *(*[]FixedIP)(unsafe.Pointer(&in.FixedIPs)) - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.SecurityGroups = (*[]string)(unsafe.Pointer(in.SecurityGroups)) - out.AllowedAddressPairs = *(*[]AddressPair)(unsafe.Pointer(&in.AllowedAddressPairs)) - out.Trunk = (*bool)(unsafe.Pointer(in.Trunk)) - out.HostID = in.HostID - out.VNICType = in.VNICType - out.Profile = *(*map[string]string)(unsafe.Pointer(&in.Profile)) - out.DisablePortSecurity = (*bool)(unsafe.Pointer(in.DisablePortSecurity)) - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta1_PortOpts_To_v1alpha4_PortOpts is an autogenerated conversion function. -func Convert_v1beta1_PortOpts_To_v1alpha4_PortOpts(in *v1beta1.PortOpts, out *PortOpts, s conversion.Scope) error { - return autoConvert_v1beta1_PortOpts_To_v1alpha4_PortOpts(in, out, s) -} - -func autoConvert_v1alpha4_RootVolume_To_v1beta1_RootVolume(in *RootVolume, out *v1beta1.RootVolume, s conversion.Scope) error { - out.SourceType = in.SourceType - out.SourceUUID = in.SourceUUID - out.DeviceType = in.DeviceType - out.Size = in.Size - return nil -} - -// Convert_v1alpha4_RootVolume_To_v1beta1_RootVolume is an autogenerated conversion function. -func Convert_v1alpha4_RootVolume_To_v1beta1_RootVolume(in *RootVolume, out *v1beta1.RootVolume, s conversion.Scope) error { - return autoConvert_v1alpha4_RootVolume_To_v1beta1_RootVolume(in, out, s) -} - -func autoConvert_v1beta1_RootVolume_To_v1alpha4_RootVolume(in *v1beta1.RootVolume, out *RootVolume, s conversion.Scope) error { - out.SourceType = in.SourceType - out.SourceUUID = in.SourceUUID - out.DeviceType = in.DeviceType - out.Size = in.Size - return nil -} - -// Convert_v1beta1_RootVolume_To_v1alpha4_RootVolume is an autogenerated conversion function. -func Convert_v1beta1_RootVolume_To_v1alpha4_RootVolume(in *v1beta1.RootVolume, out *RootVolume, s conversion.Scope) error { - return autoConvert_v1beta1_RootVolume_To_v1alpha4_RootVolume(in, out, s) -} - -func autoConvert_v1alpha4_Router_To_v1beta1_Router(in *Router, out *v1beta1.Router, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1alpha4_Router_To_v1beta1_Router is an autogenerated conversion function. -func Convert_v1alpha4_Router_To_v1beta1_Router(in *Router, out *v1beta1.Router, s conversion.Scope) error { - return autoConvert_v1alpha4_Router_To_v1beta1_Router(in, out, s) -} - -func autoConvert_v1beta1_Router_To_v1alpha4_Router(in *v1beta1.Router, out *Router, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta1_Router_To_v1alpha4_Router is an autogenerated conversion function. -func Convert_v1beta1_Router_To_v1alpha4_Router(in *v1beta1.Router, out *Router, s conversion.Scope) error { - return autoConvert_v1beta1_Router_To_v1alpha4_Router(in, out, s) -} - -func autoConvert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Rules = *(*[]v1beta1.SecurityGroupRule)(unsafe.Pointer(&in.Rules)) - return nil -} - -// Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in, out, s) -} - -func autoConvert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.Rules = *(*[]SecurityGroupRule)(unsafe.Pointer(&in.Rules)) - return nil -} - -// Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup is an autogenerated conversion function. -func Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - return autoConvert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in, out, s) -} - -func autoConvert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in *SecurityGroupFilter, out *v1beta1.SecurityGroupFilter, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Description = in.Description - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.Limit = in.Limit - out.Marker = in.Marker - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in *SecurityGroupFilter, out *v1beta1.SecurityGroupFilter, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in, out, s) -} - -func autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in *v1beta1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Description = in.Description - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.Limit = in.Limit - out.Marker = in.Marker - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter is an autogenerated conversion function. -func Convert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in *v1beta1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { - return autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in, out, s) -} - -func autoConvert_v1alpha4_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *v1beta1.SecurityGroupParam, s conversion.Scope) error { - out.UUID = in.UUID - out.Name = in.Name - if err := Convert_v1alpha4_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_SecurityGroupParam_To_v1beta1_SecurityGroupParam is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *v1beta1.SecurityGroupParam, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in, out, s) -} - -func autoConvert_v1beta1_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in *v1beta1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { - out.UUID = in.UUID - out.Name = in.Name - if err := Convert_v1beta1_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_SecurityGroupParam_To_v1alpha4_SecurityGroupParam is an autogenerated conversion function. -func Convert_v1beta1_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in *v1beta1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { - return autoConvert_v1beta1_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in, out, s) -} - -func autoConvert_v1alpha4_SecurityGroupRule_To_v1beta1_SecurityGroupRule(in *SecurityGroupRule, out *v1beta1.SecurityGroupRule, s conversion.Scope) error { - out.Description = in.Description - out.ID = in.ID - out.Direction = in.Direction - out.EtherType = in.EtherType - out.SecurityGroupID = in.SecurityGroupID - out.PortRangeMin = in.PortRangeMin - out.PortRangeMax = in.PortRangeMax - out.Protocol = in.Protocol - out.RemoteGroupID = in.RemoteGroupID - out.RemoteIPPrefix = in.RemoteIPPrefix - return nil -} - -// Convert_v1alpha4_SecurityGroupRule_To_v1beta1_SecurityGroupRule is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupRule_To_v1beta1_SecurityGroupRule(in *SecurityGroupRule, out *v1beta1.SecurityGroupRule, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupRule_To_v1beta1_SecurityGroupRule(in, out, s) -} - -func autoConvert_v1beta1_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in *v1beta1.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { - out.Description = in.Description - out.ID = in.ID - out.Direction = in.Direction - out.EtherType = in.EtherType - out.SecurityGroupID = in.SecurityGroupID - out.PortRangeMin = in.PortRangeMin - out.PortRangeMax = in.PortRangeMax - out.Protocol = in.Protocol - out.RemoteGroupID = in.RemoteGroupID - out.RemoteIPPrefix = in.RemoteIPPrefix - return nil -} - -// Convert_v1beta1_SecurityGroupRule_To_v1alpha4_SecurityGroupRule is an autogenerated conversion function. -func Convert_v1beta1_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in *v1beta1.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { - return autoConvert_v1beta1_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in, out, s) -} - -func autoConvert_v1alpha4_Subnet_To_v1beta1_Subnet(in *Subnet, out *v1beta1.Subnet, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.CIDR = in.CIDR - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1alpha4_Subnet_To_v1beta1_Subnet is an autogenerated conversion function. -func Convert_v1alpha4_Subnet_To_v1beta1_Subnet(in *Subnet, out *v1beta1.Subnet, s conversion.Scope) error { - return autoConvert_v1alpha4_Subnet_To_v1beta1_Subnet(in, out, s) -} - -func autoConvert_v1beta1_Subnet_To_v1alpha4_Subnet(in *v1beta1.Subnet, out *Subnet, s conversion.Scope) error { - out.Name = in.Name - out.ID = in.ID - out.CIDR = in.CIDR - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -// Convert_v1beta1_Subnet_To_v1alpha4_Subnet is an autogenerated conversion function. -func Convert_v1beta1_Subnet_To_v1alpha4_Subnet(in *v1beta1.Subnet, out *Subnet, s conversion.Scope) error { - return autoConvert_v1beta1_Subnet_To_v1alpha4_Subnet(in, out, s) -} - -func autoConvert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(in *SubnetFilter, out *v1beta1.SubnetFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.EnableDHCP = (*bool)(unsafe.Pointer(in.EnableDHCP)) - out.NetworkID = in.NetworkID - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.IPVersion = in.IPVersion - out.GatewayIP = in.GatewayIP - out.CIDR = in.CIDR - out.IPv6AddressMode = in.IPv6AddressMode - out.IPv6RAMode = in.IPv6RAMode - out.ID = in.ID - out.SubnetPoolID = in.SubnetPoolID - out.Limit = in.Limit - out.Marker = in.Marker - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter is an autogenerated conversion function. -func Convert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(in *SubnetFilter, out *v1beta1.SubnetFilter, s conversion.Scope) error { - return autoConvert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(in, out, s) -} - -func autoConvert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(in *v1beta1.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.EnableDHCP = (*bool)(unsafe.Pointer(in.EnableDHCP)) - out.NetworkID = in.NetworkID - out.TenantID = in.TenantID - out.ProjectID = in.ProjectID - out.IPVersion = in.IPVersion - out.GatewayIP = in.GatewayIP - out.CIDR = in.CIDR - out.IPv6AddressMode = in.IPv6AddressMode - out.IPv6RAMode = in.IPv6RAMode - out.ID = in.ID - out.SubnetPoolID = in.SubnetPoolID - out.Limit = in.Limit - out.Marker = in.Marker - out.SortKey = in.SortKey - out.SortDir = in.SortDir - out.Tags = in.Tags - out.TagsAny = in.TagsAny - out.NotTags = in.NotTags - out.NotTagsAny = in.NotTagsAny - return nil -} - -// Convert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter is an autogenerated conversion function. -func Convert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(in *v1beta1.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { - return autoConvert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(in, out, s) -} - -func autoConvert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *v1beta1.SubnetParam, s conversion.Scope) error { - out.UUID = in.UUID - if err := Convert_v1alpha4_SubnetFilter_To_v1beta1_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam is an autogenerated conversion function. -func Convert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *v1beta1.SubnetParam, s conversion.Scope) error { - return autoConvert_v1alpha4_SubnetParam_To_v1beta1_SubnetParam(in, out, s) -} - -func autoConvert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam(in *v1beta1.SubnetParam, out *SubnetParam, s conversion.Scope) error { - out.UUID = in.UUID - if err := Convert_v1beta1_SubnetFilter_To_v1alpha4_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam is an autogenerated conversion function. -func Convert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam(in *v1beta1.SubnetParam, out *SubnetParam, s conversion.Scope) error { - return autoConvert_v1beta1_SubnetParam_To_v1alpha4_SubnetParam(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index e0a16bd74..000000000 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,1005 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AddressPair) DeepCopyInto(out *AddressPair) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddressPair. -func (in *AddressPair) DeepCopy() *AddressPair { - if in == nil { - return nil - } - out := new(AddressPair) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bastion) DeepCopyInto(out *Bastion) { - *out = *in - in.Instance.DeepCopyInto(&out.Instance) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bastion. -func (in *Bastion) DeepCopy() *Bastion { - if in == nil { - return nil - } - out := new(Bastion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalRouterIPParam) DeepCopyInto(out *ExternalRouterIPParam) { - *out = *in - in.Subnet.DeepCopyInto(&out.Subnet) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRouterIPParam. -func (in *ExternalRouterIPParam) DeepCopy() *ExternalRouterIPParam { - if in == nil { - return nil - } - out := new(ExternalRouterIPParam) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Filter) DeepCopyInto(out *Filter) { - *out = *in - if in.AdminStateUp != nil { - in, out := &in.AdminStateUp, &out.AdminStateUp - *out = new(bool) - **out = **in - } - if in.Shared != nil { - in, out := &in.Shared, &out.Shared - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. -func (in *Filter) DeepCopy() *Filter { - if in == nil { - return nil - } - out := new(Filter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FixedIP) DeepCopyInto(out *FixedIP) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FixedIP. -func (in *FixedIP) DeepCopy() *FixedIP { - if in == nil { - return nil - } - out := new(FixedIP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Instance) DeepCopyInto(out *Instance) { - *out = *in - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = new([]string) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = new([]Network) - if **in != nil { - in, out := *in, *out - *out = make([]Network, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Metadata != nil { - in, out := &in.Metadata, &out.Metadata - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ConfigDrive != nil { - in, out := &in.ConfigDrive, &out.ConfigDrive - *out = new(bool) - **out = **in - } - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(RootVolume) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance. -func (in *Instance) DeepCopy() *Instance { - if in == nil { - return nil - } - out := new(Instance) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer. -func (in *LoadBalancer) DeepCopy() *LoadBalancer { - if in == nil { - return nil - } - out := new(LoadBalancer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Network) DeepCopyInto(out *Network) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(Subnet) - (*in).DeepCopyInto(*out) - } - if in.PortOpts != nil { - in, out := &in.PortOpts, &out.PortOpts - *out = new(PortOpts) - (*in).DeepCopyInto(*out) - } - if in.Router != nil { - in, out := &in.Router, &out.Router - *out = new(Router) - (*in).DeepCopyInto(*out) - } - if in.APIServerLoadBalancer != nil { - in, out := &in.APIServerLoadBalancer, &out.APIServerLoadBalancer - *out = new(LoadBalancer) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. -func (in *Network) DeepCopy() *Network { - if in == nil { - return nil - } - out := new(Network) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkParam) DeepCopyInto(out *NetworkParam) { - *out = *in - in.Filter.DeepCopyInto(&out.Filter) - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]SubnetParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkParam. -func (in *NetworkParam) DeepCopy() *NetworkParam { - if in == nil { - return nil - } - out := new(NetworkParam) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackCluster) DeepCopyInto(out *OpenStackCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackCluster. -func (in *OpenStackCluster) DeepCopy() *OpenStackCluster { - if in == nil { - return nil - } - out := new(OpenStackCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackCluster) 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 *OpenStackClusterList) DeepCopyInto(out *OpenStackClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterList. -func (in *OpenStackClusterList) DeepCopy() *OpenStackClusterList { - if in == nil { - return nil - } - out := new(OpenStackClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackClusterList) 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 *OpenStackClusterSpec) DeepCopyInto(out *OpenStackClusterSpec) { - *out = *in - in.Network.DeepCopyInto(&out.Network) - in.Subnet.DeepCopyInto(&out.Subnet) - if in.DNSNameservers != nil { - in, out := &in.DNSNameservers, &out.DNSNameservers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExternalRouterIPs != nil { - in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs - *out = make([]ExternalRouterIPParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.APIServerLoadBalancerAdditionalPorts != nil { - in, out := &in.APIServerLoadBalancerAdditionalPorts, &out.APIServerLoadBalancerAdditionalPorts - *out = make([]int, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneAvailabilityZones != nil { - in, out := &in.ControlPlaneAvailabilityZones, &out.ControlPlaneAvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Bastion) - (*in).DeepCopyInto(*out) - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(OpenStackIdentityReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterSpec. -func (in *OpenStackClusterSpec) DeepCopy() *OpenStackClusterSpec { - if in == nil { - return nil - } - out := new(OpenStackClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterStatus) DeepCopyInto(out *OpenStackClusterStatus) { - *out = *in - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(Network) - (*in).DeepCopyInto(*out) - } - if in.ExternalNetwork != nil { - in, out := &in.ExternalNetwork, &out.ExternalNetwork - *out = new(Network) - (*in).DeepCopyInto(*out) - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(v1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.ControlPlaneSecurityGroup != nil { - in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.WorkerSecurityGroup != nil { - in, out := &in.WorkerSecurityGroup, &out.WorkerSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.BastionSecurityGroup != nil { - in, out := &in.BastionSecurityGroup, &out.BastionSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Instance) - (*in).DeepCopyInto(*out) - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterStatus. -func (in *OpenStackClusterStatus) DeepCopy() *OpenStackClusterStatus { - if in == nil { - return nil - } - out := new(OpenStackClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplate) DeepCopyInto(out *OpenStackClusterTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplate. -func (in *OpenStackClusterTemplate) DeepCopy() *OpenStackClusterTemplate { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackClusterTemplate) 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 *OpenStackClusterTemplateList) DeepCopyInto(out *OpenStackClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateList. -func (in *OpenStackClusterTemplateList) DeepCopy() *OpenStackClusterTemplateList { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackClusterTemplateList) 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 *OpenStackClusterTemplateResource) DeepCopyInto(out *OpenStackClusterTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateResource. -func (in *OpenStackClusterTemplateResource) DeepCopy() *OpenStackClusterTemplateResource { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplateSpec) DeepCopyInto(out *OpenStackClusterTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateSpec. -func (in *OpenStackClusterTemplateSpec) DeepCopy() *OpenStackClusterTemplateSpec { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackIdentityReference) DeepCopyInto(out *OpenStackIdentityReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackIdentityReference. -func (in *OpenStackIdentityReference) DeepCopy() *OpenStackIdentityReference { - if in == nil { - return nil - } - out := new(OpenStackIdentityReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachine) DeepCopyInto(out *OpenStackMachine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachine. -func (in *OpenStackMachine) DeepCopy() *OpenStackMachine { - if in == nil { - return nil - } - out := new(OpenStackMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachine) 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 *OpenStackMachineList) DeepCopyInto(out *OpenStackMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineList. -func (in *OpenStackMachineList) DeepCopy() *OpenStackMachineList { - if in == nil { - return nil - } - out := new(OpenStackMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineList) 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 *OpenStackMachineSpec) DeepCopyInto(out *OpenStackMachineSpec) { - *out = *in - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.InstanceID != nil { - in, out := &in.InstanceID, &out.InstanceID - *out = new(string) - **out = **in - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = make([]NetworkParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]PortOpts, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]SecurityGroupParam, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ServerMetadata != nil { - in, out := &in.ServerMetadata, &out.ServerMetadata - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ConfigDrive != nil { - in, out := &in.ConfigDrive, &out.ConfigDrive - *out = new(bool) - **out = **in - } - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(RootVolume) - **out = **in - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(OpenStackIdentityReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineSpec. -func (in *OpenStackMachineSpec) DeepCopy() *OpenStackMachineSpec { - if in == nil { - return nil - } - out := new(OpenStackMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineStatus) DeepCopyInto(out *OpenStackMachineStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]v1.NodeAddress, len(*in)) - copy(*out, *in) - } - if in.InstanceState != nil { - in, out := &in.InstanceState, &out.InstanceState - *out = new(InstanceState) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineStatus. -func (in *OpenStackMachineStatus) DeepCopy() *OpenStackMachineStatus { - if in == nil { - return nil - } - out := new(OpenStackMachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineTemplate) DeepCopyInto(out *OpenStackMachineTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplate. -func (in *OpenStackMachineTemplate) DeepCopy() *OpenStackMachineTemplate { - if in == nil { - return nil - } - out := new(OpenStackMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineTemplate) 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 *OpenStackMachineTemplateList) DeepCopyInto(out *OpenStackMachineTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackMachineTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateList. -func (in *OpenStackMachineTemplateList) DeepCopy() *OpenStackMachineTemplateList { - if in == nil { - return nil - } - out := new(OpenStackMachineTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineTemplateList) 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 *OpenStackMachineTemplateResource) DeepCopyInto(out *OpenStackMachineTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateResource. -func (in *OpenStackMachineTemplateResource) DeepCopy() *OpenStackMachineTemplateResource { - if in == nil { - return nil - } - out := new(OpenStackMachineTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineTemplateSpec) DeepCopyInto(out *OpenStackMachineTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineTemplateSpec. -func (in *OpenStackMachineTemplateSpec) DeepCopy() *OpenStackMachineTemplateSpec { - if in == nil { - return nil - } - out := new(OpenStackMachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PortOpts) DeepCopyInto(out *PortOpts) { - *out = *in - if in.AdminStateUp != nil { - in, out := &in.AdminStateUp, &out.AdminStateUp - *out = new(bool) - **out = **in - } - if in.FixedIPs != nil { - in, out := &in.FixedIPs, &out.FixedIPs - *out = make([]FixedIP, len(*in)) - copy(*out, *in) - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = new([]string) - if **in != nil { - in, out := *in, *out - *out = make([]string, len(*in)) - copy(*out, *in) - } - } - if in.AllowedAddressPairs != nil { - in, out := &in.AllowedAddressPairs, &out.AllowedAddressPairs - *out = make([]AddressPair, len(*in)) - copy(*out, *in) - } - if in.Trunk != nil { - in, out := &in.Trunk, &out.Trunk - *out = new(bool) - **out = **in - } - if in.Profile != nil { - in, out := &in.Profile, &out.Profile - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DisablePortSecurity != nil { - in, out := &in.DisablePortSecurity, &out.DisablePortSecurity - *out = new(bool) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortOpts. -func (in *PortOpts) DeepCopy() *PortOpts { - if in == nil { - return nil - } - out := new(PortOpts) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RootVolume) DeepCopyInto(out *RootVolume) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootVolume. -func (in *RootVolume) DeepCopy() *RootVolume { - if in == nil { - return nil - } - out := new(RootVolume) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Router) DeepCopyInto(out *Router) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Router. -func (in *Router) DeepCopy() *Router { - if in == nil { - return nil - } - out := new(Router) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { - *out = *in - if in.Rules != nil { - in, out := &in.Rules, &out.Rules - *out = make([]SecurityGroupRule, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. -func (in *SecurityGroup) DeepCopy() *SecurityGroup { - if in == nil { - return nil - } - out := new(SecurityGroup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupFilter) DeepCopyInto(out *SecurityGroupFilter) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupFilter. -func (in *SecurityGroupFilter) DeepCopy() *SecurityGroupFilter { - if in == nil { - return nil - } - out := new(SecurityGroupFilter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupParam) DeepCopyInto(out *SecurityGroupParam) { - *out = *in - out.Filter = in.Filter -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupParam. -func (in *SecurityGroupParam) DeepCopy() *SecurityGroupParam { - if in == nil { - return nil - } - out := new(SecurityGroupParam) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecurityGroupRule) DeepCopyInto(out *SecurityGroupRule) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroupRule. -func (in *SecurityGroupRule) DeepCopy() *SecurityGroupRule { - if in == nil { - return nil - } - out := new(SecurityGroupRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Subnet) DeepCopyInto(out *Subnet) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet. -func (in *Subnet) DeepCopy() *Subnet { - if in == nil { - return nil - } - out := new(Subnet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubnetFilter) DeepCopyInto(out *SubnetFilter) { - *out = *in - if in.EnableDHCP != nil { - in, out := &in.EnableDHCP, &out.EnableDHCP - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetFilter. -func (in *SubnetFilter) DeepCopy() *SubnetFilter { - if in == nil { - return nil - } - out := new(SubnetFilter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SubnetParam) DeepCopyInto(out *SubnetParam) { - *out = *in - in.Filter.DeepCopyInto(&out.Filter) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetParam. -func (in *SubnetParam) DeepCopy() *SubnetParam { - if in == nil { - return nil - } - out := new(SubnetParam) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/filter_convert.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/filter_convert.go new file mode 100644 index 000000000..759b6fca3 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/filter_convert.go @@ -0,0 +1,53 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "github.com/gophercloud/gophercloud/openstack/networking/v2/networks" + "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets" +) + +func (subnetFilter SubnetFilter) ToListOpt() subnets.ListOpts { + return subnets.ListOpts{ + Name: subnetFilter.Name, + Description: subnetFilter.Description, + ProjectID: subnetFilter.ProjectID, + IPVersion: subnetFilter.IPVersion, + GatewayIP: subnetFilter.GatewayIP, + CIDR: subnetFilter.CIDR, + IPv6AddressMode: subnetFilter.IPv6AddressMode, + IPv6RAMode: subnetFilter.IPv6RAMode, + ID: subnetFilter.ID, + Tags: subnetFilter.Tags, + TagsAny: subnetFilter.TagsAny, + NotTags: subnetFilter.NotTags, + NotTagsAny: subnetFilter.NotTagsAny, + } +} + +func (networkFilter NetworkFilter) ToListOpt() networks.ListOpts { + return networks.ListOpts{ + Name: networkFilter.Name, + Description: networkFilter.Description, + ProjectID: networkFilter.ProjectID, + ID: networkFilter.ID, + Tags: networkFilter.Tags, + TagsAny: networkFilter.TagsAny, + NotTags: networkFilter.NotTags, + NotTagsAny: networkFilter.NotTagsAny, + } +} diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/openstackcluster_types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/openstackcluster_types.go index ae08e9ee5..2dd0ea526 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/openstackcluster_types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/openstackcluster_types.go @@ -40,7 +40,7 @@ type OpenStackClusterSpec struct { NodeCIDR string `json:"nodeCidr,omitempty"` // If NodeCIDR cannot be set this can be used to detect an existing network. - Network Filter `json:"network,omitempty"` + Network NetworkFilter `json:"network,omitempty"` // If NodeCIDR cannot be set this can be used to detect an existing subnet. Subnet SubnetFilter `json:"subnet,omitempty"` diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/types.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/types.go index 7fc77e76c..a1555f17a 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/types.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/types.go @@ -62,28 +62,20 @@ type NetworkParam struct { // A fixed IPv4 address for the NIC. FixedIP string `json:"fixedIP,omitempty"` // Filters for optional network query - Filter Filter `json:"filter,omitempty"` + Filter NetworkFilter `json:"filter,omitempty"` // Subnet within a network to use Subnets []SubnetParam `json:"subnets,omitempty"` } -type Filter struct { - Status string `json:"status,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - AdminStateUp *bool `json:"adminStateUp,omitempty"` - TenantID string `json:"tenantId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - Shared *bool `json:"shared,omitempty"` - ID string `json:"id,omitempty"` - Marker string `json:"marker,omitempty"` - Limit int `json:"limit,omitempty"` - SortKey string `json:"sortKey,omitempty"` - SortDir string `json:"sortDir,omitempty"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` +type NetworkFilter struct { + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + ProjectID string `json:"projectId,omitempty"` + ID string `json:"id,omitempty"` + Tags string `json:"tags,omitempty"` + TagsAny string `json:"tagsAny,omitempty"` + NotTags string `json:"notTags,omitempty"` + NotTagsAny string `json:"notTagsAny,omitempty"` } type SubnetParam struct { @@ -99,9 +91,6 @@ type SubnetParam struct { type SubnetFilter struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` - EnableDHCP *bool `json:"enableDhcp,omitempty"` - NetworkID string `json:"networkId,omitempty"` - TenantID string `json:"tenantId,omitempty"` ProjectID string `json:"projectId,omitempty"` IPVersion int `json:"ipVersion,omitempty"` GatewayIP string `json:"gateway_ip,omitempty"` @@ -109,11 +98,6 @@ type SubnetFilter struct { IPv6AddressMode string `json:"ipv6AddressMode,omitempty"` IPv6RAMode string `json:"ipv6RaMode,omitempty"` ID string `json:"id,omitempty"` - SubnetPoolID string `json:"subnetpoolId,omitempty"` - Limit int `json:"limit,omitempty"` - Marker string `json:"marker,omitempty"` - SortKey string `json:"sortKey,omitempty"` - SortDir string `json:"sortDir,omitempty"` Tags string `json:"tags,omitempty"` TagsAny string `json:"tagsAny,omitempty"` NotTags string `json:"notTags,omitempty"` @@ -121,8 +105,9 @@ type SubnetFilter struct { } type PortOpts struct { - // ID of the OpenStack network on which to create the port. If unspecified, create the port on the default cluster network. - NetworkID string `json:"networkId,omitempty"` + // Network is a query for an openstack network that the port will be created or discovered on. + // This will fail if the query returns more than one network. + Network *NetworkFilter `json:"network,omitempty"` // Used to make the name of the port unique. If unspecified, instead the 0-based index of the port in the list is used. NameSuffix string `json:"nameSuffix,omitempty"` Description string `json:"description,omitempty"` @@ -158,8 +143,10 @@ type PortOpts struct { } type FixedIP struct { - SubnetID string `json:"subnetId"` - IPAddress string `json:"ipAddress,omitempty"` + // Subnet is an openstack subnet query that will return the id of a subnet to create + // the fixed IP of a port in. This query must not return more than one subnet. + Subnet *SubnetFilter `json:"subnet"` + IPAddress string `json:"ipAddress,omitempty"` } type AddressPair struct { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go index 6da7564a3..8f8f39dce 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1/zz_generated.deepcopy.go @@ -62,7 +62,7 @@ func (in *Bastion) DeepCopy() *Bastion { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExternalRouterIPParam) DeepCopyInto(out *ExternalRouterIPParam) { *out = *in - in.Subnet.DeepCopyInto(&out.Subnet) + out.Subnet = in.Subnet } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalRouterIPParam. @@ -76,35 +76,15 @@ func (in *ExternalRouterIPParam) DeepCopy() *ExternalRouterIPParam { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Filter) DeepCopyInto(out *Filter) { +func (in *FixedIP) DeepCopyInto(out *FixedIP) { *out = *in - if in.AdminStateUp != nil { - in, out := &in.AdminStateUp, &out.AdminStateUp - *out = new(bool) - **out = **in - } - if in.Shared != nil { - in, out := &in.Shared, &out.Shared - *out = new(bool) + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(SubnetFilter) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. -func (in *Filter) DeepCopy() *Filter { - if in == nil { - return nil - } - out := new(Filter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FixedIP) DeepCopyInto(out *FixedIP) { - *out = *in -} - // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FixedIP. func (in *FixedIP) DeepCopy() *FixedIP { if in == nil { @@ -227,16 +207,29 @@ func (in *Network) DeepCopy() *Network { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkFilter) DeepCopyInto(out *NetworkFilter) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFilter. +func (in *NetworkFilter) DeepCopy() *NetworkFilter { + if in == nil { + return nil + } + out := new(NetworkFilter) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkParam) DeepCopyInto(out *NetworkParam) { *out = *in - in.Filter.DeepCopyInto(&out.Filter) + out.Filter = in.Filter if in.Subnets != nil { in, out := &in.Subnets, &out.Subnets *out = make([]SubnetParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } } @@ -312,8 +305,8 @@ func (in *OpenStackClusterList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *OpenStackClusterSpec) DeepCopyInto(out *OpenStackClusterSpec) { *out = *in - in.Network.DeepCopyInto(&out.Network) - in.Subnet.DeepCopyInto(&out.Subnet) + out.Network = in.Network + out.Subnet = in.Subnet if in.DNSNameservers != nil { in, out := &in.DNSNameservers, &out.DNSNameservers *out = make([]string, len(*in)) @@ -322,9 +315,7 @@ func (in *OpenStackClusterSpec) DeepCopyInto(out *OpenStackClusterSpec) { if in.ExternalRouterIPs != nil { in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs *out = make([]ExternalRouterIPParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + copy(*out, *in) } if in.APIServerLoadBalancerAdditionalPorts != nil { in, out := &in.APIServerLoadBalancerAdditionalPorts, &out.APIServerLoadBalancerAdditionalPorts @@ -789,6 +780,11 @@ func (in *OpenStackMachineTemplateSpec) DeepCopy() *OpenStackMachineTemplateSpec // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PortOpts) DeepCopyInto(out *PortOpts) { *out = *in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(NetworkFilter) + **out = **in + } if in.AdminStateUp != nil { in, out := &in.AdminStateUp, &out.AdminStateUp *out = new(bool) @@ -797,7 +793,9 @@ func (in *PortOpts) DeepCopyInto(out *PortOpts) { if in.FixedIPs != nil { in, out := &in.FixedIPs, &out.FixedIPs *out = make([]FixedIP, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.SecurityGroups != nil { in, out := &in.SecurityGroups, &out.SecurityGroups @@ -971,11 +969,6 @@ func (in *Subnet) DeepCopy() *Subnet { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SubnetFilter) DeepCopyInto(out *SubnetFilter) { *out = *in - if in.EnableDHCP != nil { - in, out := &in.EnableDHCP, &out.EnableDHCP - *out = new(bool) - **out = **in - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetFilter. @@ -991,7 +984,7 @@ func (in *SubnetFilter) DeepCopy() *SubnetFilter { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SubnetParam) DeepCopyInto(out *SubnetParam) { *out = *in - in.Filter.DeepCopyInto(&out.Filter) + out.Filter = in.Filter } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetParam. diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/compute/instance.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/compute/instance.go index d37ec8687..ed344d34c 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/compute/instance.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/compute/instance.go @@ -27,9 +27,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints" "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" "github.com/gophercloud/gophercloud/openstack/imageservice/v2/images" - "github.com/gophercloud/gophercloud/openstack/networking/v2/networks" "github.com/gophercloud/gophercloud/openstack/networking/v2/ports" - "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets" "k8s.io/apimachinery/pkg/runtime" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" @@ -147,9 +145,22 @@ func (s *Service) constructNetworks(openStackCluster *infrav1.OpenStackCluster, if pOpts.Trunk == nil { pOpts.Trunk = &openStackMachine.Spec.Trunk } - if port.NetworkID != "" { + if port.Network != nil { + netID := port.Network.ID + if netID == "" { + netIDs, err := s.networkingService.GetNetworkIDsByFilter(port.Network.ToListOpt()) + if err != nil { + return nil, err + } + if len(netIDs) > 1 { + return nil, fmt.Errorf("network filter for port %s returns more than one result", port.NameSuffix) + } else if len(netIDs) == 0 { + return nil, fmt.Errorf("network filter for port %s returns no networks", port.NameSuffix) + } + netID = netIDs[0] + } nets = append(nets, infrav1.Network{ - ID: port.NetworkID, + ID: netID, Subnet: &infrav1.Subnet{}, PortOpts: pOpts, }) @@ -356,7 +367,7 @@ func (s *Service) getServerNetworks(networkParams []infrav1.NetworkParam) ([]inf addSubnet(netID, subnet.UUID) } else { - subnetOpts := subnets.ListOpts(subnet.Filter) + subnetOpts := subnet.Filter.ToListOpt() if netID != "" { subnetOpts.NetworkID = netID } @@ -379,13 +390,13 @@ func (s *Service) getServerNetworks(networkParams []infrav1.NetworkParam) ([]inf // If there is no explicit network UUID and no network filter, // we will look for subnets matching any given subnet filters in // all networks. - if networkParam.UUID != "" || networkParam.Filter == (infrav1.Filter{}) { + if networkParam.UUID != "" || networkParam.Filter == (infrav1.NetworkFilter{}) { if err := addSubnets(networkParam, networkParam.UUID); err != nil { return nil, err } continue } - opts := networks.ListOpts(networkParam.Filter) + opts := networkParam.Filter.ToListOpt() ids, err := s.networkingService.GetNetworkIDsByFilter(&opts) if err != nil { return nil, err diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/port.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/port.go index ef90af2c7..939940516 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/port.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/port.go @@ -116,8 +116,12 @@ func (s *Service) GetOrCreatePort(eventObject runtime.Object, clusterName string if len(portOpts.FixedIPs) > 0 { fips := make([]ports.IP, 0, len(portOpts.FixedIPs)+1) for _, fixedIP := range portOpts.FixedIPs { + subnetID, err := s.getSubnetIDForFixedIP(fixedIP.Subnet, net.ID) + if err != nil { + return nil, err + } fips = append(fips, ports.IP{ - SubnetID: fixedIP.SubnetID, + SubnetID: subnetID, IPAddress: fixedIP.IPAddress, }) } @@ -187,6 +191,32 @@ func (s *Service) GetOrCreatePort(eventObject runtime.Object, clusterName string return port, nil } +func (s *Service) getSubnetIDForFixedIP(subnet *infrav1.SubnetFilter, networkID string) (string, error) { + if subnet == nil { + return "", nil + } + // Do not query for subnets if UUID is already provided + if subnet.ID != "" { + return subnet.ID, nil + } + + opts := subnet.ToListOpt() + opts.NetworkID = networkID + subnets, err := s.client.ListSubnet(opts) + if err != nil { + return "", err + } + + switch len(subnets) { + case 0: + return "", fmt.Errorf("subnet query %v, returns no subnets", *subnet) + case 1: + return subnets[0].ID, nil + default: + return "", fmt.Errorf("subnet query %v, returns too many subnets: %v", *subnet, subnets) + } +} + func getPortProfile(p map[string]string) map[string]interface{} { portProfile := make(map[string]interface{}) for k, v := range p { diff --git a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/router.go b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/router.go index 1dab0310c..3f6b556ee 100644 --- a/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/router.go +++ b/vendor/sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/router.go @@ -157,7 +157,7 @@ func (s *Service) setRouterExternalIPs(openStackCluster *infrav1.OpenStackCluste for _, externalRouterIP := range openStackCluster.Spec.ExternalRouterIPs { subnetID := externalRouterIP.Subnet.UUID if subnetID == "" { - listOpts := subnets.ListOpts(externalRouterIP.Subnet.Filter) + listOpts := externalRouterIP.Subnet.Filter.ToListOpt() subnetsByFilter, err := s.GetSubnetsByFilter(&listOpts) if err != nil { return err diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_phase_types.go deleted file mode 100644 index 49471c1f6..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_phase_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// ClusterPhase is a string representation of a Cluster Phase. -// -// This type is a high-level indicator of the status of the Cluster as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Cluster, and controllers should not use the Cluster Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Cluster’s fields to make those decisions. -type ClusterPhase string - -const ( - // ClusterPhasePending is the first state a Cluster is assigned by - // Cluster API Cluster controller after being created. - ClusterPhasePending = ClusterPhase("Pending") - - // ClusterPhaseProvisioning is the state when the Cluster has a provider infrastructure - // object associated and can start provisioning. - ClusterPhaseProvisioning = ClusterPhase("Provisioning") - - // ClusterPhaseProvisioned is the state when its - // infrastructure has been created and configured. - ClusterPhaseProvisioned = ClusterPhase("Provisioned") - - // ClusterPhaseDeleting is the Cluster state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - ClusterPhaseDeleting = ClusterPhase("Deleting") - - // ClusterPhaseFailed is the Cluster state when the system - // might require user intervention. - ClusterPhaseFailed = ClusterPhase("Failed") - - // ClusterPhaseUnknown is returned if the Cluster state cannot be determined. - ClusterPhaseUnknown = ClusterPhase("Unknown") -) diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_types.go deleted file mode 100644 index 794363ab6..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/cluster_types.go +++ /dev/null @@ -1,434 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "net" - "strings" - - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // ClusterFinalizer is the finalizer used by the cluster controller to - // cleanup the cluster resources when a Cluster is being deleted. - ClusterFinalizer = "cluster.cluster.x-k8s.io" -) - -// ANCHOR: ClusterSpec - -// ClusterSpec defines the desired state of Cluster. -type ClusterSpec struct { - // Paused can be used to prevent controllers from processing the Cluster and all its associated objects. - // +optional - Paused bool `json:"paused,omitempty"` - - // Cluster network configuration. - // +optional - ClusterNetwork *ClusterNetwork `json:"clusterNetwork,omitempty"` - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` - - // ControlPlaneRef is an optional reference to a provider-specific resource that holds - // the details for provisioning the Control Plane for a Cluster. - // +optional - ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` - - // InfrastructureRef is a reference to a provider-specific resource that holds the details - // for provisioning infrastructure for a cluster in said provider. - // +optional - InfrastructureRef *corev1.ObjectReference `json:"infrastructureRef,omitempty"` - - // This encapsulates the topology for the cluster. - // NOTE: It is required to enable the ClusterTopology - // feature gate flag to activate managed topologies support; - // this feature is highly experimental, and parts of it might still be not implemented. - // +optional - Topology *Topology `json:"topology,omitempty"` -} - -// Topology encapsulates the information of the managed resources. -type Topology struct { - // The name of the ClusterClass object to create the topology. - Class string `json:"class"` - - // The Kubernetes version of the cluster. - Version string `json:"version"` - - // RolloutAfter performs a rollout of the entire cluster one component at a time, - // control plane first and then machine deployments. - // +optional - RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` - - // ControlPlane describes the cluster control plane. - // +optional - ControlPlane ControlPlaneTopology `json:"controlPlane"` - - // Workers encapsulates the different constructs that form the worker nodes - // for the cluster. - // +optional - Workers *WorkersTopology `json:"workers,omitempty"` -} - -// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. -type ControlPlaneTopology struct { - // Metadata is the metadata applied to the machines of the ControlPlane. - // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - // - // This field is supported if and only if the control plane provider template - // referenced in the ClusterClass is Machine based. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Replicas is the number of control plane nodes. - // If the value is nil, the ControlPlane object is created without the number of Replicas - // and it's assumed that the control plane controller does not implement support for this field. - // When specified against a control plane provider that lacks support for this field, this value will be ignored. - // +optional - Replicas *int32 `json:"replicas,omitempty"` -} - -// WorkersTopology represents the different sets of worker nodes in the cluster. -type WorkersTopology struct { - // MachineDeployments is a list of machine deployments in the cluster. - MachineDeployments []MachineDeploymentTopology `json:"machineDeployments,omitempty"` -} - -// MachineDeploymentTopology specifies the different parameters for a set of worker nodes in the topology. -// This set of nodes is managed by a MachineDeployment object whose lifecycle is managed by the Cluster controller. -type MachineDeploymentTopology struct { - // Metadata is the metadata applied to the machines of the MachineDeployment. - // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Class is the name of the MachineDeploymentClass used to create the set of worker nodes. - // This should match one of the deployment classes defined in the ClusterClass object - // mentioned in the `Cluster.Spec.Class` field. - Class string `json:"class"` - - // Name is the unique identifier for this MachineDeploymentTopology. - // The value is used with other unique identifiers to create a MachineDeployment's Name - // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, - // the values are hashed together. - Name string `json:"name"` - - // Replicas is the number of worker nodes belonging to this set. - // If the value is nil, the MachineDeployment is created without the number of Replicas (defaulting to zero) - // and it's assumed that an external entity (like cluster autoscaler) is responsible for the management - // of this value. - // +optional - Replicas *int32 `json:"replicas,omitempty"` -} - -// ANCHOR_END: ClusterSpec - -// ANCHOR: ClusterNetwork - -// ClusterNetwork specifies the different networking -// parameters for a cluster. -type ClusterNetwork struct { - // APIServerPort specifies the port the API Server should bind to. - // Defaults to 6443. - // +optional - APIServerPort *int32 `json:"apiServerPort,omitempty"` - - // The network ranges from which service VIPs are allocated. - // +optional - Services *NetworkRanges `json:"services,omitempty"` - - // The network ranges from which Pod networks are allocated. - // +optional - Pods *NetworkRanges `json:"pods,omitempty"` - - // Domain name for services. - // +optional - ServiceDomain string `json:"serviceDomain,omitempty"` -} - -// ANCHOR_END: ClusterNetwork - -// ANCHOR: NetworkRanges - -// NetworkRanges represents ranges of network addresses. -type NetworkRanges struct { - CIDRBlocks []string `json:"cidrBlocks"` -} - -func (n *NetworkRanges) String() string { - if n == nil { - return "" - } - return strings.Join(n.CIDRBlocks, ",") -} - -// ANCHOR_END: NetworkRanges - -// ANCHOR: ClusterStatus - -// ClusterStatus defines the observed state of Cluster. -type ClusterStatus struct { - // FailureDomains is a slice of failure domain objects synced from the infrastructure provider. - FailureDomains FailureDomains `json:"failureDomains,omitempty"` - - // FailureReason indicates that there is a fatal problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // +optional - FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` - - // FailureMessage indicates that there is a fatal problem reconciling the - // state, and will be set to a descriptive error message. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Phase represents the current phase of cluster actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ControlPlaneReady defines if the control plane is ready. - // +optional - ControlPlaneReady bool `json:"controlPlaneReady,omitempty"` - - // Conditions defines current service state of the cluster. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` -} - -// ANCHOR_END: ClusterStatus - -// SetTypedPhase sets the Phase field to the string representation of ClusterPhase. -func (c *ClusterStatus) SetTypedPhase(p ClusterPhase) { - c.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed ClusterPhase representation as described in `machine_phase_types.go`. -func (c *ClusterStatus) GetTypedPhase() ClusterPhase { - switch phase := ClusterPhase(c.Phase); phase { - case - ClusterPhasePending, - ClusterPhaseProvisioning, - ClusterPhaseProvisioned, - ClusterPhaseDeleting, - ClusterPhaseFailed: - return phase - default: - return ClusterPhaseUnknown - } -} - -// ANCHOR: APIEndpoint - -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // The hostname on which the API server is serving. - Host string `json:"host"` - - // The port on which the API server is serving. - Port int32 `json:"port"` -} - -// IsZero returns true if both host and port are zero values. -func (v APIEndpoint) IsZero() bool { - return v.Host == "" && v.Port == 0 -} - -// IsValid returns true if both host and port are non-zero values. -func (v APIEndpoint) IsValid() bool { - return v.Host != "" && v.Port != 0 -} - -// String returns a formatted version HOST:PORT of this APIEndpoint. -func (v APIEndpoint) String() string { - return net.JoinHostPort(v.Host, fmt.Sprintf("%d", v.Port)) -} - -// ANCHOR_END: APIEndpoint - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" - -// Cluster is the Schema for the clusters API. -type Cluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterSpec `json:"spec,omitempty"` - Status ClusterStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *Cluster) GetConditions() Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *Cluster) SetConditions(conditions Conditions) { - c.Status.Conditions = conditions -} - -// GetIPFamily returns a ClusterIPFamily from the configuration provided. -func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) { - var podCIDRs, serviceCIDRs []string - if c.Spec.ClusterNetwork != nil { - if c.Spec.ClusterNetwork.Pods != nil { - podCIDRs = c.Spec.ClusterNetwork.Pods.CIDRBlocks - } - if c.Spec.ClusterNetwork.Services != nil { - serviceCIDRs = c.Spec.ClusterNetwork.Services.CIDRBlocks - } - } - if len(podCIDRs) == 0 && len(serviceCIDRs) == 0 { - return IPv4IPFamily, nil - } - - podsIPFamily, err := ipFamilyForCIDRStrings(podCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("pods: %s", err) - } - if len(serviceCIDRs) == 0 { - return podsIPFamily, nil - } - - servicesIPFamily, err := ipFamilyForCIDRStrings(serviceCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("services: %s", err) - } - if len(podCIDRs) == 0 { - return servicesIPFamily, nil - } - - if podsIPFamily == DualStackIPFamily { - return DualStackIPFamily, nil - } else if podsIPFamily != servicesIPFamily { - return InvalidIPFamily, errors.New("pods and services IP family mismatch") - } - - return podsIPFamily, nil -} - -func ipFamilyForCIDRStrings(cidrs []string) (ClusterIPFamily, error) { - if len(cidrs) > 2 { - return InvalidIPFamily, errors.New("too many CIDRs specified") - } - var foundIPv4 bool - var foundIPv6 bool - for _, cidr := range cidrs { - ip, _, err := net.ParseCIDR(cidr) - if err != nil { - return InvalidIPFamily, fmt.Errorf("could not parse CIDR: %s", err) - } - if ip.To4() != nil { - foundIPv4 = true - } else { - foundIPv6 = true - } - } - switch { - case foundIPv4 && foundIPv6: - return DualStackIPFamily, nil - case foundIPv4: - return IPv4IPFamily, nil - case foundIPv6: - return IPv6IPFamily, nil - default: - return InvalidIPFamily, nil - } -} - -// ClusterIPFamily defines the types of supported IP families. -type ClusterIPFamily int - -// Define the ClusterIPFamily constants. -const ( - InvalidIPFamily ClusterIPFamily = iota - IPv4IPFamily - IPv6IPFamily - DualStackIPFamily -) - -func (f ClusterIPFamily) String() string { - return [...]string{"InvalidIPFamily", "IPv4IPFamily", "IPv6IPFamily", "DualStackIPFamily"}[f] -} - -// +kubebuilder:object:root=true - -// ClusterList contains a list of Cluster. -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Cluster{}, &ClusterList{}) -} - -// FailureDomains is a slice of FailureDomains. -type FailureDomains map[string]FailureDomainSpec - -// FilterControlPlane returns a FailureDomain slice containing only the domains suitable to be used -// for control plane nodes. -func (in FailureDomains) FilterControlPlane() FailureDomains { - res := make(FailureDomains) - for id, spec := range in { - if spec.ControlPlane { - res[id] = spec - } - } - return res -} - -// GetIDs returns a slice containing the ids for failure domains. -func (in FailureDomains) GetIDs() []*string { - ids := make([]*string, 0, len(in)) - for id := range in { - ids = append(ids, pointer.StringPtr(id)) - } - return ids -} - -// FailureDomainSpec is the Schema for Cluster API failure domains. -// It allows controllers to understand how many failure domains a cluster can optionally span across. -type FailureDomainSpec struct { - // ControlPlane determines if this failure domain is suitable for use by control plane machines. - // +optional - ControlPlane bool `json:"controlPlane"` - - // Attributes is a free form map of attributes an infrastructure provider might use or require. - // +optional - Attributes map[string]string `json:"attributes,omitempty"` -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/clusterclass_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/clusterclass_types.go deleted file mode 100644 index 14ad43b15..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/clusterclass_types.go +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" - -// ClusterClass is a template which can be used to create managed topologies. -type ClusterClass struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterClassSpec `json:"spec,omitempty"` -} - -// ClusterClassSpec describes the desired state of the ClusterClass. -type ClusterClassSpec struct { - // Infrastructure is a reference to a provider-specific template that holds - // the details for provisioning infrastructure specific cluster - // for the underlying provider. - // The underlying provider is responsible for the implementation - // of the template to an infrastructure cluster. - Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"` - - // ControlPlane is a reference to a local struct that holds the details - // for provisioning the Control Plane for the Cluster. - ControlPlane ControlPlaneClass `json:"controlPlane,omitempty"` - - // Workers describes the worker nodes for the cluster. - // It is a collection of node types which can be used to create - // the worker nodes of the cluster. - // +optional - Workers WorkersClass `json:"workers,omitempty"` -} - -// ControlPlaneClass defines the class for the control plane. -type ControlPlaneClass struct { - // Metadata is the metadata applied to the machines of the ControlPlane. - // At runtime this metadata is merged with the corresponding metadata from the topology. - // - // This field is supported if and only if the control plane provider template - // referenced is Machine based. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // LocalObjectTemplate contains the reference to the control plane provider. - LocalObjectTemplate `json:",inline"` - - // MachineTemplate defines the metadata and infrastructure information - // for control plane machines. - // - // This field is supported if and only if the control plane provider template - // referenced above is Machine based and supports setting replicas. - // - // +optional - MachineInfrastructure *LocalObjectTemplate `json:"machineInfrastructure,omitempty"` -} - -// WorkersClass is a collection of deployment classes. -type WorkersClass struct { - // MachineDeployments is a list of machine deployment classes that can be used to create - // a set of worker nodes. - MachineDeployments []MachineDeploymentClass `json:"machineDeployments,omitempty"` -} - -// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster -// provisioned using the `ClusterClass`. -type MachineDeploymentClass struct { - // Class denotes a type of worker node present in the cluster, - // this name MUST be unique within a ClusterClass and can be referenced - // in the Cluster to create a managed MachineDeployment. - Class string `json:"class"` - - // Template is a local struct containing a collection of templates for creation of - // MachineDeployment objects representing a set of worker nodes. - Template MachineDeploymentClassTemplate `json:"template"` -} - -// MachineDeploymentClassTemplate defines how a MachineDeployment generated from a MachineDeploymentClass -// should look like. -type MachineDeploymentClassTemplate struct { - // Metadata is the metadata applied to the machines of the MachineDeployment. - // At runtime this metadata is merged with the corresponding metadata from the topology. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Bootstrap contains the bootstrap template reference to be used - // for the creation of worker Machines. - Bootstrap LocalObjectTemplate `json:"bootstrap"` - - // Infrastructure contains the infrastructure template reference to be used - // for the creation of worker Machines. - Infrastructure LocalObjectTemplate `json:"infrastructure"` -} - -// LocalObjectTemplate defines a template for a topology Class. -type LocalObjectTemplate struct { - // Ref is a required reference to a custom resource - // offered by a provider. - Ref *corev1.ObjectReference `json:"ref"` -} - -// +kubebuilder:object:root=true - -// ClusterClassList contains a list of Cluster. -type ClusterClassList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterClass `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ClusterClass{}, &ClusterClassList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/common_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/common_types.go deleted file mode 100644 index 5a2143d99..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/common_types.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // ClusterLabelName is the label set on machines linked to a cluster and - // external objects(bootstrap and infrastructure providers). - ClusterLabelName = "cluster.x-k8s.io/cluster-name" - - // ClusterTopologyLabelName is the label set on all the object which are managed as part of a ClusterTopology. - // Deprecated: use ClusterTopologyOwnedLabel instead. - ClusterTopologyLabelName = "cluster.x-k8s.io/topology" - - // ClusterTopologyOwnedLabel is the label set on all the object which are managed as part of a ClusterTopology. - ClusterTopologyOwnedLabel = "topology.cluster.x-k8s.io/owned" - - // ClusterTopologyMachineDeploymentLabelName is the label set on the generated MachineDeployment objects - // to track the name of the MachineDeployment topology it represents. - ClusterTopologyMachineDeploymentLabelName = "topology.cluster.x-k8s.io/deployment-name" - - // ProviderLabelName is the label set on components in the provider manifest. - // This label allows to easily identify all the components belonging to a provider; the clusterctl - // tool uses this label for implementing provider's lifecycle operations. - ProviderLabelName = "cluster.x-k8s.io/provider" - - // ClusterNameAnnotation is the annotation set on nodes identifying the name of the cluster the node belongs to. - ClusterNameAnnotation = "cluster.x-k8s.io/cluster-name" - - // ClusterNamespaceAnnotation is the annotation set on nodes identifying the namespace of the cluster the node belongs to. - ClusterNamespaceAnnotation = "cluster.x-k8s.io/cluster-namespace" - - // MachineAnnotation is the annotation set on nodes identifying the machine the node belongs to. - MachineAnnotation = "cluster.x-k8s.io/machine" - - // OwnerKindAnnotation is the annotation set on nodes identifying the owner kind. - OwnerKindAnnotation = "cluster.x-k8s.io/owner-kind" - - // OwnerNameAnnotation is the annotation set on nodes identifying the owner name. - OwnerNameAnnotation = "cluster.x-k8s.io/owner-name" - - // PausedAnnotation is an annotation that can be applied to any Cluster API - // object to prevent a controller from processing a resource. - // - // Controllers working with Cluster API objects must check the existence of this annotation - // on the reconciled object. - PausedAnnotation = "cluster.x-k8s.io/paused" - - // DisableMachineCreate is an annotation that can be used to signal a MachineSet to stop creating new machines. - // It is utilized in the OnDelete MachineDeploymentStrategy to allow the MachineDeployment controller to scale down - // older MachineSets when Machines are deleted and add the new replicas to the latest MachineSet. - DisableMachineCreate = "cluster.x-k8s.io/disable-machine-create" - - // WatchLabel is a label othat can be applied to any Cluster API object. - // - // Controllers which allow for selective reconciliation may check this label and proceed - // with reconciliation of the object only if this label and a configured value is present. - WatchLabel = "cluster.x-k8s.io/watch-filter" - - // DeleteMachineAnnotation marks control plane and worker nodes that will be given priority for deletion - // when KCP or a machineset scales down. This annotation is given top priority on all delete policies. - DeleteMachineAnnotation = "cluster.x-k8s.io/delete-machine" - - // TemplateClonedFromNameAnnotation is the infrastructure machine annotation that stores the name of the infrastructure template resource - // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. - TemplateClonedFromNameAnnotation = "cluster.x-k8s.io/cloned-from-name" - - // TemplateClonedFromGroupKindAnnotation is the infrastructure machine annotation that stores the group-kind of the infrastructure template resource - // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. - TemplateClonedFromGroupKindAnnotation = "cluster.x-k8s.io/cloned-from-groupkind" - - // MachineSkipRemediationAnnotation is the annotation used to mark the machines that should not be considered for remediation by MachineHealthCheck reconciler. - MachineSkipRemediationAnnotation = "cluster.x-k8s.io/skip-remediation" - - // ClusterSecretType defines the type of secret created by core components. - ClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret" //nolint:gosec - - // InterruptibleLabel is the label used to mark the nodes that run on interruptible instances. - InterruptibleLabel = "cluster.x-k8s.io/interruptible" - - // ManagedByAnnotation is an annotation that can be applied to InfraCluster resources to signify that - // some external system is managing the cluster infrastructure. - // - // Provider InfraCluster controllers will ignore resources with this annotation. - // An external controller must fulfill the contract of the InfraCluster resource. - // External infrastructure providers should ensure that the annotation, once set, cannot be removed. - ManagedByAnnotation = "cluster.x-k8s.io/managed-by" -) - -const ( - // TemplateSuffix is the object kind suffix used by template types. - TemplateSuffix = "Template" -) - -var ( - // ZeroDuration is a zero value of the metav1.Duration type. - ZeroDuration = metav1.Duration{} -) - -const ( - // MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. - // Deprecated: Use api/v1alpha4/index.MachineNodeNameField instead. - MachineNodeNameIndex = "status.nodeRef.name" - - // MachineProviderIDIndex is used to index Machines by ProviderID. It's useful to find Machines - // in a management cluster from Nodes in a workload cluster. - // Deprecated: Use api/v1alpha4/index.MachineProviderIDField instead. - MachineProviderIDIndex = "spec.providerID" -) - -// MachineAddressType describes a valid MachineAddress type. -type MachineAddressType string - -// Define the MachineAddressType constants. -const ( - MachineHostName MachineAddressType = "Hostname" - MachineExternalIP MachineAddressType = "ExternalIP" - MachineInternalIP MachineAddressType = "InternalIP" - MachineExternalDNS MachineAddressType = "ExternalDNS" - MachineInternalDNS MachineAddressType = "InternalDNS" -) - -// MachineAddress contains information for the node's address. -type MachineAddress struct { - // Machine address type, one of Hostname, ExternalIP or InternalIP. - Type MachineAddressType `json:"type"` - - // The machine address. - Address string `json:"address"` -} - -// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. -type MachineAddresses []MachineAddress - -// ObjectMeta is metadata that all persisted resources must have, which includes all objects -// users must create. This is a copy of customizable fields from metav1.ObjectMeta. -// -// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, -// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases -// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies -// the API and some issues that can impact user experience. -// -// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) -// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, -// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. -// The investigation showed that `controller-tools@v2` behaves differently than its previous version -// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. -// -// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` -// had validation properties, including for `creationTimestamp` (metav1.Time). -// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` -// which breaks validation because the field isn't marked as nullable. -// -// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded -// types. When that happens, this hack should be revisited. -type ObjectMeta struct { - // Map of string keys and values that can be used to organize and categorize - // (scope and select) objects. May match selectors of replication controllers - // and services. - // More info: http://kubernetes.io/docs/user-guide/labels - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. They are not - // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations - // +optional - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_consts.go deleted file mode 100644 index f858910e0..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,253 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// ANCHOR: CommonConditions - -// Common ConditionTypes used by Cluster API objects. -const ( - // ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object. - ReadyCondition ConditionType = "Ready" -) - -// Common ConditionReason used by Cluster API objects. -const ( - // DeletingReason (Severity=Info) documents an condition not in Status=True because the underlying object it is currently being deleted. - DeletingReason = "Deleting" - - // DeletionFailedReason (Severity=Warning) documents an condition not in Status=True because the underlying object - // encountered problems during deletion. This is a warning because the reconciler will retry deletion. - DeletionFailedReason = "DeletionFailed" - - // DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted. - DeletedReason = "Deleted" - - // IncorrectExternalRefReason (Severity=Error) documents a CAPI object with an incorrect external object reference. - IncorrectExternalRefReason = "IncorrectExternalRef" -) - -const ( - // InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool. - // This condition is mirrored from the Ready condition in the infrastructure ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the infrastructure provider does not implement the Ready condition yet. - InfrastructureReadyCondition ConditionType = "InfrastructureReady" - - // WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure - // to be available. - // NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition. - WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" -) - -// ANCHOR_END: CommonConditions - -// Conditions and condition Reasons for the Cluster object - -const ( - // ControlPlaneInitializedCondition reports if the cluster's control plane has been initialized such that the - // cluster's apiserver is reachable and at least one control plane Machine has a node reference. Once this - // condition is marked true, its value is never changed. See the ControlPlaneReady condition for an indication of - // the current readiness of the cluster's control plane. - ControlPlaneInitializedCondition ConditionType = "ControlPlaneInitialized" - - // MissingNodeRefReason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have - // its node reference populated. - MissingNodeRefReason = "MissingNodeRef" - - // WaitingForControlPlaneProviderInitializedReason (Severity=Info) documents a cluster waiting for the control plane - // provider to report successful control plane initialization. - WaitingForControlPlaneProviderInitializedReason = "WaitingForControlPlaneProviderInitialized" - - // ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster. - // This condition is mirrored from the Ready condition in the control plane ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the control plane provider does not not implements the Ready condition yet. - ControlPlaneReadyCondition ConditionType = "ControlPlaneReady" - - // WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane - // to be available. - // NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition. - WaitingForControlPlaneFallbackReason = "WaitingForControlPlane" - - // WaitingForControlPlaneAvailableReason (Severity=Info) documents a Cluster API object - // waiting for the control plane machine to be available. - // - // NOTE: Having the control plane machine available is a pre-condition for joining additional control planes - // or workers nodes. - WaitingForControlPlaneAvailableReason = "WaitingForControlPlaneAvailable" -) - -// Conditions and condition Reasons for the Machine object - -const ( - // BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine. - // This condition is mirrored from the Ready condition in the bootstrap ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the bootstrap provider does not implement the Ready condition yet. - BootstrapReadyCondition ConditionType = "BootstrapReady" - - // WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret - // to be available. - // NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition. - WaitingForDataSecretFallbackReason = "WaitingForDataSecret" - - // DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine - // deletion process. - DrainingSucceededCondition ConditionType = "DrainingSucceeded" - - // DrainingReason (Severity=Info) documents a machine node being drained. - DrainingReason = "Draining" - - // DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed. - DrainingFailedReason = "DrainingFailed" - - // PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded" - - // PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded" - - // WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete. - WaitingExternalHookReason = "WaitingExternalHook" - - // VolumeDetachSucceededCondition reports a machine waiting for volumes to be detached. - VolumeDetachSucceededCondition ConditionType = "VolumeDetachSucceeded" - - // WaitingForVolumeDetachReason (Severity=Info) provide evidence that a machine node waiting for volumes to be attached. - WaitingForVolumeDetachReason = "WaitingForVolumeDetach" -) - -const ( - // MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller. - // In the event that the health check fails it will be set to False. - MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded" - - // MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. - MachineHasFailureReason = "MachineHasFailure" - - // NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout. - NodeStartupTimeoutReason = "NodeStartupTimeout" - - // UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. - UnhealthyNodeConditionReason = "UnhealthyNode" -) - -const ( - // MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. - // MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. - MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated" - - // WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed. - WaitingForRemediationReason = "WaitingForRemediation" - - // RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine. - RemediationFailedReason = "RemediationFailed" - - // RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner. - RemediationInProgressReason = "RemediationInProgress" - - // ExternalRemediationTemplateAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationTemplateAvailable is set to false if external remediation template is not found. - ExternalRemediationTemplateAvailable ConditionType = "ExternalRemediationTemplateAvailable" - - // ExternalRemediationTemplateNotFound is the reason used when a machine health check fails to find external remediation template. - ExternalRemediationTemplateNotFound = "ExternalRemediationTemplateNotFound" - - // ExternalRemediationRequestAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationRequestAvailable is set to false if creating external remediation request fails. - ExternalRemediationRequestAvailable ConditionType = "ExternalRemediationRequestAvailable" - - // ExternalRemediationRequestCreationFailed is the reason used when a machine health check fails to create external remediation request. - ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed" -) - -// Conditions and condition Reasons for the Machine's Node object. -const ( - // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. - // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True. - MachineNodeHealthyCondition ConditionType = "NodeHealthy" - - // WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet. - WaitingForNodeRefReason = "WaitingForNodeRef" - - // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. - // NB. provisioning --> NodeRef == "". - NodeProvisioningReason = "NodeProvisioning" - - // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. - // NB. provisioned --> NodeRef != "". - NodeNotFoundReason = "NodeNotFound" - - // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. - NodeConditionsFailedReason = "NodeConditionsFailed" -) - -// Conditions and condition Reasons for the MachineHealthCheck object - -const ( - // RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is - // allowed to remediate any Machines or whether it is blocked from remediating any further. - RemediationAllowedCondition ConditionType = "RemediationAllowed" - - // TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked - // from making any further remediations. - TooManyUnhealthyReason = "TooManyUnhealthy" -) - -// Conditions and condition Reasons for MachineDeployments - -const ( - // MachineDeploymentAvailableCondition means the MachineDeployment is available, that is, at least the minimum available - // machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds. - MachineDeploymentAvailableCondition ConditionType = "Available" - - // WaitingForAvailableMachinesReason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available. - WaitingForAvailableMachinesReason = "WaitingForAvailableMachines" -) - -// Conditions and condition Reasons for MachineSets - -const ( - // MachinesCreatedCondition documents that the machines controlled by the MachineSet are created. - // When this condition is false, it indicates that there was an error when cloning the infrastructure/bootstrap template or - // when generating the machine object. - MachinesCreatedCondition ConditionType = "MachinesCreated" - - // MachinesReadyCondition reports an aggregate of current status of the machines controlled by the MachineSet. - MachinesReadyCondition ConditionType = "MachinesReady" - - // BootstrapTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the bootstrap template. - BootstrapTemplateCloningFailedReason = "BootstrapTemplateCloningFailed" - - // InfrastructureTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the infrastructure template. - InfrastructureTemplateCloningFailedReason = "InfrastructureTemplateCloningFailed" - - // MachineCreationFailedReason (Severity=Error) documents a MachineSet failing to - // generate a machine object. - MachineCreationFailedReason = "MachineCreationFailed" - - // ResizedCondition documents a MachineSet is resizing the set of controlled machines. - ResizedCondition ConditionType = "Resized" - - // ScalingUpReason (Severity=Info) documents a MachineSet is increasing the number of replicas. - ScalingUpReason = "ScalingUp" - - // ScalingDownReason (Severity=Info) documents a MachineSet is decreasing the number of replicas. - ScalingDownReason = "ScalingDown" -) diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_types.go deleted file mode 100644 index 6c90c0b3e..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/condition_types.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ANCHOR: ConditionSeverity - -// ConditionSeverity expresses the severity of a Condition Type failing. -type ConditionSeverity string - -const ( - // ConditionSeverityError specifies that a condition with `Status=False` is an error. - ConditionSeverityError ConditionSeverity = "Error" - - // ConditionSeverityWarning specifies that a condition with `Status=False` is a warning. - ConditionSeverityWarning ConditionSeverity = "Warning" - - // ConditionSeverityInfo specifies that a condition with `Status=False` is informative. - ConditionSeverityInfo ConditionSeverity = "Info" - - // ConditionSeverityNone should apply only to conditions with `Status=True`. - ConditionSeverityNone ConditionSeverity = "" -) - -// ANCHOR_END: ConditionSeverity - -// ANCHOR: ConditionType - -// ConditionType is a valid value for Condition.Type. -type ConditionType string - -// ANCHOR_END: ConditionType - -// ANCHOR: Condition - -// Condition defines an observation of a Cluster API resource operational state. -type Condition struct { - // Type of condition in CamelCase or in foo.example.com/CamelCase. - // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions - // can be useful (see .node.status.conditions), the ability to deconflict is important. - // +required - Type ConditionType `json:"type"` - - // Status of the condition, one of True, False, Unknown. - // +required - Status corev1.ConditionStatus `json:"status"` - - // Severity provides an explicit classification of Reason code, so the users or machines can immediately - // understand the current situation and act accordingly. - // The Severity field MUST be set only when Status=False. - // +optional - Severity ConditionSeverity `json:"severity,omitempty"` - - // Last time the condition transitioned from one status to another. - // This should be when the underlying condition changed. If that is not known, then using the time when - // the API field changed is acceptable. - // +required - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - - // The reason for the condition's last transition in CamelCase. - // The specific API may choose whether or not this field is considered a guaranteed API. - // This field may not be empty. - // +optional - Reason string `json:"reason,omitempty"` - - // A human readable message indicating details about the transition. - // This field may be empty. - // +optional - Message string `json:"message,omitempty"` -} - -// ANCHOR_END: Condition - -// ANCHOR: Conditions - -// Conditions provide observations of the operational state of a Cluster API resource. -type Conditions []Condition - -// ANCHOR_END: Conditions diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/conversion.go deleted file mode 100644 index f25d9d544..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/conversion.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.Cluster) - - return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(src, dst, nil) -} - -func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.Cluster) - - return Convert_v1beta1_Cluster_To_v1alpha4_Cluster(src, dst, nil) -} - -func (src *ClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.ClusterList) - - return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(src, dst, nil) -} - -func (dst *ClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.ClusterList) - - return Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(src, dst, nil) -} - -func (src *ClusterClass) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.ClusterClass) - - return Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(src, dst, nil) -} - -func (dst *ClusterClass) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.ClusterClass) - - return Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(src, dst, nil) -} - -func (src *ClusterClassList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.ClusterClassList) - - return Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(src, dst, nil) -} - -func (dst *ClusterClassList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.ClusterClassList) - - return Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(src, dst, nil) -} - -func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.Machine) - - return Convert_v1alpha4_Machine_To_v1beta1_Machine(src, dst, nil) -} - -func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.Machine) - - return Convert_v1beta1_Machine_To_v1alpha4_Machine(src, dst, nil) -} - -func (src *MachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineList) - - return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(src, dst, nil) -} - -func (dst *MachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineList) - - return Convert_v1beta1_MachineList_To_v1alpha4_MachineList(src, dst, nil) -} - -func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineSet) - - return Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(src, dst, nil) -} - -func (dst *MachineSet) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineSet) - - return Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(src, dst, nil) -} - -func (src *MachineSetList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineSetList) - - return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(src, dst, nil) -} - -func (dst *MachineSetList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineSetList) - - return Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(src, dst, nil) -} - -func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineDeployment) - - return Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(src, dst, nil) -} - -func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineDeployment) - - return Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(src, dst, nil) -} - -func (src *MachineDeploymentList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineDeploymentList) - - return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(src, dst, nil) -} - -func (dst *MachineDeploymentList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineDeploymentList) - - return Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(src, dst, nil) -} - -func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineHealthCheck) - - return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(src, dst, nil) -} - -func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineHealthCheck) - - return Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(src, dst, nil) -} - -func (src *MachineHealthCheckList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1beta1.MachineHealthCheckList) - - return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(src, dst, nil) -} - -func (dst *MachineHealthCheckList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1beta1.MachineHealthCheckList) - - return Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(src, dst, nil) -} - -func Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s apiconversion.Scope) error { - // Status.version has been removed in v1beta1, thus requiring custom conversion function. the information will be dropped. - return autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/doc.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/doc.go deleted file mode 100644 index ca3c5da05..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1beta1 -package v1alpha4 diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 382657c78..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the cluster v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=cluster.x-k8s.io -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_phase_types.go deleted file mode 100644 index a2edb1107..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_phase_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// MachinePhase is a string representation of a Machine Phase. -// -// This type is a high-level indicator of the status of the Machine as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Machine, and controllers should not use the Machine Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Machine’s fields to make those decisions. -type MachinePhase string - -const ( - // MachinePhasePending is the first state a Machine is assigned by - // Cluster API Machine controller after being created. - MachinePhasePending = MachinePhase("Pending") - - // MachinePhaseProvisioning is the state when the - // Machine infrastructure is being created. - MachinePhaseProvisioning = MachinePhase("Provisioning") - - // MachinePhaseProvisioned is the state when its - // infrastructure has been created and configured. - MachinePhaseProvisioned = MachinePhase("Provisioned") - - // MachinePhaseRunning is the Machine state when it has - // become a Kubernetes Node in a Ready state. - MachinePhaseRunning = MachinePhase("Running") - - // MachinePhaseDeleting is the Machine state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - MachinePhaseDeleting = MachinePhase("Deleting") - - // MachinePhaseDeleted is the Machine state when the object - // and the related infrastructure is deleted and - // ready to be garbage collected by the API Server. - MachinePhaseDeleted = MachinePhase("Deleted") - - // MachinePhaseFailed is the Machine state when the system - // might require user intervention. - MachinePhaseFailed = MachinePhase("Failed") - - // MachinePhaseUnknown is returned if the Machine state cannot be determined. - MachinePhaseUnknown = MachinePhase("Unknown") -) diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_types.go deleted file mode 100644 index fad4b798e..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machine_types.go +++ /dev/null @@ -1,275 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineFinalizer is set on PrepareForCreate callback. - MachineFinalizer = "machine.cluster.x-k8s.io" - - // MachineControlPlaneLabelName is the label set on machines or related objects that are part of a control plane. - MachineControlPlaneLabelName = "cluster.x-k8s.io/control-plane" - - // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set. - ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" - - // MachineSetLabelName is the label set on machines if they're controlled by MachineSet. - MachineSetLabelName = "cluster.x-k8s.io/set-name" - - // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment. - MachineDeploymentLabelName = "cluster.x-k8s.io/deployment-name" - - // PreDrainDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-drain.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // draining the associated node until all are removed. - PreDrainDeleteHookAnnotationPrefix = "pre-drain.delete.hook.machine.cluster.x-k8s.io" - - // PreTerminateDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-terminate.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // an instance from an infrastructure provider until all are removed. - PreTerminateDeleteHookAnnotationPrefix = "pre-terminate.delete.hook.machine.cluster.x-k8s.io" -) - -// ANCHOR: MachineSpec - -// MachineSpec defines the desired state of Machine. -type MachineSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Bootstrap is a reference to a local struct which encapsulates - // fields to configure the Machine’s bootstrapping mechanism. - Bootstrap Bootstrap `json:"bootstrap"` - - // InfrastructureRef is a required reference to a custom resource - // offered by an infrastructure provider. - InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` - - // Version defines the desired Kubernetes version. - // This field is meant to be optionally used by bootstrap providers. - // +optional - Version *string `json:"version,omitempty"` - - // ProviderID is the identification ID of the machine provided by the provider. - // This field must match the provider ID as seen on the node object corresponding to this machine. - // This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - // with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - // machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - // generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - // able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - // and then a comparison is done to find out unregistered machines and are marked for delete. - // This field will be set by the actuators and consumed by higher level entities like autoscaler that will - // be interfacing with cluster-api as generic provider. - // +optional - ProviderID *string `json:"providerID,omitempty"` - - // FailureDomain is the failure domain the machine will be created in. - // Must match a key in the FailureDomains map stored on the cluster object. - // +optional - FailureDomain *string `json:"failureDomain,omitempty"` - - // NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` -} - -// ANCHOR_END: MachineSpec - -// ANCHOR: MachineStatus - -// MachineStatus defines the observed state of Machine. -type MachineStatus struct { - // NodeRef will point to the corresponding Node if it exists. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // NodeInfo is a set of ids/uuids to uniquely identify the node. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#info - // +optional - NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"` - - // LastUpdated identifies when the phase of the Machine last transitioned. - // +optional - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // Version specifies the current version of Kubernetes running - // on the corresponding Node. This is meant to be a means of bubbling - // up status from the Node to the Machine. - // It is entirely optional, but useful for end-user UX if it’s present. - // +optional - Version *string `json:"version,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Addresses is a list of addresses assigned to the machine. - // This field is copied from the infrastructure provider reference. - // +optional - Addresses MachineAddresses `json:"addresses,omitempty"` - - // Phase represents the current phase of machine actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // BootstrapReady is the state of the bootstrap provider. - // +optional - BootstrapReady bool `json:"bootstrapReady"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the Machine. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineStatus - -// SetTypedPhase sets the Phase field to the string representation of MachinePhase. -func (m *MachineStatus) SetTypedPhase(p MachinePhase) { - m.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachinePhase representation as described in `machine_phase_types.go`. -func (m *MachineStatus) GetTypedPhase() MachinePhase { - switch phase := MachinePhase(m.Phase); phase { - case - MachinePhasePending, - MachinePhaseProvisioning, - MachinePhaseProvisioned, - MachinePhaseRunning, - MachinePhaseDeleting, - MachinePhaseDeleted, - MachinePhaseFailed: - return phase - default: - return MachinePhaseUnknown - } -} - -// ANCHOR: Bootstrap - -// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism. -type Bootstrap struct { - // ConfigRef is a reference to a bootstrap provider-specific resource - // that holds configuration details. The reference is optional to - // allow users/operators to specify Bootstrap.DataSecretName without - // the need of a controller. - // +optional - ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"` - - // DataSecretName is the name of the secret that stores the bootstrap data script. - // If nil, the Machine should remain in the Pending state. - // +optional - DataSecretName *string `json:"dataSecretName,omitempty"` -} - -// ANCHOR_END: Bootstrap - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" -// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" -// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 - -// Machine is the Schema for the machines API. -type Machine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSpec `json:"spec,omitempty"` - Status MachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *Machine) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *Machine) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineList contains a list of Machine. -type MachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Machine `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Machine{}, &MachineList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinedeployment_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinedeployment_types.go deleted file mode 100644 index 1882094c5..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinedeployment_types.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - // MachineDeploymentTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineDeployment is being deleted. - MachineDeploymentTopologyFinalizer = "machinedeployment.topology.cluster.x-k8s.io" -) - -// MachineDeploymentStrategyType defines the type of MachineDeployment rollout strategies. -type MachineDeploymentStrategyType string - -const ( - // RollingUpdateMachineDeploymentStrategyType replaces the old MachineSet by new one using rolling update - // i.e. gradually scale down the old MachineSet and scale up the new one. - RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" - - // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. - OnDeleteMachineDeploymentStrategyType MachineDeploymentStrategyType = "OnDelete" - - // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence. - RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" - - // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. - RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" - - // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation - // in its machine sets. Helps in separating scaling events from the rollout process and for - // determining if the new machine set for a deployment is really saturated. - DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" - - // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which - // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their - // proportions in case the deployment has surge replicas. - MaxReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/max-replicas" - - // MachineDeploymentUniqueLabel is the label applied to Machines - // in a MachineDeployment containing the hash of the template. - MachineDeploymentUniqueLabel = "machine-template-hash" -) - -// ANCHOR: MachineDeploymentSpec - -// MachineDeploymentSpec defines the desired state of MachineDeployment. -type MachineDeploymentSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Number of desired machines. Defaults to 1. - // This is a pointer to distinguish between explicit zero and not specified. - // +optional - // +kubebuilder:default=1 - Replicas *int32 `json:"replicas,omitempty"` - - // Label selector for machines. Existing MachineSets whose machines are - // selected by this will be the ones affected by this deployment. - // It must match the machine template's labels. - Selector metav1.LabelSelector `json:"selector"` - - // Template describes the machines that will be created. - Template MachineTemplateSpec `json:"template"` - - // The deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // Minimum number of seconds for which a newly created machine should - // be ready. - // Defaults to 0 (machine will be considered available as soon as it - // is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // The number of old MachineSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // +optional - RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - - // Indicates that the deployment is paused. - // +optional - Paused bool `json:"paused,omitempty"` - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` -} - -// ANCHOR_END: MachineDeploymentSpec - -// ANCHOR: MachineDeploymentStrategy - -// MachineDeploymentStrategy describes how to replace existing machines -// with new ones. -type MachineDeploymentStrategy struct { - // Type of deployment. - // Default is RollingUpdate. - // +kubebuilder:validation:Enum=RollingUpdate;OnDelete - // +optional - Type MachineDeploymentStrategyType `json:"type,omitempty"` - - // Rolling update config params. Present only if - // MachineDeploymentStrategyType = RollingUpdate. - // +optional - RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStrategy - -// ANCHOR: MachineRollingUpdateDeployment - -// MachineRollingUpdateDeployment is used to control the desired behavior of rolling update. -type MachineRollingUpdateDeployment struct { - // The maximum number of machines that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired - // machines (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 0. - // Example: when this is set to 30%, the old MachineSet can be scaled - // down to 70% of desired machines immediately when the rolling update - // starts. Once new machines are ready, old MachineSet can be scaled - // down further, followed by scaling up the new MachineSet, ensuring - // that the total number of machines available at all times - // during the update is at least 70% of desired machines. - // +optional - MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - - // The maximum number of machines that can be scheduled above the - // desired number of machines. - // Value can be an absolute number (ex: 5) or a percentage of - // desired machines (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 1. - // Example: when this is set to 30%, the new MachineSet can be scaled - // up immediately when the rolling update starts, such that the total - // number of old and new machines do not exceed 130% of desired - // machines. Once old machines have been killed, new MachineSet can - // be scaled up further, ensuring that total number of machines running - // at any time during the update is at most 130% of desired machines. - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` - - // DeletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. - // Valid values are "Random, "Newest", "Oldest" - // When no value is supplied, the default DeletePolicy of MachineSet is used - // +kubebuilder:validation:Enum=Random;Newest;Oldest - // +optional - DeletePolicy *string `json:"deletePolicy,omitempty"` -} - -// ANCHOR_END: MachineRollingUpdateDeployment - -// ANCHOR: MachineDeploymentStatus - -// MachineDeploymentStatus defines the observed state of MachineDeployment. -type MachineDeploymentStatus struct { - // The generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` - - // Total number of ready machines targeted by this deployment. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // Total number of available machines (ready for at least minReadySeconds) - // targeted by this deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // Total number of unavailable machines targeted by this deployment. - // This is the total number of machines that are still required for - // the deployment to have 100% available capacity. They may either - // be machines that are running but not yet available or machines - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` - - // Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). - // +optional - Phase string `json:"phase,omitempty"` - - // Conditions defines current service state of the MachineDeployment. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStatus - -// MachineDeploymentPhase indicates the progress of the machine deployment. -type MachineDeploymentPhase string - -const ( - // MachineDeploymentPhaseScalingUp indicates the MachineDeployment is scaling up. - MachineDeploymentPhaseScalingUp = MachineDeploymentPhase("ScalingUp") - - // MachineDeploymentPhaseScalingDown indicates the MachineDeployment is scaling down. - MachineDeploymentPhaseScalingDown = MachineDeploymentPhase("ScalingDown") - - // MachineDeploymentPhaseRunning indicates scaling has completed and all Machines are running. - MachineDeploymentPhaseRunning = MachineDeploymentPhase("Running") - - // MachineDeploymentPhaseFailed indicates there was a problem scaling and user intervention might be required. - MachineDeploymentPhaseFailed = MachineDeploymentPhase("Failed") - - // MachineDeploymentPhaseUnknown indicates the state of the MachineDeployment cannot be determined. - MachineDeploymentPhaseUnknown = MachineDeploymentPhase("Unknown") -) - -// SetTypedPhase sets the Phase field to the string representation of MachineDeploymentPhase. -func (md *MachineDeploymentStatus) SetTypedPhase(p MachineDeploymentPhase) { - md.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachineDeploymentPhase representation. -func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { - switch phase := MachineDeploymentPhase(md.Phase); phase { - case - MachineDeploymentPhaseScalingDown, - MachineDeploymentPhaseScalingUp, - MachineDeploymentPhaseRunning, - MachineDeploymentPhaseFailed: - return phase - default: - return MachineDeploymentPhaseUnknown - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineDeployment" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" -// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" - -// MachineDeployment is the Schema for the machinedeployments API. -type MachineDeployment struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineDeploymentSpec `json:"spec,omitempty"` - Status MachineDeploymentStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineDeploymentList contains a list of MachineDeployment. -type MachineDeploymentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineDeployment `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineDeployment{}, &MachineDeploymentList{}) -} - -// GetConditions returns the set of conditions for the machinedeployment. -func (m *MachineDeployment) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the machinedeployment. -func (m *MachineDeployment) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinehealthcheck_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinehealthcheck_types.go deleted file mode 100644 index ba5a47a41..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machinehealthcheck_types.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// ANCHOR: MachineHealthCheckSpec - -// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. -type MachineHealthCheckSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Label selector to match machines whose health will be exercised - Selector metav1.LabelSelector `json:"selector"` - - // UnhealthyConditions contains a list of the conditions that determine - // whether a node is considered unhealthy. The conditions are combined in a - // logical OR, i.e. if any of the conditions is met, the node is unhealthy. - // - // +kubebuilder:validation:MinItems=1 - UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions"` - - // Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by - // "selector" are not healthy. - // +optional - MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - - // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy - // is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. - // Eg. "[3-5]" - This means that remediation will be allowed only when: - // (a) there are at least 3 unhealthy machines (and) - // (b) there are at most 5 unhealthy machines - // +optional - // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ - UnhealthyRange *string `json:"unhealthyRange,omitempty"` - - // Machines older than this duration without a node will be considered to have - // failed and will be remediated. - // If not set, this value is defaulted to 10 minutes. - // If you wish to disable this feature, set the value explicitly to 0. - // +optional - NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` - - // RemediationTemplate is a reference to a remediation template - // provided by an infrastructure provider. - // - // This field is completely optional, when filled, the MachineHealthCheck controller - // creates a new object from the template referenced and hands off remediation of the machine to - // a controller that lives outside of Cluster API. - // +optional - RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` -} - -// ANCHOR_END: MachineHealthCHeckSpec - -// ANCHOR: UnhealthyCondition - -// UnhealthyCondition represents a Node condition type and value with a timeout -// specified as a duration. When the named condition has been in the given -// status for at least the timeout value, a node is considered unhealthy. -type UnhealthyCondition struct { - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - Type corev1.NodeConditionType `json:"type"` - - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - Status corev1.ConditionStatus `json:"status"` - - Timeout metav1.Duration `json:"timeout"` -} - -// ANCHOR_END: UnhealthyCondition - -// ANCHOR: MachineHealthCheckStatus - -// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. -type MachineHealthCheckStatus struct { - // total number of machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - ExpectedMachines int32 `json:"expectedMachines,omitempty"` - - // total number of healthy machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - CurrentHealthy int32 `json:"currentHealthy,omitempty"` - - // RemediationsAllowed is the number of further remediations allowed by this machine health check before - // maxUnhealthy short circuiting will be applied - // +kubebuilder:validation:Minimum=0 - RemediationsAllowed int32 `json:"remediationsAllowed,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Targets shows the current list of machines the machine health check is watching - // +optional - Targets []string `json:"targets,omitempty"` - - // Conditions defines current service state of the MachineHealthCheck. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineHealthCheckStatus - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" -// +kubebuilder:printcolumn:name="MaxUnhealthy",type="string",JSONPath=".spec.maxUnhealthy",description="Maximum number of unhealthy machines allowed" -// +kubebuilder:printcolumn:name="ExpectedMachines",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" -// +kubebuilder:printcolumn:name="CurrentHealthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" - -// MachineHealthCheck is the Schema for the machinehealthchecks API. -type MachineHealthCheck struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of machine health check policy - Spec MachineHealthCheckSpec `json:"spec,omitempty"` - - // Most recently observed status of MachineHealthCheck resource - Status MachineHealthCheckStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *MachineHealthCheck) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *MachineHealthCheck) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineHealthCheckList contains a list of MachineHealthCheck. -type MachineHealthCheckList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineHealthCheck `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineHealthCheck{}, &MachineHealthCheckList{}) -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machineset_types.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machineset_types.go deleted file mode 100644 index fd358b713..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/machineset_types.go +++ /dev/null @@ -1,236 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/validation/field" - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineSetTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineSet is being deleted. - MachineSetTopologyFinalizer = "machineset.topology.cluster.x-k8s.io" -) - -// ANCHOR: MachineSetSpec - -// MachineSetSpec defines the desired state of MachineSet. -type MachineSetSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // +optional - // +kubebuilder:default=1 - Replicas *int32 `json:"replicas,omitempty"` - - // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. - // Defaults to 0 (machine will be considered available as soon as it is ready) - // +optional - MinReadySeconds int32 `json:"minReadySeconds,omitempty"` - - // DeletePolicy defines the policy used to identify nodes to delete when downscaling. - // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" - // +kubebuilder:validation:Enum=Random;Newest;Oldest - DeletePolicy string `json:"deletePolicy,omitempty"` - - // Selector is a label query over machines that should match the replica count. - // Label keys and values that must match in order to be controlled by this MachineSet. - // It must match the machine template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - Selector metav1.LabelSelector `json:"selector"` - - // Template is the object that describes the machine that will be created if - // insufficient replicas are detected. - // Object references to custom resources resources are treated as templates. - // +optional - Template MachineTemplateSpec `json:"template,omitempty"` -} - -// ANCHOR_END: MachineSetSpec - -// ANCHOR: MachineTemplateSpec - -// MachineTemplateSpec describes the data needed to create a Machine from a template. -type MachineTemplateSpec struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta `json:"metadata,omitempty"` - - // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec MachineSpec `json:"spec,omitempty"` -} - -// ANCHOR_END: MachineTemplateSpec - -// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when -// downscaling a MachineSet. Defaults to "Random". -type MachineSetDeletePolicy string - -const ( - // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // Finally, it picks Machines at random to delete. - RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" - - // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. - NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" - - // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. - OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" -) - -// ANCHOR: MachineSetStatus - -// MachineSetStatus defines the observed state of MachineSet. -type MachineSetStatus struct { - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // The number of replicas that have labels matching the labels of the machine template of the MachineSet. - // +optional - FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` - - // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // ObservedGeneration reflects the generation of the most recently observed MachineSet. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // In the event that there is a terminal problem reconciling the - // replicas, both FailureReason and FailureMessage will be set. FailureReason - // will be populated with a succinct value suitable for machine - // interpretation, while FailureMessage will contain a more verbose - // string suitable for logging and human consumption. - // - // These fields should not be set for transitive errors that a - // controller faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachineTemplate's spec or the configuration of - // the machine controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the machine controller, or the - // responsible machine controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the MachineSet object and/or logged in the - // controller's output. - // +optional - FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"` - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - // Conditions defines current service state of the MachineSet. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineSetStatus - -// Validate validates the MachineSet fields. -func (m *MachineSet) Validate() field.ErrorList { - errors := field.ErrorList{} - - // validate spec.selector and spec.template.labels - fldPath := field.NewPath("spec") - errors = append(errors, metav1validation.ValidateLabelSelector(&m.Spec.Selector, fldPath.Child("selector"))...) - if len(m.Spec.Selector.MatchLabels)+len(m.Spec.Selector.MatchExpressions) == 0 { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "empty selector is not valid for MachineSet.")) - } - selector, err := metav1.LabelSelectorAsSelector(&m.Spec.Selector) - if err != nil { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "invalid label selector.")) - } else { - labels := labels.Set(m.Spec.Template.Labels) - if !selector.Matches(labels) { - errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), m.Spec.Template.Labels, "`selector` does not match template `labels`")) - } - } - - return errors -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineSet" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" -// +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." - -// MachineSet is the Schema for the machinesets API. -type MachineSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSetSpec `json:"spec,omitempty"` - Status MachineSetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineSetList contains a list of MachineSet. -type MachineSetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineSet `json:"items"` -} - -func init() { - SchemeBuilder.Register(&MachineSet{}, &MachineSetList{}) -} - -// GetConditions returns the set of conditions for the MachineSet. -func (m *MachineSet) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the MachineSet. -func (m *MachineSet) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 1b138f920..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,1733 +0,0 @@ -// +build !ignore_autogenerated_core - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" - v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - errors "sigs.k8s.io/cluster-api/errors" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Bootstrap)(nil), (*v1beta1.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(a.(*Bootstrap), b.(*v1beta1.Bootstrap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(a.(*v1beta1.Bootstrap), b.(*Bootstrap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1beta1.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(a.(*Cluster), b.(*v1beta1.Cluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Cluster_To_v1alpha4_Cluster(a.(*v1beta1.Cluster), b.(*Cluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClass)(nil), (*v1beta1.ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(a.(*ClusterClass), b.(*v1beta1.ClusterClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClass)(nil), (*ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(a.(*v1beta1.ClusterClass), b.(*ClusterClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClassList)(nil), (*v1beta1.ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(a.(*ClusterClassList), b.(*v1beta1.ClusterClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClassList)(nil), (*ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(a.(*v1beta1.ClusterClassList), b.(*ClusterClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClassSpec)(nil), (*v1beta1.ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(a.(*ClusterClassSpec), b.(*v1beta1.ClusterClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClassSpec)(nil), (*ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(a.(*v1beta1.ClusterClassSpec), b.(*ClusterClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1beta1.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(a.(*ClusterList), b.(*v1beta1.ClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(a.(*v1beta1.ClusterList), b.(*ClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterNetwork)(nil), (*v1beta1.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(a.(*ClusterNetwork), b.(*v1beta1.ClusterNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(a.(*v1beta1.ClusterNetwork), b.(*ClusterNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*v1beta1.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(a.(*ClusterSpec), b.(*v1beta1.ClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(a.(*v1beta1.ClusterSpec), b.(*ClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1beta1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Condition_To_v1beta1_Condition(a.(*Condition), b.(*v1beta1.Condition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Condition_To_v1alpha4_Condition(a.(*v1beta1.Condition), b.(*Condition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneClass)(nil), (*v1beta1.ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(a.(*ControlPlaneClass), b.(*v1beta1.ControlPlaneClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneClass)(nil), (*ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(a.(*v1beta1.ControlPlaneClass), b.(*ControlPlaneClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneTopology)(nil), (*v1beta1.ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(a.(*ControlPlaneTopology), b.(*v1beta1.ControlPlaneTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneTopology)(nil), (*ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(a.(*v1beta1.ControlPlaneTopology), b.(*ControlPlaneTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FailureDomainSpec)(nil), (*v1beta1.FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(a.(*FailureDomainSpec), b.(*v1beta1.FailureDomainSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FailureDomainSpec)(nil), (*FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(a.(*v1beta1.FailureDomainSpec), b.(*FailureDomainSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LocalObjectTemplate)(nil), (*v1beta1.LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(a.(*LocalObjectTemplate), b.(*v1beta1.LocalObjectTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LocalObjectTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(a.(*v1beta1.LocalObjectTemplate), b.(*LocalObjectTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1beta1.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Machine_To_v1beta1_Machine(a.(*Machine), b.(*v1beta1.Machine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Machine_To_v1alpha4_Machine(a.(*v1beta1.Machine), b.(*Machine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1beta1.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(a.(*MachineAddress), b.(*v1beta1.MachineAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(a.(*v1beta1.MachineAddress), b.(*MachineAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1beta1.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(a.(*MachineDeployment), b.(*v1beta1.MachineDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(a.(*v1beta1.MachineDeployment), b.(*MachineDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentClass)(nil), (*v1beta1.MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(a.(*MachineDeploymentClass), b.(*v1beta1.MachineDeploymentClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentClass)(nil), (*MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(a.(*v1beta1.MachineDeploymentClass), b.(*MachineDeploymentClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentClassTemplate)(nil), (*v1beta1.MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(a.(*MachineDeploymentClassTemplate), b.(*v1beta1.MachineDeploymentClassTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentClassTemplate)(nil), (*MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(a.(*v1beta1.MachineDeploymentClassTemplate), b.(*MachineDeploymentClassTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1beta1.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1beta1.MachineDeploymentList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(a.(*v1beta1.MachineDeploymentList), b.(*MachineDeploymentList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentSpec)(nil), (*v1beta1.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1beta1.MachineDeploymentSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(a.(*v1beta1.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStatus)(nil), (*v1beta1.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1beta1.MachineDeploymentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(a.(*v1beta1.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStrategy)(nil), (*v1beta1.MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(a.(*MachineDeploymentStrategy), b.(*v1beta1.MachineDeploymentStrategy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStrategy)(nil), (*MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(a.(*v1beta1.MachineDeploymentStrategy), b.(*MachineDeploymentStrategy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentTopology)(nil), (*v1beta1.MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(a.(*MachineDeploymentTopology), b.(*v1beta1.MachineDeploymentTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentTopology)(nil), (*MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(a.(*v1beta1.MachineDeploymentTopology), b.(*MachineDeploymentTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1beta1.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1beta1.MachineHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(a.(*v1beta1.MachineHealthCheck), b.(*MachineHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1beta1.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1beta1.MachineHealthCheckList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(a.(*v1beta1.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckSpec)(nil), (*v1beta1.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1beta1.MachineHealthCheckSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(a.(*v1beta1.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckStatus)(nil), (*v1beta1.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1beta1.MachineHealthCheckStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(a.(*v1beta1.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1beta1.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(a.(*MachineList), b.(*v1beta1.MachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineList_To_v1alpha4_MachineList(a.(*v1beta1.MachineList), b.(*MachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1beta1.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1beta1.MachineRollingUpdateDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineRollingUpdateDeployment)(nil), (*MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(a.(*v1beta1.MachineRollingUpdateDeployment), b.(*MachineRollingUpdateDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1beta1.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(a.(*MachineSet), b.(*v1beta1.MachineSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(a.(*v1beta1.MachineSet), b.(*MachineSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1beta1.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(a.(*MachineSetList), b.(*v1beta1.MachineSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(a.(*v1beta1.MachineSetList), b.(*MachineSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetSpec)(nil), (*v1beta1.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(a.(*MachineSetSpec), b.(*v1beta1.MachineSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(a.(*v1beta1.MachineSetSpec), b.(*MachineSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetStatus)(nil), (*v1beta1.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(a.(*MachineSetStatus), b.(*v1beta1.MachineSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(a.(*v1beta1.MachineSetStatus), b.(*MachineSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSpec)(nil), (*v1beta1.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(a.(*MachineSpec), b.(*v1beta1.MachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(a.(*v1beta1.MachineSpec), b.(*MachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(a.(*v1beta1.MachineStatus), b.(*MachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1beta1.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1beta1.MachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(a.(*v1beta1.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1beta1.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(a.(*NetworkRanges), b.(*v1beta1.NetworkRanges), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(a.(*v1beta1.NetworkRanges), b.(*NetworkRanges), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*v1beta1.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(a.(*ObjectMeta), b.(*v1beta1.ObjectMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(a.(*v1beta1.ObjectMeta), b.(*ObjectMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Topology)(nil), (*v1beta1.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Topology_To_v1beta1_Topology(a.(*Topology), b.(*v1beta1.Topology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Topology)(nil), (*Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Topology_To_v1alpha4_Topology(a.(*v1beta1.Topology), b.(*Topology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*UnhealthyCondition)(nil), (*v1beta1.UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(a.(*UnhealthyCondition), b.(*v1beta1.UnhealthyCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.UnhealthyCondition)(nil), (*UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(a.(*v1beta1.UnhealthyCondition), b.(*UnhealthyCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WorkersClass)(nil), (*v1beta1.WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(a.(*WorkersClass), b.(*v1beta1.WorkersClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.WorkersClass)(nil), (*WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(a.(*v1beta1.WorkersClass), b.(*WorkersClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WorkersTopology)(nil), (*v1beta1.WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(a.(*WorkersTopology), b.(*v1beta1.WorkersTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.WorkersTopology)(nil), (*WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(a.(*v1beta1.WorkersTopology), b.(*WorkersTopology), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*MachineStatus)(nil), (*v1beta1.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(a.(*MachineStatus), b.(*v1beta1.MachineStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -func autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { - out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - return nil -} - -// Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap is an autogenerated conversion function. -func Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { - return autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in, out, s) -} - -func autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { - out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - return nil -} - -// Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap is an autogenerated conversion function. -func Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { - return autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in, out, s) -} - -func autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. -func Convert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { - return autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Cluster_To_v1alpha4_Cluster is an autogenerated conversion function. -func Convert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in, out, s) -} - -func autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in, out, s) -} - -func autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *v1beta1.ClusterClass, out *ClusterClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass is an autogenerated conversion function. -func Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *v1beta1.ClusterClass, out *ClusterClass, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in, out, s) -} - -func autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.ClusterClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in, out, s) -} - -func autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]ClusterClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList is an autogenerated conversion function. -func Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - if err := Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if err := Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(&in.Workers, &out.Workers, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *v1beta1.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if err := Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(&in.Workers, &out.Workers, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *v1beta1.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in, out, s) -} - -func autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in, out, s) -} - -func autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList is an autogenerated conversion function. -func Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { - out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) - out.Services = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Services)) - out.Pods = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Pods)) - out.ServiceDomain = in.ServiceDomain - return nil -} - -// Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork is an autogenerated conversion function. -func Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in, out, s) -} - -func autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { - out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) - out.Services = (*NetworkRanges)(unsafe.Pointer(in.Services)) - out.Pods = (*NetworkRanges)(unsafe.Pointer(in.Pods)) - out.ServiceDomain = in.ServiceDomain - return nil -} - -// Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork is an autogenerated conversion function. -func Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in, out, s) -} - -func autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { - out.Paused = in.Paused - out.ClusterNetwork = (*v1beta1.ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) - out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) - out.Topology = (*v1beta1.Topology)(unsafe.Pointer(in.Topology)) - return nil -} - -// Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - out.Paused = in.Paused - out.ClusterNetwork = (*ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) - out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) - out.Topology = (*Topology)(unsafe.Pointer(in.Topology)) - return nil -} - -// Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in, out, s) -} - -func autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - out.FailureDomains = *(*v1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.InfrastructureReady = in.InfrastructureReady - out.ControlPlaneReady = in.ControlPlaneReady - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.FailureDomains = *(*FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.InfrastructureReady = in.InfrastructureReady - out.ControlPlaneReady = in.ControlPlaneReady - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { - out.Type = v1beta1.ConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Severity = v1beta1.ConditionSeverity(in.Severity) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1alpha4_Condition_To_v1beta1_Condition is an autogenerated conversion function. -func Convert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { - return autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in, out, s) -} - -func autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { - out.Type = ConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Severity = ConditionSeverity(in.Severity) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1beta1_Condition_To_v1alpha4_Condition is an autogenerated conversion function. -func Convert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { - return autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in, out, s) -} - -func autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { - return err - } - out.MachineInfrastructure = (*v1beta1.LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) - return nil -} - -// Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *v1beta1.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { - return err - } - out.MachineInfrastructure = (*LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) - return nil -} - -// Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass is an autogenerated conversion function. -func Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *v1beta1.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { - return autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in, out, s) -} - -func autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *v1beta1.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology is an autogenerated conversion function. -func Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *v1beta1.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { - return autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in, out, s) -} - -func autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { - out.ControlPlane = in.ControlPlane - out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in, out, s) -} - -func autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { - out.ControlPlane = in.ControlPlane - out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in, out, s) -} - -func autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { - out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) - return nil -} - -// Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate is an autogenerated conversion function. -func Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in, out, s) -} - -func autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { - out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) - return nil -} - -// Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate is an autogenerated conversion function. -func Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in, out, s) -} - -func autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_Machine_To_v1beta1_Machine is an autogenerated conversion function. -func Convert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { - return autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in, out, s) -} - -func autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Machine_To_v1alpha4_Machine is an autogenerated conversion function. -func Convert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { - return autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in, out, s) -} - -func autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { - out.Type = v1beta1.MachineAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress is an autogenerated conversion function. -func Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in, out, s) -} - -func autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { - out.Type = MachineAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress is an autogenerated conversion function. -func Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { - return autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in, out, s) -} - -func autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment is an autogenerated conversion function. -func Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { - out.Class = in.Class - if err := Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *v1beta1.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { - out.Class = in.Class - if err := Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *v1beta1.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.MachineDeployment)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]MachineDeployment)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.Strategy = (*v1beta1.MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) - out.Paused = in.Paused - out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.Selector = in.Selector - if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.Strategy = (*MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) - out.Paused = in.Paused - out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) - return nil -} - -// Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Selector = in.Selector - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Phase = in.Phase - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Selector = in.Selector - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Phase = in.Phase - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { - out.Type = v1beta1.MachineDeploymentStrategyType(in.Type) - out.RollingUpdate = (*v1beta1.MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { - out.Type = MachineDeploymentStrategyType(in.Type) - out.RollingUpdate = (*MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Class = in.Class - out.Name = in.Name - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *v1beta1.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Class = in.Class - out.Name = in.Name - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *v1beta1.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.MachineHealthCheck)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]MachineHealthCheck)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Selector = in.Selector - out.UnhealthyConditions = *(*[]v1beta1.UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) - out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) - out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) - out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) - out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Selector = in.Selector - out.UnhealthyConditions = *(*[]UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) - out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) - out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) - out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) - out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { - out.ExpectedMachines = in.ExpectedMachines - out.CurrentHealthy = in.CurrentHealthy - out.RemediationsAllowed = in.RemediationsAllowed - out.ObservedGeneration = in.ObservedGeneration - out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { - out.ExpectedMachines = in.ExpectedMachines - out.CurrentHealthy = in.CurrentHealthy - out.RemediationsAllowed = in.RemediationsAllowed - out.ObservedGeneration = in.ObservedGeneration - out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.Machine, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_Machine_To_v1beta1_Machine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_MachineList_To_v1beta1_MachineList is an autogenerated conversion function. -func Convert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in, out, s) -} - -func autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Machine_To_v1alpha4_Machine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_MachineList_To_v1alpha4_MachineList is an autogenerated conversion function. -func Convert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in, out, s) -} - -func autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { - out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) - return nil -} - -// Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment is an autogenerated conversion function. -func Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in, out, s) -} - -func autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { - out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) - return nil -} - -// Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment is an autogenerated conversion function. -func Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { - return autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in, out, s) -} - -func autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet is an autogenerated conversion function. -func Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in, out, s) -} - -func autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet is an autogenerated conversion function. -func Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.MachineSet)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in, out, s) -} - -func autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]MachineSet)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList is an autogenerated conversion function. -func Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.MinReadySeconds = in.MinReadySeconds - out.DeletePolicy = in.DeletePolicy - out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.MinReadySeconds = in.MinReadySeconds - out.DeletePolicy = in.DeletePolicy - out.Selector = in.Selector - if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - if err := Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) - out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - return nil -} - -// Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - if err := Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) - out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - return nil -} - -// Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) - out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) - // WARNING: in.Version requires manual conversion: does not exist in peer-type - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Addresses = *(*v1beta1.MachineAddresses)(unsafe.Pointer(&in.Addresses)) - out.Phase = in.Phase - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -func autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) - out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Addresses = *(*MachineAddresses)(unsafe.Pointer(&in.Addresses)) - out.Phase = in.Phase - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { - out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) - return nil -} - -// Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges is an autogenerated conversion function. -func Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in, out, s) -} - -func autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { - out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) - return nil -} - -// Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges is an autogenerated conversion function. -func Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in, out, s) -} - -func autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - return nil -} - -// Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta is an autogenerated conversion function. -func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { - return autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) -} - -func autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - return nil -} - -// Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta is an autogenerated conversion function. -func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) -} - -func autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { - out.Class = in.Class - out.Version = in.Version - out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) - if err := Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - out.Workers = (*v1beta1.WorkersTopology)(unsafe.Pointer(in.Workers)) - return nil -} - -// Convert_v1alpha4_Topology_To_v1beta1_Topology is an autogenerated conversion function. -func Convert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { - return autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in, out, s) -} - -func autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error { - out.Class = in.Class - out.Version = in.Version - out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) - if err := Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - out.Workers = (*WorkersTopology)(unsafe.Pointer(in.Workers)) - return nil -} - -// Convert_v1beta1_Topology_To_v1alpha4_Topology is an autogenerated conversion function. -func Convert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error { - return autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in, out, s) -} - -func autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { - out.Type = v1.NodeConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Timeout = in.Timeout - return nil -} - -// Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in, out, s) -} - -func autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { - out.Type = v1.NodeConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Timeout = in.Timeout - return nil -} - -// Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in, out, s) -} - -func autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { - out.MachineDeployments = *(*[]v1beta1.MachineDeploymentClass)(unsafe.Pointer(&in.MachineDeployments)) - return nil -} - -// Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass is an autogenerated conversion function. -func Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { - return autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in, out, s) -} - -func autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *v1beta1.WorkersClass, out *WorkersClass, s conversion.Scope) error { - out.MachineDeployments = *(*[]MachineDeploymentClass)(unsafe.Pointer(&in.MachineDeployments)) - return nil -} - -// Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass is an autogenerated conversion function. -func Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *v1beta1.WorkersClass, out *WorkersClass, s conversion.Scope) error { - return autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in, out, s) -} - -func autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { - out.MachineDeployments = *(*[]v1beta1.MachineDeploymentTopology)(unsafe.Pointer(&in.MachineDeployments)) - return nil -} - -// Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology is an autogenerated conversion function. -func Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in, out, s) -} - -func autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *v1beta1.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { - out.MachineDeployments = *(*[]MachineDeploymentTopology)(unsafe.Pointer(&in.MachineDeployments)) - return nil -} - -// Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology is an autogenerated conversion function. -func Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *v1beta1.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { - return autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in, out, s) -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 3c9b6afb6..000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,1257 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bootstrap) DeepCopyInto(out *Bootstrap) { - *out = *in - if in.ConfigRef != nil { - in, out := &in.ConfigRef, &out.ConfigRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootstrap. -func (in *Bootstrap) DeepCopy() *Bootstrap { - if in == nil { - return nil - } - out := new(Bootstrap) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) 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 *ClusterClass) DeepCopyInto(out *ClusterClass) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClass. -func (in *ClusterClass) DeepCopy() *ClusterClass { - if in == nil { - return nil - } - out := new(ClusterClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClass) 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 *ClusterClassList) DeepCopyInto(out *ClusterClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassList. -func (in *ClusterClassList) DeepCopy() *ClusterClassList { - if in == nil { - return nil - } - out := new(ClusterClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClassList) 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 *ClusterClassSpec) DeepCopyInto(out *ClusterClassSpec) { - *out = *in - in.Infrastructure.DeepCopyInto(&out.Infrastructure) - in.ControlPlane.DeepCopyInto(&out.ControlPlane) - in.Workers.DeepCopyInto(&out.Workers) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassSpec. -func (in *ClusterClassSpec) DeepCopy() *ClusterClassSpec { - if in == nil { - return nil - } - out := new(ClusterClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) 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 *ClusterNetwork) DeepCopyInto(out *ClusterNetwork) { - *out = *in - if in.APIServerPort != nil { - in, out := &in.APIServerPort, &out.APIServerPort - *out = new(int32) - **out = **in - } - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } - if in.Pods != nil { - in, out := &in.Pods, &out.Pods - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetwork. -func (in *ClusterNetwork) DeepCopy() *ClusterNetwork { - if in == nil { - return nil - } - out := new(ClusterNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ClusterNetwork != nil { - in, out := &in.ClusterNetwork, &out.ClusterNetwork - *out = new(ClusterNetwork) - (*in).DeepCopyInto(*out) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneRef != nil { - in, out := &in.ControlPlaneRef, &out.ControlPlaneRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.InfrastructureRef != nil { - in, out := &in.InfrastructureRef, &out.InfrastructureRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Conditions) DeepCopyInto(out *Conditions) { - { - in := &in - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. -func (in Conditions) DeepCopy() Conditions { - if in == nil { - return nil - } - out := new(Conditions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneClass) DeepCopyInto(out *ControlPlaneClass) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.LocalObjectTemplate.DeepCopyInto(&out.LocalObjectTemplate) - if in.MachineInfrastructure != nil { - in, out := &in.MachineInfrastructure, &out.MachineInfrastructure - *out = new(LocalObjectTemplate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClass. -func (in *ControlPlaneClass) DeepCopy() *ControlPlaneClass { - if in == nil { - return nil - } - out := new(ControlPlaneClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneTopology) DeepCopyInto(out *ControlPlaneTopology) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopology. -func (in *ControlPlaneTopology) DeepCopy() *ControlPlaneTopology { - if in == nil { - return nil - } - out := new(ControlPlaneTopology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FailureDomainSpec) DeepCopyInto(out *FailureDomainSpec) { - *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomainSpec. -func (in *FailureDomainSpec) DeepCopy() *FailureDomainSpec { - if in == nil { - return nil - } - out := new(FailureDomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in FailureDomains) DeepCopyInto(out *FailureDomains) { - { - in := &in - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomains. -func (in FailureDomains) DeepCopy() FailureDomains { - if in == nil { - return nil - } - out := new(FailureDomains) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalObjectTemplate) DeepCopyInto(out *LocalObjectTemplate) { - *out = *in - if in.Ref != nil { - in, out := &in.Ref, &out.Ref - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectTemplate. -func (in *LocalObjectTemplate) DeepCopy() *LocalObjectTemplate { - if in == nil { - return nil - } - out := new(LocalObjectTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Machine) 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 *MachineAddress) DeepCopyInto(out *MachineAddress) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddress. -func (in *MachineAddress) DeepCopy() *MachineAddress { - if in == nil { - return nil - } - out := new(MachineAddress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MachineAddresses) DeepCopyInto(out *MachineAddresses) { - { - in := &in - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddresses. -func (in MachineAddresses) DeepCopy() MachineAddresses { - if in == nil { - return nil - } - out := new(MachineAddresses) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. -func (in *MachineDeployment) DeepCopy() *MachineDeployment { - if in == nil { - return nil - } - out := new(MachineDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeployment) 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 *MachineDeploymentClass) DeepCopyInto(out *MachineDeploymentClass) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClass. -func (in *MachineDeploymentClass) DeepCopy() *MachineDeploymentClass { - if in == nil { - return nil - } - out := new(MachineDeploymentClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentClassTemplate) DeepCopyInto(out *MachineDeploymentClassTemplate) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - in.Infrastructure.DeepCopyInto(&out.Infrastructure) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassTemplate. -func (in *MachineDeploymentClassTemplate) DeepCopy() *MachineDeploymentClassTemplate { - if in == nil { - return nil - } - out := new(MachineDeploymentClassTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. -func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { - if in == nil { - return nil - } - out := new(MachineDeploymentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeploymentList) 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 *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } - if in.ProgressDeadlineSeconds != nil { - in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. -func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { - if in == nil { - return nil - } - out := new(MachineDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. -func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { - if in == nil { - return nil - } - out := new(MachineDeploymentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(MachineRollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. -func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentTopology) DeepCopyInto(out *MachineDeploymentTopology) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopology. -func (in *MachineDeploymentTopology) DeepCopy() *MachineDeploymentTopology { - if in == nil { - return nil - } - out := new(MachineDeploymentTopology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck. -func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck { - if in == nil { - return nil - } - out := new(MachineHealthCheck) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheck) 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 *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineHealthCheck, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList. -func (in *MachineHealthCheckList) DeepCopy() *MachineHealthCheckList { - if in == nil { - return nil - } - out := new(MachineHealthCheckList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheckList) 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 *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) - if in.UnhealthyConditions != nil { - in, out := &in.UnhealthyConditions, &out.UnhealthyConditions - *out = make([]UnhealthyCondition, len(*in)) - copy(*out, *in) - } - if in.MaxUnhealthy != nil { - in, out := &in.MaxUnhealthy, &out.MaxUnhealthy - *out = new(intstr.IntOrString) - **out = **in - } - if in.UnhealthyRange != nil { - in, out := &in.UnhealthyRange, &out.UnhealthyRange - *out = new(string) - **out = **in - } - if in.NodeStartupTimeout != nil { - in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.RemediationTemplate != nil { - in, out := &in.RemediationTemplate, &out.RemediationTemplate - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. -func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec { - if in == nil { - return nil - } - out := new(MachineHealthCheckSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) { - *out = *in - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus. -func (in *MachineHealthCheckStatus) DeepCopy() *MachineHealthCheckStatus { - if in == nil { - return nil - } - out := new(MachineHealthCheckStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineList) DeepCopyInto(out *MachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. -func (in *MachineList) DeepCopy() *MachineList { - if in == nil { - return nil - } - out := new(MachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineList) 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 *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } - if in.DeletePolicy != nil { - in, out := &in.DeletePolicy, &out.DeletePolicy - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSet) DeepCopyInto(out *MachineSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. -func (in *MachineSet) DeepCopy() *MachineSet { - if in == nil { - return nil - } - out := new(MachineSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSet) 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 *MachineSetList) DeepCopyInto(out *MachineSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. -func (in *MachineSetList) DeepCopy() *MachineSetList { - if in == nil { - return nil - } - out := new(MachineSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSetList) 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 *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. -func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { - if in == nil { - return nil - } - out := new(MachineSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineSetStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. -func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { - if in == nil { - return nil - } - out := new(MachineSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { - *out = *in - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - out.InfrastructureRef = in.InfrastructureRef - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. -func (in *MachineSpec) DeepCopy() *MachineSpec { - if in == nil { - return nil - } - out := new(MachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { - *out = *in - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.NodeInfo != nil { - in, out := &in.NodeInfo, &out.NodeInfo - *out = new(v1.NodeSystemInfo) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. -func (in *MachineStatus) DeepCopy() *MachineStatus { - if in == nil { - return nil - } - out := new(MachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. -func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { - if in == nil { - return nil - } - out := new(MachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { - *out = *in - if in.CIDRBlocks != nil { - in, out := &in.CIDRBlocks, &out.CIDRBlocks - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. -func (in *NetworkRanges) DeepCopy() *NetworkRanges { - if in == nil { - return nil - } - out := new(NetworkRanges) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. -func (in *ObjectMeta) DeepCopy() *ObjectMeta { - if in == nil { - return nil - } - out := new(ObjectMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { - *out = *in - if in.RolloutAfter != nil { - in, out := &in.RolloutAfter, &out.RolloutAfter - *out = (*in).DeepCopy() - } - in.ControlPlane.DeepCopyInto(&out.ControlPlane) - if in.Workers != nil { - in, out := &in.Workers, &out.Workers - *out = new(WorkersTopology) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. -func (in *Topology) DeepCopy() *Topology { - if in == nil { - return nil - } - out := new(Topology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { - *out = *in - out.Timeout = in.Timeout -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. -func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { - if in == nil { - return nil - } - out := new(UnhealthyCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkersClass) DeepCopyInto(out *WorkersClass) { - *out = *in - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersClass. -func (in *WorkersClass) DeepCopy() *WorkersClass { - if in == nil { - return nil - } - out := new(WorkersClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkersTopology) DeepCopyInto(out *WorkersTopology) { - *out = *in - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentTopology, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersTopology. -func (in *WorkersTopology) DeepCopy() *WorkersTopology { - if in == nil { - return nil - } - out := new(WorkersTopology) - in.DeepCopyInto(out) - return out -} From 8681951f4d998dd26b3571809209a345c1eef3e7 Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Tue, 14 Dec 2021 18:07:38 -0500 Subject: [PATCH 2/4] Convert Networks to Ports This code will convert all networks in the machine spec to capo ports, which will help us transition to a port only api in the future. This will disable some of the super user behavior, but that is for the better in the long run. --- .../v1alpha1/convert.go | 105 ++++++++++++++---- pkg/machine/actuator.go | 12 +- 2 files changed, 96 insertions(+), 21 deletions(-) diff --git a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go index 582024d8c..e8d4a5ac4 100644 --- a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go +++ b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go @@ -51,7 +51,80 @@ func NewOpenStackCluster(providerSpec OpenstackClusterProviderSpec, providerStat } } -func (ps OpenstackProviderSpec) toMachineSpec() capov1.OpenStackMachineSpec { +// Converts NetworkParams to capov1 portOpts +func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool) capov1.PortOpts { + network := capov1.NetworkFilter{ + ID: net.UUID, + Name: net.Filter.Name, + Description: net.Filter.Description, + ProjectID: net.Filter.ProjectID, + Tags: net.Filter.Tags, + TagsAny: net.Filter.TagsAny, + NotTags: net.Filter.NotTags, + NotTagsAny: net.Filter.NotTagsAny, + } + if network.ID == "" { + network.ID = net.Filter.ID + } + + fixedIPs := make([]capov1.FixedIP, len(net.Subnets)) + for i, subnet := range net.Subnets { + id := subnet.UUID + if id == "" { + id = subnet.Filter.ID + } + + fixedIPs[i] = capov1.FixedIP{ + Subnet: &capov1.SubnetFilter{ + Name: subnet.Filter.Name, + Description: subnet.Filter.Description, + ProjectID: subnet.Filter.ProjectID, + IPVersion: subnet.Filter.IPVersion, + GatewayIP: subnet.Filter.GatewayIP, + CIDR: subnet.Filter.CIDR, + IPv6AddressMode: subnet.Filter.IPv6AddressMode, + IPv6RAMode: subnet.Filter.IPv6RAMode, + ID: id, + Tags: subnet.Filter.Tags, + TagsAny: subnet.Filter.TagsAny, + NotTags: subnet.Filter.NotTags, + NotTagsAny: subnet.Filter.NotTagsAny, + }, + } + } + + addressPairs := []capov1.AddressPair{} + if !net.NoAllowedAddressPairs { + addressPairs = []capov1.AddressPair{ + { + IPAddress: apiVIP, + }, + { + IPAddress: ingressVIP, + }, + } + } + + portSecurity := net.PortSecurity + if net.PortSecurity != nil { + ps := *portSecurity + ps = !ps + portSecurity = &ps + } + + port := capov1.PortOpts{ + Network: &network, + AllowedAddressPairs: addressPairs, + Trunk: trunk, + DisablePortSecurity: portSecurity, + VNICType: net.VNICType, + FixedIPs: fixedIPs, + Tags: net.PortTags, + } + return port +} + +func (ps OpenstackProviderSpec) toMachineSpec(apiVIP, ingressVIP string) capov1.OpenStackMachineSpec { machineSpec := capov1.OpenStackMachineSpec{ CloudName: ps.CloudName, Flavor: ps.Flavor, @@ -90,10 +163,9 @@ func (ps OpenstackProviderSpec) toMachineSpec() capov1.OpenStackMachineSpec { } } - // TODO: close upstream/downstream feature gap: port security for i, port := range ps.Ports { machineSpec.Ports[i] = capov1.PortOpts{ - NetworkID: port.NetworkID, + Network: &capov1.NetworkFilter{ID: port.NetworkID}, NameSuffix: port.NameSuffix, Description: port.Description, AdminStateUp: port.AdminStateUp, @@ -108,7 +180,10 @@ func (ps OpenstackProviderSpec) toMachineSpec() capov1.OpenStackMachineSpec { } for fixedIPindex, fixedIP := range port.FixedIPs { - machineSpec.Ports[i].FixedIPs[fixedIPindex] = capov1.FixedIP(fixedIP) + machineSpec.Ports[i].FixedIPs[fixedIPindex] = capov1.FixedIP{ + Subnet: &capov1.SubnetFilter{ID: fixedIP.SubnetID}, + IPAddress: fixedIP.IPAddress, + } } for addrPairIndex, addrPair := range port.AllowedAddressPairs { @@ -116,26 +191,17 @@ func (ps OpenstackProviderSpec) toMachineSpec() capov1.OpenStackMachineSpec { } } - // TODO: close upstream/downstream feature gap or depricate feature in favor of ports interface: port tags, port security + portList := make([]capov1.PortOpts, len(ps.Networks)) for i, network := range ps.Networks { - machineSpec.Networks[i] = capov1.NetworkParam{ - UUID: network.UUID, - FixedIP: network.FixedIp, - Filter: capov1.Filter(network.Filter), - Subnets: make([]capov1.SubnetParam, len(network.Subnets)), - } - for subnetIndex, subnet := range network.Subnets { - machineSpec.Networks[i].Subnets[subnetIndex] = capov1.SubnetParam{ - UUID: subnet.UUID, - Filter: capov1.SubnetFilter(subnet.Filter), - } - } + portList[i] = network.toCapov1PortOpt(apiVIP, ingressVIP, &ps.Trunk) } + machineSpec.Ports = append(machineSpec.Ports, portList...) + return machineSpec } -func NewOpenStackMachine(machine *machinev1.Machine) (*capov1.OpenStackMachine, error) { +func NewOpenStackMachine(machine *machinev1.Machine, apiVIP, ingressVIP string) (*capov1.OpenStackMachine, error) { providerSpec, err := MachineSpecFromProviderSpec(machine.Spec.ProviderSpec) if err != nil { return nil, err @@ -143,11 +209,10 @@ func NewOpenStackMachine(machine *machinev1.Machine) (*capov1.OpenStackMachine, osMachine := &capov1.OpenStackMachine{ ObjectMeta: machine.ObjectMeta, - Spec: providerSpec.toMachineSpec(), + Spec: providerSpec.toMachineSpec(apiVIP, ingressVIP), } // if machine api master label exists, add v1beta control plane label to the node - // TODO(egarcia): fix the go mods so that we can track cluster-api@main and import this if osMachine.ObjectMeta.Labels["machine.openshift.io/cluster-api-machine-role"] == "master" { osMachine.ObjectMeta.Labels["cluster.x-k8s.io/control-plane"] = "" } diff --git a/pkg/machine/actuator.go b/pkg/machine/actuator.go index cc2eca559..78b6ba631 100644 --- a/pkg/machine/actuator.go +++ b/pkg/machine/actuator.go @@ -35,6 +35,7 @@ import ( configclient "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" maoMachine "github.com/openshift/machine-api-operator/pkg/controller/machine" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" @@ -144,8 +145,17 @@ func (oc *OpenstackClient) Create(ctx context.Context, machine *machinev1.Machin return oc.handleMachineError(machine, maoMachine.CreateMachine("error creating bootstrap for %s: %v", machine.Name, err), createEventAction) } + clusterInfra, err := oc.params.ConfigClient.Infrastructures().Get(context.TODO(), "cluster", metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("Failed to retrieve cluster Infrastructure object: %v", err) + } + // Convert to capov1 - osMachine, err := openstackconfigv1.NewOpenStackMachine(machine) + osMachine, err := openstackconfigv1.NewOpenStackMachine( + machine, + clusterInfra.Status.PlatformStatus.OpenStack.APIServerInternalIP, + clusterInfra.Status.PlatformStatus.OpenStack.IngressIP, + ) if err != nil { return err } From 8a84a8b9650750e9c53fb0f8c91c97167f6e40bd Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Wed, 15 Dec 2021 15:41:52 -0500 Subject: [PATCH 3/4] support for independent subnets --- .../v1alpha1/convert.go | 200 +++++++++++++----- pkg/machine/actuator.go | 6 + 2 files changed, 152 insertions(+), 54 deletions(-) diff --git a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go index e8d4a5ac4..30656f33d 100644 --- a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go +++ b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go @@ -1,8 +1,12 @@ package v1alpha1 import ( + "fmt" + + "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets" machinev1 "github.com/openshift/api/machine/v1beta1" capov1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking" ) func (cps OpenstackClusterProviderSpec) toClusterSpec() capov1.OpenStackClusterSpec { @@ -51,48 +55,22 @@ func NewOpenStackCluster(providerSpec OpenstackClusterProviderSpec, providerStat } } -// Converts NetworkParams to capov1 portOpts -func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool) capov1.PortOpts { - network := capov1.NetworkFilter{ - ID: net.UUID, - Name: net.Filter.Name, - Description: net.Filter.Description, - ProjectID: net.Filter.ProjectID, - Tags: net.Filter.Tags, - TagsAny: net.Filter.TagsAny, - NotTags: net.Filter.NotTags, - NotTagsAny: net.Filter.NotTagsAny, - } - if network.ID == "" { - network.ID = net.Filter.ID +func (filter SubnetFilter) getNetworkID(networkService *networking.Service) (string, error) { + listOpts := subnets.ListOpts(filter) + subnets, err := networkService.GetSubnetsByFilter(listOpts) + if err != nil { + return "", err } - fixedIPs := make([]capov1.FixedIP, len(net.Subnets)) - for i, subnet := range net.Subnets { - id := subnet.UUID - if id == "" { - id = subnet.Filter.ID - } - - fixedIPs[i] = capov1.FixedIP{ - Subnet: &capov1.SubnetFilter{ - Name: subnet.Filter.Name, - Description: subnet.Filter.Description, - ProjectID: subnet.Filter.ProjectID, - IPVersion: subnet.Filter.IPVersion, - GatewayIP: subnet.Filter.GatewayIP, - CIDR: subnet.Filter.CIDR, - IPv6AddressMode: subnet.Filter.IPv6AddressMode, - IPv6RAMode: subnet.Filter.IPv6RAMode, - ID: id, - Tags: subnet.Filter.Tags, - TagsAny: subnet.Filter.TagsAny, - NotTags: subnet.Filter.NotTags, - NotTagsAny: subnet.Filter.NotTagsAny, - }, - } + if len(subnets) != 1 { + return "", fmt.Errorf("subnet query must return only 1 subnet") } + return subnets[0].NetworkID, nil +} +// Converts NetworkParams to capov1 portOpts +func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool, networkService *networking.Service) ([]capov1.PortOpts, error) { + ports := []capov1.PortOpts{} addressPairs := []capov1.AddressPair{} if !net.NoAllowedAddressPairs { addressPairs = []capov1.AddressPair{ @@ -112,19 +90,124 @@ func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool) portSecurity = &ps } - port := capov1.PortOpts{ - Network: &network, - AllowedAddressPairs: addressPairs, - Trunk: trunk, - DisablePortSecurity: portSecurity, - VNICType: net.VNICType, - FixedIPs: fixedIPs, - Tags: net.PortTags, + network := capov1.NetworkFilter{ + ID: net.UUID, + Name: net.Filter.Name, + Description: net.Filter.Description, + ProjectID: net.Filter.ProjectID, + Tags: net.Filter.Tags, + TagsAny: net.Filter.TagsAny, + NotTags: net.Filter.NotTags, + NotTagsAny: net.Filter.NotTagsAny, + } + if network.ID == "" { + network.ID = net.Filter.ID + } + + tags := net.PortTags + + if network.ID == "" && (net.Filter == Filter{}) { + // Case: network is undefined and only has subnets + // Create a port for each subnet + for _, subnet := range net.Subnets { + if subnet.Filter.ID == "" { + subnet.Filter.ID = subnet.UUID + } + + subnetID := subnet.UUID + if subnetID == "" { + subnetID = subnet.Filter.ID + } + + fixedIP := []capov1.FixedIP{ + { + Subnet: &capov1.SubnetFilter{ + Name: subnet.Filter.Name, + Description: subnet.Filter.Description, + ProjectID: subnet.Filter.ProjectID, + IPVersion: subnet.Filter.IPVersion, + GatewayIP: subnet.Filter.GatewayIP, + CIDR: subnet.Filter.CIDR, + IPv6AddressMode: subnet.Filter.IPv6AddressMode, + IPv6RAMode: subnet.Filter.IPv6RAMode, + ID: subnetID, + Tags: subnet.Filter.Tags, + TagsAny: subnet.Filter.TagsAny, + NotTags: subnet.Filter.NotTags, + NotTagsAny: subnet.Filter.NotTagsAny, + }, + }, + } + + portTags := append(tags, subnet.PortTags...) + + port := capov1.PortOpts{ + Network: &network, + AllowedAddressPairs: addressPairs, + Trunk: trunk, + DisablePortSecurity: portSecurity, + VNICType: net.VNICType, + FixedIPs: fixedIP, + Tags: portTags, + } + + // Fetch the UUID of the network subnet is attached to or the conversion will fail + netID, err := subnet.Filter.getNetworkID(networkService) + if err != nil { + return []capov1.PortOpts{}, nil + } + + port.Network.ID = netID + ports = append(ports, port) + + } + } else { + // Case: network and subnet are defined + // Create a single port with an interface for each subnet + fixedIPs := make([]capov1.FixedIP, len(net.Subnets)) + for i, subnet := range net.Subnets { + id := subnet.UUID + if id == "" { + id = subnet.Filter.ID + } + + fixedIPs[i] = capov1.FixedIP{ + Subnet: &capov1.SubnetFilter{ + Name: subnet.Filter.Name, + Description: subnet.Filter.Description, + ProjectID: subnet.Filter.ProjectID, + IPVersion: subnet.Filter.IPVersion, + GatewayIP: subnet.Filter.GatewayIP, + CIDR: subnet.Filter.CIDR, + IPv6AddressMode: subnet.Filter.IPv6AddressMode, + IPv6RAMode: subnet.Filter.IPv6RAMode, + ID: id, + Tags: subnet.Filter.Tags, + TagsAny: subnet.Filter.TagsAny, + NotTags: subnet.Filter.NotTags, + NotTagsAny: subnet.Filter.NotTagsAny, + }, + } + tags = append(tags, subnet.PortTags...) + } + + port := capov1.PortOpts{ + Network: &network, + AllowedAddressPairs: addressPairs, + Trunk: trunk, + DisablePortSecurity: portSecurity, + VNICType: net.VNICType, + FixedIPs: fixedIPs, + Tags: tags, + } + + ports = append(ports, port) } - return port + + return ports, nil } -func (ps OpenstackProviderSpec) toMachineSpec(apiVIP, ingressVIP string) capov1.OpenStackMachineSpec { +func (ps OpenstackProviderSpec) toMachineSpec(apiVIP, ingressVIP string, networkService *networking.Service) (capov1.OpenStackMachineSpec, error) { machineSpec := capov1.OpenStackMachineSpec{ CloudName: ps.CloudName, Flavor: ps.Flavor, @@ -191,25 +274,34 @@ func (ps OpenstackProviderSpec) toMachineSpec(apiVIP, ingressVIP string) capov1. } } - portList := make([]capov1.PortOpts, len(ps.Networks)) - for i, network := range ps.Networks { - portList[i] = network.toCapov1PortOpt(apiVIP, ingressVIP, &ps.Trunk) + portList := []capov1.PortOpts{} + for _, network := range ps.Networks { + ports, err := network.toCapov1PortOpt(apiVIP, ingressVIP, &ps.Trunk, networkService) + if err != nil { + return capov1.OpenStackMachineSpec{}, err + } + portList = append(portList, ports...) } machineSpec.Ports = append(machineSpec.Ports, portList...) - return machineSpec + return machineSpec, nil } -func NewOpenStackMachine(machine *machinev1.Machine, apiVIP, ingressVIP string) (*capov1.OpenStackMachine, error) { +func NewOpenStackMachine(machine *machinev1.Machine, apiVIP, ingressVIP string, networkService *networking.Service) (*capov1.OpenStackMachine, error) { providerSpec, err := MachineSpecFromProviderSpec(machine.Spec.ProviderSpec) if err != nil { return nil, err } + machineSpec, err := providerSpec.toMachineSpec(apiVIP, ingressVIP, networkService) + if err != nil { + return nil, err + } + osMachine := &capov1.OpenStackMachine{ ObjectMeta: machine.ObjectMeta, - Spec: providerSpec.toMachineSpec(apiVIP, ingressVIP), + Spec: machineSpec, } // if machine api master label exists, add v1beta control plane label to the node diff --git a/pkg/machine/actuator.go b/pkg/machine/actuator.go index 78b6ba631..a126af178 100644 --- a/pkg/machine/actuator.go +++ b/pkg/machine/actuator.go @@ -150,11 +150,17 @@ func (oc *OpenstackClient) Create(ctx context.Context, machine *machinev1.Machin return fmt.Errorf("Failed to retrieve cluster Infrastructure object: %v", err) } + networkService, err := osc.getNetworkService() + if err != nil { + return err + } + // Convert to capov1 osMachine, err := openstackconfigv1.NewOpenStackMachine( machine, clusterInfra.Status.PlatformStatus.OpenStack.APIServerInternalIP, clusterInfra.Status.PlatformStatus.OpenStack.IngressIP, + networkService, ) if err != nil { return err From d919393c066ba53f89743be978ffe13091559466 Mon Sep 17 00:00:00 2001 From: Emilio Garcia Date: Thu, 16 Dec 2021 11:13:01 -0500 Subject: [PATCH 4/4] clarification of code --- .../v1alpha1/convert.go | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go index 30656f33d..f2a08150b 100644 --- a/pkg/apis/openstackproviderconfig/v1alpha1/convert.go +++ b/pkg/apis/openstackproviderconfig/v1alpha1/convert.go @@ -55,6 +55,7 @@ func NewOpenStackCluster(providerSpec OpenstackClusterProviderSpec, providerStat } } +// Looks up a subnet in openstack and gets the ID of the network its attached to func (filter SubnetFilter) getNetworkID(networkService *networking.Service) (string, error) { listOpts := subnets.ListOpts(filter) subnets, err := networkService.GetSubnetsByFilter(listOpts) @@ -83,11 +84,15 @@ func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool, } } - portSecurity := net.PortSecurity + // Flip the value of port security if not nil + // must preserve 3 use cases: + // nil: openstack default + // true: set explicitly to true + // false: set explicitly to false + disablePortSecurity := net.PortSecurity if net.PortSecurity != nil { - ps := *portSecurity - ps = !ps - portSecurity = &ps + ps := !*disablePortSecurity + disablePortSecurity = &ps } network := capov1.NetworkFilter{ @@ -145,16 +150,18 @@ func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool, Network: &network, AllowedAddressPairs: addressPairs, Trunk: trunk, - DisablePortSecurity: portSecurity, + DisablePortSecurity: disablePortSecurity, VNICType: net.VNICType, FixedIPs: fixedIP, Tags: portTags, } // Fetch the UUID of the network subnet is attached to or the conversion will fail + // NOTE: limited to returning only 1 result, which deviates from CAPO api + // but resolves a lot of problems created by the previous api netID, err := subnet.Filter.getNetworkID(networkService) if err != nil { - return []capov1.PortOpts{}, nil + return []capov1.PortOpts{}, err } port.Network.ID = netID @@ -195,7 +202,7 @@ func (net NetworkParam) toCapov1PortOpt(apiVIP, ingressVIP string, trunk *bool, Network: &network, AllowedAddressPairs: addressPairs, Trunk: trunk, - DisablePortSecurity: portSecurity, + DisablePortSecurity: disablePortSecurity, VNICType: net.VNICType, FixedIPs: fixedIPs, Tags: tags,