Skip to content

Commit

Permalink
rename APIEndpoint to VPCEndpoint (#471)
Browse files Browse the repository at this point in the history
Signed-off-by: Prajyot-Parab <[email protected]>
  • Loading branch information
Prajyot-Parab authored Dec 9, 2021
1 parent 1cb0de4 commit f6cd04c
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 83 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha3/ibmvpccluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
52 changes: 26 additions & 26 deletions api/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/v1alpha4/ibmvpccluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha4/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
52 changes: 26 additions & 26 deletions api/v1alpha4/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cloud/scope/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion controllers/ibmvpccluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/ibmvpcmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down

0 comments on commit f6cd04c

Please sign in to comment.