Skip to content

feat(vm-storage-labeling): add storage volume labeling role#5

Closed
stevefulme1 wants to merge 11 commits into
redhat-cop:mainfrom
stevefulme1:feat/vm-storage-labeling
Closed

feat(vm-storage-labeling): add storage volume labeling role#5
stevefulme1 wants to merge 11 commits into
redhat-cop:mainfrom
stevefulme1:feat/vm-storage-labeling

Conversation

@stevefulme1
Copy link
Copy Markdown
Contributor

Summary

  • Adds vm_storage_labeling role and playbook to apply labels, annotations, and descriptive names to PersistentVolumeClaims (PVCs) and DataVolumes at the OCP level
  • Supports targeting volumes by name or label selectors for bulk operations
  • If a PVC is owned by a DataVolume, labels/annotations are applied to both resources
  • Follows existing collection patterns for variable naming, validation, and k8s JSON patch operations

Moved from

Originally submitted as redhat-cop/openshift_virtualization_migration#15 — relocated here as this is day 2 ops functionality (managing storage on existing VMs), not migration logic.

FQCN updated from infra.openshift_virtualization_migration to infra.openshift_virtualization_ops.

Test plan

  • Verify yamllint passes
  • Verify ansible-lint --offline passes production profile
  • Integration test: apply labels to PVCs by name in a test namespace
  • Integration test: apply labels to PVCs by label selector
  • Integration test: verify DataVolume-owned PVCs also patch the DataVolume
  • Verify idempotency — re-running with same labels produces no changes

🤖 Generated with Claude Code

Move from openshift_virtualization_migration repo — this is day 2 ops
functionality for labeling PVCs/DataVolumes on existing VMs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevefulme1 This looks good. Only comment is related to my prior comment whether there was a requirement to scope to either a namespace or by labels. In the vm_collect role, a namespace is only required when names are specified. Not a blocking item. However, it provides alignment to other capabilities within the collection

In addition, would you be able to review the conflicts in the test-requirements.txt file?

- Resolve test-requirements.txt merge conflict (remove bare tox)
- Make namespace optional, required only when names are specified,
  aligning with vm_collect role pattern per reviewer request
- Use omit for namespace in k8s_info queries to support cluster-wide
  PVC labeling when no namespace is provided
@stevefulme1 stevefulme1 deleted the feat/vm-storage-labeling branch May 18, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants