fix: avoid maas-controller env value + valueFrom kustomize merge#657
fix: avoid maas-controller env value + valueFrom kustomize merge#657jland-redhat wants to merge 2 commits intoopendatahub-io:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jland-redhat 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR updates Kubernetes manifests for the maas-controller. In the base Deployment the manager container's cache TTL args were changed from templated env references to hardcoded Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Security Findings
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@deployment/overlays/odh/kustomization.yaml`:
- Around line 64-73: The METADATA_CACHE_TTL and AUTHZ_CACHE_TTL environment
variable ConfigMap references are marked optional:true causing empty
substitutions and invalid container args (--metadata-cache-ttl= /
--authz-cache-ttl=); change the ConfigMapKeyRef entries that supply
METADATA_CACHE_TTL and AUTHZ_CACHE_TTL to optional:false so the Pod will fail to
create (CreateContainerConfigError) when those keys are missing and
deployment-time validation enforces valid TTL args for the container.
🪄 Autofix (Beta)
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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: b6384a07-00c8-4fdb-a0ff-5099aa10e5d0
📒 Files selected for processing (2)
deployment/base/maas-controller/manager/manager.yamldeployment/overlays/odh/kustomization.yaml

Suggested title: fix(deploy): avoid maas-controller env
value+valueFromkustomize mergeDescription
Kubernetes rejects
EnvVarentries that set bothvalueandvalueFrom. The ODH overlay patchedMETADATA_CACHE_TTLandAUTHZ_CACHE_TTLwithvalueFrom(ConfigMap) while the baseDeploymentstill had literalvalue: "60". Strategic merge merges by env name and kept both fields.This change:
deployment/base/maas-controller/manager/manager.yaml): Removes the TTL entries fromenvand sets TTLs via literal manager flags (--metadata-cache-ttl=60,--authz-cache-ttl=60) so standalonekustomize build/kubectl apply -k deployment/base/maas-controller/defaultstill applies valid TTLs (unlike leaving$(METADATA_CACHE_TTL)in args with no env, which breaks flag parsing).deployment/overlays/odh/kustomization.yaml): Extends themaas-controllerpatch with a fullargslist that uses$(METADATA_CACHE_TTL)/$(AUTHZ_CACHE_TTL)andenvthat only usesvalueFromtomaas-parameters, matchingparams.envkeys (metadata-cache-ttl,authz-cache-ttl).Non-ODH overlays inherit the base literal TTL args; no duplicate overlay patches were added.
How Has This Been Tested?
Not tested yet; validation in progress.
Planned checks:
kustomize build deployment/overlays/odhand confirmmaas-controllerenv forMETADATA_CACHE_TTL/AUTHZ_CACHE_TTLhave onlyvalueFrom(novalue).kustomize build deployment/base/maas-controller/default(and other overlays that includemaas-controller) and confirm TTLs appear as literal60inargswhere expected.Deploymentis accepted and the controller starts.Merge criteria:
Summary by CodeRabbit