79417155

Date: 2025-02-06 08:11:35
Score: 2
Natty:
Report link

To extract a YAML file from OpenShift (such as a ConfigMap or DeploymentConfig) while removing unnecessary metadata fields like resourceVersion and uid, use the following command:

oc get cm -o yaml | yq 'del(.metadata.uid, .metadata.resourceVersion)' - > output.yaml

This ensures a clean backup without dynamic metadata fields that may change across deployments.

Reasons:
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Pratik Rathod