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

fix: should reconcile targets consistently #260

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Dec 25, 2023

When checking target keys using managed fields, we must also check binaryData field in target configmaps.

Fixes #259

Signed-off-by: Erik Godding Boye <egboye@gmail.com>
@jetstack-bot jetstack-bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 25, 2023
@inteon
Copy link
Member

inteon commented Dec 27, 2023

@erikgb just for context, do you know why the extra reconciliations and patches keep happening? I would expect that the noop patches do not trigger new reconciliations.

@erikgb
Copy link
Contributor Author

erikgb commented Dec 27, 2023

@inteon Neither the JKS nor PKCS#12 format is idempotent, so when the check for keys never match it will patch the target with changes. I really don't know why this didn't happen with JKS only. The added tests only fail on PKCS#12 without the fix...

@inteon
Copy link
Member

inteon commented Dec 31, 2023

@erikgb I think we explicitly try to make the JKS encoded value deterministic:

// WithOrderedAliases ensures that trusted certs are added to the JKS file in order,
// which makes the files appear to be reliably deterministic.
ks := jks.New(jks.WithOrderedAliases())

@inteon
Copy link
Member

inteon commented Jan 2, 2024

@erikgb It looks like the pkcs#12 format is using a random salt, which makes it non-idempotent.
see https://github.com/SSLMate/go-pkcs12/blob/v0.4.0/pkcs12.go#L704C5-L706

Now that I fully understand the cause of this issue and why it occurs for pkcs#12 & not for JKS, I'm more than happy to merge this.
/approve
/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 2, 2024
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 2, 2024
@jetstack-bot jetstack-bot merged commit 3484e54 into cert-manager:main Jan 2, 2024
4 checks passed
@erikgb
Copy link
Contributor Author

erikgb commented Jan 2, 2024

/cherrypick release-0.7

@jetstack-bot
Copy link
Contributor

@erikgb: new pull request created: #265

In response to this:

/cherrypick release-0.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundle is continuously synced when PKCS12 is enabled
3 participants