Skip to content

[release-4.17] Avoid using lb-ext.kubeconfig for seedgen cleanup#6885

Closed
openshift-cherrypick-robot wants to merge 1 commit into
openshift-kni:release-4.17from
openshift-cherrypick-robot:cherry-pick-6884-to-release-4.17
Closed

[release-4.17] Avoid using lb-ext.kubeconfig for seedgen cleanup#6885
openshift-cherrypick-robot wants to merge 1 commit into
openshift-kni:release-4.17from
openshift-cherrypick-robot:cherry-pick-6884-to-release-4.17

Conversation

@openshift-cherrypick-robot
Copy link
Copy Markdown

This is an automated cherry-pick of #6884

/assign openshift-cherrypick-robot

/cherrypick release-4.16

This is a *manual* cherry-pick of openshift-kni#6008, with an additional RBAC fix:
add pod delete permission to the seedgen controller's kubebuilder RBAC
annotation.

On main, switching from `oc delete pod` (authenticated via
lb-ext.kubeconfig) to `r.Client.Delete()` (authenticated via the
controller's service account) worked because an unrelated commit
d756889 ("MGMT-21789: Add new feature for deleting pods stuck in
ImagePullBackOff error") had already added the pod delete verb to the
ClusterRole. That commit is not in release-4.19, so on a clean
cherry-pick the service account lacked the permission and pod cleanup
during seed generation will fail with a forbidden error:

```
2026-05-15T15:06:58.207369896Z 2026-05-15T15:06:58Z	ERROR	controllers.SeedGenerator	Seed generation failed	{"error": "failed to cleanup Succeeded pods: failed to delete pod openshift-kube-scheduler/installer-5-retry-1-seed-sno-node: pods \"installer-5-retry-1-seed-sno-node\" is forbidden: User \"system:serviceaccount:openshift-lifecycle-agent:lifecycle-agent-controller-manager\" cannot delete resource \"pods\" in API group \"\" in the namespace \"openshift-kube-scheduler\""}
```

The original kubebuilder annotation was never updated to include delete
when the code was changed to use the client — it was simply masked on
main by the MGMT-21789 RBAC addition. This commit fixes the annotation
at the source so the permission is explicitly tied to the code that
needs it.
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 26, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign omertuc for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9fe0c1c7-20b5-4609-9ee6-d72c3dd4c5f9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jc-rh jc-rh closed this May 26, 2026
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.

3 participants