Merge pull request #544 from RaunakShah/remote_todo
Remove redundant validation checks
This commit is contained in:
@@ -96,9 +96,7 @@ func (ctrl *csiSnapshotCommonController) syncContent(content *crdv1.VolumeSnapsh
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(xiangqian): Putting this check in controller as webhook has not been implemented
|
// Keep this check in the controller since the validation webhook may not have been deployed.
|
||||||
// yet. Remove the source checking once issue #187 is resolved:
|
|
||||||
// https://github.com/kubernetes-csi/external-snapshotter/issues/187
|
|
||||||
if (content.Spec.Source.VolumeHandle == nil && content.Spec.Source.SnapshotHandle == nil) ||
|
if (content.Spec.Source.VolumeHandle == nil && content.Spec.Source.SnapshotHandle == nil) ||
|
||||||
(content.Spec.Source.VolumeHandle != nil && content.Spec.Source.SnapshotHandle != nil) {
|
(content.Spec.Source.VolumeHandle != nil && content.Spec.Source.SnapshotHandle != nil) {
|
||||||
err := fmt.Errorf("Exactly one of VolumeHandle and SnapshotHandle should be specified")
|
err := fmt.Errorf("Exactly one of VolumeHandle and SnapshotHandle should be specified")
|
||||||
@@ -207,9 +205,7 @@ func (ctrl *csiSnapshotCommonController) syncSnapshot(snapshot *crdv1.VolumeSnap
|
|||||||
return ctrl.processSnapshotWithDeletionTimestamp(snapshot)
|
return ctrl.processSnapshotWithDeletionTimestamp(snapshot)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(xiangqian@): Putting this check in controller as webhook has not been implemented
|
// Keep this check in the controller since the validation webhook may not have been deployed.
|
||||||
// yet. Remove the source checking once issue #187 is resolved:
|
|
||||||
// https://github.com/kubernetes-csi/external-snapshotter/issues/187
|
|
||||||
klog.V(5).Infof("syncSnapshot[%s]: validate snapshot to make sure source has been correctly specified", utils.SnapshotKey(snapshot))
|
klog.V(5).Infof("syncSnapshot[%s]: validate snapshot to make sure source has been correctly specified", utils.SnapshotKey(snapshot))
|
||||||
if (snapshot.Spec.Source.PersistentVolumeClaimName == nil && snapshot.Spec.Source.VolumeSnapshotContentName == nil) ||
|
if (snapshot.Spec.Source.PersistentVolumeClaimName == nil && snapshot.Spec.Source.VolumeSnapshotContentName == nil) ||
|
||||||
(snapshot.Spec.Source.PersistentVolumeClaimName != nil && snapshot.Spec.Source.VolumeSnapshotContentName != nil) {
|
(snapshot.Spec.Source.PersistentVolumeClaimName != nil && snapshot.Spec.Source.VolumeSnapshotContentName != nil) {
|
||||||
|
Reference in New Issue
Block a user