Skip to content

Commit

Permalink
Remove COS instance spec check in webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
Amulyam24 committed Mar 26, 2024
1 parent 79af100 commit 030de62
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions api/v1beta2/ibmpowervscluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,5 @@ func (r *IBMPowerVSCluster) validateIBMPowerVSClusterCreateInfraPrereq() *field.
return field.Invalid(field.NewPath("spec.resourceGroup"), r.Spec.ResourceGroup, "value of resource group is empty")
}

// TODO(Phase 1): If ignition is set and these resources are not set, auto create them.
// If ignition is set, make sure to check that CosInstanceName, BucketName and region is set
if r.Spec.CosInstance == nil {
return field.Invalid(field.NewPath("spec.cosInstance"), r.Spec.CosInstance, "ignition is set but value of cosInstance is empty")
}
if r.Spec.CosInstance.Name == "" {
return field.Invalid(field.NewPath("spec.cosInstance.name"), r.Spec.CosInstance, "ignition is set but value of cosInstance name is empty")
}
if r.Spec.CosInstance.BucketName == "" {
return field.Invalid(field.NewPath("spec.cosInstance.bucketName"), r.Spec.CosInstance, "ignition is set but value of bucketName is empty")
}
if r.Spec.CosInstance.BucketRegion == "" {
return field.Invalid(field.NewPath("spec.cosInstance.bucketRegion"), r.Spec.CosInstance, "ignition is set but value of bucketRegion is empty")
}
return nil
}

0 comments on commit 030de62

Please sign in to comment.