OSAC-1123: enable storage role k8s calls to target remote CaaS clusters - #379
akshaynadkarni wants to merge 1 commit into
Conversation
Add kubeconfig: "{{ _remote_kubeconfig | default(omit) }}" to all
kubernetes.core.k8s and kubernetes.core.k8s_info calls in the VAST
storage role so that StorageClasses, CSI resources, and cleanup
operations target the correct cluster.
For VMaaS, _remote_kubeconfig is not set, so default(omit) omits the
parameter entirely and existing behavior is preserved. For CaaS,
_remote_kubeconfig is resolved by the playbook-level kubeconfig
handling (OSAC-1327) and passed through to each k8s call.
19 k8s calls updated across 3 files:
- ensure_storage_class.yaml (6)
- ensure_csi_operator.yaml (8)
- teardown_cluster_storage.yaml (5)
Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
Assisted-by: Cursor/Claude
Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
|
@akshaynadkarni: This pull request references OSAC-1123 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.0.0" version, but no target version was set. 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. |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akshaynadkarni 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 |
WalkthroughAdds ChangesRemote kubeconfig scoping for vast_storage tasks
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
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
`@collections/ansible_collections/osac/templates/roles/vast_storage/tasks/ensure_storage_class.yaml`:
- Line 44: The remote kubeconfig path is still blocked by the provisioning
guard, so the kubeconfig-scoped Kubernetes tasks in the storage-class flow never
run for CaaS/remote-cluster cases. Update the control flow around the affected
task blocks in ensure_storage_class so they are not gated by the current
_provisioning_target != 'vmaas' fail path, and let the kubeconfig-optional calls
execute for non-VMaaS runs. Keep the existing kubeconfig: "{{ _remote_kubeconfig
| default(omit) }}" pattern on the Kubernetes invocations and adjust the
surrounding conditionals/fail logic instead.
In
`@collections/ansible_collections/osac/templates/roles/vast_storage/tasks/teardown_cluster_storage.yaml`:
- Line 24: The teardown path in teardown_cluster_storage is still gated by the
vmaas-only _provisioning_target check, so the kubeconfig-scoped cleanup tasks
for remote-cluster/CaaS never execute. Update the gating logic in the role so
the cleanup block containing the StorageClass, VolumeSnapshotClass, and CSI
Secret removals is reachable for the remote-cluster path as well, while keeping
the existing _remote_kubeconfig and default(omit) usage in those tasks.
🪄 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: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 6685ed94-7970-40cf-9b5e-5fd04ea57df9
📒 Files selected for processing (3)
collections/ansible_collections/osac/templates/roles/vast_storage/tasks/ensure_csi_operator.yamlcollections/ansible_collections/osac/templates/roles/vast_storage/tasks/ensure_storage_class.yamlcollections/ansible_collections/osac/templates/roles/vast_storage/tasks/teardown_cluster_storage.yaml
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Add
kubeconfigparameter to allkubernetes.core.k8sandkubernetes.core.k8s_infocalls in the VAST storage role so that StorageClasses, CSI resources, and cleanup operations target the correct cluster (OSAC-1123).Why
The VAST storage role creates StorageClasses, CSI Secrets, and VolumeSnapshotClasses using
kubernetes.core.k8scalls that default to the local cluster context. For CaaS clusters, these resources must be created on the tenant's hosted cluster, not the hub. Addingkubeconfig: "{{ _remote_kubeconfig | default(omit) }}"routes each call to the correct cluster when a remote kubeconfig is available, while preserving existing VMaaS behavior (where_remote_kubeconfigis unset anddefault(omit)drops the parameter).Testing
19 k8s calls updated across 3 files:
ensure_storage_class.yaml(6 calls)ensure_csi_operator.yaml(8 calls)teardown_cluster_storage.yaml(5 calls)Pre-merge ToDos
Post-merge ToDos
base/osac-aap_remote_kubeconfigat the playbook levelRelated PRs
admin_kubeconfigin extra_vars)Ticket
OSAC-1123
Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude
Summary by CodeRabbit