Skip to content

Commit c99975f

Browse files
committed
removes the validation between storage polciy and datastore as having both is an option
1 parent 5256ee3 commit c99975f

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

internal/webhooks/vspherefailuredomain.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ func (webhook *VSphereFailureDomainWebhook) ValidateCreate(_ context.Context, ra
6161
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "Topology", "ComputeCluster"), "cannot be empty if Hosts is not empty"))
6262
}
6363

64-
// We should either pass a datastore or a storage policy, not both at the same time
65-
if obj.Spec.Topology.Datastore != "" && obj.Spec.Topology.StoragePolicy != "" {
66-
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "Topology", "Datastore"), "should be empty if StoragePolicy is not empty"))
67-
}
68-
6964
if obj.Spec.Region.Type == infrav1.HostGroupFailureDomain {
7065
allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "Region", "Type"), fmt.Sprintf("region's Failure Domain type cannot be %s", obj.Spec.Region.Type)))
7166
}
@@ -98,10 +93,6 @@ func (webhook *VSphereFailureDomainWebhook) ValidateUpdate(_ context.Context, ol
9893
if !reflect.DeepEqual(newTyped.Spec, oldTyped.Spec) {
9994
return nil, field.Forbidden(field.NewPath("spec"), "VSphereFailureDomainSpec is immutable")
10095
}
101-
// We should either pass a datastore or a storage policy, not both at the same time
102-
if newTyped.Spec.Topology.Datastore != "" && newTyped.Spec.Topology.StoragePolicy != "" {
103-
return nil, field.Forbidden(field.NewPath("spec", "Topology", "Datastore"), "should be empty if StoragePolicy is not empty")
104-
}
10596
return nil, nil
10697
}
10798

0 commit comments

Comments
 (0)