From 6ddafd86556571d72cb819bf6d0513f99daca1ab Mon Sep 17 00:00:00 2001 From: Hidekazu Nakamura Date: Fri, 29 Oct 2021 07:55:17 +0000 Subject: [PATCH] Add v1beta1 API --- Makefile | 2 +- PROJECT | 12 + api/v1alpha3/conversion.go | 106 +- api/v1alpha3/doc.go | 2 +- api/v1alpha3/zz_generated.conversion.go | 792 ++++----- api/v1alpha4/conversion.go | 98 +- api/v1alpha4/doc.go | 1 + api/v1alpha4/groupversion_info.go | 2 + api/v1alpha4/openstackcluster_conversion.go | 33 + api/v1alpha4/openstackcluster_types.go | 1 - api/v1alpha4/openstackmachine_types.go | 1 - .../openstackmachinetemplate_types.go | 1 - api/v1alpha4/zz_generated.conversion.go | 1562 +++++++++++++++++ api/v1beta1/conversion.go | 35 + api/v1beta1/doc.go | 17 + api/v1beta1/groupversion_info.go | 36 + api/v1beta1/identity_types.go | 33 + api/v1beta1/openstackcluster_types.go | 239 +++ api/v1beta1/openstackcluster_webhook.go | 111 ++ api/v1beta1/openstackclusterlist_webhook.go | 32 + api/v1beta1/openstackclustertemplate_types.go | 56 + .../openstackclustertemplate_webhook.go | 79 + api/v1beta1/openstackmachine_types.go | 162 ++ api/v1beta1/openstackmachine_webhook.go | 113 ++ api/v1beta1/openstackmachinelist_webhook.go | 32 + api/v1beta1/openstackmachinetemplate_types.go | 51 + .../openstackmachinetemplate_webhook.go | 70 + .../openstackmachinetemplate_webhook_test.go | 100 ++ .../openstackmachinetemplatelist_webhook.go | 32 + api/v1beta1/types.go | 308 ++++ api/v1beta1/webhooks.go | 35 + api/v1beta1/zz_generated.deepcopy.go | 1005 +++++++++++ clusterctl-settings.json | 2 +- ...re.cluster.x-k8s.io_openstackclusters.yaml | 1404 +++++++++++++++ ...er.x-k8s.io_openstackclustertemplates.yaml | 688 ++++++++ ...re.cluster.x-k8s.io_openstackmachines.yaml | 416 +++++ ...er.x-k8s.io_openstackmachinetemplates.yaml | 373 ++++ config/crd/kustomization.yaml | 2 +- config/webhook/manifests.yaml | 147 ++ controllers/openstackcluster_controller.go | 2 +- controllers/openstackmachine_controller.go | 2 +- controllers/suite_test.go | 2 +- main.go | 38 +- metadata.yaml | 3 + pkg/cloud/services/compute/bastion.go | 2 +- pkg/cloud/services/compute/instance.go | 2 +- pkg/cloud/services/compute/instance_test.go | 2 +- pkg/cloud/services/compute/instance_types.go | 2 +- .../services/loadbalancer/loadbalancer.go | 2 +- pkg/cloud/services/networking/floatingip.go | 2 +- .../services/networking/floatingip_test.go | 2 +- pkg/cloud/services/networking/network.go | 2 +- pkg/cloud/services/networking/port.go | 2 +- pkg/cloud/services/networking/port_test.go | 2 +- pkg/cloud/services/networking/router.go | 2 +- .../services/networking/securitygroups.go | 2 +- pkg/cloud/services/provider/provider.go | 2 +- ...ster-template-external-cloud-provider.yaml | 12 +- templates/cluster-template-without-lb.yaml | 12 +- templates/cluster-template.yaml | 12 +- test/e2e/data/e2e_conf.yaml | 4 +- ...ster-template-external-cloud-provider.yaml | 12 +- .../cluster-template-multi-az.yaml | 12 +- .../cluster-template-multi-network.yaml | 12 +- .../cluster-template-without-lb.yaml | 12 +- .../cluster-template.yaml | 12 +- .../shared/v1beta1_provider/metadata.yaml | 15 + test/e2e/shared/common.go | 2 +- test/e2e/shared/defaults.go | 4 +- test/e2e/shared/openstack.go | 2 +- test/e2e/suites/e2e/e2e_test.go | 2 +- 71 files changed, 7847 insertions(+), 542 deletions(-) create mode 100644 api/v1alpha4/openstackcluster_conversion.go create mode 100644 api/v1alpha4/zz_generated.conversion.go create mode 100644 api/v1beta1/conversion.go create mode 100644 api/v1beta1/doc.go create mode 100644 api/v1beta1/groupversion_info.go create mode 100644 api/v1beta1/identity_types.go create mode 100644 api/v1beta1/openstackcluster_types.go create mode 100644 api/v1beta1/openstackcluster_webhook.go create mode 100644 api/v1beta1/openstackclusterlist_webhook.go create mode 100644 api/v1beta1/openstackclustertemplate_types.go create mode 100644 api/v1beta1/openstackclustertemplate_webhook.go create mode 100644 api/v1beta1/openstackmachine_types.go create mode 100644 api/v1beta1/openstackmachine_webhook.go create mode 100644 api/v1beta1/openstackmachinelist_webhook.go create mode 100644 api/v1beta1/openstackmachinetemplate_types.go create mode 100644 api/v1beta1/openstackmachinetemplate_webhook.go create mode 100644 api/v1beta1/openstackmachinetemplate_webhook_test.go create mode 100644 api/v1beta1/openstackmachinetemplatelist_webhook.go create mode 100644 api/v1beta1/types.go create mode 100644 api/v1beta1/webhooks.go create mode 100644 api/v1beta1/zz_generated.deepcopy.go create mode 100644 test/e2e/data/shared/v1beta1_provider/metadata.yaml diff --git a/Makefile b/Makefile index 83156ac64b..b5ade655e1 100644 --- a/Makefile +++ b/Makefile @@ -205,7 +205,7 @@ generate-go: $(MOCKGEN) object:headerFile=./hack/boilerplate/boilerplate.generatego.txt $(CONVERSION_GEN) \ - --input-dirs=./api/v1alpha4 \ + --input-dirs=./api/v1beta1 \ --output-file-base=zz_generated.conversion \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt diff --git a/PROJECT b/PROJECT index c34721b61a..cebb2ca655 100644 --- a/PROJECT +++ b/PROJECT @@ -23,3 +23,15 @@ resources: - group: infrastructure kind: OpenStackClusterTemplate version: v1alpha4 +- group: infrastructure + version: v1beta1 + kind: OpenStackCluster +- group: infrastructure + version: v1beta1 + kind: OpenStackMachine +- group: infrastructure + version: v1beta1 + kind: OpenStackMachineTemplate +- group: infrastructure + kind: OpenStackClusterTemplate + version: v1beta1 diff --git a/api/v1alpha3/conversion.go b/api/v1alpha3/conversion.go index 096955fad3..5578372046 100644 --- a/api/v1alpha3/conversion.go +++ b/api/v1alpha3/conversion.go @@ -21,146 +21,146 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion" - "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) var _ ctrlconversion.Convertible = &OpenStackCluster{} func (r *OpenStackCluster) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackCluster) + dst := dstRaw.(*v1beta1.OpenStackCluster) - return Convert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(r, dst, nil) + return Convert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(r, dst, nil) } func (r *OpenStackCluster) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackCluster) + src := srcRaw.(*v1beta1.OpenStackCluster) - return Convert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(src, r, nil) + return Convert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(src, r, nil) } var _ ctrlconversion.Convertible = &OpenStackClusterList{} func (r *OpenStackClusterList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackClusterList) + dst := dstRaw.(*v1beta1.OpenStackClusterList) - return Convert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(r, dst, nil) + return Convert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList(r, dst, nil) } func (r *OpenStackClusterList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackClusterList) + src := srcRaw.(*v1beta1.OpenStackClusterList) - return Convert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(src, r, nil) + return Convert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(src, r, nil) } var _ ctrlconversion.Convertible = &OpenStackMachine{} func (r *OpenStackMachine) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackMachine) + dst := dstRaw.(*v1beta1.OpenStackMachine) - return Convert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(r, dst, nil) + return Convert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(r, dst, nil) } func (r *OpenStackMachine) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackMachine) + src := srcRaw.(*v1beta1.OpenStackMachine) - return Convert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(src, r, nil) + return Convert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(src, r, nil) } var _ ctrlconversion.Convertible = &OpenStackMachineList{} func (r *OpenStackMachineList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackMachineList) + dst := dstRaw.(*v1beta1.OpenStackMachineList) - return Convert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(r, dst, nil) + return Convert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList(r, dst, nil) } func (r *OpenStackMachineList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackMachineList) + src := srcRaw.(*v1beta1.OpenStackMachineList) - return Convert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(src, r, nil) + return Convert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(src, r, nil) } var _ ctrlconversion.Convertible = &OpenStackMachineTemplate{} func (r *OpenStackMachineTemplate) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackMachineTemplate) + dst := dstRaw.(*v1beta1.OpenStackMachineTemplate) - return Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(r, dst, nil) + return Convert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(r, dst, nil) } func (r *OpenStackMachineTemplate) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackMachineTemplate) + src := srcRaw.(*v1beta1.OpenStackMachineTemplate) - return Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(src, r, nil) + return Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(src, r, nil) } var _ ctrlconversion.Convertible = &OpenStackMachineTemplateList{} func (r *OpenStackMachineTemplateList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*v1alpha4.OpenStackMachineTemplateList) + dst := dstRaw.(*v1beta1.OpenStackMachineTemplateList) - return Convert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(r, dst, nil) + return Convert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(r, dst, nil) } func (r *OpenStackMachineTemplateList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*v1alpha4.OpenStackMachineTemplateList) + src := srcRaw.(*v1beta1.OpenStackMachineTemplateList) - return Convert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(src, r, nil) + return Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(src, r, nil) } -// Convert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec has to be added by us because we dropped -// the useOctavia parameter. We don't have to migrate this parameter to v1alpha4 so there is nothing to do. -func Convert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1alpha4.OpenStackClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in, out, s) +// Convert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec has to be added by us because we dropped +// the useOctavia parameter. We don't have to migrate this parameter to v1beta1 so there is nothing to do. +func Convert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1beta1.OpenStackClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in, out, s) } -// Convert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec has to be added by us because we have to +// Convert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec has to be added by us because we have to // convert the Type of CloudsSecret from SecretReference to string. -func Convert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in *v1alpha4.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { +func Convert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in *v1beta1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { if in.IdentityRef != nil { out.CloudsSecret = &corev1.SecretReference{ Name: in.IdentityRef.Name, } } - return autoConvert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in, out, s) + return autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in, out, s) } -// Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec is an autogenerated conversion function. -// v1alpha4 drops the field .UserDataSecret which is why we reuqire to define the function here. -func Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1alpha4.OpenStackMachineSpec, s conversion.Scope) error { +// Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec is an autogenerated conversion function. +// v1beta1 drops the field .UserDataSecret which is why we reuqire to define the function here. +func Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1beta1.OpenStackMachineSpec, s conversion.Scope) error { if in.CloudsSecret != nil { - out.IdentityRef = &v1alpha4.OpenStackIdentityReference{ + out.IdentityRef = &v1beta1.OpenStackIdentityReference{ Name: in.CloudsSecret.Name, Kind: "Secret", } } - return autoConvert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in, out, s) + return autoConvert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in, out, s) } -// Convert_v1alpha4_Network_To_v1alpha3_Network has to be added by us for the new portOpts -// parameter in v1alpha4. There is no intention to support this parameter in v1alpha3, so the field is just dropped. -func Convert_v1alpha4_Network_To_v1alpha3_Network(in *v1alpha4.Network, out *Network, s conversion.Scope) error { - return autoConvert_v1alpha4_Network_To_v1alpha3_Network(in, out, s) +// Convert_v1beta1_Network_To_v1alpha3_Network has to be added by us for the new portOpts +// parameter in v1beta1. There is no intention to support this parameter in v1alpha3, so the field is just dropped. +func Convert_v1beta1_Network_To_v1alpha3_Network(in *v1beta1.Network, out *Network, s conversion.Scope) error { + return autoConvert_v1beta1_Network_To_v1alpha3_Network(in, out, s) } -// Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec has to be added by us for the new ports -// parameter in v1alpha4. There is no intention to support this parameter in v1alpha3, so the field is just dropped. +// Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec has to be added by us for the new ports +// parameter in v1beta1. There is no intention to support this parameter in v1alpha3, so the field is just dropped. // Further, we want to convert the Type of CloudsSecret from SecretReference to string. -func Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(in *v1alpha4.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(in, out, s) +func Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(in *v1beta1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(in, out, s) } -// Convert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus has to be added +// Convert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus has to be added // in order to drop the FailureReason and FailureMessage fields that are not present in v1alpha3. -func Convert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in *v1alpha4.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in, out, s) +func Convert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in *v1beta1.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in, out, s) } -func Convert_Slice_v1alpha4_Network_To_Slice_v1alpha3_Network(in *[]v1alpha4.Network, out *[]Network, s conversion.Scope) error { +func Convert_Slice_v1beta1_Network_To_Slice_v1alpha3_Network(in *[]v1beta1.Network, out *[]Network, s conversion.Scope) error { for i := range *in { inNet := &(*in)[i] outNet := new(Network) - if err := autoConvert_v1alpha4_Network_To_v1alpha3_Network(inNet, outNet, s); err != nil { + if err := autoConvert_v1beta1_Network_To_v1alpha3_Network(inNet, outNet, s); err != nil { return err } *out = append(*out, *outNet) @@ -168,11 +168,11 @@ func Convert_Slice_v1alpha4_Network_To_Slice_v1alpha3_Network(in *[]v1alpha4.Net return nil } -func Convert_Slice_v1alpha3_Network_To_Slice_v1alpha4_Network(in *[]Network, out *[]v1alpha4.Network, s conversion.Scope) error { +func Convert_Slice_v1alpha3_Network_To_Slice_v1beta1_Network(in *[]Network, out *[]v1beta1.Network, s conversion.Scope) error { for i := range *in { inNet := &(*in)[i] - outNet := new(v1alpha4.Network) - if err := autoConvert_v1alpha3_Network_To_v1alpha4_Network(inNet, outNet, s); err != nil { + outNet := new(v1beta1.Network) + if err := autoConvert_v1alpha3_Network_To_v1beta1_Network(inNet, outNet, s); err != nil { return err } *out = append(*out, *outNet) diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go index 8ecd58b4f5..26bba93d0d 100644 --- a/api/v1alpha3/doc.go +++ b/api/v1alpha3/doc.go @@ -14,5 +14,5 @@ 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/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 package v1alpha3 diff --git a/api/v1alpha3/zz_generated.conversion.go b/api/v1alpha3/zz_generated.conversion.go index 628ba57a4f..f99c3cd8f0 100644 --- a/api/v1alpha3/zz_generated.conversion.go +++ b/api/v1alpha3/zz_generated.conversion.go @@ -27,9 +27,9 @@ import ( v1 "k8s.io/api/core/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" errors "sigs.k8s.io/cluster-api/errors" ) @@ -40,364 +40,364 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1alpha4.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(a.(*Bastion), b.(*v1alpha4.Bastion), scope) + if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Bastion_To_v1beta1_Bastion(a.(*Bastion), b.(*v1beta1.Bastion), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(a.(*v1alpha4.Bastion), b.(*Bastion), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bastion_To_v1alpha3_Bastion(a.(*v1beta1.Bastion), b.(*Bastion), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1alpha4.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(a.(*ExternalRouterIPParam), b.(*v1alpha4.ExternalRouterIPParam), scope) + if err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1beta1.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(a.(*ExternalRouterIPParam), b.(*v1beta1.ExternalRouterIPParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ExternalRouterIPParam)(nil), (*ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(a.(*v1alpha4.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ExternalRouterIPParam)(nil), (*ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(a.(*v1beta1.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1alpha4.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Filter_To_v1alpha4_Filter(a.(*Filter), b.(*v1alpha4.Filter), scope) + if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta1.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Filter_To_v1beta1_Filter(a.(*Filter), b.(*v1beta1.Filter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Filter_To_v1alpha3_Filter(a.(*v1alpha4.Filter), b.(*Filter), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Filter_To_v1alpha3_Filter(a.(*v1beta1.Filter), b.(*Filter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Instance_To_v1alpha4_Instance(a.(*Instance), b.(*v1alpha4.Instance), scope) + if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Instance_To_v1beta1_Instance(a.(*Instance), b.(*v1beta1.Instance), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Instance_To_v1alpha3_Instance(a.(*v1alpha4.Instance), b.(*Instance), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Instance_To_v1alpha3_Instance(a.(*v1beta1.Instance), b.(*Instance), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1alpha4.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer(a.(*LoadBalancer), b.(*v1alpha4.LoadBalancer), scope) + if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1beta1.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_LoadBalancer_To_v1beta1_LoadBalancer(a.(*LoadBalancer), b.(*v1beta1.LoadBalancer), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer(a.(*v1alpha4.LoadBalancer), b.(*LoadBalancer), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LoadBalancer_To_v1alpha3_LoadBalancer(a.(*v1beta1.LoadBalancer), b.(*LoadBalancer), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1alpha4.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Network_To_v1alpha4_Network(a.(*Network), b.(*v1alpha4.Network), scope) + if err := s.AddGeneratedConversionFunc((*Network)(nil), (*v1beta1.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Network_To_v1beta1_Network(a.(*Network), b.(*v1beta1.Network), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*NetworkParam)(nil), (*v1alpha4.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_NetworkParam_To_v1alpha4_NetworkParam(a.(*NetworkParam), b.(*v1alpha4.NetworkParam), scope) + if err := s.AddGeneratedConversionFunc((*NetworkParam)(nil), (*v1beta1.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkParam_To_v1beta1_NetworkParam(a.(*NetworkParam), b.(*v1beta1.NetworkParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.NetworkParam)(nil), (*NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkParam_To_v1alpha3_NetworkParam(a.(*v1alpha4.NetworkParam), b.(*NetworkParam), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkParam)(nil), (*NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkParam_To_v1alpha3_NetworkParam(a.(*v1beta1.NetworkParam), b.(*NetworkParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1alpha4.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(a.(*OpenStackCluster), b.(*v1alpha4.OpenStackCluster), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1beta1.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(a.(*OpenStackCluster), b.(*v1beta1.OpenStackCluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackCluster)(nil), (*OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(a.(*v1alpha4.OpenStackCluster), b.(*OpenStackCluster), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackCluster)(nil), (*OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(a.(*v1beta1.OpenStackCluster), b.(*OpenStackCluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterList)(nil), (*v1alpha4.OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(a.(*OpenStackClusterList), b.(*v1alpha4.OpenStackClusterList), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackClusterList)(nil), (*v1beta1.OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList(a.(*OpenStackClusterList), b.(*v1beta1.OpenStackClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackClusterList)(nil), (*OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(a.(*v1alpha4.OpenStackClusterList), b.(*OpenStackClusterList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackClusterList)(nil), (*OpenStackClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(a.(*v1beta1.OpenStackClusterList), b.(*OpenStackClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterStatus)(nil), (*v1alpha4.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1alpha4.OpenStackClusterStatus), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackClusterStatus)(nil), (*v1beta1.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1beta1.OpenStackClusterStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1alpha4.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(a.(*OpenStackMachine), b.(*v1alpha4.OpenStackMachine), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1beta1.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(a.(*OpenStackMachine), b.(*v1beta1.OpenStackMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachine)(nil), (*OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(a.(*v1alpha4.OpenStackMachine), b.(*OpenStackMachine), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachine)(nil), (*OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(a.(*v1beta1.OpenStackMachine), b.(*OpenStackMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineList)(nil), (*v1alpha4.OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(a.(*OpenStackMachineList), b.(*v1alpha4.OpenStackMachineList), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineList)(nil), (*v1beta1.OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList(a.(*OpenStackMachineList), b.(*v1beta1.OpenStackMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineList)(nil), (*OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(a.(*v1alpha4.OpenStackMachineList), b.(*OpenStackMachineList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineList)(nil), (*OpenStackMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(a.(*v1beta1.OpenStackMachineList), b.(*OpenStackMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1alpha4.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1alpha4.OpenStackMachineStatus), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1beta1.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1beta1.OpenStackMachineStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(a.(*v1alpha4.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(a.(*v1beta1.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplate)(nil), (*v1alpha4.OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(a.(*OpenStackMachineTemplate), b.(*v1alpha4.OpenStackMachineTemplate), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplate)(nil), (*v1beta1.OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(a.(*OpenStackMachineTemplate), b.(*v1beta1.OpenStackMachineTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineTemplate)(nil), (*OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(a.(*v1alpha4.OpenStackMachineTemplate), b.(*OpenStackMachineTemplate), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplate)(nil), (*OpenStackMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(a.(*v1beta1.OpenStackMachineTemplate), b.(*OpenStackMachineTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateList)(nil), (*v1alpha4.OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(a.(*OpenStackMachineTemplateList), b.(*v1alpha4.OpenStackMachineTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateList)(nil), (*v1beta1.OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(a.(*OpenStackMachineTemplateList), b.(*v1beta1.OpenStackMachineTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineTemplateList)(nil), (*OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(a.(*v1alpha4.OpenStackMachineTemplateList), b.(*OpenStackMachineTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateList)(nil), (*OpenStackMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(a.(*v1beta1.OpenStackMachineTemplateList), b.(*OpenStackMachineTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateResource)(nil), (*v1alpha4.OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(a.(*OpenStackMachineTemplateResource), b.(*v1alpha4.OpenStackMachineTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateResource)(nil), (*v1beta1.OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(a.(*OpenStackMachineTemplateResource), b.(*v1beta1.OpenStackMachineTemplateResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineTemplateResource)(nil), (*OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(a.(*v1alpha4.OpenStackMachineTemplateResource), b.(*OpenStackMachineTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateResource)(nil), (*OpenStackMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(a.(*v1beta1.OpenStackMachineTemplateResource), b.(*OpenStackMachineTemplateResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateSpec)(nil), (*v1alpha4.OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(a.(*OpenStackMachineTemplateSpec), b.(*v1alpha4.OpenStackMachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*OpenStackMachineTemplateSpec)(nil), (*v1beta1.OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(a.(*OpenStackMachineTemplateSpec), b.(*v1beta1.OpenStackMachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OpenStackMachineTemplateSpec)(nil), (*OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(a.(*v1alpha4.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OpenStackMachineTemplateSpec)(nil), (*OpenStackMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(a.(*v1beta1.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*RootVolume)(nil), (*v1alpha4.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_RootVolume_To_v1alpha4_RootVolume(a.(*RootVolume), b.(*v1alpha4.RootVolume), scope) + if err := s.AddGeneratedConversionFunc((*RootVolume)(nil), (*v1beta1.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_RootVolume_To_v1beta1_RootVolume(a.(*RootVolume), b.(*v1beta1.RootVolume), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RootVolume_To_v1alpha3_RootVolume(a.(*v1alpha4.RootVolume), b.(*RootVolume), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RootVolume_To_v1alpha3_RootVolume(a.(*v1beta1.RootVolume), b.(*RootVolume), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1alpha4.Router)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Router_To_v1alpha4_Router(a.(*Router), b.(*v1alpha4.Router), scope) + if err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1beta1.Router)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Router_To_v1beta1_Router(a.(*Router), b.(*v1beta1.Router), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Router)(nil), (*Router)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Router_To_v1alpha3_Router(a.(*v1alpha4.Router), b.(*Router), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Router)(nil), (*Router)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Router_To_v1alpha3_Router(a.(*v1beta1.Router), b.(*Router), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1alpha4.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(a.(*SecurityGroup), b.(*v1alpha4.SecurityGroup), scope) + if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1beta1.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(a.(*SecurityGroup), b.(*v1beta1.SecurityGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*v1alpha4.SecurityGroup), b.(*SecurityGroup), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*v1beta1.SecurityGroup), b.(*SecurityGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SecurityGroupFilter)(nil), (*v1alpha4.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1alpha4.SecurityGroupFilter), scope) + if err := s.AddGeneratedConversionFunc((*SecurityGroupFilter)(nil), (*v1beta1.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1beta1.SecurityGroupFilter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(a.(*v1alpha4.SecurityGroupFilter), b.(*SecurityGroupFilter), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(a.(*v1beta1.SecurityGroupFilter), b.(*SecurityGroupFilter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SecurityGroupParam)(nil), (*v1alpha4.SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(a.(*SecurityGroupParam), b.(*v1alpha4.SecurityGroupParam), scope) + if err := s.AddGeneratedConversionFunc((*SecurityGroupParam)(nil), (*v1beta1.SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SecurityGroupParam_To_v1beta1_SecurityGroupParam(a.(*SecurityGroupParam), b.(*v1beta1.SecurityGroupParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SecurityGroupParam)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(a.(*v1alpha4.SecurityGroupParam), b.(*SecurityGroupParam), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupParam)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(a.(*v1beta1.SecurityGroupParam), b.(*SecurityGroupParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SecurityGroupRule)(nil), (*v1alpha4.SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(a.(*SecurityGroupRule), b.(*v1alpha4.SecurityGroupRule), scope) + if err := s.AddGeneratedConversionFunc((*SecurityGroupRule)(nil), (*v1beta1.SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SecurityGroupRule_To_v1beta1_SecurityGroupRule(a.(*SecurityGroupRule), b.(*v1beta1.SecurityGroupRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SecurityGroupRule)(nil), (*SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(a.(*v1alpha4.SecurityGroupRule), b.(*SecurityGroupRule), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroupRule)(nil), (*SecurityGroupRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(a.(*v1beta1.SecurityGroupRule), b.(*SecurityGroupRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1alpha4.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Subnet_To_v1alpha4_Subnet(a.(*Subnet), b.(*v1alpha4.Subnet), scope) + if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1beta1.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Subnet_To_v1beta1_Subnet(a.(*Subnet), b.(*v1beta1.Subnet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Subnet_To_v1alpha3_Subnet(a.(*v1alpha4.Subnet), b.(*Subnet), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Subnet)(nil), (*Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Subnet_To_v1alpha3_Subnet(a.(*v1beta1.Subnet), b.(*Subnet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SubnetFilter)(nil), (*v1alpha4.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(a.(*SubnetFilter), b.(*v1alpha4.SubnetFilter), scope) + if err := s.AddGeneratedConversionFunc((*SubnetFilter)(nil), (*v1beta1.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter(a.(*SubnetFilter), b.(*v1beta1.SubnetFilter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(a.(*v1alpha4.SubnetFilter), b.(*SubnetFilter), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter(a.(*v1beta1.SubnetFilter), b.(*SubnetFilter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SubnetParam)(nil), (*v1alpha4.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam(a.(*SubnetParam), b.(*v1alpha4.SubnetParam), scope) + if err := s.AddGeneratedConversionFunc((*SubnetParam)(nil), (*v1beta1.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam(a.(*SubnetParam), b.(*v1beta1.SubnetParam), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SubnetParam)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam(a.(*v1alpha4.SubnetParam), b.(*SubnetParam), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetParam)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam(a.(*v1beta1.SubnetParam), b.(*SubnetParam), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*[]Network)(nil), (*[]v1alpha4.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_Slice_v1alpha3_Network_To_Slice_v1alpha4_Network(a.(*[]Network), b.(*[]v1alpha4.Network), scope) + if err := s.AddConversionFunc((*[]Network)(nil), (*[]v1beta1.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1alpha3_Network_To_Slice_v1beta1_Network(a.(*[]Network), b.(*[]v1beta1.Network), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*[]v1alpha4.Network)(nil), (*[]Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_Slice_v1alpha4_Network_To_Slice_v1alpha3_Network(a.(*[]v1alpha4.Network), b.(*[]Network), scope) + if err := s.AddConversionFunc((*[]v1beta1.Network)(nil), (*[]Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_v1beta1_Network_To_Slice_v1alpha3_Network(a.(*[]v1beta1.Network), b.(*[]Network), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*v1beta1.APIEndpoint), scope) + if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1beta1.APIEndpoint), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*OpenStackClusterSpec)(nil), (*v1alpha4.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1alpha4.OpenStackClusterSpec), scope) + if err := s.AddConversionFunc((*OpenStackClusterSpec)(nil), (*v1beta1.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1beta1.OpenStackClusterSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*OpenStackMachineSpec)(nil), (*v1alpha4.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1alpha4.OpenStackMachineSpec), scope) + if err := s.AddConversionFunc((*OpenStackMachineSpec)(nil), (*v1beta1.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1beta1.OpenStackMachineSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Network_To_v1alpha3_Network(a.(*v1alpha4.Network), b.(*Network), scope) + if err := s.AddConversionFunc((*apiv1beta1.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1beta1.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(a.(*v1alpha4.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope) + if err := s.AddConversionFunc((*v1beta1.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Network_To_v1alpha3_Network(a.(*v1beta1.Network), b.(*Network), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(a.(*v1alpha4.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope) + if err := s.AddConversionFunc((*v1beta1.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(a.(*v1beta1.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(a.(*v1alpha4.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope) + if err := s.AddConversionFunc((*v1beta1.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(a.(*v1beta1.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1beta1.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope) + if err := s.AddConversionFunc((*v1beta1.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(a.(*v1beta1.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4.Bastion, s conversion.Scope) error { +func autoConvert_v1alpha3_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { out.Enabled = in.Enabled - if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { + if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { return err } out.AvailabilityZone = in.AvailabilityZone return nil } -// Convert_v1alpha3_Bastion_To_v1alpha4_Bastion is an autogenerated conversion function. -func Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4.Bastion, s conversion.Scope) error { - return autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in, out, s) +// Convert_v1alpha3_Bastion_To_v1beta1_Bastion is an autogenerated conversion function. +func Convert_v1alpha3_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { + return autoConvert_v1alpha3_Bastion_To_v1beta1_Bastion(in, out, s) } -func autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.Bastion, out *Bastion, s conversion.Scope) error { +func autoConvert_v1beta1_Bastion_To_v1alpha3_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { out.Enabled = in.Enabled - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { + if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Instance, &out.Instance, s); err != nil { return err } out.AvailabilityZone = in.AvailabilityZone return nil } -// Convert_v1alpha4_Bastion_To_v1alpha3_Bastion is an autogenerated conversion function. -func Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.Bastion, out *Bastion, s conversion.Scope) error { - return autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in, out, s) +// Convert_v1beta1_Bastion_To_v1alpha3_Bastion is an autogenerated conversion function. +func Convert_v1beta1_Bastion_To_v1alpha3_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { + return autoConvert_v1beta1_Bastion_To_v1alpha3_Bastion(in, out, s) } -func autoConvert_v1alpha3_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1alpha4.ExternalRouterIPParam, s conversion.Scope) error { +func autoConvert_v1alpha3_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { out.FixedIP = in.FixedIP - if err := Convert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { + if err := Convert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { return err } return nil } -// Convert_v1alpha3_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1alpha3_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1alpha4.ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1alpha3_ExternalRouterIPParam_To_v1alpha4_ExternalRouterIPParam(in, out, s) +// Convert_v1alpha3_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam is an autogenerated conversion function. +func Convert_v1alpha3_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { + return autoConvert_v1alpha3_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in, out, s) } -func autoConvert_v1alpha4_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in *v1alpha4.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { +func autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { out.FixedIP = in.FixedIP - if err := Convert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { + if err := Convert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { return err } return nil } -// Convert_v1alpha4_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1alpha4_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in *v1alpha4.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1alpha4_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in, out, s) +// Convert_v1beta1_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam is an autogenerated conversion function. +func Convert_v1beta1_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { + return autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha3_ExternalRouterIPParam(in, out, s) } -func autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.Filter, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -417,12 +417,12 @@ func autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.Fi return nil } -// Convert_v1alpha3_Filter_To_v1alpha4_Filter is an autogenerated conversion function. -func Convert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.Filter, s conversion.Scope) error { - return autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in, out, s) +// Convert_v1alpha3_Filter_To_v1beta1_Filter is an autogenerated conversion function. +func Convert_v1alpha3_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { + return autoConvert_v1alpha3_Filter_To_v1beta1_Filter(in, out, s) } -func autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.Filter, out *Filter, s conversion.Scope) error { +func autoConvert_v1beta1_Filter_To_v1alpha3_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { out.Status = in.Status out.Name = in.Name out.Description = in.Description @@ -442,12 +442,12 @@ func autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.Filter, out *Fi return nil } -// Convert_v1alpha4_Filter_To_v1alpha3_Filter is an autogenerated conversion function. -func Convert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.Filter, out *Filter, s conversion.Scope) error { - return autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in, out, s) +// Convert_v1beta1_Filter_To_v1alpha3_Filter is an autogenerated conversion function. +func Convert_v1beta1_Filter_To_v1alpha3_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { + return autoConvert_v1beta1_Filter_To_v1alpha3_Filter(in, out, s) } -func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alpha4.Instance, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -455,8 +455,8 @@ func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alp out.SecurityGroups = (*[]string)(unsafe.Pointer(in.SecurityGroups)) if in.Networks != nil { in, out := &in.Networks, &out.Networks - *out = new([]v1alpha4.Network) - if err := Convert_Slice_v1alpha3_Network_To_Slice_v1alpha4_Network(*in, *out, s); err != nil { + *out = new([]v1beta1.Network) + if err := Convert_Slice_v1alpha3_Network_To_Slice_v1beta1_Network(*in, *out, s); err != nil { return err } } else { @@ -470,20 +470,20 @@ func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alp out.UserData = in.UserData out.Metadata = *(*map[string]string)(unsafe.Pointer(&in.Metadata)) out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - out.RootVolume = (*v1alpha4.RootVolume)(unsafe.Pointer(in.RootVolume)) + out.RootVolume = (*v1beta1.RootVolume)(unsafe.Pointer(in.RootVolume)) out.ServerGroupID = in.ServerGroupID - out.State = v1alpha4.InstanceState(in.State) + out.State = v1beta1.InstanceState(in.State) out.IP = in.IP out.FloatingIP = in.FloatingIP return nil } -// Convert_v1alpha3_Instance_To_v1alpha4_Instance is an autogenerated conversion function. -func Convert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alpha4.Instance, s conversion.Scope) error { - return autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in, out, s) +// Convert_v1alpha3_Instance_To_v1beta1_Instance is an autogenerated conversion function. +func Convert_v1alpha3_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { + return autoConvert_v1alpha3_Instance_To_v1beta1_Instance(in, out, s) } -func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, out *Instance, s conversion.Scope) error { +func autoConvert_v1beta1_Instance_To_v1alpha3_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { out.ID = in.ID out.Name = in.Name out.Trunk = in.Trunk @@ -492,7 +492,7 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o if in.Networks != nil { in, out := &in.Networks, &out.Networks *out = new([]Network) - if err := Convert_Slice_v1alpha4_Network_To_Slice_v1alpha3_Network(*in, *out, s); err != nil { + if err := Convert_Slice_v1beta1_Network_To_Slice_v1alpha3_Network(*in, *out, s); err != nil { return err } } else { @@ -514,12 +514,12 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o return nil } -// Convert_v1alpha4_Instance_To_v1alpha3_Instance is an autogenerated conversion function. -func Convert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, out *Instance, s conversion.Scope) error { - return autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in, out, s) +// Convert_v1beta1_Instance_To_v1alpha3_Instance is an autogenerated conversion function. +func Convert_v1beta1_Instance_To_v1alpha3_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { + return autoConvert_v1beta1_Instance_To_v1alpha3_Instance(in, out, s) } -func autoConvert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer(in *LoadBalancer, out *v1alpha4.LoadBalancer, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -527,12 +527,12 @@ func autoConvert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer(in *LoadBalancer return nil } -// Convert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer is an autogenerated conversion function. -func Convert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer(in *LoadBalancer, out *v1alpha4.LoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha3_LoadBalancer_To_v1alpha4_LoadBalancer(in, out, s) +// Convert_v1alpha3_LoadBalancer_To_v1beta1_LoadBalancer is an autogenerated conversion function. +func Convert_v1alpha3_LoadBalancer_To_v1beta1_LoadBalancer(in *LoadBalancer, out *v1beta1.LoadBalancer, s conversion.Scope) error { + return autoConvert_v1alpha3_LoadBalancer_To_v1beta1_LoadBalancer(in, out, s) } -func autoConvert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer(in *v1alpha4.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { +func autoConvert_v1beta1_LoadBalancer_To_v1alpha3_LoadBalancer(in *v1beta1.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { out.Name = in.Name out.ID = in.ID out.IP = in.IP @@ -540,27 +540,27 @@ func autoConvert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer(in *v1alpha4.Loa return nil } -// Convert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer is an autogenerated conversion function. -func Convert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer(in *v1alpha4.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha4_LoadBalancer_To_v1alpha3_LoadBalancer(in, out, s) +// Convert_v1beta1_LoadBalancer_To_v1alpha3_LoadBalancer is an autogenerated conversion function. +func Convert_v1beta1_LoadBalancer_To_v1alpha3_LoadBalancer(in *v1beta1.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { + return autoConvert_v1beta1_LoadBalancer_To_v1alpha3_LoadBalancer(in, out, s) } -func autoConvert_v1alpha3_Network_To_v1alpha4_Network(in *Network, out *v1alpha4.Network, s conversion.Scope) error { +func autoConvert_v1alpha3_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 = (*v1alpha4.Subnet)(unsafe.Pointer(in.Subnet)) - out.Router = (*v1alpha4.Router)(unsafe.Pointer(in.Router)) - out.APIServerLoadBalancer = (*v1alpha4.LoadBalancer)(unsafe.Pointer(in.APIServerLoadBalancer)) + out.Subnet = (*v1beta1.Subnet)(unsafe.Pointer(in.Subnet)) + out.Router = (*v1beta1.Router)(unsafe.Pointer(in.Router)) + out.APIServerLoadBalancer = (*v1beta1.LoadBalancer)(unsafe.Pointer(in.APIServerLoadBalancer)) return nil } -// Convert_v1alpha3_Network_To_v1alpha4_Network is an autogenerated conversion function. -func Convert_v1alpha3_Network_To_v1alpha4_Network(in *Network, out *v1alpha4.Network, s conversion.Scope) error { - return autoConvert_v1alpha3_Network_To_v1alpha4_Network(in, out, s) +// Convert_v1alpha3_Network_To_v1beta1_Network is an autogenerated conversion function. +func Convert_v1alpha3_Network_To_v1beta1_Network(in *Network, out *v1beta1.Network, s conversion.Scope) error { + return autoConvert_v1alpha3_Network_To_v1beta1_Network(in, out, s) } -func autoConvert_v1alpha4_Network_To_v1alpha3_Network(in *v1alpha4.Network, out *Network, s conversion.Scope) error { +func autoConvert_v1beta1_Network_To_v1alpha3_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)) @@ -571,75 +571,75 @@ func autoConvert_v1alpha4_Network_To_v1alpha3_Network(in *v1alpha4.Network, out return nil } -func autoConvert_v1alpha3_NetworkParam_To_v1alpha4_NetworkParam(in *NetworkParam, out *v1alpha4.NetworkParam, s conversion.Scope) error { +func autoConvert_v1alpha3_NetworkParam_To_v1beta1_NetworkParam(in *NetworkParam, out *v1beta1.NetworkParam, s conversion.Scope) error { out.UUID = in.UUID out.FixedIP = in.FixedIP - if err := Convert_v1alpha3_Filter_To_v1alpha4_Filter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1alpha3_Filter_To_v1beta1_Filter(&in.Filter, &out.Filter, s); err != nil { return err } - out.Subnets = *(*[]v1alpha4.SubnetParam)(unsafe.Pointer(&in.Subnets)) + out.Subnets = *(*[]v1beta1.SubnetParam)(unsafe.Pointer(&in.Subnets)) return nil } -// Convert_v1alpha3_NetworkParam_To_v1alpha4_NetworkParam is an autogenerated conversion function. -func Convert_v1alpha3_NetworkParam_To_v1alpha4_NetworkParam(in *NetworkParam, out *v1alpha4.NetworkParam, s conversion.Scope) error { - return autoConvert_v1alpha3_NetworkParam_To_v1alpha4_NetworkParam(in, out, s) +// Convert_v1alpha3_NetworkParam_To_v1beta1_NetworkParam is an autogenerated conversion function. +func Convert_v1alpha3_NetworkParam_To_v1beta1_NetworkParam(in *NetworkParam, out *v1beta1.NetworkParam, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkParam_To_v1beta1_NetworkParam(in, out, s) } -func autoConvert_v1alpha4_NetworkParam_To_v1alpha3_NetworkParam(in *v1alpha4.NetworkParam, out *NetworkParam, s conversion.Scope) error { +func autoConvert_v1beta1_NetworkParam_To_v1alpha3_NetworkParam(in *v1beta1.NetworkParam, out *NetworkParam, s conversion.Scope) error { out.UUID = in.UUID out.FixedIP = in.FixedIP - if err := Convert_v1alpha4_Filter_To_v1alpha3_Filter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1beta1_Filter_To_v1alpha3_Filter(&in.Filter, &out.Filter, s); err != nil { return err } out.Subnets = *(*[]SubnetParam)(unsafe.Pointer(&in.Subnets)) return nil } -// Convert_v1alpha4_NetworkParam_To_v1alpha3_NetworkParam is an autogenerated conversion function. -func Convert_v1alpha4_NetworkParam_To_v1alpha3_NetworkParam(in *v1alpha4.NetworkParam, out *NetworkParam, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkParam_To_v1alpha3_NetworkParam(in, out, s) +// Convert_v1beta1_NetworkParam_To_v1alpha3_NetworkParam is an autogenerated conversion function. +func Convert_v1beta1_NetworkParam_To_v1alpha3_NetworkParam(in *v1beta1.NetworkParam, out *NetworkParam, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkParam_To_v1alpha3_NetworkParam(in, out, s) } -func autoConvert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(in *OpenStackCluster, out *v1alpha4.OpenStackCluster, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(in *OpenStackCluster, out *v1alpha4.OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(in, out, s) +// Convert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(in, out, s) } -func autoConvert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(in *v1alpha4.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(in *v1alpha4.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(in, out, s) +// Convert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster is an autogenerated conversion function. +func Convert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(in, out, s) } -func autoConvert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in *OpenStackClusterList, out *v1alpha4.OpenStackClusterList, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in *OpenStackClusterList, out *v1beta1.OpenStackClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.OpenStackCluster, len(*in)) + *out = make([]v1beta1.OpenStackCluster, len(*in)) for i := range *in { - if err := Convert_v1alpha3_OpenStackCluster_To_v1alpha4_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_OpenStackCluster_To_v1beta1_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -649,18 +649,18 @@ func autoConvert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList( return nil } -// Convert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in *OpenStackClusterList, out *v1alpha4.OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackClusterList_To_v1alpha4_OpenStackClusterList(in, out, s) +// Convert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in *OpenStackClusterList, out *v1beta1.OpenStackClusterList, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in, out, s) } -func autoConvert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in *v1alpha4.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in *v1beta1.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]OpenStackCluster, len(*in)) for i := range *in { - if err := Convert_v1alpha4_OpenStackCluster_To_v1alpha3_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_OpenStackCluster_To_v1alpha3_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -670,23 +670,23 @@ func autoConvert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList( return nil } -// Convert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in *v1alpha4.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in, out, s) +// Convert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList is an autogenerated conversion function. +func Convert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in *v1beta1.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackClusterList_To_v1alpha3_OpenStackClusterList(in, out, s) } -func autoConvert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1alpha4.OpenStackClusterSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1beta1.OpenStackClusterSpec, s conversion.Scope) error { // INFO: in.CloudsSecret opted out of conversion generation out.CloudName = in.CloudName out.NodeCIDR = in.NodeCIDR - if err := Convert_v1alpha3_Filter_To_v1alpha4_Filter(&in.Network, &out.Network, s); err != nil { + if err := Convert_v1alpha3_Filter_To_v1beta1_Filter(&in.Network, &out.Network, s); err != nil { return err } - if err := Convert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { + if err := Convert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { return err } out.DNSNameservers = *(*[]string)(unsafe.Pointer(&in.DNSNameservers)) - out.ExternalRouterIPs = *(*[]v1alpha4.ExternalRouterIPParam)(unsafe.Pointer(&in.ExternalRouterIPs)) + out.ExternalRouterIPs = *(*[]v1beta1.ExternalRouterIPParam)(unsafe.Pointer(&in.ExternalRouterIPs)) out.ExternalNetworkID = in.ExternalNetworkID // WARNING: in.UseOctavia requires manual conversion: does not exist in peer-type out.ManagedAPIServerLoadBalancer = in.ManagedAPIServerLoadBalancer @@ -702,8 +702,8 @@ func autoConvert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec( out.ControlPlaneAvailabilityZones = *(*[]string)(unsafe.Pointer(&in.ControlPlaneAvailabilityZones)) if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion - *out = new(v1alpha4.Bastion) - if err := Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(*in, *out, s); err != nil { + *out = new(v1beta1.Bastion) + if err := Convert_v1alpha3_Bastion_To_v1beta1_Bastion(*in, *out, s); err != nil { return err } } else { @@ -712,13 +712,13 @@ func autoConvert_v1alpha3_OpenStackClusterSpec_To_v1alpha4_OpenStackClusterSpec( return nil } -func autoConvert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in *v1alpha4.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec(in *v1beta1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { out.CloudName = in.CloudName out.NodeCIDR = in.NodeCIDR - if err := Convert_v1alpha4_Filter_To_v1alpha3_Filter(&in.Network, &out.Network, s); err != nil { + if err := Convert_v1beta1_Filter_To_v1alpha3_Filter(&in.Network, &out.Network, s); err != nil { return err } - if err := Convert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { + if err := Convert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter(&in.Subnet, &out.Subnet, s); err != nil { return err } out.DNSNameservers = *(*[]string)(unsafe.Pointer(&in.DNSNameservers)) @@ -741,7 +741,7 @@ func autoConvert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec( if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion *out = new(Bastion) - if err := Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(*in, *out, s); err != nil { + if err := Convert_v1beta1_Bastion_To_v1alpha3_Bastion(*in, *out, s); err != nil { return err } } else { @@ -751,12 +751,12 @@ func autoConvert_v1alpha4_OpenStackClusterSpec_To_v1alpha3_OpenStackClusterSpec( return nil } -func autoConvert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1alpha4.OpenStackClusterStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1beta1.OpenStackClusterStatus, s conversion.Scope) error { out.Ready = in.Ready if in.Network != nil { in, out := &in.Network, &out.Network - *out = new(v1alpha4.Network) - if err := Convert_v1alpha3_Network_To_v1alpha4_Network(*in, *out, s); err != nil { + *out = new(v1beta1.Network) + if err := Convert_v1alpha3_Network_To_v1beta1_Network(*in, *out, s); err != nil { return err } } else { @@ -764,21 +764,21 @@ func autoConvert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterSta } if in.ExternalNetwork != nil { in, out := &in.ExternalNetwork, &out.ExternalNetwork - *out = new(v1alpha4.Network) - if err := Convert_v1alpha3_Network_To_v1alpha4_Network(*in, *out, s); err != nil { + *out = new(v1beta1.Network) + if err := Convert_v1alpha3_Network_To_v1beta1_Network(*in, *out, s); err != nil { return err } } else { out.ExternalNetwork = nil } - out.FailureDomains = *(*v1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.ControlPlaneSecurityGroup = (*v1alpha4.SecurityGroup)(unsafe.Pointer(in.ControlPlaneSecurityGroup)) - out.WorkerSecurityGroup = (*v1alpha4.SecurityGroup)(unsafe.Pointer(in.WorkerSecurityGroup)) - out.BastionSecurityGroup = (*v1alpha4.SecurityGroup)(unsafe.Pointer(in.BastionSecurityGroup)) + 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)) if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion - *out = new(v1alpha4.Instance) - if err := Convert_v1alpha3_Instance_To_v1alpha4_Instance(*in, *out, s); err != nil { + *out = new(v1beta1.Instance) + if err := Convert_v1alpha3_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { return err } } else { @@ -787,17 +787,17 @@ func autoConvert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterSta return nil } -// Convert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1alpha4.OpenStackClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackClusterStatus_To_v1alpha4_OpenStackClusterStatus(in, out, s) +// Convert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in *OpenStackClusterStatus, out *v1beta1.OpenStackClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in, out, s) } -func autoConvert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in *v1alpha4.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterStatus(in *v1beta1.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { out.Ready = in.Ready if in.Network != nil { in, out := &in.Network, &out.Network *out = new(Network) - if err := Convert_v1alpha4_Network_To_v1alpha3_Network(*in, *out, s); err != nil { + if err := Convert_v1beta1_Network_To_v1alpha3_Network(*in, *out, s); err != nil { return err } } else { @@ -806,7 +806,7 @@ func autoConvert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterSta if in.ExternalNetwork != nil { in, out := &in.ExternalNetwork, &out.ExternalNetwork *out = new(Network) - if err := Convert_v1alpha4_Network_To_v1alpha3_Network(*in, *out, s); err != nil { + if err := Convert_v1beta1_Network_To_v1alpha3_Network(*in, *out, s); err != nil { return err } } else { @@ -819,7 +819,7 @@ func autoConvert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterSta if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion *out = new(Instance) - if err := Convert_v1alpha4_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { + if err := Convert_v1beta1_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { return err } } else { @@ -830,45 +830,45 @@ func autoConvert_v1alpha4_OpenStackClusterStatus_To_v1alpha3_OpenStackClusterSta return nil } -func autoConvert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(in *OpenStackMachine, out *v1alpha4.OpenStackMachine, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(in *OpenStackMachine, out *v1alpha4.OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(in, out, s) +// Convert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(in *v1alpha4.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(in *v1alpha4.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(in, out, s) +// Convert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in *OpenStackMachineList, out *v1alpha4.OpenStackMachineList, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in *OpenStackMachineList, out *v1beta1.OpenStackMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.OpenStackMachine, len(*in)) + *out = make([]v1beta1.OpenStackMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha3_OpenStackMachine_To_v1alpha4_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_OpenStackMachine_To_v1beta1_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -878,18 +878,18 @@ func autoConvert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList( return nil } -// Convert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in *OpenStackMachineList, out *v1alpha4.OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineList_To_v1alpha4_OpenStackMachineList(in, out, s) +// Convert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in *OpenStackMachineList, out *v1beta1.OpenStackMachineList, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in *v1alpha4.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in *v1beta1.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]OpenStackMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha4_OpenStackMachine_To_v1alpha3_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_OpenStackMachine_To_v1alpha3_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -899,12 +899,12 @@ func autoConvert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList( return nil } -// Convert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in *v1alpha4.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in, out, s) +// Convert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in *v1beta1.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineList_To_v1alpha3_OpenStackMachineList(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1alpha4.OpenStackMachineSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_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)) // INFO: in.CloudsSecret opted out of conversion generation @@ -912,21 +912,21 @@ func autoConvert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec( out.Flavor = in.Flavor out.Image = in.Image out.SSHKeyName = in.SSHKeyName - out.Networks = *(*[]v1alpha4.NetworkParam)(unsafe.Pointer(&in.Networks)) + out.Networks = *(*[]v1beta1.NetworkParam)(unsafe.Pointer(&in.Networks)) out.Subnet = in.Subnet out.FloatingIP = in.FloatingIP - out.SecurityGroups = *(*[]v1alpha4.SecurityGroupParam)(unsafe.Pointer(&in.SecurityGroups)) + out.SecurityGroups = *(*[]v1beta1.SecurityGroupParam)(unsafe.Pointer(&in.SecurityGroups)) // WARNING: in.UserDataSecret requires manual conversion: does not exist in peer-type 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 = (*v1alpha4.RootVolume)(unsafe.Pointer(in.RootVolume)) + out.RootVolume = (*v1beta1.RootVolume)(unsafe.Pointer(in.RootVolume)) out.ServerGroupID = in.ServerGroupID return nil } -func autoConvert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(in *v1alpha4.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha3_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 @@ -948,21 +948,21 @@ func autoConvert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec( return nil } -func autoConvert_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1alpha4.OpenStackMachineStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_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 = (*v1alpha4.InstanceState)(unsafe.Pointer(in.InstanceState)) + 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_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1alpha4.OpenStackMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineStatus_To_v1alpha4_OpenStackMachineStatus(in, out, s) +// Convert_v1alpha3_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1beta1.OpenStackMachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(in *v1alpha4.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha3_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)) @@ -971,44 +971,44 @@ func autoConvert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineSta return nil } -// Convert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(in *v1alpha4.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(in, out, s) +// Convert_v1beta1_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(in *v1beta1.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha3_OpenStackMachineStatus(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1alpha4.OpenStackMachineTemplate, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1alpha4.OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(in, out, s) +// Convert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in *v1alpha4.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in *v1alpha4.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in, out, s) +// Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1alpha4.OpenStackMachineTemplateList, s conversion.Scope) error { +func autoConvert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1beta1.OpenStackMachineTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.OpenStackMachineTemplate, len(*in)) + *out = make([]v1beta1.OpenStackMachineTemplate, len(*in)) for i := range *in { - if err := Convert_v1alpha3_OpenStackMachineTemplate_To_v1alpha4_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1018,18 +1018,18 @@ func autoConvert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMach return nil } -// Convert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1alpha4.OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineTemplateList_To_v1alpha4_OpenStackMachineTemplateList(in, out, s) +// Convert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1beta1.OpenStackMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in *v1alpha4.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { +func autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in *v1beta1.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]OpenStackMachineTemplate, len(*in)) for i := range *in { - if err := Convert_v1alpha4_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha3_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1039,60 +1039,60 @@ func autoConvert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMach return nil } -// Convert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in *v1alpha4.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in, out, s) +// Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in *v1beta1.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha3_OpenStackMachineTemplateList(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1alpha4.OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1alpha4_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha3_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1alpha4.OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(in, out, s) +// Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in *v1alpha4.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { + if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha3_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in *v1alpha4.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in, out, s) +// Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(in, out, s) } -func autoConvert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1alpha4.OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1alpha4_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1alpha4.OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_OpenStackMachineTemplateSpec_To_v1alpha4_OpenStackMachineTemplateSpec(in, out, s) +// Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in *v1alpha4.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha3_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in *v1alpha4.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in, out, s) +// Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha3_OpenStackMachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha3_RootVolume_To_v1alpha4_RootVolume(in *RootVolume, out *v1alpha4.RootVolume, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -1100,12 +1100,12 @@ func autoConvert_v1alpha3_RootVolume_To_v1alpha4_RootVolume(in *RootVolume, out return nil } -// Convert_v1alpha3_RootVolume_To_v1alpha4_RootVolume is an autogenerated conversion function. -func Convert_v1alpha3_RootVolume_To_v1alpha4_RootVolume(in *RootVolume, out *v1alpha4.RootVolume, s conversion.Scope) error { - return autoConvert_v1alpha3_RootVolume_To_v1alpha4_RootVolume(in, out, s) +// Convert_v1alpha3_RootVolume_To_v1beta1_RootVolume is an autogenerated conversion function. +func Convert_v1alpha3_RootVolume_To_v1beta1_RootVolume(in *RootVolume, out *v1beta1.RootVolume, s conversion.Scope) error { + return autoConvert_v1alpha3_RootVolume_To_v1beta1_RootVolume(in, out, s) } -func autoConvert_v1alpha4_RootVolume_To_v1alpha3_RootVolume(in *v1alpha4.RootVolume, out *RootVolume, s conversion.Scope) error { +func autoConvert_v1beta1_RootVolume_To_v1alpha3_RootVolume(in *v1beta1.RootVolume, out *RootVolume, s conversion.Scope) error { out.SourceType = in.SourceType out.SourceUUID = in.SourceUUID out.DeviceType = in.DeviceType @@ -1113,60 +1113,60 @@ func autoConvert_v1alpha4_RootVolume_To_v1alpha3_RootVolume(in *v1alpha4.RootVol return nil } -// Convert_v1alpha4_RootVolume_To_v1alpha3_RootVolume is an autogenerated conversion function. -func Convert_v1alpha4_RootVolume_To_v1alpha3_RootVolume(in *v1alpha4.RootVolume, out *RootVolume, s conversion.Scope) error { - return autoConvert_v1alpha4_RootVolume_To_v1alpha3_RootVolume(in, out, s) +// Convert_v1beta1_RootVolume_To_v1alpha3_RootVolume is an autogenerated conversion function. +func Convert_v1beta1_RootVolume_To_v1alpha3_RootVolume(in *v1beta1.RootVolume, out *RootVolume, s conversion.Scope) error { + return autoConvert_v1beta1_RootVolume_To_v1alpha3_RootVolume(in, out, s) } -func autoConvert_v1alpha3_Router_To_v1alpha4_Router(in *Router, out *v1alpha4.Router, s conversion.Scope) error { +func autoConvert_v1alpha3_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_v1alpha3_Router_To_v1alpha4_Router is an autogenerated conversion function. -func Convert_v1alpha3_Router_To_v1alpha4_Router(in *Router, out *v1alpha4.Router, s conversion.Scope) error { - return autoConvert_v1alpha3_Router_To_v1alpha4_Router(in, out, s) +// Convert_v1alpha3_Router_To_v1beta1_Router is an autogenerated conversion function. +func Convert_v1alpha3_Router_To_v1beta1_Router(in *Router, out *v1beta1.Router, s conversion.Scope) error { + return autoConvert_v1alpha3_Router_To_v1beta1_Router(in, out, s) } -func autoConvert_v1alpha4_Router_To_v1alpha3_Router(in *v1alpha4.Router, out *Router, s conversion.Scope) error { +func autoConvert_v1beta1_Router_To_v1alpha3_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_v1alpha4_Router_To_v1alpha3_Router is an autogenerated conversion function. -func Convert_v1alpha4_Router_To_v1alpha3_Router(in *v1alpha4.Router, out *Router, s conversion.Scope) error { - return autoConvert_v1alpha4_Router_To_v1alpha3_Router(in, out, s) +// Convert_v1beta1_Router_To_v1alpha3_Router is an autogenerated conversion function. +func Convert_v1beta1_Router_To_v1alpha3_Router(in *v1beta1.Router, out *Router, s conversion.Scope) error { + return autoConvert_v1beta1_Router_To_v1alpha3_Router(in, out, s) } -func autoConvert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in *SecurityGroup, out *v1alpha4.SecurityGroup, s conversion.Scope) error { +func autoConvert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { out.Name = in.Name out.ID = in.ID - out.Rules = *(*[]v1alpha4.SecurityGroupRule)(unsafe.Pointer(&in.Rules)) + out.Rules = *(*[]v1beta1.SecurityGroupRule)(unsafe.Pointer(&in.Rules)) return nil } -// Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup is an autogenerated conversion function. -func Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in *SecurityGroup, out *v1alpha4.SecurityGroup, s conversion.Scope) error { - return autoConvert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in, out, s) +// Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup is an autogenerated conversion function. +func Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { + return autoConvert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in, out, s) } -func autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { +func autoConvert_v1beta1_SecurityGroup_To_v1alpha3_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_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in, out, s) +// Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(in, out, s) } -func autoConvert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in *SecurityGroupFilter, out *v1alpha4.SecurityGroupFilter, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -1183,12 +1183,12 @@ func autoConvert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in return nil } -// Convert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter is an autogenerated conversion function. -func Convert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in *SecurityGroupFilter, out *v1alpha4.SecurityGroupFilter, s conversion.Scope) error { - return autoConvert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(in, out, s) +// Convert_v1alpha3_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter is an autogenerated conversion function. +func Convert_v1alpha3_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in *SecurityGroupFilter, out *v1beta1.SecurityGroupFilter, s conversion.Scope) error { + return autoConvert_v1alpha3_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in, out, s) } -func autoConvert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in *v1alpha4.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { +func autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in *v1beta1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { out.ID = in.ID out.Name = in.Name out.Description = in.Description @@ -1205,40 +1205,40 @@ func autoConvert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in return nil } -// Convert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in *v1alpha4.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in, out, s) +// Convert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in *v1beta1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(in, out, s) } -func autoConvert_v1alpha3_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in *SecurityGroupParam, out *v1alpha4.SecurityGroupParam, s conversion.Scope) error { +func autoConvert_v1alpha3_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *v1beta1.SecurityGroupParam, s conversion.Scope) error { out.UUID = in.UUID out.Name = in.Name - if err := Convert_v1alpha3_SecurityGroupFilter_To_v1alpha4_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1alpha3_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { return err } return nil } -// Convert_v1alpha3_SecurityGroupParam_To_v1alpha4_SecurityGroupParam is an autogenerated conversion function. -func Convert_v1alpha3_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in *SecurityGroupParam, out *v1alpha4.SecurityGroupParam, s conversion.Scope) error { - return autoConvert_v1alpha3_SecurityGroupParam_To_v1alpha4_SecurityGroupParam(in, out, s) +// Convert_v1alpha3_SecurityGroupParam_To_v1beta1_SecurityGroupParam is an autogenerated conversion function. +func Convert_v1alpha3_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *v1beta1.SecurityGroupParam, s conversion.Scope) error { + return autoConvert_v1alpha3_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in, out, s) } -func autoConvert_v1alpha4_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in *v1alpha4.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { +func autoConvert_v1beta1_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in *v1beta1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { out.UUID = in.UUID out.Name = in.Name - if err := Convert_v1alpha4_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1beta1_SecurityGroupFilter_To_v1alpha3_SecurityGroupFilter(&in.Filter, &out.Filter, s); err != nil { return err } return nil } -// Convert_v1alpha4_SecurityGroupParam_To_v1alpha3_SecurityGroupParam is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in *v1alpha4.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in, out, s) +// Convert_v1beta1_SecurityGroupParam_To_v1alpha3_SecurityGroupParam is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in *v1beta1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroupParam_To_v1alpha3_SecurityGroupParam(in, out, s) } -func autoConvert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in *SecurityGroupRule, out *v1alpha4.SecurityGroupRule, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -1252,12 +1252,12 @@ func autoConvert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in *Se return nil } -// Convert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule is an autogenerated conversion function. -func Convert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in *SecurityGroupRule, out *v1alpha4.SecurityGroupRule, s conversion.Scope) error { - return autoConvert_v1alpha3_SecurityGroupRule_To_v1alpha4_SecurityGroupRule(in, out, s) +// Convert_v1alpha3_SecurityGroupRule_To_v1beta1_SecurityGroupRule is an autogenerated conversion function. +func Convert_v1alpha3_SecurityGroupRule_To_v1beta1_SecurityGroupRule(in *SecurityGroupRule, out *v1beta1.SecurityGroupRule, s conversion.Scope) error { + return autoConvert_v1alpha3_SecurityGroupRule_To_v1beta1_SecurityGroupRule(in, out, s) } -func autoConvert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in *v1alpha4.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { +func autoConvert_v1beta1_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in *v1beta1.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { out.Description = in.Description out.ID = in.ID out.Direction = in.Direction @@ -1271,12 +1271,12 @@ func autoConvert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in *v1 return nil } -// Convert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in *v1alpha4.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in, out, s) +// Convert_v1beta1_SecurityGroupRule_To_v1alpha3_SecurityGroupRule is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in *v1beta1.SecurityGroupRule, out *SecurityGroupRule, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroupRule_To_v1alpha3_SecurityGroupRule(in, out, s) } -func autoConvert_v1alpha3_Subnet_To_v1alpha4_Subnet(in *Subnet, out *v1alpha4.Subnet, s conversion.Scope) error { +func autoConvert_v1alpha3_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 @@ -1284,12 +1284,12 @@ func autoConvert_v1alpha3_Subnet_To_v1alpha4_Subnet(in *Subnet, out *v1alpha4.Su return nil } -// Convert_v1alpha3_Subnet_To_v1alpha4_Subnet is an autogenerated conversion function. -func Convert_v1alpha3_Subnet_To_v1alpha4_Subnet(in *Subnet, out *v1alpha4.Subnet, s conversion.Scope) error { - return autoConvert_v1alpha3_Subnet_To_v1alpha4_Subnet(in, out, s) +// Convert_v1alpha3_Subnet_To_v1beta1_Subnet is an autogenerated conversion function. +func Convert_v1alpha3_Subnet_To_v1beta1_Subnet(in *Subnet, out *v1beta1.Subnet, s conversion.Scope) error { + return autoConvert_v1alpha3_Subnet_To_v1beta1_Subnet(in, out, s) } -func autoConvert_v1alpha4_Subnet_To_v1alpha3_Subnet(in *v1alpha4.Subnet, out *Subnet, s conversion.Scope) error { +func autoConvert_v1beta1_Subnet_To_v1alpha3_Subnet(in *v1beta1.Subnet, out *Subnet, s conversion.Scope) error { out.Name = in.Name out.ID = in.ID out.CIDR = in.CIDR @@ -1297,12 +1297,12 @@ func autoConvert_v1alpha4_Subnet_To_v1alpha3_Subnet(in *v1alpha4.Subnet, out *Su return nil } -// Convert_v1alpha4_Subnet_To_v1alpha3_Subnet is an autogenerated conversion function. -func Convert_v1alpha4_Subnet_To_v1alpha3_Subnet(in *v1alpha4.Subnet, out *Subnet, s conversion.Scope) error { - return autoConvert_v1alpha4_Subnet_To_v1alpha3_Subnet(in, out, s) +// Convert_v1beta1_Subnet_To_v1alpha3_Subnet is an autogenerated conversion function. +func Convert_v1beta1_Subnet_To_v1alpha3_Subnet(in *v1beta1.Subnet, out *Subnet, s conversion.Scope) error { + return autoConvert_v1beta1_Subnet_To_v1alpha3_Subnet(in, out, s) } -func autoConvert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(in *SubnetFilter, out *v1alpha4.SubnetFilter, s conversion.Scope) error { +func autoConvert_v1alpha3_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)) @@ -1327,12 +1327,12 @@ func autoConvert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(in *SubnetFilter return nil } -// Convert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter is an autogenerated conversion function. -func Convert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(in *SubnetFilter, out *v1alpha4.SubnetFilter, s conversion.Scope) error { - return autoConvert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(in, out, s) +// Convert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter is an autogenerated conversion function. +func Convert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter(in *SubnetFilter, out *v1beta1.SubnetFilter, s conversion.Scope) error { + return autoConvert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter(in, out, s) } -func autoConvert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(in *v1alpha4.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { +func autoConvert_v1beta1_SubnetFilter_To_v1alpha3_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)) @@ -1357,33 +1357,33 @@ func autoConvert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(in *v1alpha4.Sub return nil } -// Convert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter is an autogenerated conversion function. -func Convert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(in *v1alpha4.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { - return autoConvert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(in, out, s) +// Convert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter is an autogenerated conversion function. +func Convert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter(in *v1beta1.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { + return autoConvert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter(in, out, s) } -func autoConvert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam(in *SubnetParam, out *v1alpha4.SubnetParam, s conversion.Scope) error { +func autoConvert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *v1beta1.SubnetParam, s conversion.Scope) error { out.UUID = in.UUID - if err := Convert_v1alpha3_SubnetFilter_To_v1alpha4_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1alpha3_SubnetFilter_To_v1beta1_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { return err } return nil } -// Convert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam is an autogenerated conversion function. -func Convert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam(in *SubnetParam, out *v1alpha4.SubnetParam, s conversion.Scope) error { - return autoConvert_v1alpha3_SubnetParam_To_v1alpha4_SubnetParam(in, out, s) +// Convert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam is an autogenerated conversion function. +func Convert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *v1beta1.SubnetParam, s conversion.Scope) error { + return autoConvert_v1alpha3_SubnetParam_To_v1beta1_SubnetParam(in, out, s) } -func autoConvert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam(in *v1alpha4.SubnetParam, out *SubnetParam, s conversion.Scope) error { +func autoConvert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam(in *v1beta1.SubnetParam, out *SubnetParam, s conversion.Scope) error { out.UUID = in.UUID - if err := Convert_v1alpha4_SubnetFilter_To_v1alpha3_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { + if err := Convert_v1beta1_SubnetFilter_To_v1alpha3_SubnetFilter(&in.Filter, &out.Filter, s); err != nil { return err } return nil } -// Convert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam is an autogenerated conversion function. -func Convert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam(in *v1alpha4.SubnetParam, out *SubnetParam, s conversion.Scope) error { - return autoConvert_v1alpha4_SubnetParam_To_v1alpha3_SubnetParam(in, out, s) +// Convert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam is an autogenerated conversion function. +func Convert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam(in *v1beta1.SubnetParam, out *SubnetParam, s conversion.Scope) error { + return autoConvert_v1beta1_SubnetParam_To_v1alpha3_SubnetParam(in, out, s) } diff --git a/api/v1alpha4/conversion.go b/api/v1alpha4/conversion.go index 1d2a79f97a..b07a788b43 100644 --- a/api/v1alpha4/conversion.go +++ b/api/v1alpha4/conversion.go @@ -16,20 +16,94 @@ limitations under the License. package v1alpha4 -// Hub marks OpenStackCluster as a conversion hub. -func (*OpenStackCluster) Hub() {} +import ( + // corev1 "k8s.io/api/core/v1" + // conversion "k8s.io/apimachinery/pkg/conversion" + ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion" -// Hub marks OpenStackClusterList as a conversion hub. -func (*OpenStackClusterList) Hub() {} + "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" +) -// Hub marks OpenStackMachine as a conversion hub. -func (*OpenStackMachine) Hub() {} +var _ ctrlconversion.Convertible = &OpenStackCluster{} -// Hub marks OpenStackMachineList as a conversion hub. -func (*OpenStackMachineList) Hub() {} +func (r *OpenStackCluster) ConvertTo(dstRaw ctrlconversion.Hub) error { + dst := dstRaw.(*v1beta1.OpenStackCluster) -// Hub marks OpenStackMachineTemplate as a conversion hub. -func (*OpenStackMachineTemplate) Hub() {} + return Convert_v1alpha4_OpenStackCluster_To_v1beta1_OpenStackCluster(r, dst, nil) +} -// Hub marks OpenStackMachineTemplateList as a conversion hub. -func (*OpenStackMachineTemplateList) Hub() {} +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/api/v1alpha4/doc.go b/api/v1alpha4/doc.go index 88aee94426..3a92324cb3 100644 --- a/api/v1alpha4/doc.go +++ b/api/v1alpha4/doc.go @@ -14,4 +14,5 @@ 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/api/v1alpha4/groupversion_info.go b/api/v1alpha4/groupversion_info.go index 7953553546..0986718ae3 100644 --- a/api/v1alpha4/groupversion_info.go +++ b/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1alpha4/openstackcluster_conversion.go b/api/v1alpha4/openstackcluster_conversion.go new file mode 100644 index 0000000000..3689949acf --- /dev/null +++ b/api/v1alpha4/openstackcluster_conversion.go @@ -0,0 +1,33 @@ +/* +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/api/v1alpha4/openstackcluster_types.go b/api/v1alpha4/openstackcluster_types.go index d9b7c94dc8..ca8a89226c 100644 --- a/api/v1alpha4/openstackcluster_types.go +++ b/api/v1alpha4/openstackcluster_types.go @@ -207,7 +207,6 @@ type OpenStackClusterStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc -// +kubebuilder:storageversion // +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" diff --git a/api/v1alpha4/openstackmachine_types.go b/api/v1alpha4/openstackmachine_types.go index 89c16f5877..cf059ba5e4 100644 --- a/api/v1alpha4/openstackmachine_types.go +++ b/api/v1alpha4/openstackmachine_types.go @@ -131,7 +131,6 @@ type OpenStackMachineStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm -// +kubebuilder:storageversion // +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" diff --git a/api/v1alpha4/openstackmachinetemplate_types.go b/api/v1alpha4/openstackmachinetemplate_types.go index 9344ef6a2e..50815d54c8 100644 --- a/api/v1alpha4/openstackmachinetemplate_types.go +++ b/api/v1alpha4/openstackmachinetemplate_types.go @@ -27,7 +27,6 @@ type OpenStackMachineTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt -// +kubebuilder:storageversion // OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API. type OpenStackMachineTemplate struct { diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 0000000000..dd50a8d450 --- /dev/null +++ b/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,1562 @@ +//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)) + // INFO: in.IdentityRef opted out of conversion generation + 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)) + // INFO: in.IdentityRef opted out of conversion generation + 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 + // INFO: in.IdentityRef opted out of conversion generation + 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 + // INFO: in.IdentityRef opted out of conversion generation + 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/api/v1beta1/conversion.go b/api/v1beta1/conversion.go new file mode 100644 index 0000000000..265be053c0 --- /dev/null +++ b/api/v1beta1/conversion.go @@ -0,0 +1,35 @@ +/* +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 + +// Hub marks OpenStackCluster as a conversion hub. +func (*OpenStackCluster) Hub() {} + +// Hub marks OpenStackClusterList as a conversion hub. +func (*OpenStackClusterList) Hub() {} + +// Hub marks OpenStackMachine as a conversion hub. +func (*OpenStackMachine) Hub() {} + +// Hub marks OpenStackMachineList as a conversion hub. +func (*OpenStackMachineList) Hub() {} + +// Hub marks OpenStackMachineTemplate as a conversion hub. +func (*OpenStackMachineTemplate) Hub() {} + +// Hub marks OpenStackMachineTemplateList as a conversion hub. +func (*OpenStackMachineTemplateList) Hub() {} diff --git a/api/v1beta1/doc.go b/api/v1beta1/doc.go new file mode 100644 index 0000000000..d55ab5609a --- /dev/null +++ b/api/v1beta1/doc.go @@ -0,0 +1,17 @@ +/* +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 diff --git a/api/v1beta1/groupversion_info.go b/api/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..3715bbfa5b --- /dev/null +++ b/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +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 contains API Schema definitions for the infrastructure v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta1 + +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: "v1beta1"} + + // 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 +) diff --git a/api/v1beta1/identity_types.go b/api/v1beta1/identity_types.go new file mode 100644 index 0000000000..e8f2ed0eb6 --- /dev/null +++ b/api/v1beta1/identity_types.go @@ -0,0 +1,33 @@ +/* +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 + +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/api/v1beta1/openstackcluster_types.go b/api/v1beta1/openstackcluster_types.go new file mode 100644 index 0000000000..2044b031ab --- /dev/null +++ b/api/v1beta1/openstackcluster_types.go @@ -0,0 +1,239 @@ +/* +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 ( + 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 + // +k8s:conversion-gen=false + 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:storageversion +// +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/api/v1beta1/openstackcluster_webhook.go b/api/v1beta1/openstackcluster_webhook.go new file mode 100644 index 0000000000..a0d8fd9348 --- /dev/null +++ b/api/v1beta1/openstackcluster_webhook.go @@ -0,0 +1,111 @@ +/* +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 ( + "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("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-v1beta1-openstackcluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclusters,versions=v1beta1,name=validation.openstackcluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-openstackcluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclusters,versions=v1beta1,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(old runtime.Object) error { + var allErrs field.ErrorList + + newOpenStackCluster, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) + if err != nil { + return apierrors.NewInvalid(GroupVersion.WithKind("OpenStackCluster").GroupKind(), r.Name, field.ErrorList{ + field.InternalError(nil, errors.Wrap(err, "failed to convert new OpenStackCluster to unstructured object")), + }) + } + oldOpenStackCluster, err := runtime.DefaultUnstructuredConverter.ToUnstructured(old) + if err != nil { + return apierrors.NewInvalid(GroupVersion.WithKind("OpenStackCluster").GroupKind(), r.Name, field.ErrorList{ + field.InternalError(nil, errors.Wrap(err, "failed to convert old OpenStackCluster to unstructured object")), + }) + } + + if r.Spec.IdentityRef != nil && r.Spec.IdentityRef.Kind != defaultIdentityRefKind { + allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "identityRef", "kind"), "must be a Secret")) + } + + newOpenStackClusterSpec := newOpenStackCluster["spec"].(map[string]interface{}) + oldOpenStackClusterSpec := oldOpenStackCluster["spec"].(map[string]interface{}) + + // get controlPlaneEndpoint, something like {"host":"", "port":""} + cpe := oldOpenStackClusterSpec["controlPlaneEndpoint"].(map[string]interface{}) + + // allow change only for the first time + host, ok := cpe["host"].(string) + if ok && len(host) == 0 { + delete(oldOpenStackClusterSpec, "controlPlaneEndpoint") + delete(newOpenStackClusterSpec, "controlPlaneEndpoint") + } + + if !reflect.DeepEqual(oldOpenStackClusterSpec, newOpenStackClusterSpec) { + 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/api/v1beta1/openstackclusterlist_webhook.go b/api/v1beta1/openstackclusterlist_webhook.go new file mode 100644 index 0000000000..402d9f3a8f --- /dev/null +++ b/api/v1beta1/openstackclusterlist_webhook.go @@ -0,0 +1,32 @@ +/* +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 ( + "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/api/v1beta1/openstackclustertemplate_types.go b/api/v1beta1/openstackclustertemplate_types.go new file mode 100644 index 0000000000..e74708d34e --- /dev/null +++ b/api/v1beta1/openstackclustertemplate_types.go @@ -0,0 +1,56 @@ +/* +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 ( + 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:storageversion +//+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/api/v1beta1/openstackclustertemplate_webhook.go b/api/v1beta1/openstackclustertemplate_webhook.go new file mode 100644 index 0000000000..f77a5228fe --- /dev/null +++ b/api/v1beta1/openstackclustertemplate_webhook.go @@ -0,0 +1,79 @@ +/* +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 ( + "reflect" + + "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-v1beta1-openstackclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclustertemplates,versions=v1beta1,name=default.openstackclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-openstackclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackclustertemplates,versions=v1beta1,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 := oldRaw.(*OpenStackClusterTemplate) + 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/api/v1beta1/openstackmachine_types.go b/api/v1beta1/openstackmachine_types.go new file mode 100644 index 0000000000..88ee705518 --- /dev/null +++ b/api/v1beta1/openstackmachine_types.go @@ -0,0 +1,162 @@ +/* +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 ( + 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 + // +k8s:conversion-gen=false + 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:storageversion +// +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/api/v1beta1/openstackmachine_webhook.go b/api/v1beta1/openstackmachine_webhook.go new file mode 100644 index 0000000000..4739d7ffa2 --- /dev/null +++ b/api/v1beta1/openstackmachine_webhook.go @@ -0,0 +1,113 @@ +/* +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 ( + "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-v1beta1-openstackmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachines,versions=v1beta1,name=validation.openstackmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-openstackmachine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachines,versions=v1beta1,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/api/v1beta1/openstackmachinelist_webhook.go b/api/v1beta1/openstackmachinelist_webhook.go new file mode 100644 index 0000000000..04acea8398 --- /dev/null +++ b/api/v1beta1/openstackmachinelist_webhook.go @@ -0,0 +1,32 @@ +/* +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 ( + "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/api/v1beta1/openstackmachinetemplate_types.go b/api/v1beta1/openstackmachinetemplate_types.go new file mode 100644 index 0000000000..e18edfa510 --- /dev/null +++ b/api/v1beta1/openstackmachinetemplate_types.go @@ -0,0 +1,51 @@ +/* +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 ( + 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:storageversion +// +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/api/v1beta1/openstackmachinetemplate_webhook.go b/api/v1beta1/openstackmachinetemplate_webhook.go new file mode 100644 index 0000000000..8c09a196d9 --- /dev/null +++ b/api/v1beta1/openstackmachinetemplate_webhook.go @@ -0,0 +1,70 @@ +/* +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 ( + "reflect" + + "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-v1beta1-openstackmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=openstackmachinetemplates,versions=v1beta1,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(old runtime.Object) error { + var allErrs field.ErrorList + oldOpenStackMachineTemplate := old.(*OpenStackMachineTemplate) + + if !reflect.DeepEqual(r.Spec.Template.Spec, oldOpenStackMachineTemplate.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/api/v1beta1/openstackmachinetemplate_webhook_test.go b/api/v1beta1/openstackmachinetemplate_webhook_test.go new file mode 100644 index 0000000000..85a3eb9739 --- /dev/null +++ b/api/v1beta1/openstackmachinetemplate_webhook_test.go @@ -0,0 +1,100 @@ +/* +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 ( + "testing" + + . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestOpenStackMachineTemplate_ValidateUpdate(t *testing.T) { + g := NewWithT(t) + + tests := []struct { + name string + oldTemplate *OpenStackMachineTemplate + newTemplate *OpenStackMachineTemplate + wantErr bool + }{ + { + name: "OpenStackMachineTemplate with immutable spec", + oldTemplate: &OpenStackMachineTemplate{ + Spec: OpenStackMachineTemplateSpec{ + Template: OpenStackMachineTemplateResource{ + Spec: OpenStackMachineSpec{ + Flavor: "foo", + Image: "bar", + }, + }, + }, + }, + newTemplate: &OpenStackMachineTemplate{ + Spec: OpenStackMachineTemplateSpec{ + Template: OpenStackMachineTemplateResource{ + Spec: OpenStackMachineSpec{ + Flavor: "foo", + Image: "NewImage", + }, + }, + }, + }, + wantErr: true, + }, + { + name: "OpenStackMachineTemplate with mutable metadata", + oldTemplate: &OpenStackMachineTemplate{ + Spec: OpenStackMachineTemplateSpec{ + Template: OpenStackMachineTemplateResource{ + Spec: OpenStackMachineSpec{ + Flavor: "foo", + Image: "bar", + }, + }, + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + }, + }, + newTemplate: &OpenStackMachineTemplate{ + Spec: OpenStackMachineTemplateSpec{ + Template: OpenStackMachineTemplateResource{ + Spec: OpenStackMachineSpec{ + Flavor: "foo", + Image: "bar", + }, + }, + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "bar", + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + err := tt.newTemplate.ValidateUpdate(tt.oldTemplate) + if tt.wantErr { + g.Expect(err).To(HaveOccurred()) + } else { + g.Expect(err).NotTo(HaveOccurred()) + } + }) + } +} diff --git a/api/v1beta1/openstackmachinetemplatelist_webhook.go b/api/v1beta1/openstackmachinetemplatelist_webhook.go new file mode 100644 index 0000000000..6f9b56f7cb --- /dev/null +++ b/api/v1beta1/openstackmachinetemplatelist_webhook.go @@ -0,0 +1,32 @@ +/* +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 ( + "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/api/v1beta1/types.go b/api/v1beta1/types.go new file mode 100644 index 0000000000..300fa1b78a --- /dev/null +++ b/api/v1beta1/types.go @@ -0,0 +1,308 @@ +/* +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 + +// 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 ( + // InstanceStateBuilding is the string representing an instance in a building state. + InstanceStateBuilding = InstanceState("BUILDING") + + // 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") +) + +// 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/api/v1beta1/webhooks.go b/api/v1beta1/webhooks.go new file mode 100644 index 0000000000..ba5c490737 --- /dev/null +++ b/api/v1beta1/webhooks.go @@ -0,0 +1,35 @@ +/* +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 ( + 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/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..6da7564a3c --- /dev/null +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,1005 @@ +//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 v1beta1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "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(apiv1beta1.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/clusterctl-settings.json b/clusterctl-settings.json index 11b29ef37a..cd66f066ee 100644 --- a/clusterctl-settings.json +++ b/clusterctl-settings.json @@ -2,6 +2,6 @@ "name": "infrastructure-openstack", "config": { "componentsFile": "infrastructure-components.yaml", - "nextVersion": "v0.5.0" + "nextVersion": "v1.0.0" } } diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml index f9ff333647..d9c6e84b21 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml @@ -2427,6 +2427,1410 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this OpenStackCluster belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: Cluster infrastructure is ready for OpenStack instances + jsonPath: .status.ready + name: Ready + type: string + - description: Network the cluster is using + jsonPath: .status.network.id + name: Network + type: string + - description: Subnet the cluster is using + jsonPath: .status.network.subnet.id + name: Subnet + type: string + - description: API Endpoint + jsonPath: .spec.controlPlaneEndpoint.host + name: Endpoint + priority: 1 + type: string + - description: Bastion address for breakglass access + jsonPath: .status.bastion.floatingIP + name: Bastion IP + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: OpenStackCluster is the Schema for the openstackclusters API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OpenStackClusterSpec defines the desired state of OpenStackCluster. + properties: + allowAllInClusterTraffic: + description: 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. + type: boolean + apiServerFixedIP: + description: 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. + type: string + apiServerFloatingIP: + description: 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. + type: string + apiServerLoadBalancerAdditionalPorts: + description: APIServerLoadBalancerAdditionalPorts adds additional + ports to the APIServerLoadBalancer + items: + type: integer + type: array + apiServerPort: + description: APIServerPort is the port on which the listener on the + APIServer will be created + type: integer + bastion: + description: Bastion is the OpenStack instance to login the nodes + properties: + availabilityZone: + type: string + enabled: + type: boolean + instance: + description: Instance for the bastion itself + properties: + cloudName: + description: The name of the cloud to use from the clouds + secret + type: string + configDrive: + description: Config Drive support + type: boolean + flavor: + description: The flavor reference for the flavor for your + server instance. + type: string + floatingIP: + description: The floatingIP which will be associated to the + machine, only used for master. The floatingIP should have + been created and haven't been associated. + type: string + identityRef: + description: IdentityRef is a reference to a identity to be + used when reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported by + the infrastructure provider and may be either cluster + or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + image: + description: The name of the image to use for your server + instance. If the RootVolume is specified, this will be ignored + and use rootVolume directly. + type: string + instanceID: + description: InstanceID is the OpenStack instance ID for this + machine. + type: string + networks: + description: 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. + items: + properties: + filter: + description: Filters for optional network query + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + fixedIP: + description: A fixed IPv4 address for the NIC. + type: string + subnets: + description: Subnet within a network to use + items: + properties: + filter: + description: Filters for optional subnet query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + type: array + uuid: + description: Optional UUID of the network. If specified + this will not be validated prior to server creation. + Required if `Subnets` specifies a subnet by UUID. + type: string + type: object + type: array + ports: + description: 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. + items: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables + the port security when set. When not set, it takes + the value of the corresponding field at the network + level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. + These should be subnets of the network with the given + NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. + If unspecified, instead the 0-based index of the port + in the list is used. + type: string + networkId: + description: ID of the OpenStack network on which to + create the port. If unspecified, create the port on + the default cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. + If not provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) + type that is bound to the neutron port. + type: string + type: object + type: array + providerID: + description: ProviderID is the unique identifier as specified + by the cloud provider. + type: string + rootVolume: + description: The volume metadata to boot from + properties: + deviceType: + type: string + diskSize: + type: integer + sourceType: + type: string + sourceUUID: + type: string + type: object + securityGroups: + description: The names of the security groups to assign to + the instance + items: + properties: + filter: + description: Filters used to query security groups in + openstack + properties: + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + name: + description: Security Group name + type: string + uuid: + description: Security Group UID + type: string + type: object + type: array + serverGroupID: + description: The server group to assign the machine to + type: string + serverMetadata: + additionalProperties: + type: string + description: Metadata mapping. Allows you to create a map + of key value pairs to add to the server instance. + type: object + sshKeyName: + description: The ssh key to inject in the instance + type: string + subnet: + description: UUID, IP address of a port from this subnet will + be marked as AccessIPv4 on the created compute instance + type: string + tags: + description: Machine tags Requires Nova api 2.52 minimum! + items: + type: string + type: array + trunk: + description: Whether the server instance is created on a trunk + port or not. + type: boolean + required: + - flavor + type: object + type: object + cloudName: + description: The name of the cloud to use from the clouds secret + type: string + controlPlaneAvailabilityZones: + description: ControlPlaneAvailabilityZones is the az to deploy control + plane to + items: + type: string + type: array + controlPlaneEndpoint: + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int32 + type: integer + required: + - host + - port + type: object + disableAPIServerFloatingIP: + description: 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. + type: boolean + disablePortSecurity: + description: DisablePortSecurity disables the port security of the + network created for the Kubernetes cluster, which also disables + SecurityGroups + type: boolean + dnsNameservers: + description: 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. + items: + type: string + type: array + externalNetworkId: + description: ExternalNetworkID is the ID of an external OpenStack + Network. This is necessary to get public internet to the VMs. + type: string + externalRouterIPs: + description: ExternalRouterIPs is an array of externalIPs on the respective + subnets. This is necessary if the router needs a fixed ip in a specific + subnet. + items: + properties: + fixedIP: + description: The FixedIP in the corresponding subnet + type: string + subnet: + description: The subnet in which the FixedIP is used for the + Gateway of this router + properties: + filter: + description: Filters for optional subnet query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + required: + - subnet + type: object + type: array + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported by the infrastructure + provider and may be either cluster or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + managedAPIServerLoadBalancer: + description: ManagedAPIServerLoadBalancer defines whether a LoadBalancer + for the APIServer should be created. + type: boolean + managedSecurityGroups: + description: 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. + type: boolean + network: + description: If NodeCIDR cannot be set this can be used to detect + an existing network. + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + nodeCidr: + description: 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. + type: string + subnet: + description: If NodeCIDR cannot be set this can be used to detect + an existing subnet. + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + tags: + description: Tags for all resources in cluster + items: + type: string + type: array + type: object + status: + description: OpenStackClusterStatus defines the observed state of OpenStackCluster. + properties: + bastion: + properties: + configDrive: + type: boolean + failureDomain: + type: string + flavor: + type: string + floatingIP: + type: string + id: + type: string + image: + type: string + ip: + type: string + metadata: + additionalProperties: + type: string + type: object + name: + type: string + networks: + items: + description: Network represents basic information about an OpenStack + Neutron Network associated with an instance's port. + properties: + apiServerLoadBalancer: + description: Be careful when using APIServerLoadBalancer, + because this field is optional and therefore not set in + all cases + properties: + id: + type: string + internalIP: + type: string + ip: + type: string + name: + type: string + required: + - id + - internalIP + - ip + - name + type: object + id: + type: string + name: + type: string + port: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables + the port security when set. When not set, it takes + the value of the corresponding field at the network + level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. + These should be subnets of the network with the given + NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. + If unspecified, instead the 0-based index of the port + in the list is used. + type: string + networkId: + description: ID of the OpenStack network on which to + create the port. If unspecified, create the port on + the default cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. + If not provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) + type that is bound to the neutron port. + type: string + type: object + router: + description: Router represents basic information about the + associated OpenStack Neutron Router. + properties: + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - id + - name + type: object + subnet: + description: Subnet represents basic information about the + associated OpenStack Neutron Subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - cidr + - id + - name + type: object + tags: + items: + type: string + type: array + required: + - id + - name + type: object + type: array + rootVolume: + properties: + deviceType: + type: string + diskSize: + type: integer + sourceType: + type: string + sourceUUID: + type: string + type: object + securigyGroups: + items: + type: string + type: array + serverGroupID: + type: string + sshKeyName: + type: string + state: + description: InstanceState describes the state of an OpenStack + instance. + type: string + subnet: + type: string + tags: + items: + type: string + type: array + trunk: + type: boolean + userData: + type: string + type: object + bastionSecurityGroup: + description: SecurityGroup represents the basic information of the + associated OpenStack Neutron Security Group. + properties: + id: + type: string + name: + type: string + rules: + items: + description: SecurityGroupRule represent the basic information + of the associated OpenStack Security Group Role. + properties: + description: + type: string + direction: + type: string + etherType: + type: string + name: + type: string + portRangeMax: + type: integer + portRangeMin: + type: integer + protocol: + type: string + remoteGroupID: + type: string + remoteIPPrefix: + type: string + securityGroupID: + type: string + required: + - description + - direction + - etherType + - name + - portRangeMax + - portRangeMin + - protocol + - remoteGroupID + - remoteIPPrefix + - securityGroupID + type: object + type: array + required: + - id + - name + - rules + type: object + controlPlaneSecurityGroup: + description: '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?' + properties: + id: + type: string + name: + type: string + rules: + items: + description: SecurityGroupRule represent the basic information + of the associated OpenStack Security Group Role. + properties: + description: + type: string + direction: + type: string + etherType: + type: string + name: + type: string + portRangeMax: + type: integer + portRangeMin: + type: integer + protocol: + type: string + remoteGroupID: + type: string + remoteIPPrefix: + type: string + securityGroupID: + type: string + required: + - description + - direction + - etherType + - name + - portRangeMax + - portRangeMin + - protocol + - remoteGroupID + - remoteIPPrefix + - securityGroupID + type: object + type: array + required: + - id + - name + - rules + type: object + externalNetwork: + description: External Network contains information about the created + OpenStack external network. + properties: + apiServerLoadBalancer: + description: Be careful when using APIServerLoadBalancer, because + this field is optional and therefore not set in all cases + properties: + id: + type: string + internalIP: + type: string + ip: + type: string + name: + type: string + required: + - id + - internalIP + - ip + - name + type: object + id: + type: string + name: + type: string + port: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables the port + security when set. When not set, it takes the value of the + corresponding field at the network level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. These + should be subnets of the network with the given NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. If + unspecified, instead the 0-based index of the port in the + list is used. + type: string + networkId: + description: ID of the OpenStack network on which to create + the port. If unspecified, create the port on the default + cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. If + not provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) type + that is bound to the neutron port. + type: string + type: object + router: + description: Router represents basic information about the associated + OpenStack Neutron Router. + properties: + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - id + - name + type: object + subnet: + description: Subnet represents basic information about the associated + OpenStack Neutron Subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - cidr + - id + - name + type: object + tags: + items: + type: string + type: array + required: + - id + - name + type: object + failureDomains: + additionalProperties: + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. + properties: + attributes: + additionalProperties: + type: string + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. + type: object + controlPlane: + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. + type: boolean + type: object + description: FailureDomains represent OpenStack availability zones + type: object + failureMessage: + description: "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. + \n 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. \n 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." + type: string + failureReason: + description: "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. \n 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. \n 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." + type: string + network: + description: Network contains all information about the created OpenStack + Network. It includes Subnets and Router. + properties: + apiServerLoadBalancer: + description: Be careful when using APIServerLoadBalancer, because + this field is optional and therefore not set in all cases + properties: + id: + type: string + internalIP: + type: string + ip: + type: string + name: + type: string + required: + - id + - internalIP + - ip + - name + type: object + id: + type: string + name: + type: string + port: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables the port + security when set. When not set, it takes the value of the + corresponding field at the network level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. These + should be subnets of the network with the given NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. If + unspecified, instead the 0-based index of the port in the + list is used. + type: string + networkId: + description: ID of the OpenStack network on which to create + the port. If unspecified, create the port on the default + cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. If + not provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) type + that is bound to the neutron port. + type: string + type: object + router: + description: Router represents basic information about the associated + OpenStack Neutron Router. + properties: + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - id + - name + type: object + subnet: + description: Subnet represents basic information about the associated + OpenStack Neutron Subnet. + properties: + cidr: + type: string + id: + type: string + name: + type: string + tags: + items: + type: string + type: array + required: + - cidr + - id + - name + type: object + tags: + items: + type: string + type: array + required: + - id + - name + type: object + ready: + type: boolean + workerSecurityGroup: + description: WorkerSecurityGroup contains all the information about + the OpenStack Security Group that needs to be applied to worker + nodes. + properties: + id: + type: string + name: + type: string + rules: + items: + description: SecurityGroupRule represent the basic information + of the associated OpenStack Security Group Role. + properties: + description: + type: string + direction: + type: string + etherType: + type: string + name: + type: string + portRangeMax: + type: integer + portRangeMin: + type: integer + protocol: + type: string + remoteGroupID: + type: string + remoteIPPrefix: + type: string + securityGroupID: + type: string + required: + - description + - direction + - etherType + - name + - portRangeMax + - portRangeMin + - protocol + - remoteGroupID + - remoteIPPrefix + - securityGroupID + type: object + type: array + required: + - id + - name + - rules + type: object + required: + - ready + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml index a36d136c43..b2eba1c013 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml @@ -707,6 +707,694 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: OpenStackClusterTemplate is the Schema for the openstackclustertemplates + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OpenStackClusterTemplateSpec defines the desired state of + OpenStackClusterTemplate. + properties: + template: + description: OpenStackClusterTemplateResource describes the data needed + to create a OpenStackCluster from a template. + properties: + spec: + description: OpenStackClusterSpec defines the desired state of + OpenStackCluster. + properties: + allowAllInClusterTraffic: + description: 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. + type: boolean + apiServerFixedIP: + description: 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. + type: string + apiServerFloatingIP: + description: 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. + type: string + apiServerLoadBalancerAdditionalPorts: + description: APIServerLoadBalancerAdditionalPorts adds additional + ports to the APIServerLoadBalancer + items: + type: integer + type: array + apiServerPort: + description: APIServerPort is the port on which the listener + on the APIServer will be created + type: integer + bastion: + description: Bastion is the OpenStack instance to login the + nodes + properties: + availabilityZone: + type: string + enabled: + type: boolean + instance: + description: Instance for the bastion itself + properties: + cloudName: + description: The name of the cloud to use from the + clouds secret + type: string + configDrive: + description: Config Drive support + type: boolean + flavor: + description: The flavor reference for the flavor for + your server instance. + type: string + floatingIP: + description: The floatingIP which will be associated + to the machine, only used for master. The floatingIP + should have been created and haven't been associated. + type: string + identityRef: + description: IdentityRef is a reference to a identity + to be used when reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported + by the infrastructure provider and may be either + cluster or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + image: + description: The name of the image to use for your + server instance. If the RootVolume is specified, + this will be ignored and use rootVolume directly. + type: string + instanceID: + description: InstanceID is the OpenStack instance + ID for this machine. + type: string + networks: + description: 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. + items: + properties: + filter: + description: Filters for optional network query + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + fixedIP: + description: A fixed IPv4 address for the NIC. + type: string + subnets: + description: Subnet within a network to use + items: + properties: + filter: + description: Filters for optional subnet + query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + type: array + uuid: + description: Optional UUID of the network. If + specified this will not be validated prior + to server creation. Required if `Subnets` + specifies a subnet by UUID. + type: string + type: object + type: array + ports: + description: 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. + items: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or + disables the port security when set. When + not set, it takes the value of the corresponding + field at the network level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or + IP address. These should be subnets of the + network with the given NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port + is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port + unique. If unspecified, instead the 0-based + index of the port in the list is used. + type: string + networkId: + description: ID of the OpenStack network on + which to create the port. If unspecified, + create the port on the default cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port + level. If not provided, openStackMachine.Spec.Trunk + is inherited. + type: boolean + vnicType: + description: The virtual network interface card + (vNIC) type that is bound to the neutron port. + type: string + type: object + type: array + providerID: + description: ProviderID is the unique identifier as + specified by the cloud provider. + type: string + rootVolume: + description: The volume metadata to boot from + properties: + deviceType: + type: string + diskSize: + type: integer + sourceType: + type: string + sourceUUID: + type: string + type: object + securityGroups: + description: The names of the security groups to assign + to the instance + items: + properties: + filter: + description: Filters used to query security + groups in openstack + properties: + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + name: + description: Security Group name + type: string + uuid: + description: Security Group UID + type: string + type: object + type: array + serverGroupID: + description: The server group to assign the machine + to + type: string + serverMetadata: + additionalProperties: + type: string + description: Metadata mapping. Allows you to create + a map of key value pairs to add to the server instance. + type: object + sshKeyName: + description: The ssh key to inject in the instance + type: string + subnet: + description: UUID, IP address of a port from this + subnet will be marked as AccessIPv4 on the created + compute instance + type: string + tags: + description: Machine tags Requires Nova api 2.52 minimum! + items: + type: string + type: array + trunk: + description: Whether the server instance is created + on a trunk port or not. + type: boolean + required: + - flavor + type: object + type: object + cloudName: + description: The name of the cloud to use from the clouds + secret + type: string + controlPlaneAvailabilityZones: + description: ControlPlaneAvailabilityZones is the az to deploy + control plane to + items: + type: string + type: array + controlPlaneEndpoint: + description: ControlPlaneEndpoint represents the endpoint + used to communicate with the control plane. + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int32 + type: integer + required: + - host + - port + type: object + disableAPIServerFloatingIP: + description: 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. + type: boolean + disablePortSecurity: + description: DisablePortSecurity disables the port security + of the network created for the Kubernetes cluster, which + also disables SecurityGroups + type: boolean + dnsNameservers: + description: 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. + items: + type: string + type: array + externalNetworkId: + description: ExternalNetworkID is the ID of an external OpenStack + Network. This is necessary to get public internet to the + VMs. + type: string + externalRouterIPs: + description: ExternalRouterIPs is an array of externalIPs + on the respective subnets. This is necessary if the router + needs a fixed ip in a specific subnet. + items: + properties: + fixedIP: + description: The FixedIP in the corresponding subnet + type: string + subnet: + description: The subnet in which the FixedIP is used + for the Gateway of this router + properties: + filter: + description: Filters for optional subnet query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + required: + - subnet + type: object + type: array + identityRef: + description: IdentityRef is a reference to a identity to be + used when reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported by + the infrastructure provider and may be either cluster + or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + managedAPIServerLoadBalancer: + description: ManagedAPIServerLoadBalancer defines whether + a LoadBalancer for the APIServer should be created. + type: boolean + managedSecurityGroups: + description: 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. + type: boolean + network: + description: If NodeCIDR cannot be set this can be used to + detect an existing network. + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + nodeCidr: + description: 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. + type: string + subnet: + description: If NodeCIDR cannot be set this can be used to + detect an existing subnet. + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + tags: + description: Tags for all resources in cluster + items: + type: string + type: array + type: object + required: + - spec + type: object + required: + - template + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml index f47fa87761..8496dab3c8 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml @@ -768,6 +768,422 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this OpenStackMachine belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: OpenStack instance state + jsonPath: .status.instanceState + name: InstanceState + type: string + - description: Machine ready status + jsonPath: .status.ready + name: Ready + type: string + - description: OpenStack instance ID + jsonPath: .spec.providerID + name: ProviderID + type: string + - description: Machine object which owns with this OpenStackMachine + jsonPath: .metadata.ownerReferences[?(@.kind=="Machine")].name + name: Machine + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: OpenStackMachine is the Schema for the openstackmachines API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OpenStackMachineSpec defines the desired state of OpenStackMachine. + properties: + cloudName: + description: The name of the cloud to use from the clouds secret + type: string + configDrive: + description: Config Drive support + type: boolean + flavor: + description: The flavor reference for the flavor for your server instance. + type: string + floatingIP: + description: The floatingIP which will be associated to the machine, + only used for master. The floatingIP should have been created and + haven't been associated. + type: string + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported by the infrastructure + provider and may be either cluster or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + image: + description: The name of the image to use for your server instance. + If the RootVolume is specified, this will be ignored and use rootVolume + directly. + type: string + instanceID: + description: InstanceID is the OpenStack instance ID for this machine. + type: string + networks: + description: 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. + items: + properties: + filter: + description: Filters for optional network query + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + fixedIP: + description: A fixed IPv4 address for the NIC. + type: string + subnets: + description: Subnet within a network to use + items: + properties: + filter: + description: Filters for optional subnet query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + type: array + uuid: + description: Optional UUID of the network. If specified this + will not be validated prior to server creation. Required if + `Subnets` specifies a subnet by UUID. + type: string + type: object + type: array + ports: + description: 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. + items: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables the port + security when set. When not set, it takes the value of the + corresponding field at the network level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. These + should be subnets of the network with the given NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. If unspecified, + instead the 0-based index of the port in the list is used. + type: string + networkId: + description: ID of the OpenStack network on which to create + the port. If unspecified, create the port on the default cluster + network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. If not + provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) type + that is bound to the neutron port. + type: string + type: object + type: array + providerID: + description: ProviderID is the unique identifier as specified by the + cloud provider. + type: string + rootVolume: + description: The volume metadata to boot from + properties: + deviceType: + type: string + diskSize: + type: integer + sourceType: + type: string + sourceUUID: + type: string + type: object + securityGroups: + description: The names of the security groups to assign to the instance + items: + properties: + filter: + description: Filters used to query security groups in openstack + properties: + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + name: + description: Security Group name + type: string + uuid: + description: Security Group UID + type: string + type: object + type: array + serverGroupID: + description: The server group to assign the machine to + type: string + serverMetadata: + additionalProperties: + type: string + description: Metadata mapping. Allows you to create a map of key value + pairs to add to the server instance. + type: object + sshKeyName: + description: The ssh key to inject in the instance + type: string + subnet: + description: UUID, IP address of a port from this subnet will be marked + as AccessIPv4 on the created compute instance + type: string + tags: + description: Machine tags Requires Nova api 2.52 minimum! + items: + type: string + type: array + trunk: + description: Whether the server instance is created on a trunk port + or not. + type: boolean + required: + - flavor + type: object + status: + description: OpenStackMachineStatus defines the observed state of OpenStackMachine. + properties: + addresses: + description: Addresses contains the OpenStack instance associated + addresses. + items: + description: NodeAddress contains information for the node's address. + properties: + address: + description: The node address. + type: string + type: + description: Node address type, one of Hostname, ExternalIP + or InternalIP. + type: string + required: + - address + - type + type: object + type: array + errorMessage: + description: "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. \n 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. \n 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." + type: string + errorReason: + description: MachineStatusError defines errors states for Machine + objects. + type: string + instanceState: + description: InstanceState is the state of the OpenStack instance + for this machine. + type: string + ready: + description: Ready is true when the provider resource is ready. + type: boolean + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml index 921138016e..df03ed0b63 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml @@ -678,6 +678,379 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: OpenStackMachineTemplate is the Schema for the openstackmachinetemplates + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OpenStackMachineTemplateSpec defines the desired state of + OpenStackMachineTemplate. + properties: + template: + description: OpenStackMachineTemplateResource describes the data needed + to create a OpenStackMachine from a template. + properties: + spec: + description: Spec is the specification of the desired behavior + of the machine. + properties: + cloudName: + description: The name of the cloud to use from the clouds + secret + type: string + configDrive: + description: Config Drive support + type: boolean + flavor: + description: The flavor reference for the flavor for your + server instance. + type: string + floatingIP: + description: The floatingIP which will be associated to the + machine, only used for master. The floatingIP should have + been created and haven't been associated. + type: string + identityRef: + description: IdentityRef is a reference to a identity to be + used when reconciling this cluster + properties: + kind: + description: Kind of the identity. Must be supported by + the infrastructure provider and may be either cluster + or namespace-scoped. + minLength: 1 + type: string + name: + description: 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. + type: string + required: + - kind + - name + type: object + image: + description: The name of the image to use for your server + instance. If the RootVolume is specified, this will be ignored + and use rootVolume directly. + type: string + instanceID: + description: InstanceID is the OpenStack instance ID for this + machine. + type: string + networks: + description: 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. + items: + properties: + filter: + description: Filters for optional network query + properties: + adminStateUp: + type: boolean + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + shared: + type: boolean + sortDir: + type: string + sortKey: + type: string + status: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + fixedIP: + description: A fixed IPv4 address for the NIC. + type: string + subnets: + description: Subnet within a network to use + items: + properties: + filter: + description: Filters for optional subnet query + properties: + cidr: + type: string + description: + type: string + enableDhcp: + type: boolean + gateway_ip: + type: string + id: + type: string + ipVersion: + type: integer + ipv6AddressMode: + type: string + ipv6RaMode: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + networkId: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + subnetpoolId: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + uuid: + description: 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. + type: string + type: object + type: array + uuid: + description: Optional UUID of the network. If specified + this will not be validated prior to server creation. + Required if `Subnets` specifies a subnet by UUID. + type: string + type: object + type: array + ports: + description: 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. + items: + properties: + adminStateUp: + type: boolean + allowedAddressPairs: + items: + properties: + ipAddress: + type: string + macAddress: + type: string + type: object + type: array + description: + type: string + disablePortSecurity: + description: DisablePortSecurity enables or disables + the port security when set. When not set, it takes + the value of the corresponding field at the network + level. + type: boolean + fixedIPs: + description: Specify pairs of subnet and/or IP address. + These should be subnets of the network with the given + NetworkID. + items: + properties: + ipAddress: + type: string + subnetId: + type: string + required: + - subnetId + type: object + type: array + hostId: + description: The ID of the host where the port is allocated + type: string + macAddress: + type: string + nameSuffix: + description: Used to make the name of the port unique. + If unspecified, instead the 0-based index of the port + in the list is used. + type: string + networkId: + description: ID of the OpenStack network on which to + create the port. If unspecified, create the port on + the default cluster network. + type: string + profile: + additionalProperties: + type: string + description: 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. + type: object + projectId: + type: string + securityGroups: + items: + type: string + type: array + tags: + description: 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. + items: + type: string + type: array + tenantId: + type: string + trunk: + description: Enables and disables trunk at port level. + If not provided, openStackMachine.Spec.Trunk is inherited. + type: boolean + vnicType: + description: The virtual network interface card (vNIC) + type that is bound to the neutron port. + type: string + type: object + type: array + providerID: + description: ProviderID is the unique identifier as specified + by the cloud provider. + type: string + rootVolume: + description: The volume metadata to boot from + properties: + deviceType: + type: string + diskSize: + type: integer + sourceType: + type: string + sourceUUID: + type: string + type: object + securityGroups: + description: The names of the security groups to assign to + the instance + items: + properties: + filter: + description: Filters used to query security groups in + openstack + properties: + description: + type: string + id: + type: string + limit: + type: integer + marker: + type: string + name: + type: string + notTags: + type: string + notTagsAny: + type: string + projectId: + type: string + sortDir: + type: string + sortKey: + type: string + tags: + type: string + tagsAny: + type: string + tenantId: + type: string + type: object + name: + description: Security Group name + type: string + uuid: + description: Security Group UID + type: string + type: object + type: array + serverGroupID: + description: The server group to assign the machine to + type: string + serverMetadata: + additionalProperties: + type: string + description: Metadata mapping. Allows you to create a map + of key value pairs to add to the server instance. + type: object + sshKeyName: + description: The ssh key to inject in the instance + type: string + subnet: + description: UUID, IP address of a port from this subnet will + be marked as AccessIPv4 on the created compute instance + type: string + tags: + description: Machine tags Requires Nova api 2.52 minimum! + items: + type: string + type: array + trunk: + description: Whether the server instance is created on a trunk + port or not. + type: boolean + required: + - flavor + type: object + required: + - spec + type: object + required: + - template + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 53c6edd20d..8451455366 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,7 +1,7 @@ commonLabels: cluster.x-k8s.io/v1alpha3: v1alpha3 cluster.x-k8s.io/v1alpha4: v1alpha4 - cluster.x-k8s.io/v1beta1: v1alpha4 + cluster.x-k8s.io/v1beta1: v1beta1 # This kustomization.yaml is not intended to be run by itself, # since it depends on service name and namespace that are out of this kustomize package. diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 859bf3699c..ee1dd390aa 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -6,6 +6,69 @@ metadata: creationTimestamp: null name: mutating-webhook-configuration webhooks: +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-openstackcluster + failurePolicy: Fail + matchPolicy: Equivalent + name: default.openstackcluster.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackclusters + sideEffects: None +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-openstackclustertemplate + failurePolicy: Fail + matchPolicy: Equivalent + name: default.openstackclustertemplate.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackclustertemplates + sideEffects: None +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-openstackmachine + failurePolicy: Fail + matchPolicy: Equivalent + name: default.openstackmachine.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackmachines + sideEffects: None - admissionReviewVersions: - v1beta1 clientConfig: @@ -77,6 +140,90 @@ metadata: creationTimestamp: null name: validating-webhook-configuration webhooks: +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-openstackcluster + failurePolicy: Fail + matchPolicy: Equivalent + name: validation.openstackcluster.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackclusters + sideEffects: None +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-openstackclustertemplate + failurePolicy: Fail + matchPolicy: Equivalent + name: validation.openstackclustertemplate.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackclustertemplates + sideEffects: None +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-openstackmachine + failurePolicy: Fail + matchPolicy: Equivalent + name: validation.openstackmachine.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackmachines + sideEffects: None +- admissionReviewVersions: + - v1beta1 + clientConfig: + service: + name: webhook-service + namespace: system + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-openstackmachinetemplate + failurePolicy: Fail + matchPolicy: Equivalent + name: validation.openstackmachinetemplate.infrastructure.cluster.x-k8s.io + rules: + - apiGroups: + - infrastructure.cluster.x-k8s.io + apiVersions: + - v1beta1 + operations: + - CREATE + - UPDATE + resources: + - openstackmachinetemplates + sideEffects: None - admissionReviewVersions: - v1beta1 clientConfig: diff --git a/controllers/openstackcluster_controller.go b/controllers/openstackcluster_controller.go index 2b9f616235..45112325f4 100644 --- a/controllers/openstackcluster_controller.go +++ b/controllers/openstackcluster_controller.go @@ -48,7 +48,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "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/loadbalancer" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking" diff --git a/controllers/openstackmachine_controller.go b/controllers/openstackmachine_controller.go index 18c5ada70b..287d901f1e 100644 --- a/controllers/openstackmachine_controller.go +++ b/controllers/openstackmachine_controller.go @@ -48,7 +48,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "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/loadbalancer" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking" diff --git a/controllers/suite_test.go b/controllers/suite_test.go index a1febf658b..812840a108 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to diff --git a/main.go b/main.go index 254749ce12..17467f80ae 100644 --- a/main.go +++ b/main.go @@ -37,8 +37,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" "sigs.k8s.io/controller-runtime/pkg/controller" - infrav1old "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha3" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha3" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/controllers" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" @@ -72,7 +73,8 @@ func init() { _ = clientgoscheme.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = infrav1.AddToScheme(scheme) - _ = infrav1old.AddToScheme(scheme) + _ = infrav1alpha3.AddToScheme(scheme) + _ = infrav1alpha4.AddToScheme(scheme) // +kubebuilder:scaffold:scheme metrics.RegisterAPIPrometheusMetrics() @@ -244,6 +246,36 @@ func setupWebhooks(mgr ctrl.Manager) { setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackClusterList") os.Exit(1) } + + // infrav1alpha4 + if err := (&infrav1alpha4.OpenStackMachineTemplate{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackMachineTemplate") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackMachineTemplateList{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackMachineTemplateList") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackCluster{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackCluster") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackClusterTemplate{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackClusterTemplate") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackMachine{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackMachine") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackMachineList{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackMachineList") + os.Exit(1) + } + if err := (&infrav1alpha4.OpenStackClusterList{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "OpenStackClusterList") + os.Exit(1) + } } func concurrency(c int) controller.Options { diff --git a/metadata.yaml b/metadata.yaml index fc980d6916..c6becbf7e0 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -10,3 +10,6 @@ releaseSeries: - major: 0 minor: 5 contract: v1beta1 +- major: 1 + minor: 0 + contract: v1beta1 diff --git a/pkg/cloud/services/compute/bastion.go b/pkg/cloud/services/compute/bastion.go index a20d4a0353..53cfb0e94a 100644 --- a/pkg/cloud/services/compute/bastion.go +++ b/pkg/cloud/services/compute/bastion.go @@ -19,7 +19,7 @@ package compute import ( "fmt" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) func (s *Service) CreateBastion(openStackCluster *infrav1.OpenStackCluster, clusterName string) (*InstanceStatus, error) { diff --git a/pkg/cloud/services/compute/instance.go b/pkg/cloud/services/compute/instance.go index 045fc9a7b0..24dcb1381f 100644 --- a/pkg/cloud/services/compute/instance.go +++ b/pkg/cloud/services/compute/instance.go @@ -36,7 +36,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" diff --git a/pkg/cloud/services/compute/instance_test.go b/pkg/cloud/services/compute/instance_test.go index 5d0c565ac2..663eb2cd09 100644 --- a/pkg/cloud/services/compute/instance_test.go +++ b/pkg/cloud/services/compute/instance_test.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/mock_networking" ) diff --git a/pkg/cloud/services/compute/instance_types.go b/pkg/cloud/services/compute/instance_types.go index 656fed9f07..4f4e284b24 100644 --- a/pkg/cloud/services/compute/instance_types.go +++ b/pkg/cloud/services/compute/instance_types.go @@ -26,7 +26,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" corev1 "k8s.io/api/core/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) // ServerExt is the base gophercloud Server with extensions used by InstanceStatus. diff --git a/pkg/cloud/services/loadbalancer/loadbalancer.go b/pkg/cloud/services/loadbalancer/loadbalancer.go index 2f5b9a1f12..3ff314f7a6 100644 --- a/pkg/cloud/services/loadbalancer/loadbalancer.go +++ b/pkg/cloud/services/loadbalancer/loadbalancer.go @@ -29,7 +29,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/names" diff --git a/pkg/cloud/services/networking/floatingip.go b/pkg/cloud/services/networking/floatingip.go index 779727f021..3dfba7bb38 100644 --- a/pkg/cloud/services/networking/floatingip.go +++ b/pkg/cloud/services/networking/floatingip.go @@ -23,7 +23,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips" "k8s.io/apimachinery/pkg/util/wait" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/names" diff --git a/pkg/cloud/services/networking/floatingip_test.go b/pkg/cloud/services/networking/floatingip_test.go index 16ec696a3b..53024bf3ff 100644 --- a/pkg/cloud/services/networking/floatingip_test.go +++ b/pkg/cloud/services/networking/floatingip_test.go @@ -24,7 +24,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips" . "github.com/onsi/gomega" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/mock_networking" ) diff --git a/pkg/cloud/services/networking/network.go b/pkg/cloud/services/networking/network.go index cbdfd492c0..3221c0a48c 100644 --- a/pkg/cloud/services/networking/network.go +++ b/pkg/cloud/services/networking/network.go @@ -25,7 +25,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/networks" "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/names" diff --git a/pkg/cloud/services/networking/port.go b/pkg/cloud/services/networking/port.go index 66b269ccf9..ef90af2c7f 100644 --- a/pkg/cloud/services/networking/port.go +++ b/pkg/cloud/services/networking/port.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/cluster-api/util" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/names" diff --git a/pkg/cloud/services/networking/port_test.go b/pkg/cloud/services/networking/port_test.go index e1b6a6d760..397180b4ab 100644 --- a/pkg/cloud/services/networking/port_test.go +++ b/pkg/cloud/services/networking/port_test.go @@ -28,7 +28,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/ports" . "github.com/onsi/gomega" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/cloud/services/networking/mock_networking" ) diff --git a/pkg/cloud/services/networking/router.go b/pkg/cloud/services/networking/router.go index d5100ea3e9..5089141033 100644 --- a/pkg/cloud/services/networking/router.go +++ b/pkg/cloud/services/networking/router.go @@ -24,7 +24,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/ports" "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" capoerrors "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/errors" "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/names" diff --git a/pkg/cloud/services/networking/securitygroups.go b/pkg/cloud/services/networking/securitygroups.go index 8a5ea18d6f..6f51f6b1ab 100644 --- a/pkg/cloud/services/networking/securitygroups.go +++ b/pkg/cloud/services/networking/securitygroups.go @@ -22,7 +22,7 @@ import ( "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups" "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/record" ) diff --git a/pkg/cloud/services/provider/provider.go b/pkg/cloud/services/provider/provider.go index cbfb6f5fbf..a2337641fa 100644 --- a/pkg/cloud/services/provider/provider.go +++ b/pkg/cloud/services/provider/provider.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/pkg/metrics" ) diff --git a/templates/cluster-template-external-cloud-provider.yaml b/templates/cluster-template-external-cloud-provider.yaml index 9de1548819..b7476163f3 100644 --- a/templates/cluster-template-external-cloud-provider.yaml +++ b/templates/cluster-template-external-cloud-provider.yaml @@ -9,7 +9,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -17,7 +17,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -42,7 +42,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -65,7 +65,7 @@ spec: cloud-provider: external version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -101,10 +101,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/templates/cluster-template-without-lb.yaml b/templates/cluster-template-without-lb.yaml index 12d9a205dc..5aed35a00b 100644 --- a/templates/cluster-template-without-lb.yaml +++ b/templates/cluster-template-without-lb.yaml @@ -9,7 +9,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -17,7 +17,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -41,7 +41,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -93,7 +93,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -129,10 +129,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index e35e6acc21..d384524841 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -9,7 +9,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -17,7 +17,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -42,7 +42,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -94,7 +94,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -130,10 +130,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/e2e_conf.yaml b/test/e2e/data/e2e_conf.yaml index d9608a2863..e6622e2cac 100644 --- a/test/e2e/data/e2e_conf.yaml +++ b/test/e2e/data/e2e_conf.yaml @@ -71,11 +71,11 @@ providers: - name: openstack type: InfrastructureProvider versions: - - name: v0.5.0 + - name: v1.0.0 value: ../../../config/default contract: v1beta1 files: - - sourcePath: "../data/shared/v1alpha4_provider/metadata.yaml" + - sourcePath: "../data/shared/v1beta1_provider/metadata.yaml" - sourcePath: "./infrastructure-openstack/cluster-template.yaml" - sourcePath: "./infrastructure-openstack/cluster-template-external-cloud-provider.yaml" - sourcePath: "./infrastructure-openstack/cluster-template-without-lb.yaml" diff --git a/test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml b/test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml index 7563194f1f..c7cc2067ea 100644 --- a/test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml +++ b/test/e2e/data/infrastructure-openstack/cluster-template-external-cloud-provider.yaml @@ -12,7 +12,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -20,7 +20,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -54,7 +54,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -88,7 +88,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -124,10 +124,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/infrastructure-openstack/cluster-template-multi-az.yaml b/test/e2e/data/infrastructure-openstack/cluster-template-multi-az.yaml index d0b7099ca8..ba5e7a68ed 100644 --- a/test/e2e/data/infrastructure-openstack/cluster-template-multi-az.yaml +++ b/test/e2e/data/infrastructure-openstack/cluster-template-multi-az.yaml @@ -11,7 +11,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -19,7 +19,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -53,7 +53,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -105,7 +105,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -141,10 +141,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/infrastructure-openstack/cluster-template-multi-network.yaml b/test/e2e/data/infrastructure-openstack/cluster-template-multi-network.yaml index 12a601e064..6c1f99e4fd 100644 --- a/test/e2e/data/infrastructure-openstack/cluster-template-multi-network.yaml +++ b/test/e2e/data/infrastructure-openstack/cluster-template-multi-network.yaml @@ -11,7 +11,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -19,7 +19,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -52,7 +52,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -104,7 +104,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -146,10 +146,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/infrastructure-openstack/cluster-template-without-lb.yaml b/test/e2e/data/infrastructure-openstack/cluster-template-without-lb.yaml index 01fdfee956..b15e94bc3c 100644 --- a/test/e2e/data/infrastructure-openstack/cluster-template-without-lb.yaml +++ b/test/e2e/data/infrastructure-openstack/cluster-template-without-lb.yaml @@ -11,7 +11,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -19,7 +19,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -51,7 +51,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -103,7 +103,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -139,10 +139,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/infrastructure-openstack/cluster-template.yaml b/test/e2e/data/infrastructure-openstack/cluster-template.yaml index 777b58c659..2d30515ce1 100644 --- a/test/e2e/data/infrastructure-openstack/cluster-template.yaml +++ b/test/e2e/data/infrastructure-openstack/cluster-template.yaml @@ -11,7 +11,7 @@ spec: cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. serviceDomain: "cluster.local" infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster name: ${CLUSTER_NAME} controlPlaneRef: @@ -19,7 +19,7 @@ spec: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: ${CLUSTER_NAME}-control-plane --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackCluster metadata: name: ${CLUSTER_NAME} @@ -52,7 +52,7 @@ spec: machineTemplate: infrastructureRef: kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -104,7 +104,7 @@ spec: encoding: base64 version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-control-plane @@ -140,10 +140,10 @@ spec: kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: OpenStackMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/shared/v1beta1_provider/metadata.yaml b/test/e2e/data/shared/v1beta1_provider/metadata.yaml new file mode 100644 index 0000000000..c6becbf7e0 --- /dev/null +++ b/test/e2e/data/shared/v1beta1_provider/metadata.yaml @@ -0,0 +1,15 @@ +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +kind: Metadata +releaseSeries: +- major: 0 + minor: 3 + contract: v1alpha3 +- major: 0 + minor: 4 + contract: v1alpha4 +- major: 0 + minor: 5 + contract: v1beta1 +- major: 1 + minor: 0 + contract: v1beta1 diff --git a/test/e2e/shared/common.go b/test/e2e/shared/common.go index 23c1c47667..49490dbfc4 100644 --- a/test/e2e/shared/common.go +++ b/test/e2e/shared/common.go @@ -36,7 +36,7 @@ import ( "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) func SetupSpecNamespace(ctx context.Context, specName string, e2eCtx *E2EContext) *corev1.Namespace { diff --git a/test/e2e/shared/defaults.go b/test/e2e/shared/defaults.go index 5e2dcb4ace..cac05369ff 100644 --- a/test/e2e/shared/defaults.go +++ b/test/e2e/shared/defaults.go @@ -26,7 +26,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/cluster-api/test/framework" - "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" ) const ( @@ -52,7 +52,7 @@ const ( func DefaultScheme() *runtime.Scheme { sc := runtime.NewScheme() framework.TryAddDefaultSchemes(sc) - _ = v1alpha4.AddToScheme(sc) + _ = v1beta1.AddToScheme(sc) _ = clientgoscheme.AddToScheme(sc) return sc } diff --git a/test/e2e/shared/openstack.go b/test/e2e/shared/openstack.go index a2ec1086bf..1492c7a72c 100644 --- a/test/e2e/shared/openstack.go +++ b/test/e2e/shared/openstack.go @@ -46,7 +46,7 @@ import ( "gopkg.in/ini.v1" "sigs.k8s.io/yaml" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "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/provider" ) diff --git a/test/e2e/suites/e2e/e2e_test.go b/test/e2e/suites/e2e/e2e_test.go index a2a30c7f79..3f01c3aee3 100644 --- a/test/e2e/suites/e2e/e2e_test.go +++ b/test/e2e/suites/e2e/e2e_test.go @@ -45,7 +45,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" crclient "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" "sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared" )