@@ -26,7 +26,7 @@ const (
26
26
minAsyncSnapshotVersion = "0.29.0-alpha.1"
27
27
)
28
28
29
- func Snapshot (ctx context.Context , args []string , globalFlags * flags.GlobalFlags , snapshotOpts * snapshot.Options , podOptions * pod.Options , log log.Logger , async bool ) error {
29
+ func Snapshot (ctx context.Context , args []string , globalFlags * flags.GlobalFlags , snapshotOpts * snapshot.Options , podOptions * pod.Options , log log.Logger , async , includeVolumes bool ) error {
30
30
// init kube client and vCluster
31
31
vCluster , kubeClient , restConfig , err := initSnapshotCommand (ctx , args , globalFlags , snapshotOpts , log )
32
32
if err != nil {
@@ -57,7 +57,7 @@ func Snapshot(ctx context.Context, args []string, globalFlags *flags.GlobalFlags
57
57
}
58
58
59
59
// creating snapshot request with 'vcluster snapshot create' command
60
- err = createSnapshotRequest (ctx , vCluster , kubeClient , snapshotOpts , log )
60
+ err = createSnapshotRequest (ctx , vCluster , kubeClient , snapshotOpts , log , includeVolumes )
61
61
if err != nil {
62
62
return err
63
63
}
@@ -129,7 +129,7 @@ func initSnapshotCommand(
129
129
return vCluster , kubeClient , restClient , nil
130
130
}
131
131
132
- func createSnapshotRequest (ctx context.Context , vCluster * find.VCluster , kubeClient * kubernetes.Clientset , snapshotOpts * snapshot.Options , log log.Logger ) error {
132
+ func createSnapshotRequest (ctx context.Context , vCluster * find.VCluster , kubeClient * kubernetes.Clientset , snapshotOpts * snapshot.Options , log log.Logger , includeVolumes bool ) error {
133
133
vClusterConfig , err := getVClusterConfig (ctx , vCluster , kubeClient , snapshotOpts )
134
134
if err != nil {
135
135
return err
@@ -156,6 +156,9 @@ func createSnapshotRequest(ctx context.Context, vCluster *find.VCluster, kubeCli
156
156
// then create the snapshot request that will be reconciled by the controller
157
157
snapshotRequest := & snapshot.Request {
158
158
Name : secret .Name ,
159
+ Spec : snapshot.RequestSpec {
160
+ IncludeVolumes : includeVolumes ,
161
+ },
159
162
}
160
163
configMap , err := snapshot .CreateSnapshotRequestConfigMap (vCluster .Namespace , vCluster .Name , snapshotRequest )
161
164
if err != nil {
0 commit comments