|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * operators/metallb/metallb-upgrading-operator.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="olm-updating-metallb-operatorgroup_{context}"] |
| 7 | += Editing the MetalLB Operator Operator group |
| 8 | + |
| 9 | +When upgrading from any MetalLB Operator version up to and including 4.10 to 4.11 and later, remove `spec.targetNamespaces` from the Operator group custom resource (CR). You must remove the spec regardless of whether you used the web console or the CLI to delete the MetalLB Operator. |
| 10 | +[NOTE] |
| 11 | +==== |
| 12 | +The MetalLB Operator version 4.11 or later only supports the `AllNamespaces` install mode, whereas 4.10 or earlier versions support `OwnNamespace` or `SingleNamespace` modes. |
| 13 | +==== |
| 14 | + |
| 15 | +.Prerequisites |
| 16 | + |
| 17 | +- You have access to an {product-title} cluster with `cluster-admin` permissions. |
| 18 | +- You have installed the OpenShift CLI (`oc`). |
| 19 | +
|
| 20 | +.Procedure |
| 21 | + |
| 22 | +. List the Operator groups in the `metallb-system` namespace by running the following command: |
| 23 | ++ |
| 24 | +[source,terminal] |
| 25 | +---- |
| 26 | +$ oc get operatorgroup -n metallb-system |
| 27 | +---- |
| 28 | ++ |
| 29 | +.Example output |
| 30 | + |
| 31 | +[source,terminal] |
| 32 | +---- |
| 33 | +NAME AGE |
| 34 | +metallb-system-7jc66 85m |
| 35 | +---- |
| 36 | + |
| 37 | +. Verify that the `spec.targetNamespaces` is present in the Operator group CR associated with the `metallb-system` namespace by running the following command: |
| 38 | ++ |
| 39 | +[source,terminal] |
| 40 | +---- |
| 41 | +$ oc get operatorgroup metallb-system-7jc66 -n metallb-system -o yaml |
| 42 | +---- |
| 43 | ++ |
| 44 | +.Example output |
| 45 | +[source,terminal] |
| 46 | +---- |
| 47 | +apiVersion: operators.coreos.com/v1 |
| 48 | +kind: OperatorGroup |
| 49 | +metadata: |
| 50 | + annotations: |
| 51 | + olm.providedAPIs: "" |
| 52 | + creationTimestamp: "2023-10-25T09:42:49Z" |
| 53 | + generateName: metallb-system- |
| 54 | + generation: 1 |
| 55 | + name: metallb-system-7jc66 |
| 56 | + namespace: metallb-system |
| 57 | + resourceVersion: "25027" |
| 58 | + uid: f5f644a0-eef8-4e31-a306-e2bbcfaffab3 |
| 59 | +spec: |
| 60 | + targetNamespaces: |
| 61 | + - metallb-system |
| 62 | + upgradeStrategy: Default |
| 63 | +status: |
| 64 | + lastUpdated: "2023-10-25T09:42:49Z" |
| 65 | + namespaces: |
| 66 | + - metallb-system |
| 67 | +---- |
| 68 | + |
| 69 | +. Edit the Operator group and remove the `targetNamespaces` and `metallb-system` present under the `spec` section by running the following command: |
| 70 | ++ |
| 71 | +[source,terminal] |
| 72 | +---- |
| 73 | +$ oc edit n metallb-system |
| 74 | +---- |
| 75 | ++ |
| 76 | +.Example output |
| 77 | ++ |
| 78 | +[source,terminal] |
| 79 | +---- |
| 80 | +operatorgroup.operators.coreos.com/metallb-system-7jc66 edited |
| 81 | +---- |
| 82 | + |
| 83 | +. Verify the `spec.targetNamespaces` is removed from the Operator group custom resource associated with the `metallb-system` namespace by running the following command: |
| 84 | ++ |
| 85 | +[source,terminal] |
| 86 | +---- |
| 87 | +$ oc get operatorgroup metallb-system-7jc66 -n metallb-system -o yaml |
| 88 | +---- |
| 89 | ++ |
| 90 | +.Example output |
| 91 | +[source,terminal] |
| 92 | +---- |
| 93 | +apiVersion: operators.coreos.com/v1 |
| 94 | +kind: OperatorGroup |
| 95 | +metadata: |
| 96 | + annotations: |
| 97 | + olm.providedAPIs: "" |
| 98 | + creationTimestamp: "2023-10-25T09:42:49Z" |
| 99 | + generateName: metallb-system- |
| 100 | + generation: 2 |
| 101 | + name: metallb-system-7jc66 |
| 102 | + namespace: metallb-system |
| 103 | + resourceVersion: "61658" |
| 104 | + uid: f5f644a0-eef8-4e31-a306-e2bbcfaffab3 |
| 105 | +spec: |
| 106 | + upgradeStrategy: Default |
| 107 | +status: |
| 108 | + lastUpdated: "2023-10-25T14:31:30Z" |
| 109 | + namespaces: |
| 110 | + - "" |
| 111 | +---- |
| 112 | + |
| 113 | + |
0 commit comments