diff --git a/api/v1beta1/ibmvpc_conversion.go b/api/v1beta1/ibmvpc_conversion.go index 7bb5b821e..98711ef85 100644 --- a/api/v1beta1/ibmvpc_conversion.go +++ b/api/v1beta1/ibmvpc_conversion.go @@ -215,3 +215,7 @@ func Convert_Slice_Pointer_v1beta2_IBMVPCResourceReference_To_Slice_Pointer_stri } return nil } + +func Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in *infrav1beta2.VPCLoadBalancerSpec, out *VPCLoadBalancerSpec, s apiconversion.Scope) error { + return autoConvert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(in, out, s) +} diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go index fc40f1d93..972a718b0 100644 --- a/api/v1beta1/zz_generated.conversion.go +++ b/api/v1beta1/zz_generated.conversion.go @@ -394,11 +394,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1beta2.VPCLoadBalancerSpec)(nil), (*VPCLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(a.(*v1beta2.VPCLoadBalancerSpec), b.(*VPCLoadBalancerSpec), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*VPCVolume)(nil), (*v1beta2.VPCVolume)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_VPCVolume_To_v1beta2_VPCVolume(a.(*VPCVolume), b.(*v1beta2.VPCVolume), scope) }); err != nil { @@ -449,6 +444,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1beta2.VPCLoadBalancerSpec)(nil), (*VPCLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_VPCLoadBalancerSpec_To_v1beta1_VPCLoadBalancerSpec(a.(*v1beta2.VPCLoadBalancerSpec), b.(*VPCLoadBalancerSpec), scope) + }); err != nil { + return err + } return nil } @@ -569,13 +569,13 @@ func Convert_v1beta1_IBMPowerVSClusterStatus_To_v1beta2_IBMPowerVSClusterStatus( func autoConvert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *v1beta2.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s conversion.Scope) error { out.Ready = in.Ready - // WARNING: in.ServiceInstanceID requires manual conversion: does not exist in peer-type - // WARNING: in.NetworkID requires manual conversion: does not exist in peer-type - // WARNING: in.DHCPServerID requires manual conversion: does not exist in peer-type - // WARNING: in.VPCID requires manual conversion: does not exist in peer-type - // WARNING: in.VPCSubnetID requires manual conversion: does not exist in peer-type - // WARNING: in.TransitGatewayID requires manual conversion: does not exist in peer-type - // WARNING: in.COSBucketID requires manual conversion: does not exist in peer-type + // WARNING: in.ServiceInstance requires manual conversion: does not exist in peer-type + // WARNING: in.Network requires manual conversion: does not exist in peer-type + // WARNING: in.DHCPServer requires manual conversion: does not exist in peer-type + // WARNING: in.VPC requires manual conversion: does not exist in peer-type + // WARNING: in.VPCSubnet requires manual conversion: does not exist in peer-type + // WARNING: in.TransitGateway requires manual conversion: does not exist in peer-type + // WARNING: in.COSBucket requires manual conversion: does not exist in peer-type // WARNING: in.LoadBalancers requires manual conversion: does not exist in peer-type // WARNING: in.Conditions requires manual conversion: does not exist in peer-type return nil diff --git a/api/v1beta2/ibmpowervscluster_types.go b/api/v1beta2/ibmpowervscluster_types.go index 70cfa1caf..15700c10c 100644 --- a/api/v1beta2/ibmpowervscluster_types.go +++ b/api/v1beta2/ibmpowervscluster_types.go @@ -89,32 +89,41 @@ type IBMPowerVSClusterSpec struct { CosBucket *CosBucket `json:"cosBucket,omitempty"` } +// ResourceReference identifies a resource with id. +type ResourceReference struct { + // id represents the id of the resource. + ID *string `json:"id,omitempty"` + // +kubebuilder:default=false + // controllerCreated indicates whether the resource is created by the controller. + ControllerCreated *bool `json:"controllerCreated,omitempty"` +} + // IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster. type IBMPowerVSClusterStatus struct { // ready is true when the provider resource is ready. // +kubebuilder:default=false Ready bool `json:"ready"` - // serviceInstanceID is the reference to the Power VS service on which the server instance(VM) will be created. - ServiceInstanceID *string `json:"serviceInstanceID,omitempty"` + // serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. + ServiceInstance *ResourceReference `json:"serviceInstance,omitempty"` // networkID is the reference to the Power VS network to use for this cluster. - NetworkID *string `json:"networkID,omitempty"` + Network *ResourceReference `json:"network,omitempty"` - // dhcpServerID is the reference to the Power VS DHCP server. - DHCPServerID *string `json:"dhcpServerID,omitempty"` + // dhcpServer is the reference to the Power VS DHCP server. + DHCPServer *ResourceReference `json:"dhcpServer,omitempty"` - // vpcID is reference to IBM Cloud VPC resources. - VPCID *string `json:"vpcID,omitempty"` + // vpc is reference to IBM Cloud VPC resources. + VPC *ResourceReference `json:"vpc,omitempty"` - // vpcSubnetID is reference to IBM Cloud VPC subnet. - VPCSubnetID *string `json:"vpcSubnetID,omitempty"` + // vpcSubnet is reference to IBM Cloud VPC subnet. + VPCSubnet *ResourceReference `json:"vpcSubnet,omitempty"` - // transitGatewayID is reference to IBM Cloud TransitGateway. - TransitGatewayID *string `json:"transitGatewayID,omitempty"` + // transitGateway is reference to IBM Cloud TransitGateway. + TransitGateway *ResourceReference `json:"transitGateway,omitempty"` - // cosBucketID is reference to IBM Cloud COS Bucket resource. - COSBucketID *string `json:"cosBucketID,omitempty"` + // cosBucket is reference to IBM Cloud COS Bucket resource. + COSBucket *ResourceReference `json:"cosBucket,omitempty"` // loadBalancers reference to IBM Cloud VPC Loadbalancer. LoadBalancers []VPCLoadBalancerStatus `json:"loadBalancers,omitempty"` diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 822f2d1f7..22cedd26b 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -169,40 +169,40 @@ func (in *IBMPowerVSClusterSpec) DeepCopy() *IBMPowerVSClusterSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IBMPowerVSClusterStatus) DeepCopyInto(out *IBMPowerVSClusterStatus) { *out = *in - if in.ServiceInstanceID != nil { - in, out := &in.ServiceInstanceID, &out.ServiceInstanceID - *out = new(string) - **out = **in + if in.ServiceInstance != nil { + in, out := &in.ServiceInstance, &out.ServiceInstance + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.NetworkID != nil { - in, out := &in.NetworkID, &out.NetworkID - *out = new(string) - **out = **in + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.DHCPServerID != nil { - in, out := &in.DHCPServerID, &out.DHCPServerID - *out = new(string) - **out = **in + if in.DHCPServer != nil { + in, out := &in.DHCPServer, &out.DHCPServer + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.VPCID != nil { - in, out := &in.VPCID, &out.VPCID - *out = new(string) - **out = **in + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.VPCSubnetID != nil { - in, out := &in.VPCSubnetID, &out.VPCSubnetID - *out = new(string) - **out = **in + if in.VPCSubnet != nil { + in, out := &in.VPCSubnet, &out.VPCSubnet + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.TransitGatewayID != nil { - in, out := &in.TransitGatewayID, &out.TransitGatewayID - *out = new(string) - **out = **in + if in.TransitGateway != nil { + in, out := &in.TransitGateway, &out.TransitGateway + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } - if in.COSBucketID != nil { - in, out := &in.COSBucketID, &out.COSBucketID - *out = new(string) - **out = **in + if in.COSBucket != nil { + in, out := &in.COSBucket, &out.COSBucket + *out = new(ResourceReference) + (*in).DeepCopyInto(*out) } if in.LoadBalancers != nil { in, out := &in.LoadBalancers, &out.LoadBalancers @@ -1160,6 +1160,31 @@ func (in *NetworkInterface) DeepCopy() *NetworkInterface { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceReference) DeepCopyInto(out *ResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ControllerCreated != nil { + in, out := &in.ControllerCreated, &out.ControllerCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. +func (in *ResourceReference) DeepCopy() *ResourceReference { + if in == nil { + return nil + } + out := new(ResourceReference) + 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 diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml index 64cb04a70..6fd85a48e 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmpowervsclusters.yaml @@ -363,12 +363,30 @@ spec: - type type: object type: array - cosBucketID: - description: cosBucketID is reference to IBM Cloud COS Bucket resource. - type: string - dhcpServerID: - description: dhcpServerID is the reference to the Power VS DHCP server. - type: string + cosBucket: + description: cosBucket is reference to IBM Cloud COS Bucket resource. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object + dhcpServer: + description: dhcpServer is the reference to the Power VS DHCP server. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object loadBalancers: description: loadBalancers reference to IBM Cloud VPC Loadbalancer. items: @@ -384,27 +402,72 @@ spec: type: string type: object type: array - networkID: + network: description: networkID is the reference to the Power VS network to use for this cluster. - type: string + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object ready: default: false description: ready is true when the provider resource is ready. type: boolean - serviceInstanceID: - description: serviceInstanceID is the reference to the Power VS service + serviceInstance: + description: serviceInstance is the reference to the Power VS service on which the server instance(VM) will be created. - type: string - transitGatewayID: - description: transitGatewayID is reference to IBM Cloud TransitGateway. - type: string - vpcID: - description: vpcID is reference to IBM Cloud VPC resources. - type: string - vpcSubnetID: - description: vpcSubnetID is reference to IBM Cloud VPC subnet. - type: string + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object + transitGateway: + description: transitGateway is reference to IBM Cloud TransitGateway. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object + vpc: + description: vpc is reference to IBM Cloud VPC resources. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object + vpcSubnet: + description: vpcSubnet is reference to IBM Cloud VPC subnet. + properties: + controllerCreated: + default: false + description: controllerCreated indicates whether the resource + is created by the controller. + type: boolean + id: + description: id represents the id of the resource. + type: string + type: object required: - ready type: object