Skip to content

Commit

Permalink
Merge pull request #65 from xing-yang/content_name
Browse files Browse the repository at this point in the history
Use existing content name
  • Loading branch information
k8s-ci-robot authored Nov 19, 2018
2 parents 799fb95 + fddc554 commit 30701bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ func storeObjectUpdate(store cache.Store, obj interface{}, className string) (bo
// GetSnapshotContentNameForSnapshot returns SnapshotContent.Name for the create VolumeSnapshotContent.
// The name must be unique.
func GetSnapshotContentNameForSnapshot(snapshot *crdv1.VolumeSnapshot) string {
// If VolumeSnapshot object has SnapshotContentName, use it directly.
// This might be the case for static provisioning.
if len(snapshot.Spec.SnapshotContentName) > 0 {
return snapshot.Spec.SnapshotContentName
}
// Construct SnapshotContentName for dynamic provisioning.
return "snapcontent-" + string(snapshot.UID)
}

Expand Down

0 comments on commit 30701bb

Please sign in to comment.