Skip to content

Commit

Permalink
Fix kyverno webhook namespace selectors (#434)
Browse files Browse the repository at this point in the history
* Fix kyverno webhook namespace selectors

* Fix waiting for kyverno webhook
  • Loading branch information
timebertt authored Jan 19, 2025
1 parent 637af40 commit 0064efc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hack/config/kyverno/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ configMapGenerator:
# overwrite default namespaceSelector for webhook configs to exclude kube-system
# the second part makes gardeners care controller/webhook remediation happy
- >-
webhooks=[{
webhooks={
"namespaceSelector": {
"matchExpressions": [{
"key": "kubernetes.io/metadata.name",
Expand All @@ -26,4 +26,4 @@ configMapGenerator:
"values": ["kube-system"]
}]
}
}]
}
2 changes: 1 addition & 1 deletion hack/config/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ deploy:
- |
for i in $(seq 1 20); do
# create dummy policy with dry-run enabled to test availability of webhook
if kubectl create --raw "/apis/kyverno.io/v1/clusterpolicies?dryRun=All" -f <(echo '{"apiVersion": "kyverno.io/v1", "kind": "ClusterPolicy", "metadata": {"name": "test"}, "spec": {}}') >/dev/null ; then
if kubectl create --dry-run=server -f <(yq '.metadata.name |= "test-kyverno"' hack/config/policy/shoot/sharder-scheduling.yaml) ; then
exit 0
fi
echo "Waiting until kyverno webhook is ready to handle policy creation"
Expand Down

0 comments on commit 0064efc

Please sign in to comment.