Skip to content

Commit

Permalink
Setting MutuallyExclusive and OneRequired flag options for --fromSnap…
Browse files Browse the repository at this point in the history
…shot and --fromPVC
  • Loading branch information
shlokc9 committed Sep 5, 2024
1 parent 85bde93 commit 37926c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/rootCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ func init() {
rootCmd.AddCommand(restoreFileCmd)
restoreFileCmd.Flags().StringVarP(&fromSnapshot, "fromSnapshot", "f", "", "The name of a VolumeSnapshot.")
restoreFileCmd.Flags().StringVarP(&fromPVC, "fromPVC", "v", "", "The name of a PersistentVolumeClaim.")
restoreFileCmd.MarkFlagsMutuallyExclusive("fromSnapshot", "fromPVC")
restoreFileCmd.MarkFlagsOneRequired("fromSnapshot", "fromPVC")
restoreFileCmd.Flags().StringVarP(&toPVC, "toPVC", "t", "", "The name of a PersistentVolumeClaim.")
restoreFileCmd.Flags().StringVarP(&namespace, "namespace", "n", fio.DefaultNS, "The namespace of both the given PVC & VS.")
restoreFileCmd.Flags().Int64VarP(&csiCheckRunAsUser, "runAsUser", "u", 0, "Runs the inspector pod as a user (int)")
Expand Down

0 comments on commit 37926c4

Please sign in to comment.