redhat-cop / namespace-configuration-operator

The namespace-configuration-operator helps keeping configurations related to Users, Groups and Namespaces aligned with one of more policies specified as a CRs
Apache License 2.0
204 stars 55 forks source link

[FEATURE] Request for upgrade feature or doc #53

Closed saberkan closed 4 years ago

saberkan commented 4 years ago

Issue: We are trying to find the best approach to upgrade the configurator. While CRD may have some changes, we need to find an approach to upgrade existing CRs without deleting them.

Expected: An official procedure to upgrade the operator in a stable manner (without deleting existing CRs and CRDs).

raffaelespazzoli commented 4 years ago

can you test this approach:

  1. turn off the old version operator (scale to zero).
  2. delete the CRs
  3. update the CRDs
  4. create the new CRs equivalent to the old ones
  5. deploy the new operator
  6. delete the old operator

If it works as expected we can document it.

saberkan commented 4 years ago

The procedure was applied successfully, meanwhile in step 4. we needed to delete existing CRDs, and recreate them, otherwise the following error occurs: $ oc apply -f deploy/crds/redhatcop.redhat.io_namespaceconfigs_crd.yaml Warning: oc apply should be used on resource created by either oc create --save-config or oc apply The CustomResourceDefinition "namespaceconfigs.redhatcop.redhat.io" is invalid: spec.scope: Invalid value: "Cluster": field is immutable