Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support service instance id in ibmpowervsmachine reconcilation #1652

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Support service instance id
  • Loading branch information
Karthik-K-N committed Mar 8, 2024
commit 48fa610f76d6087dcd037176a6d44285be3f9bb6
4 changes: 4 additions & 0 deletions api/v1beta2/ibmpowervscluster_webhook.go
Original file line number Diff line number Diff line change
@@ -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")
}
2 changes: 2 additions & 0 deletions cloud/scope/powervs_machine.go
Original file line number Diff line number Diff line change
@@ -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 {