OCPBUGS-43353: fix(nodepool): validate registry entries in image config#8070
OCPBUGS-43353: fix(nodepool): validate registry entries in image config#8070reedcort wants to merge 1 commit intoopenshift:mainfrom
Conversation
Registry entries in blockedRegistries, allowedRegistries, and insecureRegistries were not validated, allowing invalid entries (e.g. with tags like :latest or digests) to pass through and generate an invalid /etc/containers/policy.json, causing nodes to silently fail to join the cluster. Add validation using the MCO sourceRegex pattern at three layers: - Webhook: reject invalid entries at admission time - Controller: surface errors via ValidHostedClusterConfiguration - NodePool: surface errors via ValidMachineConfig condition Fixes: https://redhat.atlassian.net/browse/OCPBUGS-43353 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe changes introduce validation for OpenShift image registry sources across multiple components of the hosted cluster infrastructure. A new ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: reedcort The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/hold |
|
/test all |
|
/test e2e-azure-self-managed |
|
@reedcort: This pull request references Jira Issue OCPBUGS-43353, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@joshbranham: This pull request references Jira Issue OCPBUGS-43353, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/test e2e-azure-self-managed |
|
@reedcort: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
please fix this in the canonical API https://github.com/openshift/api/blob/30c2ef7a272e592fd836c6bedbd4394b3ed15042/config/v1/types_image.go#L56 with CEL |
|
@reedcort: This pull request references Jira Issue OCPBUGS-43353. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Summary
blockedRegistries,allowedRegistries, andinsecureRegistriesusing the MCOsourceRegexpattern:latestor digests like@sha256:...) are now rejected at webhook admission time and surfaced viaValidHostedClusterConfigurationandValidMachineConfigconditions/etc/containers/policy.json, causing nodes to fail to joinChanges
support/globalconfig/image.goValidateRegistrySources()with MCO regexsupport/globalconfig/image_test.gohostedcluster_webhook.gohostedcluster_controller.goValidHostedClusterConfigurationnodepool/config.goValidMachineConfigconditionBug Reproduction
Confirmed the bug still exists on OCP 4.21.5 (ROSA HCP staging cluster):
trusted.com/myrepo:latestas a blocked registryValidMachineConfigreportedTruedespite the invalid entrypolicy.jsonTest plan
go test ./support/globalconfig/ -v— 11/11)go build)make verifypasses🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Tests