mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 18:38:40 +00:00
feat: enable kubectl-validate by default in cli (#9220)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
8858d4fd48
commit
438a53cb3d
2 changed files with 6 additions and 6 deletions
4
.github/workflows/cli.yaml
vendored
4
.github/workflows/cli.yaml
vendored
|
@ -42,7 +42,7 @@ jobs:
|
|||
fi
|
||||
- name: Test CLI
|
||||
run: |
|
||||
VERSION=${{ github.ref_name }} make test-cli
|
||||
KYVERNO_KUBECTL_VALIDATE=false VERSION=${{ github.ref_name }} make test-cli
|
||||
- name: Test CLI (failures)
|
||||
run: |
|
||||
CLI_PATH=$PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno
|
||||
|
@ -75,7 +75,7 @@ jobs:
|
|||
fi
|
||||
- name: Test CLI
|
||||
run: |
|
||||
KYVERNO_KUBECTL_VALIDATE=true VERSION=${{ github.ref_name }} make test-cli
|
||||
VERSION=${{ github.ref_name }} make test-cli
|
||||
- name: Test CLI (failures)
|
||||
run: |
|
||||
CLI_PATH=$PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno
|
||||
|
|
|
@ -10,17 +10,17 @@ const (
|
|||
KubectlValidateEnv = "KYVERNO_KUBECTL_VALIDATE" //nolint:gosec
|
||||
)
|
||||
|
||||
func getBool(env string) bool {
|
||||
func getBool(env string, fallback bool) bool {
|
||||
if b, err := strconv.ParseBool(os.Getenv(env)); err == nil {
|
||||
return b
|
||||
}
|
||||
return false
|
||||
return fallback
|
||||
}
|
||||
|
||||
func IsEnabled() bool {
|
||||
return getBool(ExperimentalEnv)
|
||||
return getBool(ExperimentalEnv, false)
|
||||
}
|
||||
|
||||
func UseKubectlValidate() bool {
|
||||
return getBool(KubectlValidateEnv)
|
||||
return getBool(KubectlValidateEnv, true)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue