Skip to content

Commit

Permalink
Support service instance id
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-K-N committed Mar 8, 2024
1 parent 21b92d6 commit 48fa610
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/v1beta2/ibmpowervscluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func (r *IBMPowerVSCluster) validateIBMPowerVSClusterCreateInfraPrereq() *field.
return field.Invalid(field.NewPath("spec.zone"), r.Spec.Zone, "value of zone is empty")
}

if r.Spec.VPC == nil {
return field.Invalid(field.NewPath("spec.vpc"), r.Spec.VPC, "value of VPC is empty")
}

if r.Spec.VPC.Region == nil {
return field.Invalid(field.NewPath("spec.vpc.region"), r.Spec.VPC.Region, "value of VPC region is empty")
}
Expand Down
2 changes: 2 additions & 0 deletions cloud/scope/powervs_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ func NewPowerVSMachineScope(params PowerVSMachineScopeParams) (scope *PowerVSMac
var serviceInstanceID, serviceInstanceName string
if params.IBMPowerVSMachine.Spec.ServiceInstanceID != "" {
serviceInstanceID = params.IBMPowerVSMachine.Spec.ServiceInstanceID
} else if params.IBMPowerVSMachine.Spec.ServiceInstance != nil && params.IBMPowerVSMachine.Spec.ServiceInstance.ID != nil {
serviceInstanceID = *params.IBMPowerVSMachine.Spec.ServiceInstance.ID
} else {
serviceInstanceName = fmt.Sprintf("%s-%s", params.IBMPowerVSCluster.GetName(), "serviceInstance")
if params.IBMPowerVSCluster.Spec.ServiceInstance != nil && params.IBMPowerVSCluster.Spec.ServiceInstance.Name != nil {
Expand Down

0 comments on commit 48fa610

Please sign in to comment.