GetVolumeSnapshot gets a VolumeSnapshot given name and namespace
( ctx context.Context, crudClient client.Client, namespace, name string, )
| 70 | |
| 71 | // GetVolumeSnapshot gets a VolumeSnapshot given name and namespace |
| 72 | func 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 |
| 90 | func CreateOnDemandBackupViaKubectlPlugin( |
no test coverage detected