Repository navigation
feat(cli): kates auto and kyverno apply pass .policies, as deploy does - #586
Merged
Merged
Conversation
kates auto installed kafka-cluster and monitoring without the current context's .policies values, and kyverno apply upgraded the kates release with the values reused from the last deploy. On a cluster whose Kyverno policies need a pod label or a value, both could be refused where deploy passed. Each now passes the chart's values and warns about unresolved rules. The admin-less kind gate is left alone: it installs operators on a cluster it has just created, which has no policies of its own yet.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up named in #578: only
kates deployapplied.policies.kates autowrites the current context's.policiesvalues next tovalues-detected.yamland passes them to thekafka-clusterandmonitoringreleases.kates kyverno applypasses thekateschart's values to its upgrade.--reset-then-reuse-valuesreuses only what the last deploy passed, so a.policiesedit since then was lost.unresolvedrules, as deploy does.currentDeployPoliciesasks kubectl for the context only when the file has environments.The admin-less kind gate is unchanged. It installs Strimzi, Kyverno and monitoring on a Kind cluster it has just created, so there are no user policies yet to satisfy.
Tests:
TestKyvernoApplyPassesPolicies(fails without the change) andTestAutoMonitoringPassesPolicies.go test ./...inclipasses. golangci-lint flags only the knownmcp_test.goerrcheck lines under 2.15 (CI pins 2.14.0). Not run against a live cluster.