Skip to content

Remove issuer owner reference from challenges - #8743

Merged
cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
erikgb:revert-issuer-challenge-ownerref
Apr 29, 2026
Merged

cert-manager-prow[bot] merged 1 commit into
cert-manager:masterfrom
erikgb:revert-issuer-challenge-ownerref

Conversation

@erikgb

@erikgb erikgb commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

Pull Request Motivation

This PR reverts a change done as part of #7286, which added an owner reference to the issuer on challenges. This new owner reference blocks challenges from being garbage collected by Kubernetes when the order is deleted. And as described in #8737 (comment), this doesn't guarantee what we were trying to achieve in #7286: to keep the issuer around until all challenges are finalized.

I will create a new issue to track how we can fix the challenge finalization issue.

Fixes #8737

Kind

/kind bug

Release Note

Remove issuer owner reference from challenges blocking challenge garbage collection

@cert-manager-prow cert-manager-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. area/acme Indicates a PR directly modifies the ACME Issuer code size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 23, 2026
@erikgb

erikgb commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-master-make-test

@erikgb
erikgb force-pushed the revert-issuer-challenge-ownerref branch from 375bcc1 to 0a75439 Compare April 23, 2026 16:03
@cert-manager-prow cert-manager-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 23, 2026
@erikgb
erikgb requested a review from Copilot April 23, 2026 17:02
@erikgb

erikgb commented Apr 23, 2026

Copy link
Copy Markdown
Member Author

/cherrypick release-1.20
/cc @inteon @SgtCoDFish

@cert-manager-bot

Copy link
Copy Markdown
Contributor

@erikgb: once the present PR merges, I will cherry-pick it on top of release-1.20 in a new PR and assign it to you.

Details

In response to this:

/cherrypick release-1.20
/cc @inteon @SgtCoDFish

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-sigs/prow repository.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Reverts the Challenge Issuer/ClusterIssuer ownerReference that was introduced to improve finalization behavior, because it prevents Kubernetes garbage collection of Challenges when their owning Order is deleted.

Changes:

  • Remove the Issuer/ClusterIssuer OwnerReference from newly created Challenge objects.
  • Drop now-unused GVK variables and the k8s.io/utils/ptr import used to set BlockOwnerDeletion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 80 to 85
Name: chName,
Namespace: o.Namespace,
OwnerReferences: []metav1.OwnerReference{
*metav1.NewControllerRef(o, orderGvk),
issuerOwnerRef,
},
},

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

This change removes the Issuer/ClusterIssuer OwnerReference from Challenges, but there’s no regression test asserting the generated Challenge has only the Order controller OwnerReference. Adding a focused unit test (e.g., for buildPartialChallenge) would prevent accidentally reintroducing the Issuer ownerRef and bringing back the GC issue.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As this change is a revert and going to be cherry-picked into a release branch, I propose to keep the change as minimal as possible.

@SgtCoDFish SgtCoDFish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/approve
/hold

The review comment doesn't seem a huge problem - this is a revert, not a net-new feature - but I'll add a hold if you want to add a regression test. Happy to merge either way!

@cert-manager-prow cert-manager-prow Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 24, 2026

@inteon inteon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve
/lgtm

/hold in case you want to still change something

@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon, SgtCoDFish

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

The pull request process is described here

Details 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

@inteon

inteon commented Apr 29, 2026

Copy link
Copy Markdown
Member

/unhold

@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2026
@cert-manager-prow
cert-manager-prow Bot merged commit 6b7f85c into cert-manager:master Apr 29, 2026
4 checks passed
@cert-manager-bot

Copy link
Copy Markdown
Contributor

@erikgb: new pull request created: #8759

Details

In response to this:

/cherrypick release-1.20
/cc @inteon @SgtCoDFish

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-sigs/prow repository.

@wallrj-cyberark

Copy link
Copy Markdown
Member

📢 The fix or feature is now available for testing

Please test and report back.

eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jul 9, 2026