MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / GetVolumeSnapshot

Function GetVolumeSnapshot

tests/utils/backups/backup.go:72–87  ·  view source on GitHub ↗

GetVolumeSnapshot gets a VolumeSnapshot given name and namespace

(
	ctx context.Context,
	crudClient client.Client,
	namespace, name string,
)

Source from the content-addressed store, hash-verified

70
71// GetVolumeSnapshot gets a VolumeSnapshot given name and namespace
72func GetVolumeSnapshot(
73 ctx context.Context,
74 crudClient client.Client,
75 namespace, name string,
76) (*volumesnapshotv1.VolumeSnapshot, error) {
77 namespacedName := types.NamespacedName{
78 Namespace: namespace,
79 Name: name,
80 }
81 volumeSnapshot := &volumesnapshotv1.VolumeSnapshot{}
82 err := objects.Get(ctx, crudClient, namespacedName, volumeSnapshot)
83 if err != nil {
84 return nil, err
85 }
86 return volumeSnapshot, nil
87}
88
89// CreateOnDemandBackupViaKubectlPlugin uses the kubectl plugin to create a backup
90func CreateOnDemandBackupViaKubectlPlugin(

Callers 2

Calls 1

GetFunction · 0.92

Tested by

no test coverage detected