Skip to content

Commit 7fdc72c

Browse files
committed
Implemented OCP peer review comments
1 parent fb1db6a commit 7fdc72c

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

modules/ztp-removing-content-from-managed-clusters.adoc

+14-16
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
[id="ztp-removing-content-from-managed-clusters_{context}"]
77
= Changing applied managed cluster CRs using policies
88

9-
You can remove content from a custom resource (CR) deployed to a managed cluster through a policy.
9+
You can remove content from a custom resource (CR) that is deployed in a managed cluster through a policy.
1010

11-
By default, all `Policy` CRs created from a `PolicyGenTemplate` CR have a `complianceType` set to `musthave`.
12-
In this mode, when you remove a field from a CR, the value is removed from the policy but is not removed from the CR on the managed cluster.
13-
A `musthave` policy without the removed field is still compliant because the CR on the managed cluster has all the specified content.
11+
By default, all `Policy` CRs created from a `PolicyGenTemplate` CR have the `complianceType` field set to `musthave`.
12+
A `musthave` policy without the removed content is still compliant because the CR on the managed cluster has all the specified content.
13+
In this configuration, when you remove content from a CR, {cgu-operator} removes it from the policy but the content is not removed from the CR on the managed cluster.
1414

15-
To remove the content from the managed cluster, set the `complianceType` field to `mustonlyhave`.
16-
In this mode, the policy ensures that the CR on the cluster is an exact match of what is specified in the policy.
15+
With the `complianceType` field to `mustonlyhave`, the policy ensures that the CR on the cluster is an exact match of what is specified in the policy.
1716

1817
.Prerequisites
1918

@@ -27,7 +26,7 @@ In this mode, the policy ensures that the CR on the cluster is an exact match of
2726
2827
.Procedure
2928

30-
. Remove the content that you no longer need from the affected CRs. In this example, the `disableDrain: false` line should be removed from the `SriovOperatorConfig` CR.
29+
. Remove the content that you no longer need from the affected CRs. In this example, the `disableDrain: false` line was removed from the `SriovOperatorConfig` CR.
3130
+
3231
.Example CR
3332

@@ -38,28 +37,27 @@ kind: SriovOperatorConfig
3837
metadata:
3938
name: default
4039
namespace: openshift-sriov-network-operator
41-
annotations:
42-
ran.openshift.io/ztp-deploy-wave: "10"
4340
spec:
4441
configDaemonNodeSelector:
4542
"node-role.kubernetes.io/$mcp": ""
46-
disableDrain: true <1>
43+
disableDrain: true
4744
enableInjector: true
4845
enableOperatorWebhook: true
4946
----
50-
<1> Remove the `disableDrain: true` line.
5147

5248
. Change the `complianceType` of the affected policies to `mustonlyhave` in the `group-du-sno-ranGen.yaml` file.
5349
+
5450
.Example YAML
5551
[source,yaml]
5652
----
53+
# ...
5754
- fileName: SriovOperatorConfig.yaml
5855
policyName: "config-policy"
5956
complianceType: mustonlyhave
57+
# ...
6058
----
6159

62-
. Create a `ClusterGroupUpdates` CR and specify the clusters you want to deploy the changes to:
60+
. Create a `ClusterGroupUpdates` CR and specify the clusters that must receive the CR changes::
6361
+
6462
.Example ClusterGroupUpdates CR
6563
[source,yaml]
@@ -97,11 +95,13 @@ $ oc --namespace=default patch clustergroupupgrade.ran.openshift.io/cgu-remove \
9795
--patch '{"spec":{"enable":true}}' --type=merge
9896
----
9997

98+
.Verification
99+
100100
. Check the status of the policies by running the following command:
101101
+
102102
[source,terminal]
103103
----
104-
$ oc get <changed_cr>
104+
$ oc get <kind> <changed_cr_name>
105105
----
106106

107107
+
@@ -116,13 +116,11 @@ default ztp-group.group-du-sno-config-policy inform
116116
+
117117
When the `COMPLIANCE STATE` of the policy is `Compliant`, it means that the CR is updated and the unwanted content is removed.
118118

119-
.Verification
120-
121119
* Check that the policies are removed from the targeted clusters by running the following command on the managed clusters:
122120
+
123121
[source,terminal]
124122
----
125-
$ oc get <changed_cr>
123+
$ oc get <kind> <changed_cr_name>
126124
----
127125
128126
+

0 commit comments

Comments
 (0)