Add feature flag

This commit is contained in:
Raunak Pradip Shah
2022-04-19 15:58:09 +05:30
parent bb13123906
commit 24bbdae16f
2 changed files with 12 additions and 6 deletions

View File

@@ -39,10 +39,11 @@ import (
)
var (
certFile string
keyFile string
kubeconfigFile string
port int
certFile string
keyFile string
kubeconfigFile string
port int
preventVolumeModeConversion bool
)
// CmdWebhook is used by Cobra.
@@ -67,6 +68,8 @@ func init() {
CmdWebhook.MarkFlagRequired("tls-private-key-file")
// Add optional flag for kubeconfig
CmdWebhook.Flags().StringVar(&kubeconfigFile, "kubeconfig", "", "kubeconfig file to use for volumesnapshotclasses")
CmdWebhook.Flags().BoolVar(&preventVolumeModeConversion, "prevent-volume-mode-conversion",
false, "Prevents an unauthorised user from modifying the volume mode when creating a PVC from an existing VolumeSnapshot.")
}
// admitv1beta1Func handles a v1beta1 admission