janus-idp / operator

Deprecated - Operator for Backstage, based on the Operator SDK framework - see https://github.com/redhat-developer/rhdh-operator
https://github.com/redhat-developer/rhdh-operator
Apache License 2.0
15 stars 15 forks source link

fix: Make sure to use backward-compatible names for resources created by the operator [RHIDP-2432] #369

Closed rm3l closed 5 months ago

rm3l commented 6 months ago

Description

This fixes a critical issue where, when upgrading existing resources using an operator upgraded from 1.1 to 1.2 (main branch), the operator would create and use a brand new database StatefulSet. This would cause the upgraded Backstage application to boot using an empty database, rather than starting with the existing database (which could already contain some data).

~It also fixes a more general issue where resource naming was not backward-compatible, which would create for example 2 different ConfigMaps after an upgrade: one named backstage-dynamic-plugins-<cr> (created by the operator on the main branch) besides an already existing one named <cr>-dynamic-plugins (created in 1.1), which could create some confusion when looking at the resources in the namespace.~

Which issue(s) does this PR fix or relate to

PR acceptance criteria

How to test changes / Special notes to the reviewer

See the repro steps depicted in https://issues.redhat.com/browse/RHIDP-2432 and run the tests with the following command:

make test
make integration-test \
  ARGS=-focus='creates runtime object using raw configuration then updates StatefulSet to replace some immutable fields' \
  USE_EXISTING_CLUSTER=true
github-actions[bot] commented 6 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-6cb5780
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-6cb5780
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-6cb5780

github-actions[bot] commented 6 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-7b108ad
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-7b108ad
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-7b108ad

github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-ef1ea9d
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-ef1ea9d
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-ef1ea9d

github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-ec43e69
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-ec43e69
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-ec43e69

rm3l commented 5 months ago

@gazarenkov Thanks for the review comments. Apart from the added integration test (which I think makes sense as a way to guarantee the behavior and prevent further regression on this), I think it should be good. PTAL and approve if it is okay for you.

github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-bd44f0d
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-bd44f0d
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-bd44f0d

github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.2.0-pr-369-4c8609c
  2. https://quay.io/janus-idp/operator-bundle:0.2.0-pr-369-4c8609c
  3. https://quay.io/janus-idp/operator-catalog:0.2.0-pr-369-4c8609c

github-actions[bot] commented 5 months ago

⚠️ Files changed in bundle generation!

Those changes to the operator bundle manifests should have been pushed automatically to your PR branch.
You might also need to manually update the .rhdh/bundle/manifests/rhdh-operator.csv.yaml CSV file accordingly.

github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.3.0-pr-369-0f194b2
  2. https://quay.io/janus-idp/operator-bundle:0.3.0-pr-369-0f194b2
  3. https://quay.io/janus-idp/operator-catalog:0.3.0-pr-369-0f194b2

rm3l commented 5 months ago

/cherry-pick 1.2.x

But putting on hold until https://github.com/janus-idp/operator/pull/376 is merged, to avoid the change to the CSV.

/hold

openshift-cherrypick-robot commented 5 months ago

@rm3l: once the present PR merges, I will cherry-pick it on top of 1.2.x in a new PR and assign it to you.

In response to [this](https://github.com/janus-idp/operator/pull/369#issuecomment-2146831191): >/cherry-pick 1.2.x > >But putting on hold until https://github.com/janus-idp/operator/pull/376 is merged, to avoid the change to the CSV. > >/hold Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
3 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.0% Duplication on New Code

See analysis details on SonarCloud

rm3l commented 5 months ago

/hold cancel

Rebased onto main, now that https://github.com/janus-idp/operator/pull/376 has been merged.

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gazarenkov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/janus-idp/operator/blob/main/OWNERS)~~ [gazarenkov] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
github-actions[bot] commented 5 months ago

PR images are available:

  1. https://quay.io/janus-idp/operator:0.3.0-pr-369-604b7ed
  2. https://quay.io/janus-idp/operator-bundle:0.3.0-pr-369-604b7ed
  3. https://quay.io/janus-idp/operator-catalog:0.3.0-pr-369-604b7ed

openshift-cherrypick-robot commented 5 months ago

@rm3l: new pull request created: #377

In response to [this](https://github.com/janus-idp/operator/pull/369#issuecomment-2146831191): >/cherry-pick 1.2.x > >But putting on hold until https://github.com/janus-idp/operator/pull/376 is merged, to avoid the change to the CSV. > >/hold Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.