diff --git a/.golangci.yml b/.golangci.yml index 7e3d5aac16..35e2d1494a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -96,8 +96,6 @@ linters-settings: - pkg: sigs.k8s.io/controller-runtime alias: ctrl # CAPO - - pkg: sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5 - alias: infrav1alpha5 - pkg: sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6 alias: infrav1alpha6 - pkg: sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7 diff --git a/Makefile b/Makefile index a0991f0ed4..6184d2980f 100644 --- a/Makefile +++ b/Makefile @@ -266,7 +266,6 @@ generate-controller-gen: $(CONTROLLER_GEN) capo_module := sigs.k8s.io/cluster-api-provider-openstack generate-conversion-gen: $(CONVERSION_GEN) $(CONVERSION_GEN) \ - --input-dirs=$(capo_module)/api/v1alpha5 \ --input-dirs=$(capo_module)/api/v1alpha6 \ --input-dirs=$(capo_module)/api/v1alpha7 \ --extra-dirs=$(capo_module)/pkg/utils/optional \ diff --git a/PROJECT b/PROJECT index 6b397b884f..9db67d8145 100644 --- a/PROJECT +++ b/PROJECT @@ -5,18 +5,6 @@ domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-openstack resources: -- group: infrastructure - kind: OpenStackCluster - version: v1alpha5 -- group: infrastructure - kind: OpenStackMachine - version: v1alpha5 -- group: infrastructure - kind: OpenStackMachineTemplate - version: v1alpha5 -- group: infrastructure - kind: OpenStackClusterTemplate - version: v1alpha5 - group: infrastructure kind: OpenStackCluster version: v1alpha6 diff --git a/README.md b/README.md index 51b35911b5..43834d6514 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ This provider's versions are compatible with the following versions of Cluster A | | v1beta1 (v1.x) | |------------------------------------| -------------- | -| OpenStack Provider v1alpha5 (v0.6) | ✓ | | OpenStack Provider v1alpha6 (v0.7) | ✓ | | OpenStack Provider v1alpha7 (v0.9) | ✓ | | OpenStack Provider v1beta1 | ✓ | @@ -51,7 +50,6 @@ This provider's versions are able to install and manage the following versions o | | v1.25 | v1.26 | v1.27 | v1.28 | |------------------------------------| ----- | ----- | ----- | ----- | -| OpenStack Provider v1alpha5 (v0.6) | ✓ | + | + | + | | OpenStack Provider v1alpha6 (v0.7) | ✓ | ✓ | ✓ | + | | OpenStack Provider v1alpha7 (v0.9) | + | ✓ | ✓ | ★ | | OpenStack Provider v1beta1 | + | ✓ | ✓ | ★ | @@ -60,7 +58,6 @@ This provider's versions are able to install Kubernetes to the following version | | Queens | Rocky | Stein | Train | Ussuri | Victoria | Wallaby | Xena | Yoga | Bobcat | |------------------------------------| ------ | ----- | ----- | ----- | ------ | -------- | ------- | ---- | ---- | ------ | -| OpenStack Provider v1alpha5 (v0.6) | + | + | + | + | + | ✓ | ✓ | ✓ | ✓ | ★ | | OpenStack Provider v1alpha6 (v0.7) | + | + | + | + | + | ✓ | ✓ | ✓ | ✓ | ★ | | OpenStack Provider v1alpha7 (v0.9) | | + | + | + | + | ✓ | ✓ | ✓ | ✓ | ★ | | OpenStack Provider v1beta1 | | + | + | + | + | ✓ | ✓ | ✓ | ✓ | ★ | diff --git a/api/v1alpha5/conversion.go b/api/v1alpha5/conversion.go deleted file mode 100644 index c9d71031d1..0000000000 --- a/api/v1alpha5/conversion.go +++ /dev/null @@ -1,844 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -import ( - "errors" - "strings" - - conversion "k8s.io/apimachinery/pkg/conversion" - "k8s.io/utils/ptr" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" - "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/conversioncommon" -) - -var _ ctrlconversion.Convertible = &OpenStackCluster{} - -const trueString = "true" - -func (r *OpenStackCluster) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackCluster) - - if err := Convert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.OpenStackCluster{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - return nil -} - -func (r *OpenStackCluster) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackCluster) - - if err := Convert_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, r) -} - -var _ ctrlconversion.Convertible = &OpenStackClusterList{} - -func (r *OpenStackClusterList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackClusterList) - - return Convert_v1alpha5_OpenStackClusterList_To_v1beta1_OpenStackClusterList(r, dst, nil) -} - -func (r *OpenStackClusterList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackClusterList) - - return Convert_v1beta1_OpenStackClusterList_To_v1alpha5_OpenStackClusterList(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackClusterTemplate{} - -func (r *OpenStackClusterTemplate) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackClusterTemplate) - - if err := Convert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.OpenStackClusterTemplate{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - return nil -} - -func (r *OpenStackClusterTemplate) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackClusterTemplate) - - if err := Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, r) -} - -var _ ctrlconversion.Convertible = &OpenStackClusterTemplateList{} - -func (r *OpenStackClusterTemplateList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackClusterTemplateList) - return Convert_v1alpha5_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(r, dst, nil) -} - -func (r *OpenStackClusterTemplateList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackClusterTemplateList) - return Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha5_OpenStackClusterTemplateList(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachine{} - -func (r *OpenStackMachine) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackMachine) - - if err := Convert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.OpenStackMachine{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - return nil -} - -func (r *OpenStackMachine) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackMachine) - - if err := Convert_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, r) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineList{} - -func (r *OpenStackMachineList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackMachineList) - - return Convert_v1alpha5_OpenStackMachineList_To_v1beta1_OpenStackMachineList(r, dst, nil) -} - -func (r *OpenStackMachineList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackMachineList) - - return Convert_v1beta1_OpenStackMachineList_To_v1alpha5_OpenStackMachineList(src, r, nil) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineTemplate{} - -func (r *OpenStackMachineTemplate) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackMachineTemplate) - - if err := Convert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(r, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.OpenStackMachineTemplate{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - return nil -} - -func (r *OpenStackMachineTemplate) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackMachineTemplate) - - if err := Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, r) -} - -var _ ctrlconversion.Convertible = &OpenStackMachineTemplateList{} - -func (r *OpenStackMachineTemplateList) ConvertTo(dstRaw ctrlconversion.Hub) error { - dst := dstRaw.(*infrav1.OpenStackMachineTemplateList) - - return Convert_v1alpha5_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(r, dst, nil) -} - -func (r *OpenStackMachineTemplateList) ConvertFrom(srcRaw ctrlconversion.Hub) error { - src := srcRaw.(*infrav1.OpenStackMachineTemplateList) - - return Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList(src, r, nil) -} - -func Convert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(in *infrav1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { - err := autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(in, out, s) - if err != nil { - return err - } - - if in.ExternalNetwork != nil && in.ExternalNetwork.ID != nil { - out.ExternalNetworkID = *in.ExternalNetwork.ID - } - - if len(in.ManagedSubnets) > 0 { - out.NodeCIDR = in.ManagedSubnets[0].CIDR - out.DNSNameservers = in.ManagedSubnets[0].DNSNameservers - } - - if in.Subnets != nil { - if len(in.Subnets) >= 1 { - if err := Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetFilter(&in.Subnets[0], &out.Subnet, s); err != nil { - return err - } - } - } - - if in.ManagedSecurityGroups != nil { - out.ManagedSecurityGroups = true - out.AllowAllInClusterTraffic = in.ManagedSecurityGroups.AllowAllInClusterTraffic - } - - if in.APIServerLoadBalancer != nil { - if err := Convert_v1beta1_APIServerLoadBalancer_To_v1alpha5_APIServerLoadBalancer(in.APIServerLoadBalancer, &out.APIServerLoadBalancer, s); err != nil { - return err - } - } - - out.CloudName = in.IdentityRef.CloudName - out.IdentityRef = &OpenStackIdentityReference{Name: in.IdentityRef.Name} - - return nil -} - -func Convert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *infrav1.OpenStackClusterSpec, s conversion.Scope) error { - err := autoConvert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in, out, s) - if err != nil { - return err - } - - if in.ExternalNetworkID != "" { - out.ExternalNetwork = &infrav1.NetworkParam{ - ID: &in.ExternalNetworkID, - } - } - - emptySubnet := SubnetFilter{} - if in.Subnet != emptySubnet { - subnet := infrav1.SubnetParam{} - if err := Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetParam(&in.Subnet, &subnet, s); err != nil { - return err - } - out.Subnets = []infrav1.SubnetParam{subnet} - } - - if len(in.NodeCIDR) > 0 { - out.ManagedSubnets = []infrav1.SubnetSpec{ - { - CIDR: in.NodeCIDR, - DNSNameservers: in.DNSNameservers, - }, - } - } - // We're dropping DNSNameservers even if these were set as without NodeCIDR it doesn't make sense. - - if in.ManagedSecurityGroups { - out.ManagedSecurityGroups = &infrav1.ManagedSecurityGroups{} - if !in.AllowAllInClusterTraffic { - out.ManagedSecurityGroups.AllNodesSecurityGroupRules = infrav1.LegacyCalicoSecurityGroupRules() - } else { - out.ManagedSecurityGroups.AllowAllInClusterTraffic = true - } - } - - if in.APIServerLoadBalancer.Enabled { - out.APIServerLoadBalancer = &infrav1.APIServerLoadBalancer{} - if err := Convert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer(&in.APIServerLoadBalancer, out.APIServerLoadBalancer, s); err != nil { - return err - } - } - - out.IdentityRef.CloudName = in.CloudName - if in.IdentityRef != nil { - out.IdentityRef.Name = in.IdentityRef.Name - } - - // The generated conversion function converts "" to &"" which is not what we want - if in.APIServerFloatingIP == "" { - out.APIServerFloatingIP = nil - } - if in.APIServerFixedIP == "" { - out.APIServerFixedIP = nil - } - - if in.APIServerPort != 0 { - out.APIServerPort = ptr.To(in.APIServerPort) - } - - return nil -} - -func Convert_v1beta1_LoadBalancer_To_v1alpha5_LoadBalancer(in *infrav1.LoadBalancer, out *LoadBalancer, s conversion.Scope) error { - return autoConvert_v1beta1_LoadBalancer_To_v1alpha5_LoadBalancer(in, out, s) -} - -func Convert_v1beta1_PortOpts_To_v1alpha5_PortOpts(in *infrav1.PortOpts, out *PortOpts, s conversion.Scope) error { - // value specs and propagate uplink status have been added in v1beta1 but have no equivalent in v1alpha5 - err := autoConvert_v1beta1_PortOpts_To_v1alpha5_PortOpts(in, out, s) - if err != nil { - return err - } - - // The auto-generated function converts v1beta1 SecurityGroup to - // v1alpha6 SecurityGroup, but v1alpha6 SecurityGroupFilter is more - // appropriate. Unset them and convert to SecurityGroupFilter instead. - out.SecurityGroups = nil - if len(in.SecurityGroups) > 0 { - out.SecurityGroupFilters = make([]SecurityGroupParam, len(in.SecurityGroups)) - for i := range in.SecurityGroups { - if err := Convert_v1beta1_SecurityGroupParam_To_v1alpha5_SecurityGroupParam(&in.SecurityGroups[i], &out.SecurityGroupFilters[i], s); err != nil { - return err - } - } - } - - if in.Profile != nil { - out.Profile = make(map[string]string) - if ptr.Deref(in.Profile.OVSHWOffload, false) { - (out.Profile)["capabilities"] = "[\"switchdev\"]" - } - if ptr.Deref(in.Profile.TrustedVF, false) { - (out.Profile)["trusted"] = trueString - } - } - - return nil -} - -func Convert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in *OpenStackMachineSpec, out *infrav1.OpenStackMachineSpec, s conversion.Scope) error { - err := autoConvert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in, out, s) - if err != nil { - return err - } - - if in.ServerGroupID != "" { - out.ServerGroup = &infrav1.ServerGroupParam{ID: &in.ServerGroupID} - } - - imageParam := infrav1.ImageParam{} - if in.ImageUUID != "" { - imageParam.ID = &in.ImageUUID - } else if in.Image != "" { // Only add name when ID is not set, in v1beta1 it's not possible to set both. - imageParam.Filter = &infrav1.ImageFilter{Name: &in.Image} - } - out.Image = imageParam - - if in.IdentityRef != nil { - out.IdentityRef = &infrav1.OpenStackIdentityReference{Name: in.IdentityRef.Name} - } - if in.CloudName != "" { - if out.IdentityRef == nil { - out.IdentityRef = &infrav1.OpenStackIdentityReference{} - } - out.IdentityRef.CloudName = in.CloudName - } - - return nil -} - -func Convert_v1beta1_APIServerLoadBalancer_To_v1alpha5_APIServerLoadBalancer(in *infrav1.APIServerLoadBalancer, out *APIServerLoadBalancer, s conversion.Scope) error { - // Provider was originally added in v1beta1, but was backported to v1alpha6, but has no equivalent in v1alpha5 - return autoConvert_v1beta1_APIServerLoadBalancer_To_v1alpha5_APIServerLoadBalancer(in, out, s) -} - -func Convert_v1alpha5_PortOpts_To_v1beta1_PortOpts(in *PortOpts, out *infrav1.PortOpts, s conversion.Scope) error { - // SecurityGroups have been removed in v1beta1. - err := autoConvert_v1alpha5_PortOpts_To_v1beta1_PortOpts(in, out, s) - if err != nil { - return err - } - - if len(in.SecurityGroups) > 0 || len(in.SecurityGroupFilters) > 0 { - out.SecurityGroups = make([]infrav1.SecurityGroupParam, 0, len(in.SecurityGroups)+len(in.SecurityGroupFilters)) - for i := range in.SecurityGroupFilters { - sgParam := &in.SecurityGroupFilters[i] - switch { - case sgParam.UUID != "": - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{ID: &sgParam.UUID}) - case sgParam.Name != "": - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{Filter: &infrav1.SecurityGroupFilter{Name: sgParam.Name}}) - case sgParam.Filter != (SecurityGroupFilter{}): - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{}) - outSG := &out.SecurityGroups[len(out.SecurityGroups)-1] - outSG.Filter = &infrav1.SecurityGroupFilter{} - if err := Convert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(&sgParam.Filter, outSG.Filter, s); err != nil { - return err - } - } - } - for i := range in.SecurityGroups { - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{ID: &in.SecurityGroups[i]}) - } - } - - if len(in.SecurityGroups) > 0 || len(in.SecurityGroupFilters) > 0 { - out.SecurityGroups = make([]infrav1.SecurityGroupParam, 0, len(in.SecurityGroups)+len(in.SecurityGroupFilters)) - for i := range in.SecurityGroupFilters { - sgParam := &in.SecurityGroupFilters[i] - switch { - case sgParam.UUID != "": - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{ID: &sgParam.UUID}) - case sgParam.Name != "": - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{Filter: &infrav1.SecurityGroupFilter{Name: sgParam.Name}}) - case sgParam.Filter != (SecurityGroupFilter{}): - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{}) - outSG := &out.SecurityGroups[len(out.SecurityGroups)-1] - outSG.Filter = &infrav1.SecurityGroupFilter{} - if err := Convert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(&sgParam.Filter, outSG.Filter, s); err != nil { - return err - } - } - } - for i := range in.SecurityGroups { - out.SecurityGroups = append(out.SecurityGroups, infrav1.SecurityGroupParam{ID: &in.SecurityGroups[i]}) - } - } - - // Profile is now a struct in v1beta1. - if strings.Contains(in.Profile["capabilities"], "switchdev") { - out.Profile.OVSHWOffload = ptr.To(true) - } - if in.Profile["trusted"] == trueString { - out.Profile.TrustedVF = ptr.To(true) - } - return nil -} - -func Convert_v1alpha5_Instance_To_v1beta1_BastionStatus(in *Instance, out *infrav1.BastionStatus, _ conversion.Scope) error { - // BastionStatus is the same as Spec with unused fields removed - out.ID = in.ID - out.Name = in.Name - out.SSHKeyName = in.SSHKeyName - out.State = infrav1.InstanceState(in.State) - out.IP = in.IP - out.FloatingIP = in.FloatingIP - - if out.Resolved == nil { - out.Resolved = &infrav1.ResolvedMachineSpec{} - } - out.Resolved.ServerGroupID = in.ServerGroupID - return nil -} - -func Convert_v1beta1_BastionStatus_To_v1alpha5_Instance(in *infrav1.BastionStatus, out *Instance, _ conversion.Scope) error { - // BastionStatus is the same as Spec with unused fields removed - out.ID = in.ID - out.Name = in.Name - out.SSHKeyName = in.SSHKeyName - out.State = InstanceState(in.State) - out.IP = in.IP - out.FloatingIP = in.FloatingIP - if in.Resolved != nil { - out.ServerGroupID = in.Resolved.ServerGroupID - } - return nil -} - -func Convert_v1alpha5_Network_To_v1beta1_NetworkStatusWithSubnets(in *Network, out *infrav1.NetworkStatusWithSubnets, s conversion.Scope) error { - // PortOpts has been removed in v1beta1 - err := Convert_v1alpha5_Network_To_v1beta1_NetworkStatus(in, &out.NetworkStatus, s) - if err != nil { - return err - } - - if in.Subnet != nil { - out.Subnets = []infrav1.Subnet{infrav1.Subnet(*in.Subnet)} - } - return nil -} - -func Convert_v1beta1_NetworkStatusWithSubnets_To_v1alpha5_Network(in *infrav1.NetworkStatusWithSubnets, out *Network, s conversion.Scope) error { - // PortOpts has been removed in v1beta1 - err := Convert_v1beta1_NetworkStatus_To_v1alpha5_Network(&in.NetworkStatus, out, s) - if err != nil { - return err - } - - // Can only down-convert a single subnet - if len(in.Subnets) > 0 { - out.Subnet = (*Subnet)(&in.Subnets[0]) - } - return nil -} - -func Convert_v1alpha5_Network_To_v1beta1_NetworkStatus(in *Network, out *infrav1.NetworkStatus, _ conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Tags = in.Tags - - return nil -} - -func Convert_v1beta1_NetworkStatus_To_v1alpha5_Network(in *infrav1.NetworkStatus, out *Network, _ conversion.Scope) error { - out.ID = in.ID - out.Name = in.Name - out.Tags = in.Tags - - return nil -} - -func Convert_v1alpha5_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *infrav1.SecurityGroupParam, s conversion.Scope) error { - if in.UUID != "" { - out.ID = &in.UUID - return nil - } - - outFilter := &infrav1.SecurityGroupFilter{} - if in.Name != "" { - outFilter.Name = in.Name - } else { - // SecurityGroupParam is replaced by its contained SecurityGroupFilter in v1beta1 - err := Convert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(&in.Filter, outFilter, s) - if err != nil { - return err - } - } - - if !outFilter.IsZero() { - out.Filter = outFilter - } - return nil -} - -func Convert_v1beta1_SecurityGroupParam_To_v1alpha5_SecurityGroupParam(in *infrav1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { - if in.ID != nil { - out.UUID = *in.ID - return nil - } - - if in.Filter != nil { - err := Convert_v1beta1_SecurityGroupFilter_To_v1alpha5_SecurityGroupFilter(in.Filter, &out.Filter, s) - if err != nil { - return err - } - } - return nil -} - -func Convert_v1alpha5_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *infrav1.SubnetParam, s conversion.Scope) error { - if in.UUID != "" { - out.ID = &in.UUID - return nil - } - outFilter := &infrav1.SubnetFilter{} - if err := Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(&in.Filter, outFilter, s); err != nil { - return err - } - if !outFilter.IsZero() { - out.Filter = outFilter - } - return nil -} - -func Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetParam(in *infrav1.SubnetParam, out *SubnetParam, s conversion.Scope) error { - if in.ID != nil { - out.UUID = *in.ID - return nil - } - - if in.Filter != nil { - if err := Convert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(in.Filter, &out.Filter, s); err != nil { - return err - } - } - - return nil -} - -func Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetParam(in *SubnetFilter, out *infrav1.SubnetParam, s conversion.Scope) error { - if in.ID != "" { - out.ID = &in.ID - return nil - } - out.Filter = &infrav1.SubnetFilter{} - return Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(in, out.Filter, s) -} - -func Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetFilter(in *infrav1.SubnetParam, out *SubnetFilter, s conversion.Scope) error { - if in.ID != nil { - out.ID = *in.ID - return nil - } - if in.Filter != nil { - return Convert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(in.Filter, out, s) - } - return nil -} - -func Convert_Map_string_To_Interface_To_v1beta1_BindingProfile(in map[string]string, out *infrav1.BindingProfile, _ conversion.Scope) error { - for k, v := range in { - if k == "capabilities" { - if strings.Contains(v, "switchdev") { - out.OVSHWOffload = ptr.To(true) - } - } - if k == "trusted" && v == trueString { - out.TrustedVF = ptr.To(true) - } - } - return nil -} - -func Convert_v1beta1_BindingProfile_To_Map_string_To_Interface(in *infrav1.BindingProfile, out map[string]string, _ conversion.Scope) error { - if ptr.Deref(in.OVSHWOffload, false) { - (out)["capabilities"] = "[\"switchdev\"]" - } - if ptr.Deref(in.TrustedVF, false) { - (out)["trusted"] = trueString - } - return nil -} - -func Convert_v1beta1_OpenStackClusterStatus_To_v1alpha5_OpenStackClusterStatus(in *infrav1.OpenStackClusterStatus, out *OpenStackClusterStatus, s conversion.Scope) error { - err := autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha5_OpenStackClusterStatus(in, out, s) - if err != nil { - return err - } - - // Router and APIServerLoadBalancer have been moved out of Network in v1beta1 - if in.Router != nil || in.APIServerLoadBalancer != nil { - if out.Network == nil { - out.Network = &Network{} - } - - out.Network.Router = (*Router)(in.Router) - if in.APIServerLoadBalancer != nil { - out.Network.APIServerLoadBalancer = &LoadBalancer{} - err = Convert_v1beta1_LoadBalancer_To_v1alpha5_LoadBalancer(in.APIServerLoadBalancer, out.Network.APIServerLoadBalancer, s) - if err != nil { - return err - } - } - } - - return nil -} - -func Convert_v1alpha5_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in *OpenStackClusterStatus, out *infrav1.OpenStackClusterStatus, s conversion.Scope) error { - err := autoConvert_v1alpha5_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(in, out, s) - if err != nil { - return err - } - - // Router and APIServerLoadBalancer have been moved out of Network in v1beta1 - if in.Network != nil { - out.Router = (*infrav1.Router)(in.Network.Router) - if in.Network.APIServerLoadBalancer != nil { - out.APIServerLoadBalancer = &infrav1.LoadBalancer{} - err = Convert_v1alpha5_LoadBalancer_To_v1beta1_LoadBalancer(in.Network.APIServerLoadBalancer, out.APIServerLoadBalancer, s) - if err != nil { - return err - } - } - } - - return nil -} - -func Convert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in *infrav1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { - err := autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in, out, s) - if err != nil { - return err - } - - if in.ServerGroup != nil && in.ServerGroup.ID != nil { - out.ServerGroupID = *in.ServerGroup.ID - } - - if in.Image.ID != nil { - out.ImageUUID = *in.Image.ID - } else if in.Image.Filter != nil && in.Image.Filter.Name != nil { - out.Image = *in.Image.Filter.Name - } - - if in.IdentityRef != nil { - out.IdentityRef = &OpenStackIdentityReference{Name: in.IdentityRef.Name} - out.CloudName = in.IdentityRef.CloudName - } - - return nil -} - -func Convert_v1beta1_OpenStackMachineStatus_To_v1alpha5_OpenStackMachineStatus(in *infrav1.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { - // ReferencedResources have no equivalent in v1alpha5 - return autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha5_OpenStackMachineStatus(in, out, s) -} - -func Convert_v1beta1_Bastion_To_v1alpha5_Bastion(in *infrav1.Bastion, out *Bastion, s conversion.Scope) error { - err := autoConvert_v1beta1_Bastion_To_v1alpha5_Bastion(in, out, s) - if err != nil { - return err - } - if in.FloatingIP != nil { - out.Instance.FloatingIP = *in.FloatingIP - } - return nil -} - -func Convert_v1alpha5_Bastion_To_v1beta1_Bastion(in *Bastion, out *infrav1.Bastion, s conversion.Scope) error { - err := autoConvert_v1alpha5_Bastion_To_v1beta1_Bastion(in, out, s) - if err != nil { - return err - } - if in.Instance.FloatingIP != "" { - out.FloatingIP = &in.Instance.FloatingIP - } - return nil -} - -func Convert_v1beta1_SecurityGroupStatus_To_v1alpha5_SecurityGroup(in *infrav1.SecurityGroupStatus, out *SecurityGroup, s conversion.Scope) error { //nolint:revive - out.ID = in.ID - out.Name = in.Name - return nil -} - -func Convert_v1alpha5_SecurityGroup_To_v1beta1_SecurityGroupStatus(in *SecurityGroup, out *infrav1.SecurityGroupStatus, s conversion.Scope) error { //nolint:revive - out.ID = in.ID - out.Name = in.Name - return nil -} - -func Convert_v1alpha5_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in *OpenStackIdentityReference, out *infrav1.OpenStackIdentityReference, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in, out, s) -} - -func Convert_v1beta1_OpenStackIdentityReference_To_v1alpha5_OpenStackIdentityReference(in *infrav1.OpenStackIdentityReference, out *OpenStackIdentityReference, _ conversion.Scope) error { - out.Name = in.Name - return nil -} - -func Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(in *SubnetFilter, out *infrav1.SubnetFilter, s conversion.Scope) error { - if err := autoConvert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(in, out, s); err != nil { - return err - } - infrav1.ConvertAllTagsTo(in.Tags, in.TagsAny, in.NotTags, in.NotTagsAny, &out.FilterByNeutronTags) - return nil -} - -func Convert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(in *infrav1.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { - if err := autoConvert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(in, out, s); err != nil { - return err - } - infrav1.ConvertAllTagsFrom(&in.FilterByNeutronTags, &out.Tags, &out.TagsAny, &out.NotTags, &out.NotTagsAny) - return nil -} - -func Convert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in *SecurityGroupFilter, out *infrav1.SecurityGroupFilter, s conversion.Scope) error { - if err := autoConvert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in, out, s); err != nil { - return err - } - infrav1.ConvertAllTagsTo(in.Tags, in.TagsAny, in.NotTags, in.NotTagsAny, &out.FilterByNeutronTags) - - // TenantID has been removed in v1beta1. Write it to ProjectID if ProjectID is not already set. - if out.ProjectID == "" { - out.ProjectID = in.TenantID - } - return nil -} - -func Convert_v1beta1_SecurityGroupFilter_To_v1alpha5_SecurityGroupFilter(in *infrav1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { - if err := autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha5_SecurityGroupFilter(in, out, s); err != nil { - return err - } - infrav1.ConvertAllTagsFrom(&in.FilterByNeutronTags, &out.Tags, &out.TagsAny, &out.NotTags, &out.NotTagsAny) - return nil -} - -func Convert_v1alpha5_NetworkFilter_To_v1beta1_NetworkParam(in *NetworkFilter, out *infrav1.NetworkParam, s conversion.Scope) error { - if in.ID != "" { - out.ID = &in.ID - return nil - } - outFilter := &infrav1.NetworkFilter{} - if err := autoConvert_v1alpha5_NetworkFilter_To_v1beta1_NetworkFilter(in, outFilter, s); err != nil { - return err - } - infrav1.ConvertAllTagsTo(in.Tags, in.TagsAny, in.NotTags, in.NotTagsAny, &outFilter.FilterByNeutronTags) - if !outFilter.IsZero() { - out.Filter = outFilter - } - return nil -} - -func Convert_v1beta1_NetworkParam_To_v1alpha5_NetworkFilter(in *infrav1.NetworkParam, out *NetworkFilter, s conversion.Scope) error { - if in.ID != nil { - out.ID = *in.ID - return nil - } - if in.Filter != nil { - if err := autoConvert_v1beta1_NetworkFilter_To_v1alpha5_NetworkFilter(in.Filter, out, s); err != nil { - return err - } - infrav1.ConvertAllTagsFrom(&in.Filter.FilterByNeutronTags, &out.Tags, &out.TagsAny, &out.NotTags, &out.NotTagsAny) - } - return nil -} - -func Convert_v1alpha5_RootVolume_To_v1beta1_RootVolume(in *RootVolume, out *infrav1.RootVolume, s conversion.Scope) error { - out.SizeGiB = in.Size - out.Type = in.VolumeType - return conversioncommon.Convert_string_To_Pointer_v1beta1_VolumeAvailabilityZone(&in.AvailabilityZone, &out.AvailabilityZone, s) -} - -func Convert_v1beta1_RootVolume_To_v1alpha5_RootVolume(in *infrav1.RootVolume, out *RootVolume, s conversion.Scope) error { - out.Size = in.SizeGiB - out.VolumeType = in.Type - return conversioncommon.Convert_Pointer_v1beta1_VolumeAvailabilityZone_To_string(&in.AvailabilityZone, &out.AvailabilityZone, s) -} - -// conversion-gen registers the following functions so we have to define them, but nothing should ever call them. -func Convert_v1alpha5_NetworkFilter_To_v1beta1_NetworkFilter(_ *NetworkFilter, _ *infrav1.NetworkFilter, _ conversion.Scope) error { - return errors.New("Convert_v1alpha6_NetworkFilter_To_v1beta1_NetworkFilter should not be called") -} - -func Convert_v1beta1_NetworkFilter_To_v1alpha5_NetworkFilter(_ *infrav1.NetworkFilter, _ *NetworkFilter, _ conversion.Scope) error { - return errors.New("Convert_v1beta1_NetworkFilter_To_v1alpha6_NetworkFilter should not be called") -} - -func Convert_v1alpha5_NetworkParam_To_v1beta1_NetworkParam(_ *NetworkParam, _ *infrav1.NetworkParam, _ conversion.Scope) error { - return errors.New("Convert_v1alpha6_NetworkParam_To_v1beta1_NetworkParam should not be called") -} - -func Convert_v1beta1_NetworkParam_To_v1alpha5_NetworkParam(_ *infrav1.NetworkParam, _ *NetworkParam, _ conversion.Scope) error { - return errors.New("Convert_v1beta1_NetworkParam_To_v1alpha6_NetworkParam should not be called") -} diff --git a/api/v1alpha5/conversion_test.go b/api/v1alpha5/conversion_test.go deleted file mode 100644 index f180d9744a..0000000000 --- a/api/v1alpha5/conversion_test.go +++ /dev/null @@ -1,239 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -import ( - "runtime/debug" - "testing" - - "github.com/onsi/gomega" - "github.com/onsi/gomega/format" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/client-go/kubernetes/scheme" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - ctrlconversion "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" - testhelpers "sigs.k8s.io/cluster-api-provider-openstack/test/helpers" -) - -func TestConvertFrom(t *testing.T) { - g := gomega.NewWithT(t) - scheme := runtime.NewScheme() - g.Expect(AddToScheme(scheme)).To(gomega.Succeed()) - g.Expect(infrav1.AddToScheme(scheme)).To(gomega.Succeed()) - - tests := []struct { - name string - spoke ctrlconversion.Convertible - hub ctrlconversion.Hub - want ctrlconversion.Convertible - }{ - { - name: "cluster conversion must have conversion-data annotation", - spoke: &OpenStackCluster{}, - hub: &infrav1.OpenStackCluster{ - Spec: infrav1.OpenStackClusterSpec{}, - }, - want: &OpenStackCluster{ - Spec: OpenStackClusterSpec{ - IdentityRef: &OpenStackIdentityReference{}, - }, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "cluster.x-k8s.io/conversion-data": "{\"spec\":{\"identityRef\":{\"cloudName\":\"\",\"name\":\"\"}},\"status\":{\"ready\":false}}", - }, - }, - }, - }, - { - name: "cluster template conversion must have conversion-data annotation", - spoke: &OpenStackClusterTemplate{}, - hub: &infrav1.OpenStackClusterTemplate{ - Spec: infrav1.OpenStackClusterTemplateSpec{}, - }, - want: &OpenStackClusterTemplate{ - Spec: OpenStackClusterTemplateSpec{ - Template: OpenStackClusterTemplateResource{ - Spec: OpenStackClusterSpec{ - IdentityRef: &OpenStackIdentityReference{}, - }, - }, - }, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "cluster.x-k8s.io/conversion-data": "{\"spec\":{\"template\":{\"spec\":{\"identityRef\":{\"cloudName\":\"\",\"name\":\"\"}}}}}", - }, - }, - }, - }, - { - name: "machine conversion must have conversion-data annotation", - spoke: &OpenStackMachine{}, - hub: &infrav1.OpenStackMachine{ - Spec: infrav1.OpenStackMachineSpec{}, - }, - want: &OpenStackMachine{ - Spec: OpenStackMachineSpec{}, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "cluster.x-k8s.io/conversion-data": "{\"spec\":{\"flavor\":\"\",\"image\":{}},\"status\":{\"ready\":false}}", - }, - }, - }, - }, - { - name: "machine template conversion must have conversion-data annotation", - spoke: &OpenStackMachineTemplate{}, - hub: &infrav1.OpenStackMachineTemplate{ - Spec: infrav1.OpenStackMachineTemplateSpec{}, - }, - want: &OpenStackMachineTemplate{ - Spec: OpenStackMachineTemplateSpec{}, - ObjectMeta: metav1.ObjectMeta{ - Annotations: map[string]string{ - "cluster.x-k8s.io/conversion-data": "{\"spec\":{\"template\":{\"spec\":{\"flavor\":\"\",\"image\":{}}}}}", - }, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.spoke.ConvertFrom(tt.hub) - g.Expect(err).NotTo(gomega.HaveOccurred()) - g.Expect(tt.spoke).To(gomega.Equal(tt.want)) - }) - } -} - -func TestConvert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(t *testing.T) { - tests := []struct { - name string - in *OpenStackClusterSpec - expectedOut *infrav1.OpenStackClusterSpec - }{ - { - name: "empty", - in: &OpenStackClusterSpec{}, - expectedOut: &infrav1.OpenStackClusterSpec{}, - }, - { - name: "with managed security groups and not allow all in cluster traffic", - in: &OpenStackClusterSpec{ - ManagedSecurityGroups: true, - AllowAllInClusterTraffic: false, - }, - expectedOut: &infrav1.OpenStackClusterSpec{ - ManagedSecurityGroups: &infrav1.ManagedSecurityGroups{ - AllNodesSecurityGroupRules: infrav1.LegacyCalicoSecurityGroupRules(), - }, - }, - }, - { - name: "with managed security groups and allow all in cluster traffic", - in: &OpenStackClusterSpec{ - ManagedSecurityGroups: true, - AllowAllInClusterTraffic: true, - }, - expectedOut: &infrav1.OpenStackClusterSpec{ - ManagedSecurityGroups: &infrav1.ManagedSecurityGroups{ - AllowAllInClusterTraffic: true, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - g := gomega.NewWithT(t) - out := &infrav1.OpenStackClusterSpec{} - err := Convert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(tt.in, out, nil) - g.Expect(err).NotTo(gomega.HaveOccurred()) - g.Expect(out).To(gomega.Equal(tt.expectedOut)) - }) - } -} - -type convertiblePointer[T any] interface { - ctrlconversion.Convertible - *T -} - -type hubPointer[T any] interface { - ctrlconversion.Hub - *T -} - -func test_ObjectConvert[SP convertiblePointer[S], HP hubPointer[H], S, H any](tb testing.TB) { - tb.Helper() - - fuzzerFuncs := func(_ runtimeserializer.CodecFactory) []interface{} { - return testhelpers.InfraV1FuzzerFuncs() - } - f := utilconversion.GetFuzzer(scheme.Scheme, fuzzerFuncs) - g := gomega.NewWithT(tb) - - for i := 0; i < 10000; i++ { - var hub HP = new(H) - f.Fuzz(hub) - var spoke SP = new(S) - - func() { - defer func() { - if r := recover(); r != nil { - tb.Errorf("PANIC! Down-converting:\n%s\n%s", format.Object(hub, 1), debug.Stack()) - tb.FailNow() - } - }() - g.Expect(spoke.ConvertFrom(hub)).To(gomega.Succeed()) - }() - - spoke = new(S) - f.Fuzz(spoke) - hub = new(H) - - func() { - defer func() { - if r := recover(); r != nil { - tb.Errorf("PANIC! Up-converting:\n%s\n%s", format.Object(spoke, 1), debug.Stack()) - tb.FailNow() - } - }() - g.Expect(spoke.ConvertTo(hub)).To(gomega.Succeed()) - }() - } -} - -func Test_OpenStackClusterConvert(t *testing.T) { - test_ObjectConvert[*OpenStackCluster, *infrav1.OpenStackCluster](t) -} - -func Test_OpenStackClusterTemplate(t *testing.T) { - test_ObjectConvert[*OpenStackClusterTemplate, *infrav1.OpenStackClusterTemplate](t) -} - -func Test_OpenStackMachineConvert(t *testing.T) { - test_ObjectConvert[*OpenStackMachine, *infrav1.OpenStackMachine](t) -} - -func Test_OpenStackMachineTemplateConvert(t *testing.T) { - test_ObjectConvert[*OpenStackMachineTemplate, *infrav1.OpenStackMachineTemplate](t) -} diff --git a/api/v1alpha5/doc.go b/api/v1alpha5/doc.go deleted file mode 100644 index 4b0192a1be..0000000000 --- a/api/v1alpha5/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1 -package v1alpha5 diff --git a/api/v1alpha5/groupversion_info.go b/api/v1alpha5/groupversion_info.go deleted file mode 100644 index af859c3711..0000000000 --- a/api/v1alpha5/groupversion_info.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// package v1alpha5 contains API Schema definitions for the infrastructure v1alpha5 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -package v1alpha5 - -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: "v1alpha5"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/api/v1alpha5/identity_types.go b/api/v1alpha5/identity_types.go deleted file mode 100644 index 9ade7f073a..0000000000 --- a/api/v1alpha5/identity_types.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -// 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/v1alpha5/openstackcluster_types.go b/api/v1alpha5/openstackcluster_types.go deleted file mode 100644 index 3bc26c8cd1..0000000000 --- a/api/v1alpha5/openstackcluster_types.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -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 NetworkFilter `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"` - - // APIServerLoadBalancer configures the optional LoadBalancer for the APIServer. - // It must be activated by setting `enabled: true`. - // +optional - APIServerLoadBalancer APIServerLoadBalancer `json:"apiServerLoadBalancer,omitempty"` - - // 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"` - - // 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 - // - // As a rolling update is not ideal during a bastion host session, we - // prevent changes to a running bastion configuration. Set `enabled: false` to - // make changes. - //+optional - Bastion *Bastion `json:"bastion,omitempty"` - - // IdentityRef is a reference to a identity to be used when reconciling this cluster - // +optional - IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"` -} - -// OpenStackClusterStatus defines the observed state of OpenStackCluster. -type OpenStackClusterStatus struct { - Ready bool `json:"ready"` - - // Network contains all information about the created OpenStack Network. - // It includes Subnets and Router. - Network *Network `json:"network,omitempty"` - - // External Network contains information about the created OpenStack external network. - ExternalNetwork *Network `json:"externalNetwork,omitempty"` - - // FailureDomains represent OpenStack availability zones - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - - // ControlPlaneSecurityGroups contains all the information about the OpenStack - // Security Group that needs to be applied to control plane nodes. - // TODO: Maybe instead of two properties, we add a property to the group? - ControlPlaneSecurityGroup *SecurityGroup `json:"controlPlaneSecurityGroup,omitempty"` - - // WorkerSecurityGroup contains all the information about the OpenStack Security - // Group that needs to be applied to worker nodes. - WorkerSecurityGroup *SecurityGroup `json:"workerSecurityGroup,omitempty"` - - BastionSecurityGroup *SecurityGroup `json:"bastionSecurityGroup,omitempty"` - - Bastion *Instance `json:"bastion,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the OpenStackCluster and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the OpenStackCluster's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // OpenStackClusters can be added as events to the OpenStackCluster object - // and/or logged in the controller's output. - // +optional - FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the OpenStackCluster and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the OpenStackCluster's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of - // OpenStackClusters can be added as events to the OpenStackCluster object - // and/or logged in the controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion:warning="The v1alpha5 version of OpenStackCluster has been deprecated and will be removed in a future release of the API. Please upgrade." -// +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc -// +kubebuilder:subresource:status -// +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" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackCluster" - -// OpenStackCluster is the Schema for the openstackclusters API. -// -// Deprecated: This type will be removed in one of the next releases. -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. -// -// Deprecated: This type will be removed in one of the next releases. -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/v1alpha5/openstackclustertemplate_types.go b/api/v1alpha5/openstackclustertemplate_types.go deleted file mode 100644 index 6dc4ef8d2a..0000000000 --- a/api/v1alpha5/openstackclustertemplate_types.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -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:unservedversion -// +kubebuilder:deprecatedversion:warning="The v1alpha5 version of OpenStackClusterTemplate has been deprecated and will be removed in a future release of the API. Please upgrade." -// +kubebuilder:resource:path=openstackclustertemplates,scope=Namespaced,categories=cluster-api,shortName=osct - -// OpenStackClusterTemplate is the Schema for the openstackclustertemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -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. -// -// Deprecated: This type will be removed in one of the next releases. -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/v1alpha5/openstackmachine_types.go b/api/v1alpha5/openstackmachine_types.go deleted file mode 100644 index 56e0c6619a..0000000000 --- a/api/v1alpha5/openstackmachine_types.go +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - "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 uuid of the image to use for your server instance. - // if it's empty, Image name will be used - ImageUUID string `json:"imageUUID,omitempty"` - - // The ssh key to inject in the instance - SSHKeyName string `json:"sshKeyName,omitempty"` - - // A networks object. Required parameter when there are multiple networks defined for the tenant. - // When you do not specify both networks and ports parameters, the server attaches to the only network created for the current tenant. - Networks []NetworkParam `json:"networks,omitempty"` - - // Ports to be attached to the server instance. They are created if a port with the given name does not already exist. - // When you do not specify both networks and ports parameters, the server attaches to the only network created for the current tenant. - Ports []PortOpts `json:"ports,omitempty"` - - // UUID, IP address of a port from this subnet will be marked as AccessIPv4 on the created compute instance - Subnet string `json:"subnet,omitempty"` - - // The floatingIP which will be associated to the machine, only used for master. - // The floatingIP should have been created and haven't been associated. - FloatingIP string `json:"floatingIP,omitempty"` - - // The names of the security groups to assign to the instance - SecurityGroups []SecurityGroupParam `json:"securityGroups,omitempty"` - - // Whether the server instance is created on a trunk port or not. - Trunk bool `json:"trunk,omitempty"` - - // Machine tags - // Requires Nova api 2.52 minimum! - Tags []string `json:"tags,omitempty"` - - // Metadata mapping. Allows you to create a map of key value pairs to add to the server instance. - ServerMetadata map[string]string `json:"serverMetadata,omitempty"` - - // Config Drive support - ConfigDrive *bool `json:"configDrive,omitempty"` - - // The volume metadata to boot from - RootVolume *RootVolume `json:"rootVolume,omitempty"` - - // The server group to assign the machine to - ServerGroupID string `json:"serverGroupID,omitempty"` - - // IdentityRef is a reference to a identity to be used when reconciling this cluster - // +optional - IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"` -} - -// OpenStackMachineStatus defines the observed state of OpenStackMachine. -type OpenStackMachineStatus struct { - // Ready is true when the provider resource is ready. - // +optional - Ready bool `json:"ready"` - - // Addresses contains the OpenStack instance associated addresses. - Addresses []corev1.NodeAddress `json:"addresses,omitempty"` - - // InstanceState is the state of the OpenStack instance for this machine. - // +optional - InstanceState *InstanceState `json:"instanceState,omitempty"` - - FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - Conditions clusterv1.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion:warning="The v1alpha5 version of OpenStackMachine has been deprecated and will be removed in a future release of the API. Please upgrade." -// +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm -// +kubebuilder:subresource:status -// +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" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackMachine" - -// OpenStackMachine is the Schema for the openstackmachines API. -// -// Deprecated: This type will be removed in one of the next releases. -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. -// -// Deprecated: This type will be removed in one of the next releases. -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/v1alpha5/openstackmachinetemplate_types.go b/api/v1alpha5/openstackmachinetemplate_types.go deleted file mode 100644 index 7bb5d89628..0000000000 --- a/api/v1alpha5/openstackmachinetemplate_types.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -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:unservedversion -// +kubebuilder:deprecatedversion:warning="The v1alpha5 version of OpenStackMachineTemplate has been deprecated and will be removed in a future release of the API. Please upgrade." -// +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt - -// OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -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. -// -// Deprecated: This type will be removed in one of the next releases. -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/v1alpha5/types.go b/api/v1alpha5/types.go deleted file mode 100644 index 5c1a37ac7d..0000000000 --- a/api/v1alpha5/types.go +++ /dev/null @@ -1,319 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha5 - -// 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 NetworkFilter `json:"filter,omitempty"` - // Subnet within a network to use - Subnets []SubnetParam `json:"subnets,omitempty"` -} - -type NetworkFilter struct { - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - ProjectID string `json:"projectId,omitempty"` - ID string `json:"id,omitempty"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` -} - -type SubnetParam struct { - // 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"` - 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"` - Tags string `json:"tags,omitempty"` - TagsAny string `json:"tagsAny,omitempty"` - NotTags string `json:"notTags,omitempty"` - NotTagsAny string `json:"notTagsAny,omitempty"` -} - -type PortOpts struct { - // Network is a query for an openstack network that the port will be created or discovered on. - // This will fail if the query returns more than one network. - Network *NetworkFilter `json:"network,omitempty"` - // Used to make the name of the port unique. If unspecified, instead the 0-based index of the port in the list is used. - NameSuffix string `json:"nameSuffix,omitempty"` - Description string `json:"description,omitempty"` - 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"` - // The uuids of the security groups to assign to the instance - // +k8s:conversion-gen=false - SecurityGroups []string `json:"securityGroups,omitempty"` - // The names, uuids, filters or any combination these of the security groups to assign to the instance - // +k8s:conversion-gen=false - SecurityGroupFilters []SecurityGroupParam `json:"securityGroupFilters,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 { - // Subnet is an openstack subnet query that will return the id of a subnet to create - // the fixed IP of a port in. This query must not return more than one subnet. - Subnet *SubnetFilter `json:"subnet"` - IPAddress string `json:"ipAddress,omitempty"` -} - -type AddressPair struct { - 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"` - ImageUUID string `json:"imageUUID,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 { - Size int `json:"diskSize,omitempty"` - VolumeType string `json:"volumeType,omitempty"` - AvailabilityZone string `json:"availabilityZone,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"` - //+optional - IPs []string `json:"ips,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"` - //+optional - AllowedCIDRs []string `json:"allowedCIDRs,omitempty"` -} - -// 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,omitempty"` -} - -// 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 ( - // InstanceStateBuild is the string representing an instance in a build state. - InstanceStateBuild = InstanceState("BUILD") - - // InstanceStateActive is the string representing an instance in an active state. - InstanceStateActive = InstanceState("ACTIVE") - - // InstanceStateError is the string representing an instance in an error state. - InstanceStateError = InstanceState("ERROR") - - // InstanceStateStopped is the string representing an instance in a stopped state. - InstanceStateStopped = InstanceState("STOPPED") - - // InstanceStateShutoff is the string representing an instance in a shutoff state. - InstanceStateShutoff = InstanceState("SHUTOFF") - - // InstanceStateDeleted is the string representing an instance in a deleted state. - InstanceStateDeleted = InstanceState("DELETED") - - // InstanceStateUndefined is the string representing an undefined instance state. - InstanceStateUndefined = InstanceState("") -) - -// 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"` -} - -type APIServerLoadBalancer struct { - // Enabled defines whether a load balancer should be created. - Enabled bool `json:"enabled,omitempty"` - // AdditionalPorts adds additional tcp ports to the load balancer. - AdditionalPorts []int `json:"additionalPorts,omitempty"` - // AllowedCIDRs restrict access to all API-Server listeners to the given address CIDRs. - AllowedCIDRs []string `json:"allowedCidrs,omitempty"` -} diff --git a/api/v1alpha5/zz_generated.conversion.go b/api/v1alpha5/zz_generated.conversion.go deleted file mode 100644 index a77967fb5a..0000000000 --- a/api/v1alpha5/zz_generated.conversion.go +++ /dev/null @@ -1,1636 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2023 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 v1alpha5 - -import ( - unsafe "unsafe" - - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6" - v1beta1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" - optional "sigs.k8s.io/cluster-api-provider-openstack/pkg/utils/optional" - 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((*APIServerLoadBalancer)(nil), (*v1beta1.APIServerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer(a.(*APIServerLoadBalancer), b.(*v1beta1.APIServerLoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AddressPair)(nil), (*v1beta1.AddressPair)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_AddressPair(a.(*v1beta1.AddressPair), b.(*AddressPair), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalRouterIPParam)(nil), (*v1beta1.ExternalRouterIPParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_ExternalRouterIPParam(a.(*v1beta1.ExternalRouterIPParam), b.(*ExternalRouterIPParam), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FixedIP)(nil), (*v1beta1.FixedIP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_FixedIP(a.(*v1beta1.FixedIP), b.(*FixedIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*v1beta1.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_LoadBalancer_To_v1beta1_LoadBalancer(a.(*LoadBalancer), b.(*v1beta1.LoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackCluster)(nil), (*v1beta1.OpenStackCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_OpenStackClusterList(a.(*v1beta1.OpenStackClusterList), b.(*OpenStackClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackClusterTemplate)(nil), (*v1beta1.OpenStackClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_OpenStackClusterTemplateSpec(a.(*v1beta1.OpenStackClusterTemplateSpec), b.(*OpenStackClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachine)(nil), (*v1beta1.OpenStackMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_OpenStackMachineList(a.(*v1beta1.OpenStackMachineList), b.(*OpenStackMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineStatus)(nil), (*v1beta1.OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(a.(*OpenStackMachineStatus), b.(*v1beta1.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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_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_v1alpha5_OpenStackMachineTemplateSpec(a.(*v1beta1.OpenStackMachineTemplateSpec), b.(*OpenStackMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Router)(nil), (*v1beta1.Router)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_Router(a.(*v1beta1.Router), b.(*Router), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Subnet)(nil), (*v1beta1.Subnet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_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_v1alpha5_Subnet(a.(*v1beta1.Subnet), b.(*Subnet), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*Bastion)(nil), (*v1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_Bastion_To_v1beta1_Bastion(a.(*Bastion), b.(*v1beta1.Bastion), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*Instance)(nil), (*v1beta1.BastionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_Instance_To_v1beta1_BastionStatus(a.(*Instance), b.(*v1beta1.BastionStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NetworkFilter)(nil), (*v1beta1.NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_NetworkFilter_To_v1beta1_NetworkFilter(a.(*NetworkFilter), b.(*v1beta1.NetworkFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NetworkFilter)(nil), (*v1beta1.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_NetworkFilter_To_v1beta1_NetworkParam(a.(*NetworkFilter), b.(*v1beta1.NetworkParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NetworkParam)(nil), (*v1beta1.NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_NetworkParam_To_v1beta1_NetworkParam(a.(*NetworkParam), b.(*v1beta1.NetworkParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*Network)(nil), (*v1beta1.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_Network_To_v1beta1_NetworkStatus(a.(*Network), b.(*v1beta1.NetworkStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*Network)(nil), (*v1beta1.NetworkStatusWithSubnets)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_Network_To_v1beta1_NetworkStatusWithSubnets(a.(*Network), b.(*v1beta1.NetworkStatusWithSubnets), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*OpenStackClusterSpec)(nil), (*v1beta1.OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(a.(*OpenStackClusterSpec), b.(*v1beta1.OpenStackClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*OpenStackClusterStatus)(nil), (*v1beta1.OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(a.(*OpenStackClusterStatus), b.(*v1beta1.OpenStackClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*OpenStackIdentityReference)(nil), (*v1beta1.OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(a.(*OpenStackIdentityReference), b.(*v1beta1.OpenStackIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*OpenStackMachineSpec)(nil), (*v1beta1.OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(a.(*OpenStackMachineSpec), b.(*v1beta1.OpenStackMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*PortOpts)(nil), (*v1beta1.PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_PortOpts_To_v1beta1_PortOpts(a.(*PortOpts), b.(*v1beta1.PortOpts), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*RootVolume)(nil), (*v1beta1.RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_RootVolume_To_v1beta1_RootVolume(a.(*RootVolume), b.(*v1beta1.RootVolume), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SecurityGroupFilter)(nil), (*v1beta1.SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(a.(*SecurityGroupFilter), b.(*v1beta1.SecurityGroupFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SecurityGroupParam)(nil), (*v1beta1.SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SecurityGroupParam_To_v1beta1_SecurityGroupParam(a.(*SecurityGroupParam), b.(*v1beta1.SecurityGroupParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SecurityGroup)(nil), (*v1beta1.SecurityGroupStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SecurityGroup_To_v1beta1_SecurityGroupStatus(a.(*SecurityGroup), b.(*v1beta1.SecurityGroupStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SubnetFilter)(nil), (*v1beta1.SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(a.(*SubnetFilter), b.(*v1beta1.SubnetFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SubnetFilter)(nil), (*v1beta1.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetParam(a.(*SubnetFilter), b.(*v1beta1.SubnetParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*SubnetParam)(nil), (*v1beta1.SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha5_SubnetParam_To_v1beta1_SubnetParam(a.(*SubnetParam), b.(*v1beta1.SubnetParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.APIServerLoadBalancer)(nil), (*APIServerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIServerLoadBalancer_To_v1alpha5_APIServerLoadBalancer(a.(*v1beta1.APIServerLoadBalancer), b.(*APIServerLoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.BastionStatus)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BastionStatus_To_v1alpha5_Instance(a.(*v1beta1.BastionStatus), b.(*Instance), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Bastion_To_v1alpha5_Bastion(a.(*v1beta1.Bastion), b.(*Bastion), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LoadBalancer_To_v1alpha5_LoadBalancer(a.(*v1beta1.LoadBalancer), b.(*LoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NetworkFilter)(nil), (*NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkFilter_To_v1alpha5_NetworkFilter(a.(*v1beta1.NetworkFilter), b.(*NetworkFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NetworkParam)(nil), (*NetworkFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkParam_To_v1alpha5_NetworkFilter(a.(*v1beta1.NetworkParam), b.(*NetworkFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NetworkParam)(nil), (*NetworkParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkParam_To_v1alpha5_NetworkParam(a.(*v1beta1.NetworkParam), b.(*NetworkParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NetworkStatusWithSubnets)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkStatusWithSubnets_To_v1alpha5_Network(a.(*v1beta1.NetworkStatusWithSubnets), b.(*Network), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NetworkStatus)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkStatus_To_v1alpha5_Network(a.(*v1beta1.NetworkStatus), b.(*Network), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.OpenStackClusterSpec)(nil), (*OpenStackClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(a.(*v1beta1.OpenStackClusterSpec), b.(*OpenStackClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.OpenStackClusterStatus)(nil), (*OpenStackClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackClusterStatus_To_v1alpha5_OpenStackClusterStatus(a.(*v1beta1.OpenStackClusterStatus), b.(*OpenStackClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.OpenStackIdentityReference)(nil), (*OpenStackIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackIdentityReference_To_v1alpha5_OpenStackIdentityReference(a.(*v1beta1.OpenStackIdentityReference), b.(*OpenStackIdentityReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.OpenStackMachineSpec)(nil), (*OpenStackMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(a.(*v1beta1.OpenStackMachineSpec), b.(*OpenStackMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.OpenStackMachineStatus)(nil), (*OpenStackMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_OpenStackMachineStatus_To_v1alpha5_OpenStackMachineStatus(a.(*v1beta1.OpenStackMachineStatus), b.(*OpenStackMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.PortOpts)(nil), (*PortOpts)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PortOpts_To_v1alpha5_PortOpts(a.(*v1beta1.PortOpts), b.(*PortOpts), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.RootVolume)(nil), (*RootVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RootVolume_To_v1alpha5_RootVolume(a.(*v1beta1.RootVolume), b.(*RootVolume), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SecurityGroupFilter)(nil), (*SecurityGroupFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupFilter_To_v1alpha5_SecurityGroupFilter(a.(*v1beta1.SecurityGroupFilter), b.(*SecurityGroupFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SecurityGroupParam)(nil), (*SecurityGroupParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupParam_To_v1alpha5_SecurityGroupParam(a.(*v1beta1.SecurityGroupParam), b.(*SecurityGroupParam), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SecurityGroupStatus)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecurityGroupStatus_To_v1alpha5_SecurityGroup(a.(*v1beta1.SecurityGroupStatus), b.(*SecurityGroup), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SubnetFilter)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(a.(*v1beta1.SubnetFilter), b.(*SubnetFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SubnetParam)(nil), (*SubnetFilter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetFilter(a.(*v1beta1.SubnetParam), b.(*SubnetFilter), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.SubnetParam)(nil), (*SubnetParam)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetParam(a.(*v1beta1.SubnetParam), b.(*SubnetParam), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer(in *APIServerLoadBalancer, out *v1beta1.APIServerLoadBalancer, s conversion.Scope) error { - if err := v1.Convert_bool_To_Pointer_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - out.AdditionalPorts = *(*[]int)(unsafe.Pointer(&in.AdditionalPorts)) - out.AllowedCIDRs = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRs)) - return nil -} - -// Convert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer is an autogenerated conversion function. -func Convert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer(in *APIServerLoadBalancer, out *v1beta1.APIServerLoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha5_APIServerLoadBalancer_To_v1beta1_APIServerLoadBalancer(in, out, s) -} - -func autoConvert_v1beta1_APIServerLoadBalancer_To_v1alpha5_APIServerLoadBalancer(in *v1beta1.APIServerLoadBalancer, out *APIServerLoadBalancer, s conversion.Scope) error { - if err := v1.Convert_Pointer_bool_To_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - out.AdditionalPorts = *(*[]int)(unsafe.Pointer(&in.AdditionalPorts)) - out.AllowedCIDRs = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRs)) - // WARNING: in.Provider requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: does not exist in peer-type - // WARNING: in.Subnets requires manual conversion: does not exist in peer-type - // WARNING: in.AvailabilityZone requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_AddressPair_To_v1beta1_AddressPair(in *AddressPair, out *v1beta1.AddressPair, s conversion.Scope) error { - out.IPAddress = in.IPAddress - if err := optional.Convert_string_To_optional_String(&in.MACAddress, &out.MACAddress, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_AddressPair_To_v1beta1_AddressPair is an autogenerated conversion function. -func Convert_v1alpha5_AddressPair_To_v1beta1_AddressPair(in *AddressPair, out *v1beta1.AddressPair, s conversion.Scope) error { - return autoConvert_v1alpha5_AddressPair_To_v1beta1_AddressPair(in, out, s) -} - -func autoConvert_v1beta1_AddressPair_To_v1alpha5_AddressPair(in *v1beta1.AddressPair, out *AddressPair, s conversion.Scope) error { - out.IPAddress = in.IPAddress - if err := optional.Convert_optional_String_To_string(&in.MACAddress, &out.MACAddress, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_AddressPair_To_v1alpha5_AddressPair is an autogenerated conversion function. -func Convert_v1beta1_AddressPair_To_v1alpha5_AddressPair(in *v1beta1.AddressPair, out *AddressPair, s conversion.Scope) error { - return autoConvert_v1beta1_AddressPair_To_v1alpha5_AddressPair(in, out, s) -} - -func autoConvert_v1alpha5_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { - if err := optional.Convert_bool_To_optional_Bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - // WARNING: in.Instance requires manual conversion: does not exist in peer-type - if err := optional.Convert_string_To_optional_String(&in.AvailabilityZone, &out.AvailabilityZone, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_Bastion_To_v1alpha5_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { - if err := optional.Convert_optional_Bool_To_bool(&in.Enabled, &out.Enabled, s); err != nil { - return err - } - // WARNING: in.Spec requires manual conversion: does not exist in peer-type - if err := optional.Convert_optional_String_To_string(&in.AvailabilityZone, &out.AvailabilityZone, s); err != nil { - return err - } - // WARNING: in.FloatingIP requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { - out.FixedIP = in.FixedIP - if err := Convert_v1alpha5_SubnetParam_To_v1beta1_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1alpha5_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in *ExternalRouterIPParam, out *v1beta1.ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1alpha5_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(in, out, s) -} - -func autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha5_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { - out.FixedIP = in.FixedIP - if err := Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetParam(&in.Subnet, &out.Subnet, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ExternalRouterIPParam_To_v1alpha5_ExternalRouterIPParam is an autogenerated conversion function. -func Convert_v1beta1_ExternalRouterIPParam_To_v1alpha5_ExternalRouterIPParam(in *v1beta1.ExternalRouterIPParam, out *ExternalRouterIPParam, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalRouterIPParam_To_v1alpha5_ExternalRouterIPParam(in, out, s) -} - -func autoConvert_v1alpha5_FixedIP_To_v1beta1_FixedIP(in *FixedIP, out *v1beta1.FixedIP, s conversion.Scope) error { - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(v1beta1.SubnetParam) - if err := Convert_v1alpha5_SubnetFilter_To_v1beta1_SubnetParam(*in, *out, s); err != nil { - return err - } - } else { - out.Subnet = nil - } - if err := optional.Convert_string_To_optional_String(&in.IPAddress, &out.IPAddress, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_FixedIP_To_v1beta1_FixedIP is an autogenerated conversion function. -func Convert_v1alpha5_FixedIP_To_v1beta1_FixedIP(in *FixedIP, out *v1beta1.FixedIP, s conversion.Scope) error { - return autoConvert_v1alpha5_FixedIP_To_v1beta1_FixedIP(in, out, s) -} - -func autoConvert_v1beta1_FixedIP_To_v1alpha5_FixedIP(in *v1beta1.FixedIP, out *FixedIP, s conversion.Scope) error { - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(SubnetFilter) - if err := Convert_v1beta1_SubnetParam_To_v1alpha5_SubnetFilter(*in, *out, s); err != nil { - return err - } - } else { - out.Subnet = nil - } - if err := optional.Convert_optional_String_To_string(&in.IPAddress, &out.IPAddress, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_FixedIP_To_v1alpha5_FixedIP is an autogenerated conversion function. -func Convert_v1beta1_FixedIP_To_v1alpha5_FixedIP(in *v1beta1.FixedIP, out *FixedIP, s conversion.Scope) error { - return autoConvert_v1beta1_FixedIP_To_v1alpha5_FixedIP(in, out, s) -} - -func autoConvert_v1alpha5_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 - out.AllowedCIDRs = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRs)) - return nil -} - -// Convert_v1alpha5_LoadBalancer_To_v1beta1_LoadBalancer is an autogenerated conversion function. -func Convert_v1alpha5_LoadBalancer_To_v1beta1_LoadBalancer(in *LoadBalancer, out *v1beta1.LoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha5_LoadBalancer_To_v1beta1_LoadBalancer(in, out, s) -} - -func autoConvert_v1beta1_LoadBalancer_To_v1alpha5_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 - out.AllowedCIDRs = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRs)) - // WARNING: in.Tags requires manual conversion: does not exist in peer-type - // WARNING: in.LoadBalancerNetwork requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_NetworkFilter_To_v1beta1_NetworkFilter(in *NetworkFilter, out *v1beta1.NetworkFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.ProjectID = in.ProjectID - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Tags requires manual conversion: does not exist in peer-type - // WARNING: in.TagsAny requires manual conversion: does not exist in peer-type - // WARNING: in.NotTags requires manual conversion: does not exist in peer-type - // WARNING: in.NotTagsAny requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_NetworkFilter_To_v1alpha5_NetworkFilter(in *v1beta1.NetworkFilter, out *NetworkFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.ProjectID = in.ProjectID - // WARNING: in.FilterByNeutronTags requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_NetworkParam_To_v1beta1_NetworkParam(in *NetworkParam, out *v1beta1.NetworkParam, s conversion.Scope) error { - // WARNING: in.UUID requires manual conversion: does not exist in peer-type - // WARNING: in.FixedIP requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.NetworkFilter vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.NetworkFilter) - // WARNING: in.Subnets requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_NetworkParam_To_v1alpha5_NetworkParam(in *v1beta1.NetworkParam, out *NetworkParam, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.NetworkFilter vs sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.NetworkFilter) - return nil -} - -func autoConvert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha5_OpenStackClusterStatus_To_v1beta1_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster(in *OpenStackCluster, out *v1beta1.OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster(in, out, s) -} - -func autoConvert_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_OpenStackClusterStatus_To_v1alpha5_OpenStackClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster is an autogenerated conversion function. -func Convert_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster(in *v1beta1.OpenStackCluster, out *OpenStackCluster, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster(in, out, s) -} - -func autoConvert_v1alpha5_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([]v1beta1.OpenStackCluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_OpenStackCluster_To_v1beta1_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha5_OpenStackClusterList_To_v1beta1_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in *OpenStackClusterList, out *v1beta1.OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackClusterList_To_v1beta1_OpenStackClusterList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterList_To_v1alpha5_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_v1beta1_OpenStackCluster_To_v1alpha5_OpenStackCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_OpenStackClusterList_To_v1alpha5_OpenStackClusterList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterList_To_v1alpha5_OpenStackClusterList(in *v1beta1.OpenStackClusterList, out *OpenStackClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterList_To_v1alpha5_OpenStackClusterList(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(in *OpenStackClusterSpec, out *v1beta1.OpenStackClusterSpec, s conversion.Scope) error { - // WARNING: in.CloudName requires manual conversion: does not exist in peer-type - // WARNING: in.NodeCIDR requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.NetworkFilter vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.NetworkParam) - // WARNING: in.Subnet requires manual conversion: does not exist in peer-type - // WARNING: in.DNSNameservers requires manual conversion: does not exist in peer-type - if in.ExternalRouterIPs != nil { - in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs - *out = make([]v1beta1.ExternalRouterIPParam, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_ExternalRouterIPParam_To_v1beta1_ExternalRouterIPParam(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ExternalRouterIPs = nil - } - // WARNING: in.ExternalNetworkID requires manual conversion: does not exist in peer-type - // WARNING: in.APIServerLoadBalancer requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.APIServerLoadBalancer vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.APIServerLoadBalancer) - if err := optional.Convert_bool_To_optional_Bool(&in.DisableAPIServerFloatingIP, &out.DisableAPIServerFloatingIP, s); err != nil { - return err - } - if err := optional.Convert_string_To_optional_String(&in.APIServerFloatingIP, &out.APIServerFloatingIP, s); err != nil { - return err - } - if err := optional.Convert_string_To_optional_String(&in.APIServerFixedIP, &out.APIServerFixedIP, s); err != nil { - return err - } - if err := optional.Convert_int_To_optional_Int(&in.APIServerPort, &out.APIServerPort, s); err != nil { - return err - } - // WARNING: in.ManagedSecurityGroups requires manual conversion: inconvertible types (bool vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ManagedSecurityGroups) - // WARNING: in.AllowAllInClusterTraffic requires manual conversion: does not exist in peer-type - if err := optional.Convert_bool_To_optional_Bool(&in.DisablePortSecurity, &out.DisablePortSecurity, s); err != nil { - return err - } - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - // WARNING: in.ControlPlaneEndpoint requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint vs *sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint) - out.ControlPlaneAvailabilityZones = *(*[]string)(unsafe.Pointer(&in.ControlPlaneAvailabilityZones)) - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(v1beta1.Bastion) - if err := Convert_v1alpha5_Bastion_To_v1beta1_Bastion(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - // WARNING: in.IdentityRef requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.OpenStackIdentityReference vs sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.OpenStackIdentityReference) - return nil -} - -func autoConvert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(in *v1beta1.OpenStackClusterSpec, out *OpenStackClusterSpec, s conversion.Scope) error { - // WARNING: in.ManagedSubnets requires manual conversion: does not exist in peer-type - // WARNING: in.Router requires manual conversion: does not exist in peer-type - // WARNING: in.Network requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.NetworkParam vs sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.NetworkFilter) - // WARNING: in.Subnets requires manual conversion: does not exist in peer-type - // WARNING: in.NetworkMTU requires manual conversion: does not exist in peer-type - if in.ExternalRouterIPs != nil { - in, out := &in.ExternalRouterIPs, &out.ExternalRouterIPs - *out = make([]ExternalRouterIPParam, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ExternalRouterIPParam_To_v1alpha5_ExternalRouterIPParam(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.ExternalRouterIPs = nil - } - // WARNING: in.ExternalNetwork requires manual conversion: does not exist in peer-type - // WARNING: in.DisableExternalNetwork requires manual conversion: does not exist in peer-type - // WARNING: in.APIServerLoadBalancer requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.APIServerLoadBalancer vs sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.APIServerLoadBalancer) - if err := optional.Convert_optional_Bool_To_bool(&in.DisableAPIServerFloatingIP, &out.DisableAPIServerFloatingIP, s); err != nil { - return err - } - if err := optional.Convert_optional_String_To_string(&in.APIServerFloatingIP, &out.APIServerFloatingIP, s); err != nil { - return err - } - if err := optional.Convert_optional_String_To_string(&in.APIServerFixedIP, &out.APIServerFixedIP, s); err != nil { - return err - } - if err := optional.Convert_optional_Int_To_int(&in.APIServerPort, &out.APIServerPort, s); err != nil { - return err - } - // WARNING: in.ManagedSecurityGroups requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ManagedSecurityGroups vs bool) - if err := optional.Convert_optional_Bool_To_bool(&in.DisablePortSecurity, &out.DisablePortSecurity, s); err != nil { - return err - } - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - // WARNING: in.ControlPlaneEndpoint requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint vs sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint) - out.ControlPlaneAvailabilityZones = *(*[]string)(unsafe.Pointer(&in.ControlPlaneAvailabilityZones)) - // WARNING: in.ControlPlaneOmitAvailabilityZone requires manual conversion: does not exist in peer-type - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Bastion) - if err := Convert_v1beta1_Bastion_To_v1alpha5_Bastion(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - // WARNING: in.IdentityRef requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.OpenStackIdentityReference vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.OpenStackIdentityReference) - return nil -} - -func autoConvert_v1alpha5_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(v1beta1.NetworkStatusWithSubnets) - if err := Convert_v1alpha5_Network_To_v1beta1_NetworkStatusWithSubnets(*in, *out, s); err != nil { - return err - } - } else { - out.Network = nil - } - if in.ExternalNetwork != nil { - in, out := &in.ExternalNetwork, &out.ExternalNetwork - *out = new(v1beta1.NetworkStatus) - if err := Convert_v1alpha5_Network_To_v1beta1_NetworkStatus(*in, *out, s); err != nil { - return err - } - } else { - out.ExternalNetwork = nil - } - out.FailureDomains = *(*apiv1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - if in.ControlPlaneSecurityGroup != nil { - in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup - *out = new(v1beta1.SecurityGroupStatus) - if err := Convert_v1alpha5_SecurityGroup_To_v1beta1_SecurityGroupStatus(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneSecurityGroup = nil - } - if in.WorkerSecurityGroup != nil { - in, out := &in.WorkerSecurityGroup, &out.WorkerSecurityGroup - *out = new(v1beta1.SecurityGroupStatus) - if err := Convert_v1alpha5_SecurityGroup_To_v1beta1_SecurityGroupStatus(*in, *out, s); err != nil { - return err - } - } else { - out.WorkerSecurityGroup = nil - } - if in.BastionSecurityGroup != nil { - in, out := &in.BastionSecurityGroup, &out.BastionSecurityGroup - *out = new(v1beta1.SecurityGroupStatus) - if err := Convert_v1alpha5_SecurityGroup_To_v1beta1_SecurityGroupStatus(*in, *out, s); err != nil { - return err - } - } else { - out.BastionSecurityGroup = nil - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(v1beta1.BastionStatus) - if err := Convert_v1alpha5_Instance_To_v1beta1_BastionStatus(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -func autoConvert_v1beta1_OpenStackClusterStatus_To_v1alpha5_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_v1beta1_NetworkStatusWithSubnets_To_v1alpha5_Network(*in, *out, s); err != nil { - return err - } - } else { - out.Network = nil - } - if in.ExternalNetwork != nil { - in, out := &in.ExternalNetwork, &out.ExternalNetwork - *out = new(Network) - if err := Convert_v1beta1_NetworkStatus_To_v1alpha5_Network(*in, *out, s); err != nil { - return err - } - } else { - out.ExternalNetwork = nil - } - // WARNING: in.Router requires manual conversion: does not exist in peer-type - // WARNING: in.APIServerLoadBalancer requires manual conversion: does not exist in peer-type - out.FailureDomains = *(*apiv1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - if in.ControlPlaneSecurityGroup != nil { - in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup - *out = new(SecurityGroup) - if err := Convert_v1beta1_SecurityGroupStatus_To_v1alpha5_SecurityGroup(*in, *out, s); err != nil { - return err - } - } else { - out.ControlPlaneSecurityGroup = nil - } - if in.WorkerSecurityGroup != nil { - in, out := &in.WorkerSecurityGroup, &out.WorkerSecurityGroup - *out = new(SecurityGroup) - if err := Convert_v1beta1_SecurityGroupStatus_To_v1alpha5_SecurityGroup(*in, *out, s); err != nil { - return err - } - } else { - out.WorkerSecurityGroup = nil - } - if in.BastionSecurityGroup != nil { - in, out := &in.BastionSecurityGroup, &out.BastionSecurityGroup - *out = new(SecurityGroup) - if err := Convert_v1beta1_SecurityGroupStatus_To_v1alpha5_SecurityGroup(*in, *out, s); err != nil { - return err - } - } else { - out.BastionSecurityGroup = nil - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Instance) - if err := Convert_v1beta1_BastionStatus_To_v1alpha5_Instance(*in, *out, s); err != nil { - return err - } - } else { - out.Bastion = nil - } - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -func autoConvert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in *OpenStackClusterTemplate, out *v1beta1.OpenStackClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha5_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in *OpenStackClusterTemplate, out *v1beta1.OpenStackClusterTemplate, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate(in *v1beta1.OpenStackClusterTemplate, out *OpenStackClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha5_OpenStackClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate(in *v1beta1.OpenStackClusterTemplate, out *OpenStackClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in *OpenStackClusterTemplateList, out *v1beta1.OpenStackClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.OpenStackClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_OpenStackClusterTemplate_To_v1beta1_OpenStackClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha5_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in *OpenStackClusterTemplateList, out *v1beta1.OpenStackClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackClusterTemplateList_To_v1beta1_OpenStackClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateList_To_v1alpha5_OpenStackClusterTemplateList(in *v1beta1.OpenStackClusterTemplateList, out *OpenStackClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_OpenStackClusterTemplate_To_v1alpha5_OpenStackClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha5_OpenStackClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateList_To_v1alpha5_OpenStackClusterTemplateList(in *v1beta1.OpenStackClusterTemplateList, out *OpenStackClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateList_To_v1alpha5_OpenStackClusterTemplateList(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in *OpenStackClusterTemplateResource, out *v1beta1.OpenStackClusterTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha5_OpenStackClusterSpec_To_v1beta1_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in *OpenStackClusterTemplateResource, out *v1beta1.OpenStackClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha5_OpenStackClusterTemplateResource(in *v1beta1.OpenStackClusterTemplateResource, out *OpenStackClusterTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackClusterSpec_To_v1alpha5_OpenStackClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha5_OpenStackClusterTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha5_OpenStackClusterTemplateResource(in *v1beta1.OpenStackClusterTemplateResource, out *OpenStackClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha5_OpenStackClusterTemplateResource(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in *OpenStackClusterTemplateSpec, out *v1beta1.OpenStackClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha5_OpenStackClusterTemplateResource_To_v1beta1_OpenStackClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in *OpenStackClusterTemplateSpec, out *v1beta1.OpenStackClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackClusterTemplateSpec_To_v1beta1_OpenStackClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha5_OpenStackClusterTemplateSpec(in *v1beta1.OpenStackClusterTemplateSpec, out *OpenStackClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackClusterTemplateResource_To_v1alpha5_OpenStackClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha5_OpenStackClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha5_OpenStackClusterTemplateSpec(in *v1beta1.OpenStackClusterTemplateSpec, out *OpenStackClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackClusterTemplateSpec_To_v1alpha5_OpenStackClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(in *OpenStackIdentityReference, out *v1beta1.OpenStackIdentityReference, s conversion.Scope) error { - // WARNING: in.Kind requires manual conversion: does not exist in peer-type - out.Name = in.Name - return nil -} - -func autoConvert_v1beta1_OpenStackIdentityReference_To_v1alpha5_OpenStackIdentityReference(in *v1beta1.OpenStackIdentityReference, out *OpenStackIdentityReference, s conversion.Scope) error { - out.Name = in.Name - // WARNING: in.CloudName requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine(in *OpenStackMachine, out *v1beta1.OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_OpenStackMachineStatus_To_v1alpha5_OpenStackMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine(in *v1beta1.OpenStackMachine, out *OpenStackMachine, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine(in, out, s) -} - -func autoConvert_v1alpha5_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([]v1beta1.OpenStackMachine, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_OpenStackMachine_To_v1beta1_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha5_OpenStackMachineList_To_v1beta1_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in *OpenStackMachineList, out *v1beta1.OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineList_To_v1beta1_OpenStackMachineList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineList_To_v1alpha5_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_v1beta1_OpenStackMachine_To_v1alpha5_OpenStackMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_OpenStackMachineList_To_v1alpha5_OpenStackMachineList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineList_To_v1alpha5_OpenStackMachineList(in *v1beta1.OpenStackMachineList, out *OpenStackMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineList_To_v1alpha5_OpenStackMachineList(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(in *OpenStackMachineSpec, out *v1beta1.OpenStackMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - // WARNING: in.InstanceID requires manual conversion: does not exist in peer-type - // WARNING: in.CloudName requires manual conversion: does not exist in peer-type - out.Flavor = in.Flavor - // WARNING: in.Image requires manual conversion: inconvertible types (string vs sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ImageParam) - // WARNING: in.ImageUUID requires manual conversion: does not exist in peer-type - out.SSHKeyName = in.SSHKeyName - // WARNING: in.Networks requires manual conversion: does not exist in peer-type - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]v1beta1.PortOpts, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_PortOpts_To_v1beta1_PortOpts(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - // WARNING: in.Subnet requires manual conversion: does not exist in peer-type - // WARNING: in.FloatingIP requires manual conversion: does not exist in peer-type - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]v1beta1.SecurityGroupParam, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_SecurityGroupParam_To_v1beta1_SecurityGroupParam(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.SecurityGroups = nil - } - out.Trunk = in.Trunk - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - // WARNING: in.ServerMetadata requires manual conversion: inconvertible types (map[string]string vs []sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ServerMetadata) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(v1beta1.RootVolume) - if err := Convert_v1alpha5_RootVolume_To_v1beta1_RootVolume(*in, *out, s); err != nil { - return err - } - } else { - out.RootVolume = nil - } - // WARNING: in.ServerGroupID requires manual conversion: does not exist in peer-type - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(v1beta1.OpenStackIdentityReference) - if err := Convert_v1alpha5_OpenStackIdentityReference_To_v1beta1_OpenStackIdentityReference(*in, *out, s); err != nil { - return err - } - } else { - out.IdentityRef = nil - } - return nil -} - -func autoConvert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(in *v1beta1.OpenStackMachineSpec, out *OpenStackMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.Flavor = in.Flavor - // WARNING: in.Image requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ImageParam vs string) - out.SSHKeyName = in.SSHKeyName - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]PortOpts, len(*in)) - for i := range *in { - if err := Convert_v1beta1_PortOpts_To_v1alpha5_PortOpts(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Ports = nil - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]SecurityGroupParam, len(*in)) - for i := range *in { - if err := Convert_v1beta1_SecurityGroupParam_To_v1alpha5_SecurityGroupParam(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.SecurityGroups = nil - } - out.Trunk = in.Trunk - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - // WARNING: in.ServerMetadata requires manual conversion: inconvertible types ([]sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.ServerMetadata vs map[string]string) - out.ConfigDrive = (*bool)(unsafe.Pointer(in.ConfigDrive)) - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(RootVolume) - if err := Convert_v1beta1_RootVolume_To_v1alpha5_RootVolume(*in, *out, s); err != nil { - return err - } - } else { - out.RootVolume = nil - } - // WARNING: in.AdditionalBlockDevices requires manual conversion: does not exist in peer-type - // WARNING: in.ServerGroup requires manual conversion: does not exist in peer-type - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(OpenStackIdentityReference) - if err := Convert_v1beta1_OpenStackIdentityReference_To_v1alpha5_OpenStackIdentityReference(*in, *out, s); err != nil { - return err - } - } else { - out.IdentityRef = nil - } - // WARNING: in.FloatingIPPoolRef requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1beta1.OpenStackMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Addresses = *(*[]corev1.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)) - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in *OpenStackMachineStatus, out *v1beta1.OpenStackMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineStatus_To_v1beta1_OpenStackMachineStatus(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineStatus_To_v1alpha5_OpenStackMachineStatus(in *v1beta1.OpenStackMachineStatus, out *OpenStackMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - // WARNING: in.InstanceID requires manual conversion: does not exist in peer-type - out.Addresses = *(*[]corev1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*InstanceState)(unsafe.Pointer(in.InstanceState)) - // WARNING: in.Resolved requires manual conversion: does not exist in peer-type - // WARNING: in.Resources requires manual conversion: does not exist in peer-type - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -func autoConvert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha5_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in *OpenStackMachineTemplate, out *v1beta1.OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(in *v1beta1.OpenStackMachineTemplate, out *OpenStackMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(in, out, s) -} - -func autoConvert_v1alpha5_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([]v1beta1.OpenStackMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_OpenStackMachineTemplate_To_v1beta1_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha5_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in *OpenStackMachineTemplateList, out *v1beta1.OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineTemplateList_To_v1beta1_OpenStackMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha5_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_v1beta1_OpenStackMachineTemplate_To_v1alpha5_OpenStackMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList(in *v1beta1.OpenStackMachineTemplateList, out *OpenStackMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateList_To_v1alpha5_OpenStackMachineTemplateList(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha5_OpenStackMachineSpec_To_v1beta1_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in *OpenStackMachineTemplateResource, out *v1beta1.OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackMachineSpec_To_v1alpha5_OpenStackMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(in *v1beta1.OpenStackMachineTemplateResource, out *OpenStackMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(in, out, s) -} - -func autoConvert_v1alpha5_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha5_OpenStackMachineTemplateResource_To_v1beta1_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha5_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha5_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in *OpenStackMachineTemplateSpec, out *v1beta1.OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha5_OpenStackMachineTemplateSpec_To_v1beta1_OpenStackMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_OpenStackMachineTemplateResource_To_v1alpha5_OpenStackMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(in *v1beta1.OpenStackMachineTemplateSpec, out *OpenStackMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_OpenStackMachineTemplateSpec_To_v1alpha5_OpenStackMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha5_PortOpts_To_v1beta1_PortOpts(in *PortOpts, out *v1beta1.PortOpts, s conversion.Scope) error { - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(v1beta1.NetworkParam) - if err := Convert_v1alpha5_NetworkFilter_To_v1beta1_NetworkParam(*in, *out, s); err != nil { - return err - } - } else { - out.Network = nil - } - if err := optional.Convert_string_To_optional_String(&in.NameSuffix, &out.NameSuffix, s); err != nil { - return err - } - if err := optional.Convert_string_To_optional_String(&in.Description, &out.Description, s); err != nil { - return err - } - // WARNING: in.AdminStateUp requires manual conversion: does not exist in peer-type - // WARNING: in.MACAddress requires manual conversion: does not exist in peer-type - if in.FixedIPs != nil { - in, out := &in.FixedIPs, &out.FixedIPs - *out = make([]v1beta1.FixedIP, len(*in)) - for i := range *in { - if err := Convert_v1alpha5_FixedIP_To_v1beta1_FixedIP(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.FixedIPs = nil - } - // WARNING: in.TenantID requires manual conversion: does not exist in peer-type - // WARNING: in.ProjectID requires manual conversion: does not exist in peer-type - // INFO: in.SecurityGroups opted out of conversion generation - // INFO: in.SecurityGroupFilters opted out of conversion generation - // WARNING: in.AllowedAddressPairs requires manual conversion: does not exist in peer-type - out.Trunk = (*bool)(unsafe.Pointer(in.Trunk)) - // WARNING: in.HostID requires manual conversion: does not exist in peer-type - // WARNING: in.VNICType requires manual conversion: does not exist in peer-type - // WARNING: in.Profile requires manual conversion: does not exist in peer-type - // WARNING: in.DisablePortSecurity requires manual conversion: does not exist in peer-type - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - return nil -} - -func autoConvert_v1beta1_PortOpts_To_v1alpha5_PortOpts(in *v1beta1.PortOpts, out *PortOpts, s conversion.Scope) error { - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(NetworkFilter) - if err := Convert_v1beta1_NetworkParam_To_v1alpha5_NetworkFilter(*in, *out, s); err != nil { - return err - } - } else { - out.Network = nil - } - if err := optional.Convert_optional_String_To_string(&in.Description, &out.Description, s); err != nil { - return err - } - if err := optional.Convert_optional_String_To_string(&in.NameSuffix, &out.NameSuffix, s); err != nil { - return err - } - if in.FixedIPs != nil { - in, out := &in.FixedIPs, &out.FixedIPs - *out = make([]FixedIP, len(*in)) - for i := range *in { - if err := Convert_v1beta1_FixedIP_To_v1alpha5_FixedIP(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.FixedIPs = nil - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]string, len(*in)) - for i := range *in { - if err := v1alpha6.Convert_v1beta1_SecurityGroupParam_To_string(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.SecurityGroups = nil - } - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Trunk = (*bool)(unsafe.Pointer(in.Trunk)) - // WARNING: in.ResolvedPortSpecFields requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_RootVolume_To_v1beta1_RootVolume(in *RootVolume, out *v1beta1.RootVolume, s conversion.Scope) error { - // WARNING: in.Size requires manual conversion: does not exist in peer-type - // WARNING: in.VolumeType requires manual conversion: does not exist in peer-type - // WARNING: in.AvailabilityZone requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_RootVolume_To_v1alpha5_RootVolume(in *v1beta1.RootVolume, out *RootVolume, s conversion.Scope) error { - // WARNING: in.SizeGiB requires manual conversion: does not exist in peer-type - // WARNING: in.BlockDeviceVolume requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_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)) - out.IPs = *(*[]string)(unsafe.Pointer(&in.IPs)) - return nil -} - -// Convert_v1alpha5_Router_To_v1beta1_Router is an autogenerated conversion function. -func Convert_v1alpha5_Router_To_v1beta1_Router(in *Router, out *v1beta1.Router, s conversion.Scope) error { - return autoConvert_v1alpha5_Router_To_v1beta1_Router(in, out, s) -} - -func autoConvert_v1beta1_Router_To_v1alpha5_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)) - out.IPs = *(*[]string)(unsafe.Pointer(&in.IPs)) - return nil -} - -// Convert_v1beta1_Router_To_v1alpha5_Router is an autogenerated conversion function. -func Convert_v1beta1_Router_To_v1alpha5_Router(in *v1beta1.Router, out *Router, s conversion.Scope) error { - return autoConvert_v1beta1_Router_To_v1alpha5_Router(in, out, s) -} - -func autoConvert_v1alpha5_SecurityGroupFilter_To_v1beta1_SecurityGroupFilter(in *SecurityGroupFilter, out *v1beta1.SecurityGroupFilter, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: does not exist in peer-type - out.Name = in.Name - out.Description = in.Description - // WARNING: in.TenantID requires manual conversion: does not exist in peer-type - out.ProjectID = in.ProjectID - // WARNING: in.Limit requires manual conversion: does not exist in peer-type - // WARNING: in.Marker requires manual conversion: does not exist in peer-type - // WARNING: in.SortKey requires manual conversion: does not exist in peer-type - // WARNING: in.SortDir requires manual conversion: does not exist in peer-type - // WARNING: in.Tags requires manual conversion: does not exist in peer-type - // WARNING: in.TagsAny requires manual conversion: does not exist in peer-type - // WARNING: in.NotTags requires manual conversion: does not exist in peer-type - // WARNING: in.NotTagsAny requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_SecurityGroupFilter_To_v1alpha5_SecurityGroupFilter(in *v1beta1.SecurityGroupFilter, out *SecurityGroupFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.ProjectID = in.ProjectID - // WARNING: in.FilterByNeutronTags requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_SecurityGroupParam_To_v1beta1_SecurityGroupParam(in *SecurityGroupParam, out *v1beta1.SecurityGroupParam, s conversion.Scope) error { - // WARNING: in.UUID requires manual conversion: does not exist in peer-type - // WARNING: in.Name requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.SecurityGroupFilter vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.SecurityGroupFilter) - return nil -} - -func autoConvert_v1beta1_SecurityGroupParam_To_v1alpha5_SecurityGroupParam(in *v1beta1.SecurityGroupParam, out *SecurityGroupParam, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.SecurityGroupFilter vs sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.SecurityGroupFilter) - return nil -} - -func autoConvert_v1alpha5_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_v1alpha5_Subnet_To_v1beta1_Subnet is an autogenerated conversion function. -func Convert_v1alpha5_Subnet_To_v1beta1_Subnet(in *Subnet, out *v1beta1.Subnet, s conversion.Scope) error { - return autoConvert_v1alpha5_Subnet_To_v1beta1_Subnet(in, out, s) -} - -func autoConvert_v1beta1_Subnet_To_v1alpha5_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_v1alpha5_Subnet is an autogenerated conversion function. -func Convert_v1beta1_Subnet_To_v1alpha5_Subnet(in *v1beta1.Subnet, out *Subnet, s conversion.Scope) error { - return autoConvert_v1beta1_Subnet_To_v1alpha5_Subnet(in, out, s) -} - -func autoConvert_v1alpha5_SubnetFilter_To_v1beta1_SubnetFilter(in *SubnetFilter, out *v1beta1.SubnetFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.ProjectID = in.ProjectID - out.IPVersion = in.IPVersion - out.GatewayIP = in.GatewayIP - out.CIDR = in.CIDR - out.IPv6AddressMode = in.IPv6AddressMode - out.IPv6RAMode = in.IPv6RAMode - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Tags requires manual conversion: does not exist in peer-type - // WARNING: in.TagsAny requires manual conversion: does not exist in peer-type - // WARNING: in.NotTags requires manual conversion: does not exist in peer-type - // WARNING: in.NotTagsAny requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1beta1_SubnetFilter_To_v1alpha5_SubnetFilter(in *v1beta1.SubnetFilter, out *SubnetFilter, s conversion.Scope) error { - out.Name = in.Name - out.Description = in.Description - out.ProjectID = in.ProjectID - out.IPVersion = in.IPVersion - out.GatewayIP = in.GatewayIP - out.CIDR = in.CIDR - out.IPv6AddressMode = in.IPv6AddressMode - out.IPv6RAMode = in.IPv6RAMode - // WARNING: in.FilterByNeutronTags requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha5_SubnetParam_To_v1beta1_SubnetParam(in *SubnetParam, out *v1beta1.SubnetParam, s conversion.Scope) error { - // WARNING: in.UUID requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.SubnetFilter vs *sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.SubnetFilter) - return nil -} - -func autoConvert_v1beta1_SubnetParam_To_v1alpha5_SubnetParam(in *v1beta1.SubnetParam, out *SubnetParam, s conversion.Scope) error { - // WARNING: in.ID requires manual conversion: does not exist in peer-type - // WARNING: in.Filter requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1.SubnetFilter vs sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5.SubnetFilter) - return nil -} diff --git a/api/v1alpha5/zz_generated.deepcopy.go b/api/v1alpha5/zz_generated.deepcopy.go deleted file mode 100644 index 5b2d856eed..0000000000 --- a/api/v1alpha5/zz_generated.deepcopy.go +++ /dev/null @@ -1,1028 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2023 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 v1alpha5 - -import ( - "k8s.io/api/core/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServerLoadBalancer) DeepCopyInto(out *APIServerLoadBalancer) { - *out = *in - if in.AdditionalPorts != nil { - in, out := &in.AdditionalPorts, &out.AdditionalPorts - *out = make([]int, len(*in)) - copy(*out, *in) - } - if in.AllowedCIDRs != nil { - in, out := &in.AllowedCIDRs, &out.AllowedCIDRs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerLoadBalancer. -func (in *APIServerLoadBalancer) DeepCopy() *APIServerLoadBalancer { - if in == nil { - return nil - } - out := new(APIServerLoadBalancer) - in.DeepCopyInto(out) - return out -} - -// 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 - out.Subnet = in.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 *FixedIP) DeepCopyInto(out *FixedIP) { - *out = *in - if in.Subnet != nil { - in, out := &in.Subnet, &out.Subnet - *out = new(SubnetFilter) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new 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 = make([]string, len(*in)) - copy(*out, *in) - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *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 - if in.AllowedCIDRs != nil { - in, out := &in.AllowedCIDRs, &out.AllowedCIDRs - *out = make([]string, len(*in)) - copy(*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) - (*in).DeepCopyInto(*out) - } -} - -// 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 *NetworkFilter) DeepCopyInto(out *NetworkFilter) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkFilter. -func (in *NetworkFilter) DeepCopy() *NetworkFilter { - if in == nil { - return nil - } - out := new(NetworkFilter) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkParam) DeepCopyInto(out *NetworkParam) { - *out = *in - out.Filter = in.Filter - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]SubnetParam, len(*in)) - copy(*out, *in) - } -} - -// 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 - out.Network = in.Network - out.Subnet = in.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)) - copy(*out, *in) - } - in.APIServerLoadBalancer.DeepCopyInto(&out.APIServerLoadBalancer) - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneAvailabilityZones != nil { - in, out := &in.ControlPlaneAvailabilityZones, &out.ControlPlaneAvailabilityZones - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Bastion) - (*in).DeepCopyInto(*out) - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(OpenStackIdentityReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterSpec. -func (in *OpenStackClusterSpec) DeepCopy() *OpenStackClusterSpec { - if in == nil { - return nil - } - out := new(OpenStackClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterStatus) DeepCopyInto(out *OpenStackClusterStatus) { - *out = *in - if in.Network != nil { - in, out := &in.Network, &out.Network - *out = new(Network) - (*in).DeepCopyInto(*out) - } - if in.ExternalNetwork != nil { - in, out := &in.ExternalNetwork, &out.ExternalNetwork - *out = new(Network) - (*in).DeepCopyInto(*out) - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(v1beta1.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.ControlPlaneSecurityGroup != nil { - in, out := &in.ControlPlaneSecurityGroup, &out.ControlPlaneSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.WorkerSecurityGroup != nil { - in, out := &in.WorkerSecurityGroup, &out.WorkerSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.BastionSecurityGroup != nil { - in, out := &in.BastionSecurityGroup, &out.BastionSecurityGroup - *out = new(SecurityGroup) - (*in).DeepCopyInto(*out) - } - if in.Bastion != nil { - in, out := &in.Bastion, &out.Bastion - *out = new(Instance) - (*in).DeepCopyInto(*out) - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterStatus. -func (in *OpenStackClusterStatus) DeepCopy() *OpenStackClusterStatus { - if in == nil { - return nil - } - out := new(OpenStackClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplate) DeepCopyInto(out *OpenStackClusterTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplate. -func (in *OpenStackClusterTemplate) DeepCopy() *OpenStackClusterTemplate { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackClusterTemplate) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplateList) DeepCopyInto(out *OpenStackClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateList. -func (in *OpenStackClusterTemplateList) DeepCopy() *OpenStackClusterTemplateList { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackClusterTemplateList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplateResource) DeepCopyInto(out *OpenStackClusterTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateResource. -func (in *OpenStackClusterTemplateResource) DeepCopy() *OpenStackClusterTemplateResource { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackClusterTemplateSpec) DeepCopyInto(out *OpenStackClusterTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackClusterTemplateSpec. -func (in *OpenStackClusterTemplateSpec) DeepCopy() *OpenStackClusterTemplateSpec { - if in == nil { - return nil - } - out := new(OpenStackClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackIdentityReference) DeepCopyInto(out *OpenStackIdentityReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackIdentityReference. -func (in *OpenStackIdentityReference) DeepCopy() *OpenStackIdentityReference { - if in == nil { - return nil - } - out := new(OpenStackIdentityReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachine) DeepCopyInto(out *OpenStackMachine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachine. -func (in *OpenStackMachine) DeepCopy() *OpenStackMachine { - if in == nil { - return nil - } - out := new(OpenStackMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineList) DeepCopyInto(out *OpenStackMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineList. -func (in *OpenStackMachineList) DeepCopy() *OpenStackMachineList { - if in == nil { - return nil - } - out := new(OpenStackMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineSpec) DeepCopyInto(out *OpenStackMachineSpec) { - *out = *in - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.InstanceID != nil { - in, out := &in.InstanceID, &out.InstanceID - *out = new(string) - **out = **in - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = make([]NetworkParam, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]PortOpts, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]SecurityGroupParam, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ServerMetadata != nil { - in, out := &in.ServerMetadata, &out.ServerMetadata - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ConfigDrive != nil { - in, out := &in.ConfigDrive, &out.ConfigDrive - *out = new(bool) - **out = **in - } - if in.RootVolume != nil { - in, out := &in.RootVolume, &out.RootVolume - *out = new(RootVolume) - **out = **in - } - if in.IdentityRef != nil { - in, out := &in.IdentityRef, &out.IdentityRef - *out = new(OpenStackIdentityReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineSpec. -func (in *OpenStackMachineSpec) DeepCopy() *OpenStackMachineSpec { - if in == nil { - return nil - } - out := new(OpenStackMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineStatus) DeepCopyInto(out *OpenStackMachineStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]v1.NodeAddress, len(*in)) - copy(*out, *in) - } - if in.InstanceState != nil { - in, out := &in.InstanceState, &out.InstanceState - *out = new(InstanceState) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(v1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// 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.Network != nil { - in, out := &in.Network, &out.Network - *out = new(NetworkFilter) - **out = **in - } - if in.AdminStateUp != nil { - in, out := &in.AdminStateUp, &out.AdminStateUp - *out = new(bool) - **out = **in - } - if in.FixedIPs != nil { - in, out := &in.FixedIPs, &out.FixedIPs - *out = make([]FixedIP, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SecurityGroupFilters != nil { - in, out := &in.SecurityGroupFilters, &out.SecurityGroupFilters - *out = make([]SecurityGroupParam, 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) - } - if in.IPs != nil { - in, out := &in.IPs, &out.IPs - *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 -} - -// 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 - out.Filter = in.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/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml index fd240c51f5..383fcb8021 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml @@ -18,1780 +18,6 @@ spec: singular: openstackcluster scope: Namespaced versions: - - 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 - - description: Time duration since creation of OpenStackCluster - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - deprecationWarning: The v1alpha5 version of OpenStackCluster has been deprecated - and will be removed in a future release of the API. Please upgrade. - name: v1alpha5 - schema: - openAPIV3Schema: - description: |- - OpenStackCluster is the Schema for the openstackclusters API. - - - Deprecated: This type will be removed in one of the next releases. - 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 - apiServerLoadBalancer: - description: |- - APIServerLoadBalancer configures the optional LoadBalancer for the APIServer. - It must be activated by setting `enabled: true`. - properties: - additionalPorts: - description: AdditionalPorts adds additional tcp ports to the - load balancer. - items: - type: integer - type: array - allowedCidrs: - description: AllowedCIDRs restrict access to all API-Server listeners - to the given address CIDRs. - items: - type: string - type: array - enabled: - description: Enabled defines whether a load balancer should be - created. - type: boolean - type: object - 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 - - - As a rolling update is not ideal during a bastion host session, we - prevent changes to a running bastion configuration. Set `enabled: false` to - make changes. - 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 - imageUUID: - description: |- - The uuid of the image to use for your server instance. - if it's empty, Image name will be used - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination - these 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 - securityGroups: - description: The uuids of the security groups to assign - to the instance - 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: - availabilityZone: - type: string - diskSize: - type: integer - volumeType: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - imageUUID: - 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: - allowedCIDRs: - items: - type: string - type: array - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination - these 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 - securityGroups: - description: The uuids of the security groups to assign - to the instance - 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 - ips: - items: - type: string - type: array - 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: - availabilityZone: - type: string - diskSize: - type: integer - volumeType: - 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 - 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 - 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: - allowedCIDRs: - items: - type: string - type: array - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination - these 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 - securityGroups: - description: The uuids of the security groups to assign to - the instance - 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 - ips: - items: - type: string - type: array - 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. - - - 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. - 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. - - - 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. - 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: - allowedCIDRs: - items: - type: string - type: array - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination - these 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 - securityGroups: - description: The uuids of the security groups to assign to - the instance - 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 - ips: - items: - type: string - type: array - 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 - type: object - required: - - ready - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster to which this OpenStackCluster belongs jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name 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 96680265b6..7778494f26 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml @@ -18,731 +18,6 @@ spec: singular: openstackclustertemplate scope: Namespaced versions: - - deprecated: true - deprecationWarning: The v1alpha5 version of OpenStackClusterTemplate has been - deprecated and will be removed in a future release of the API. Please upgrade. - name: v1alpha5 - schema: - openAPIV3Schema: - description: |- - OpenStackClusterTemplate is the Schema for the openstackclustertemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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 - apiServerLoadBalancer: - description: |- - APIServerLoadBalancer configures the optional LoadBalancer for the APIServer. - It must be activated by setting `enabled: true`. - properties: - additionalPorts: - description: AdditionalPorts adds additional tcp ports - to the load balancer. - items: - type: integer - type: array - allowedCidrs: - description: AllowedCIDRs restrict access to all API-Server - listeners to the given address CIDRs. - items: - type: string - type: array - enabled: - description: Enabled defines whether a load balancer should - be created. - type: boolean - type: object - 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 - - - As a rolling update is not ideal during a bastion host session, we - prevent changes to a running bastion configuration. Set `enabled: false` to - make changes. - 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 - imageUUID: - description: |- - The uuid of the image to use for your server instance. - if it's empty, Image name will be used - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any - combination these 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 - securityGroups: - description: The uuids of the security groups - to assign to the instance - 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: - availabilityZone: - type: string - diskSize: - type: integer - volumeType: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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: false - storage: false - deprecated: true deprecationWarning: The v1alpha6 version of OpenStackClusterTemplate has been deprecated and will be removed in a future release of the API. Please upgrade. 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 243087e475..84368f2326 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml @@ -18,557 +18,6 @@ spec: singular: openstackmachine scope: Namespaced versions: - - 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 - - description: Time duration since creation of OpenStackMachine - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - deprecationWarning: The v1alpha5 version of OpenStackMachine has been deprecated - and will be removed in a future release of the API. Please upgrade. - name: v1alpha5 - schema: - openAPIV3Schema: - description: |- - OpenStackMachine is the Schema for the openstackmachines API. - - - Deprecated: This type will be removed in one of the next releases. - 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 - imageUUID: - description: |- - The uuid of the image to use for your server instance. - if it's empty, Image name will be used - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination these - 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 - securityGroups: - description: The uuids of the security groups to assign to the - instance - 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: - availabilityZone: - type: string - diskSize: - type: integer - volumeType: - 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 - conditions: - description: Conditions provide observations of the operational state - of a Cluster API resource. - items: - description: Condition defines an observation of a Cluster API resource - operational state. - properties: - lastTransitionTime: - description: |- - Last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when - the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - A human readable message indicating details about the transition. - This field may be empty. - type: string - reason: - description: |- - The reason for the condition's last transition in CamelCase. - The specific API may choose whether or not this field is considered a guaranteed API. - This field may not be empty. - type: string - severity: - description: |- - Severity provides an explicit classification of Reason code, so the users or machines can immediately - understand the current situation and act accordingly. - The Severity field MUST be set only when Status=False. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions - can be useful (see .node.status.conditions), the ability to deconflict is important. - type: string - required: - - lastTransitionTime - - status - - type - type: object - type: array - failureMessage: - 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. - - - 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. - type: string - failureReason: - 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: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster to which this OpenStackMachine belongs jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name 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 7e5c5bbe6f..6028e6b5ce 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml @@ -18,452 +18,6 @@ spec: singular: openstackmachinetemplate scope: Namespaced versions: - - deprecated: true - deprecationWarning: The v1alpha5 version of OpenStackMachineTemplate has been - deprecated and will be removed in a future release of the API. Please upgrade. - name: v1alpha5 - schema: - openAPIV3Schema: - description: |- - OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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 - imageUUID: - description: |- - The uuid of the image to use for your server instance. - if it's empty, Image name will be used - 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: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - 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 - subnet: - description: |- - Subnet is an openstack subnet query that will return the id of a subnet to create - the fixed IP of a port in. This query must not return more than one subnet. - properties: - cidr: - type: string - description: - type: string - gateway_ip: - type: string - id: - type: string - ipVersion: - type: integer - ipv6AddressMode: - type: string - ipv6RaMode: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - required: - - subnet - 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 - network: - description: |- - Network is a query for an openstack network that the port will be created or discovered on. - This will fail if the query returns more than one network. - properties: - description: - type: string - id: - type: string - name: - type: string - notTags: - type: string - notTagsAny: - type: string - projectId: - type: string - tags: - type: string - tagsAny: - type: string - type: object - 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 - securityGroupFilters: - description: The names, uuids, filters or any combination - these 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 - securityGroups: - description: The uuids of the security groups to assign - to the instance - 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: - availabilityZone: - type: string - diskSize: - type: integer - volumeType: - 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: false - storage: false - deprecated: true deprecationWarning: The v1alpha6 version of OpenStackMachineTemplate has been deprecated and will be removed in a future release of the API. Please upgrade. diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 5e25640181..a4c9e050cf 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,5 +1,5 @@ commonLabels: - cluster.x-k8s.io/v1beta1: v1alpha5_v1alpha6_v1alpha7_v1beta1 + cluster.x-k8s.io/v1beta1: v1alpha6_v1alpha7_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/kustomize/v1alpha5/default/cluster-template.yaml b/kustomize/v1alpha5/default/cluster-template.yaml deleted file mode 100644 index 0cb074da0c..0000000000 --- a/kustomize/v1alpha5/default/cluster-template.yaml +++ /dev/null @@ -1,184 +0,0 @@ ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico. - serviceDomain: "cluster.local" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 - kind: OpenStackCluster - name: ${CLUSTER_NAME} - controlPlaneRef: - kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1beta1 - name: ${CLUSTER_NAME}-control-plane ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret - apiServerLoadBalancer: - enabled: true - managedSecurityGroups: true - nodeCidr: 10.6.0.0/24 - dnsNameservers: - - ${OPENSTACK_DNS_NAMESERVERS} - externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID} ---- -kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - machineTemplate: - infrastructureRef: - kind: OpenStackMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 - name: "${CLUSTER_NAME}-control-plane" - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - extraVolumes: - - name: cloud - hostPath: /etc/kubernetes/cloud.conf - mountPath: /etc/kubernetes/cloud.conf - readOnly: true - controllerManager: - extraArgs: - cloud-provider: openstack - cloud-config: /etc/kubernetes/cloud.conf - extraVolumes: - - name: cloud - hostPath: /etc/kubernetes/cloud.conf - mountPath: /etc/kubernetes/cloud.conf - readOnly: true - - name: cacerts - hostPath: /etc/certs/cacert - mountPath: /etc/certs/cacert - readOnly: true - joinConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack - files: - - path: /etc/kubernetes/cloud.conf - owner: root - permissions: "0600" - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} - encoding: base64 - - path: /etc/certs/cacert - owner: root - permissions: "0600" - content: ${OPENSTACK_CLOUD_CACERT_B64} - encoding: base64 - version: "${KUBERNETES_VERSION}" ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR} - image: ${OPENSTACK_IMAGE_NAME} - sshKeyName: ${OPENSTACK_SSH_KEY_NAME} - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineDeployment -metadata: - name: "${CLUSTER_NAME}-md-0" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: - template: - spec: - clusterName: "${CLUSTER_NAME}" - version: "${KUBERNETES_VERSION}" - failureDomain: ${OPENSTACK_FAILURE_DOMAIN} - bootstrap: - configRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - infrastructureRef: - name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 - kind: OpenStackMachineTemplate ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 -kind: OpenStackMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - cloudName: ${OPENSTACK_CLOUD} - identityRef: - name: ${CLUSTER_NAME}-cloud-config - kind: Secret - flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR} - image: ${OPENSTACK_IMAGE_NAME} - sshKeyName: ${OPENSTACK_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: - - content: ${OPENSTACK_CLOUD_PROVIDER_CONF_B64} - encoding: base64 - owner: root - path: /etc/kubernetes/cloud.conf - permissions: "0600" - - content: ${OPENSTACK_CLOUD_CACERT_B64} - encoding: base64 - owner: root - path: /etc/certs/cacert - permissions: "0600" - joinConfiguration: - nodeRegistration: - name: '{{ local_hostname }}' - kubeletExtraArgs: - cloud-config: /etc/kubernetes/cloud.conf - cloud-provider: openstack ---- -apiVersion: v1 -kind: Secret -metadata: - name: ${CLUSTER_NAME}-cloud-config - labels: - clusterctl.cluster.x-k8s.io/move: "true" -data: - clouds.yaml: ${OPENSTACK_CLOUD_YAML_B64} - cacert: ${OPENSTACK_CLOUD_CACERT_B64} diff --git a/kustomize/v1alpha5/default/kustomization.yaml b/kustomize/v1alpha5/default/kustomization.yaml deleted file mode 100644 index bc7ab04c05..0000000000 --- a/kustomize/v1alpha5/default/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- cluster-template.yaml diff --git a/kustomize/v1alpha5/external-cloud-provider/kustomization.yaml b/kustomize/v1alpha5/external-cloud-provider/kustomization.yaml deleted file mode 100644 index f1239f1c40..0000000000 --- a/kustomize/v1alpha5/external-cloud-provider/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-ccm.yaml diff --git a/kustomize/v1alpha5/external-cloud-provider/patch-ccm.yaml b/kustomize/v1alpha5/external-cloud-provider/patch-ccm.yaml deleted file mode 100644 index 35ba1cdaf7..0000000000 --- a/kustomize/v1alpha5/external-cloud-provider/patch-ccm.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - kubeadmConfigSpec: - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - controllerManager: - extraArgs: - cloud-provider: external - cloud-config: - extraVolumes: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: - files: [] ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - files: [] - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - cloud-config: diff --git a/kustomize/v1alpha5/without-lb/kustomization.yaml b/kustomize/v1alpha5/without-lb/kustomization.yaml deleted file mode 100644 index b12f7e5db4..0000000000 --- a/kustomize/v1alpha5/without-lb/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../default -patches: -- path: patch-without-lb.yaml diff --git a/kustomize/v1alpha5/without-lb/patch-without-lb.yaml b/kustomize/v1alpha5/without-lb/patch-without-lb.yaml deleted file mode 100644 index d5f6d01e6b..0000000000 --- a/kustomize/v1alpha5/without-lb/patch-without-lb.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha5 -kind: OpenStackCluster -metadata: - name: ${CLUSTER_NAME} -spec: - apiServerLoadBalancer: - $patch: delete ---- -apiVersion: controlplane.cluster.x-k8s.io/v1beta1 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-control-plane" -spec: - replicas: 1 diff --git a/main.go b/main.go index c170553eeb..0629ca5a9c 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" infrav1alpha1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1" - infrav1alpha5 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5" infrav1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6" infrav1alpha7 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7" infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" @@ -105,7 +104,6 @@ func init() { _ = clusterv1.AddToScheme(scheme) _ = ipamv1.AddToScheme(scheme) _ = infrav1.AddToScheme(scheme) - _ = infrav1alpha5.AddToScheme(scheme) _ = infrav1alpha6.AddToScheme(scheme) _ = infrav1alpha7.AddToScheme(scheme) _ = infrav1alpha1.AddToScheme(scheme) diff --git a/test/e2e/suites/apivalidations/suite_test.go b/test/e2e/suites/apivalidations/suite_test.go index beac7d11aa..b104a3ea46 100644 --- a/test/e2e/suites/apivalidations/suite_test.go +++ b/test/e2e/suites/apivalidations/suite_test.go @@ -40,7 +40,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" infrav1alpha1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha1" - infrav1alpha5 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha5" infrav1alpha6 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha6" infrav1alpha7 "sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7" infrav1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1" @@ -71,7 +70,6 @@ var _ = BeforeSuite(func() { testScheme = scheme.Scheme for _, f := range []func(*runtime.Scheme) error{ infrav1alpha1.AddToScheme, - infrav1alpha5.AddToScheme, infrav1alpha6.AddToScheme, infrav1alpha7.AddToScheme, infrav1.AddToScheme,