diff --git a/api/v1alpha3/ibmvpccluster_types.go b/api/v1alpha3/ibmvpccluster_types.go index 5d4ac997b..9b6e15c10 100644 --- a/api/v1alpha3/ibmvpccluster_types.go +++ b/api/v1alpha3/ibmvpccluster_types.go @@ -60,7 +60,7 @@ type IBMVPCClusterStatus struct { // Bastion Instance `json:"bastion,omitempty"` Ready bool `json:"ready"` Subnet Subnet `json:"subnet,omitempty"` - APIEndpoint APIEndpoint `json:"apiEndpoint,omitempty"` + VPCEndpoint VPCEndpoint `json:"vpcEndpoint,omitempty"` } // VPC holds the VPC information diff --git a/api/v1alpha3/types.go b/api/v1alpha3/types.go index b5927a9c7..4a555acb1 100644 --- a/api/v1alpha3/types.go +++ b/api/v1alpha3/types.go @@ -30,8 +30,8 @@ type Subnet struct { Zone *string `json:"zone"` } -// APIEndpoint describes a APIEndpoint -type APIEndpoint struct { +// VPCEndpoint describes a VPCEndpoint +type VPCEndpoint struct { Address *string `json:"address"` FIPID *string `json:"floatingIPID"` } diff --git a/api/v1alpha3/zz_generated.deepcopy.go b/api/v1alpha3/zz_generated.deepcopy.go index 0165e7265..d4e2657c7 100644 --- a/api/v1alpha3/zz_generated.deepcopy.go +++ b/api/v1alpha3/zz_generated.deepcopy.go @@ -25,31 +25,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in - if in.Address != nil { - in, out := &in.Address, &out.Address - *out = new(string) - **out = **in - } - if in.FIPID != nil { - in, out := &in.FIPID, &out.FIPID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IBMVPCCluster) DeepCopyInto(out *IBMVPCCluster) { *out = *in @@ -130,7 +105,7 @@ func (in *IBMVPCClusterStatus) DeepCopyInto(out *IBMVPCClusterStatus) { *out = *in out.VPC = in.VPC in.Subnet.DeepCopyInto(&out.Subnet) - in.APIEndpoint.DeepCopyInto(&out.APIEndpoint) + in.VPCEndpoint.DeepCopyInto(&out.VPCEndpoint) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterStatus. @@ -408,3 +383,28 @@ func (in *VPC) DeepCopy() *VPC { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCEndpoint) DeepCopyInto(out *VPCEndpoint) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.FIPID != nil { + in, out := &in.FIPID, &out.FIPID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCEndpoint. +func (in *VPCEndpoint) DeepCopy() *VPCEndpoint { + if in == nil { + return nil + } + out := new(VPCEndpoint) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1alpha4/ibmvpccluster_types.go b/api/v1alpha4/ibmvpccluster_types.go index d9fafa939..8c717c90d 100644 --- a/api/v1alpha4/ibmvpccluster_types.go +++ b/api/v1alpha4/ibmvpccluster_types.go @@ -60,7 +60,7 @@ type IBMVPCClusterStatus struct { // Bastion Instance `json:"bastion,omitempty"` Ready bool `json:"ready"` Subnet Subnet `json:"subnet,omitempty"` - APIEndpoint APIEndpoint `json:"apiEndpoint,omitempty"` + VPCEndpoint VPCEndpoint `json:"vpcEndpoint,omitempty"` } // VPC holds the VPC information diff --git a/api/v1alpha4/types.go b/api/v1alpha4/types.go index eec96d624..759742c14 100644 --- a/api/v1alpha4/types.go +++ b/api/v1alpha4/types.go @@ -30,8 +30,8 @@ type Subnet struct { Zone *string `json:"zone"` } -// APIEndpoint describes a APIEndpoint -type APIEndpoint struct { +// VPCEndpoint describes a VPCEndpoint +type VPCEndpoint struct { Address *string `json:"address"` FIPID *string `json:"floatingIPID"` } diff --git a/api/v1alpha4/zz_generated.deepcopy.go b/api/v1alpha4/zz_generated.deepcopy.go index b36602e8d..689e2db1a 100644 --- a/api/v1alpha4/zz_generated.deepcopy.go +++ b/api/v1alpha4/zz_generated.deepcopy.go @@ -25,31 +25,6 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in - if in.Address != nil { - in, out := &in.Address, &out.Address - *out = new(string) - **out = **in - } - if in.FIPID != nil { - in, out := &in.FIPID, &out.FIPID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IBMPowerVSCluster) DeepCopyInto(out *IBMPowerVSCluster) { *out = *in @@ -453,7 +428,7 @@ func (in *IBMVPCClusterStatus) DeepCopyInto(out *IBMVPCClusterStatus) { *out = *in out.VPC = in.VPC in.Subnet.DeepCopyInto(&out.Subnet) - in.APIEndpoint.DeepCopyInto(&out.APIEndpoint) + in.VPCEndpoint.DeepCopyInto(&out.VPCEndpoint) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IBMVPCClusterStatus. @@ -731,3 +706,28 @@ func (in *VPC) DeepCopy() *VPC { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCEndpoint) DeepCopyInto(out *VPCEndpoint) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.FIPID != nil { + in, out := &in.FIPID, &out.FIPID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCEndpoint. +func (in *VPCEndpoint) DeepCopy() *VPCEndpoint { + if in == nil { + return nil + } + out := new(VPCEndpoint) + in.DeepCopyInto(out) + return out +} diff --git a/cloud/scope/cluster.go b/cloud/scope/cluster.go index 0d6314e55..7be75a9f3 100644 --- a/cloud/scope/cluster.go +++ b/cloud/scope/cluster.go @@ -188,7 +188,7 @@ func (s *ClusterScope) ensureFIPUnique(fipName string) (*vpcv1.FloatingIP, error // DeleteFloatingIP deletes a Floating IP associated with floating ip id func (s *ClusterScope) DeleteFloatingIP() error { - fipID := *s.IBMVPCCluster.Status.APIEndpoint.FIPID + fipID := *s.IBMVPCCluster.Status.VPCEndpoint.FIPID if fipID != "" { deleteFIPOption := &vpcv1.DeleteFloatingIPOptions{} deleteFIPOption.SetID(fipID) diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml index 949855bd4..cfb606331 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ibmvpcclusters.yaml @@ -82,17 +82,6 @@ spec: status: description: IBMVPCClusterStatus defines the observed state of IBMVPCCluster properties: - apiEndpoint: - description: APIEndpoint describes a APIEndpoint - properties: - address: - type: string - floatingIPID: - type: string - required: - - address - - floatingIPID - type: object ready: description: Bastion Instance `json:"bastion,omitempty"` type: boolean @@ -126,6 +115,17 @@ spec: - id - name type: object + vpcEndpoint: + description: VPCEndpoint describes a VPCEndpoint + properties: + address: + type: string + floatingIPID: + type: string + required: + - address + - floatingIPID + type: object required: - ready type: object @@ -198,17 +198,6 @@ spec: status: description: IBMVPCClusterStatus defines the observed state of IBMVPCCluster properties: - apiEndpoint: - description: APIEndpoint describes a APIEndpoint - properties: - address: - type: string - floatingIPID: - type: string - required: - - address - - floatingIPID - type: object ready: description: Bastion Instance `json:"bastion,omitempty"` type: boolean @@ -242,6 +231,17 @@ spec: - id - name type: object + vpcEndpoint: + description: VPCEndpoint describes a VPCEndpoint + properties: + address: + type: string + floatingIPID: + type: string + required: + - address + - floatingIPID + type: object required: - ready type: object diff --git a/controllers/ibmvpccluster_controller.go b/controllers/ibmvpccluster_controller.go index de2399bd0..2e81b6dd7 100644 --- a/controllers/ibmvpccluster_controller.go +++ b/controllers/ibmvpccluster_controller.go @@ -140,7 +140,7 @@ func (r *IBMVPCClusterReconciler) reconcile(ctx context.Context, clusterScope *s Port: 6443, } - clusterScope.IBMVPCCluster.Status.APIEndpoint = infrastructurev1alpha4.APIEndpoint{ + clusterScope.IBMVPCCluster.Status.VPCEndpoint = infrastructurev1alpha4.VPCEndpoint{ Address: fip.Address, FIPID: fip.ID, } diff --git a/controllers/ibmvpcmachine_controller.go b/controllers/ibmvpcmachine_controller.go index a26ec868e..993a17732 100644 --- a/controllers/ibmvpcmachine_controller.go +++ b/controllers/ibmvpcmachine_controller.go @@ -173,7 +173,7 @@ func (r *IBMVPCMachineReconciler) reconcileNormal(ctx context.Context, machineSc machineScope.IBMVPCMachine.Spec.ProviderID = pointer.StringPtr(fmt.Sprintf("ibmvpc://%s/%s", machineScope.Machine.Spec.ClusterName, machineScope.IBMVPCMachine.Name)) if ok { options := &vpcv1.AddInstanceNetworkInterfaceFloatingIPOptions{} - options.SetID(*machineScope.IBMVPCCluster.Status.APIEndpoint.FIPID) + options.SetID(*machineScope.IBMVPCCluster.Status.VPCEndpoint.FIPID) options.SetInstanceID(*instance.ID) options.SetNetworkInterfaceID(*instance.PrimaryNetworkInterface.ID) floatingIP, _, err :=