Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check for the agent-tls-mode setting #416

Open
wants to merge 3 commits into
base: release/v0.5
Choose a base branch
from

Conversation

maxsokolovsky
Copy link
Contributor

@maxsokolovsky maxsokolovsky commented Jun 28, 2024

Issue: rancher/rancher#45589

Problem

The webhook needs to validate updates to the agent-tls-mode setting given the logic below.

Solution

If agent-tls-mode has default or value updated from system-store to strict, then all non-local clusters must
have a status condition AgentTlsStrictCheck set to True, unless the new setting has an overriding
annotation cattle.io/force=true.

CheckList

  • Test
  • Docs

@maxsokolovsky maxsokolovsky requested a review from a team as a code owner June 28, 2024 18:02
Copy link
Contributor

@JonCrowther JonCrowther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, just one comment.

@@ -129,3 +164,21 @@ func validateDuration(value string) (time.Duration, error) {

return dur, err
}

func clusterConditionMatches(cluster *v3.Cluster, t v3.ClusterConditionType, status v1.ConditionStatus) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the tests on effectiveValue, I think for the sake of completeness we could add a test for clusterConditionMatches too

Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified everything passes with the GHA-based CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants