Address review comments
This commit is contained in:
@@ -290,7 +290,7 @@ func (ctrl *csiSnapshotCommonController) checkandAddSnapshotFinalizers(snapshot
|
|||||||
// If there is any problem with the binding (e.g., snapshot points to a non-existent snapshot content), update the snapshot status and emit event.
|
// If there is any problem with the binding (e.g., snapshot points to a non-existent snapshot content), update the snapshot status and emit event.
|
||||||
func (ctrl *csiSnapshotCommonController) syncReadySnapshot(snapshot *crdv1.VolumeSnapshot) error {
|
func (ctrl *csiSnapshotCommonController) syncReadySnapshot(snapshot *crdv1.VolumeSnapshot) error {
|
||||||
if !utils.IsBoundVolumeSnapshotContentNameSet(snapshot) {
|
if !utils.IsBoundVolumeSnapshotContentNameSet(snapshot) {
|
||||||
return nil
|
return fmt.Errorf("snapshot %s is not bound to a content.", utils.SnapshotKey(snapshot))
|
||||||
}
|
}
|
||||||
obj, found, err := ctrl.contentStore.GetByKey(*snapshot.Status.BoundVolumeSnapshotContentName)
|
obj, found, err := ctrl.contentStore.GetByKey(*snapshot.Status.BoundVolumeSnapshotContentName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -337,7 +337,7 @@ func NeedToAddSnapshotAsSourceFinalizer(snapshot *crdv1.VolumeSnapshot) bool {
|
|||||||
|
|
||||||
// NeedToAddSnapshotBoundFinalizer checks if a Finalizer needs to be added for the bound volume snapshot.
|
// NeedToAddSnapshotBoundFinalizer checks if a Finalizer needs to be added for the bound volume snapshot.
|
||||||
func NeedToAddSnapshotBoundFinalizer(snapshot *crdv1.VolumeSnapshot) bool {
|
func NeedToAddSnapshotBoundFinalizer(snapshot *crdv1.VolumeSnapshot) bool {
|
||||||
return snapshot.ObjectMeta.DeletionTimestamp == nil && !slice.ContainsString(snapshot.ObjectMeta.Finalizers, VolumeSnapshotBoundFinalizer, nil) && snapshot.Status != nil && snapshot.Status.BoundVolumeSnapshotContentName != nil
|
return snapshot.ObjectMeta.DeletionTimestamp == nil && !slice.ContainsString(snapshot.ObjectMeta.Finalizers, VolumeSnapshotBoundFinalizer, nil) && IsBoundVolumeSnapshotContentNameSet(snapshot)
|
||||||
}
|
}
|
||||||
|
|
||||||
func deprecationWarning(deprecatedParam, newParam, removalVersion string) string {
|
func deprecationWarning(deprecatedParam, newParam, removalVersion string) string {
|
||||||
|
Reference in New Issue
Block a user