1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/cmd/cli/kubectl-kyverno/experimental/experimental.go

27 lines
458 B
Go
Raw Normal View History

package experimental
import (
"os"
"strconv"
)
const (
ExperimentalEnv = "KYVERNO_EXPERIMENTAL"
KubectlValidateEnv = "KYVERNO_KUBECTL_VALIDATE" //nolint:gosec
)
func getBool(env string, fallback bool) bool {
if b, err := strconv.ParseBool(os.Getenv(env)); err == nil {
return b
}
return fallback
}
func IsEnabled() bool {
return getBool(ExperimentalEnv, false)
}
func UseKubectlValidate() bool {
return getBool(KubectlValidateEnv, true)
}