Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Recreate Backstage Pod on changes of ConfigMaps/Secrets configured in CR #351

Merged
merged 17 commits into from
May 21, 2024

Conversation

gazarenkov
Copy link
Member

Description

This pull-request added following functionality:

  • Adds label and annotation to ConfigMaps/Secrets configured in Backstage CR.
  • By default rhdh.redhat.com/ext-config-sync=true which allow controller watch ConfigMaps/Secrets
  • Enqueuing function calculates hash of the data, compares it with saved in the deployment's pod template annotation and calls reconcile in case they do not match (configuration changed)
  • Since Pod template is changed k8s restarting it and reconciliation function saves new hash for the next cycle.

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

#236

PR acceptance criteria

  • Tests
  • Documentation TBD, scratched in the issue comments

How to test changes / Special notes to the reviewer

  • Create Backstage CR with configuration
  • Create ConfigMap(s)/Secret(s) referenced in CR
  • Check if Operator added label rhdh.redhat.com/ext-config-sync=true and annotation rhdh.redhat.com/backstage-name=
  • Make sure Backstage instance is running
  • Change anything in the data field of CMs/Secrets
  • Make sure Backstage started recreating the Pod
  • Make sure files/env vars with new content mounted to backstage container

@openshift-ci openshift-ci bot requested review from nickboldt and rm3l May 2, 2024 09:15
@gazarenkov gazarenkov requested review from kadel and removed request for nickboldt May 2, 2024 09:16
Copy link
Contributor

github-actions bot commented May 2, 2024

⚠️ 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.

controllers/backstage_controller.go Outdated Show resolved Hide resolved
controllers/backstage_controller.go Outdated Show resolved Hide resolved
pkg/model/runtime_test.go Outdated Show resolved Hide resolved
pkg/model/runtime_test.go Outdated Show resolved Hide resolved
pkg/model/runtime_test.go Outdated Show resolved Hide resolved
pkg/model/externalconfig.go Show resolved Hide resolved
integration_tests/suite_test.go Outdated Show resolved Hide resolved
integration_tests/suite_test.go Outdated Show resolved Hide resolved
Signed-off-by: gazarenkov <[email protected]>
Signed-off-by: gazarenkov <[email protected]>
Signed-off-by: gazarenkov <[email protected]>
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Small comment about the permissions in the RHDH CSV..

.rhdh/bundle/manifests/rhdh-operator.csv.yaml Outdated Show resolved Hide resolved
controllers/preprocessor_test.go Outdated Show resolved Hide resolved
@rm3l rm3l mentioned this pull request May 21, 2024
2 tasks
Copy link
Contributor

⚠️ 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.

1 similar comment
Copy link

sonarcloud bot commented May 21, 2024

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@gazarenkov gazarenkov requested a review from rm3l May 21, 2024 11:32
@openshift-ci openshift-ci bot added the lgtm PR is ready to be merged. Required by Prow. label May 21, 2024
Copy link

openshift-ci bot commented May 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved PR has been approved by an approver from all required OWNERS files. Required by Prow. label May 21, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 806c5af into janus-idp:main May 21, 2024
8 checks passed
@gazarenkov gazarenkov deleted the refresh_config branch June 6, 2024 09:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved PR has been approved by an approver from all required OWNERS files. Required by Prow. lgtm PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants