mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
26 lines
427 B
Go
26 lines
427 B
Go
package experimental
|
|
|
|
import (
|
|
"os"
|
|
"strconv"
|
|
)
|
|
|
|
const (
|
|
ExperimentalEnv = "KYVERNO_EXPERIMENTAL"
|
|
KubectlValidateEnv = "KYVERNO_KUBECTL_VALIDATE" //nolint:gosec
|
|
)
|
|
|
|
func getBool(env string) bool {
|
|
if b, err := strconv.ParseBool(os.Getenv(env)); err == nil {
|
|
return b
|
|
}
|
|
return false
|
|
}
|
|
|
|
func IsEnabled() bool {
|
|
return getBool(ExperimentalEnv)
|
|
}
|
|
|
|
func UseKubectlValidate() bool {
|
|
return getBool(KubectlValidateEnv)
|
|
}
|