Skip to content

[release-4.22] fix: skip CRD check for built-in Kubernetes API groups - #343

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-virtualization:release-4.22from
tiraboschi:r422_crd-name-from-gvk-builtin-groups
Aug 25, 2026
Merged

[release-4.22] fix: skip CRD check for built-in Kubernetes API groups#343
openshift-merge-bot[bot] merged 1 commit into
openshift-virtualization:release-4.22from
tiraboschi:r422_crd-name-from-gvk-builtin-groups

Conversation

@tiraboschi

@tiraboschi tiraboschi commented Aug 25, 2026

Copy link
Copy Markdown
Member

crdNameFromGVK was treating any apiVersion with a "/" as a CRD, so groups like apps, batch, and rbac.authorization.k8s.io would produce spurious CRD names (e.g. "deployments.apps") and cause assets to be skipped with "CRD not installed" errors.

Fix uses the .k8s.io suffix to identify Kubernetes-owned groups, with an explicit allowlist for the legacy groups (apps, batch, policy, autoscaling) that predate that naming convention.

Also guard IsManagedCRD against an empty crdName to avoid a false match if any asset has an empty RequiredCRD field.

(cherry picked from commit 7b53e43)
This is manual cherry-pick of #191

Comment thread pkg/assets/registry.go Outdated

@michalskrivanek michalskrivanek 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.

maybe it could be just a comment and the code could be simpler?

crdNameFromGVK was treating any apiVersion with a "/" as a CRD,
so groups like apps, batch, and rbac.authorization.k8s.io would
produce spurious CRD names (e.g. "deployments.apps") and cause
assets to be skipped with "CRD not installed" errors.

Fix uses the .k8s.io/.apiserver.k8s.io suffix to identify
Kubernetes-owned groups, with an explicit allowlist for the
legacy groups (apps, batch, policy, autoscaling) that predate
that naming convention.

Also guard IsManagedCRD against an empty crdName to avoid a
false match if any asset has an empty RequiredCRD field.

(cherry picked from commit 7b53e43)
Co-Authored-By: Nir Dothan <nirdothan@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>
@tiraboschi
tiraboschi force-pushed the r422_crd-name-from-gvk-builtin-groups branch from a696dec to d205c58 Compare August 25, 2026 15:51
@tiraboschi

Copy link
Copy Markdown
Member Author

/approve

@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiraboschi

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 69ec5dc into openshift-virtualization:release-4.22 Aug 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants