Skip to content

Commit 37b85a9

Browse files
Merge pull request #1270 from klgill/add-oc-patch-note
added module about oc patch command
2 parents 5b46197 + 784d8dc commit 37b85a9

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

docs_user/assemblies/assembly_rhoso-180-adoption-overview.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,7 @@ include::../assemblies/assembly_preparing-an-instance-HA-deployment-for-adoption
4242

4343
include::../modules/proc_comparing-configuration-files-between-deployments.adoc[leveloffset=+1]
4444

45+
include::../modules/con_preventing-config-loss-when-using-oc-patch.adoc[leveloffset=+1]
46+
4547
ifdef::parent-context[:context: {parent-context}]
4648
ifndef::parent-context[:!context:]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
:_mod-docs-content-type: CONCEPT
2+
[id="preventing-config-loss-when-using-oc-patch_{context}"]
3+
4+
= Preventing configuration loss when using the `oc patch` command
5+
6+
[role="_abstract"]
7+
When you use the `oc patch` command to modify a resource, the changes are applied directly to the live object in your OpenShift cluster. If you later edit the custom resource (CR) file for the resource and apply the updates by using `oc apply -f <filename>`, your previous patched changes are overwritten and lost from the resource.
8+
9+
To prevent loss of configuration, you can use the `--patch-file` option to configure the patch and retain patch files. Alternatively, you can export your `openstackcontrolplane` CR after the patch is applied:
10+
11+
----
12+
$ oc get <resource_type> <resource_name> -o yaml > <filename>.yaml
13+
----
14+
15+
For example:
16+
----
17+
$ oc get OpenStackControlPlane openstack-control-plane -o yaml > openstack_control_plane.yaml
18+
----

0 commit comments

Comments
 (0)