Fix OKD release-controller-api registry auth - #83163
Conversation
The OKD API deployment created in openshift#83116 is missing the HOME and XDG_RUNTIME_DIR environment variables and the oc-prepare init container that the OCP API deployment has. Without these, oc cannot locate registry credentials and all release info requests fail with "unauthorized: authentication required". Add get_oc_env_vars() and get_oc_prepare_container() to the OKD API deployment template, matching the OCP API template.
|
[REHEARSALNOTIFIER] Note: If this PR includes changes to step registry files ( |
WalkthroughThe release-controller generator now adds shared runtime environment variables and an ChangesRelease controller preparation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant oc-prepare
participant ReleaseRegistry
participant GitCache
participant ReleaseControllerAPI
oc-prepare->>ReleaseRegistry: Authenticate and query accepted releases
oc-prepare->>GitCache: Populate release changelogs
oc-prepare->>ReleaseControllerAPI: Complete initialization
ReleaseControllerAPI->>GitCache: Use the shared Git cache
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@clusters/app.ci/release-controller/deploy-origin-arm64-controller.yaml`:
- Around line 285-306: Update get_oc_prepare_container() to add a restrictive
container securityContext with runAsNonRoot, readOnlyRootFilesystem,
allowPrivilegeEscalation: false, and dropped capabilities, plus CPU and memory
requests and limits; then regenerate both manifests so the hardened oc-prepare
container is rendered in
clusters/app.ci/release-controller/deploy-origin-arm64-controller.yaml:285-306
and clusters/app.ci/release-controller/deploy-origin-controller.yaml:285-306.
In `@hack/generators/release-controllers/content/origin_resources.py`:
- Line 299: Update get_oc_prepare_container so both release-stream curl fetches
use connection and total timeouts, and handle nonzero curl results without
triggering set -e. Preserve the existing fallback values when either discovery
request fails, allowing the init container to complete.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 5fa856c7-79ef-4122-8fdd-8dcf409bcbe4
📒 Files selected for processing (3)
clusters/app.ci/release-controller/deploy-origin-arm64-controller.yamlclusters/app.ci/release-controller/deploy-origin-controller.yamlhack/generators/release-controllers/content/origin_resources.py
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bradmwilliams, hoxhaeris, thiagoalessio The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@hoxhaeris: 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. |
The OKD API deployment created in openshift#83116 is missing the HOME and XDG_RUNTIME_DIR environment variables and the oc-prepare init container that the OCP API deployment has. Without these, oc cannot locate registry credentials and all release info requests fail with "unauthorized: authentication required". Add get_oc_env_vars() and get_oc_prepare_container() to the OKD API deployment template, matching the OCP API template.
The OKD API deployment created in #83116 is missing the
HOMEandXDG_RUNTIME_DIRenvironment variables and theoc-prepareinit container that the OCP API deployment has. Without these,occannot locate registry credentials and all release info requests fail with:This adds
get_oc_env_vars()andget_oc_prepare_container()to the OKD API deployment template inorigin_resources.py, matching the OCP API template inosd_rc_deployments.py.Summary by CodeRabbit
HOMEandXDG_RUNTIME_DIRsooccan find registry credentials.oc-prepareinit container to configure Git credentials, authenticate to the registry, and populate release changelog data.unauthorized: authentication required.