Skip to content

Commit 30701bb

Browse files
authored
Merge pull request #65 from xing-yang/content_name
Use existing content name
2 parents 799fb95 + fddc554 commit 30701bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/controller/util.go

+6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ func storeObjectUpdate(store cache.Store, obj interface{}, className string) (bo
106106
// GetSnapshotContentNameForSnapshot returns SnapshotContent.Name for the create VolumeSnapshotContent.
107107
// The name must be unique.
108108
func GetSnapshotContentNameForSnapshot(snapshot *crdv1.VolumeSnapshot) string {
109+
// If VolumeSnapshot object has SnapshotContentName, use it directly.
110+
// This might be the case for static provisioning.
111+
if len(snapshot.Spec.SnapshotContentName) > 0 {
112+
return snapshot.Spec.SnapshotContentName
113+
}
114+
// Construct SnapshotContentName for dynamic provisioning.
109115
return "snapcontent-" + string(snapshot.UID)
110116
}
111117

0 commit comments

Comments
 (0)