Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROX-18427: read central DB ID override from optional ConfigMap #1198

Merged
merged 5 commits into from
Sep 12, 2023

Conversation

vladbologa
Copy link
Contributor

@vladbologa vladbologa commented Aug 11, 2023

Description

Currently the name of a Central DB is fixed and based on the Central's ID. E.g. for the ID cjmugfm9rusboqitae5g the DB cluster must be called rhacs-cjmugfm9rusboqitae5g-db-cluster.

This PR gives the possibility to override the default naming scheme. For example, if the above DB is restored from backup into rhacs-examplebackup-db-cluster, then fleetshard-sync can be instructed to use the alternate name in the following way:
kubectl create configmap central-db-override --namespace=rhacs-cjmugfm9rusboqitae5g --from-literal=databaseID=examplebackup

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • Add secret to app-interface Vault or Secrets Manager if necessary
  • RDS changes were e2e tested manually
  • Check AWS limits are reasonable for changes provisioning new resources

Test manual

Tested E2E locally by creating a ConfigMap as described above and confirming that Central can connect to an overridden DB.

# To run tests locally run:
make db/teardown db/setup db/migrate
make ocm/setup OCM_OFFLINE_TOKEN=<ocm-offline-token> OCM_ENV=development
make verify lint binary test test/integration

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 11, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@vladbologa vladbologa temporarily deployed to development August 11, 2023 13:31 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development August 11, 2023 13:31 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development August 11, 2023 13:31 — with GitHub Actions Inactive
@vladbologa vladbologa force-pushed the vbologa/ROX-18427-database-id-override branch from dbc7fc2 to f320661 Compare September 1, 2023 12:38
@vladbologa vladbologa temporarily deployed to development September 1, 2023 12:38 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 1, 2023 12:38 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 1, 2023 12:38 — with GitHub Actions Inactive
@vladbologa vladbologa force-pushed the vbologa/ROX-18427-database-id-override branch from f320661 to d94244a Compare September 11, 2023 09:47
@vladbologa vladbologa temporarily deployed to development September 11, 2023 09:47 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 09:47 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 09:47 — with GitHub Actions Inactive
@vladbologa vladbologa force-pushed the vbologa/ROX-18427-database-id-override branch from d94244a to cf41e21 Compare September 11, 2023 19:26
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:26 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:26 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:26 — with GitHub Actions Inactive
@vladbologa vladbologa marked this pull request as ready for review September 11, 2023 19:27
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:27 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:27 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 11, 2023 19:27 — with GitHub Actions Inactive
@vladbologa vladbologa force-pushed the vbologa/ROX-18427-database-id-override branch from cf41e21 to fa417c2 Compare September 12, 2023 09:53
@vladbologa vladbologa temporarily deployed to development September 12, 2023 09:53 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 09:53 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 09:53 — with GitHub Actions Inactive
Copy link
Contributor

@johannes94 johannes94 left a comment

Choose a reason for hiding this comment

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

I think the override approach is more safe than relying on tags, so i'm fine with that. Just a minor thing about the comment.

At some point we probably want to integrate the DB ID override to the GitOps configuration. Could be worth creating a ticket for that.

@vladbologa vladbologa temporarily deployed to development September 12, 2023 13:05 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 13:05 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 13:05 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot removed the lgtm label Sep 12, 2023
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:32 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:32 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:32 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:42 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:42 — with GitHub Actions Inactive
@vladbologa vladbologa temporarily deployed to development September 12, 2023 14:42 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot added the lgtm label Sep 12, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johannes94, vladbologa

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 [johannes94,vladbologa]

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

@vladbologa vladbologa merged commit ce96b7e into main Sep 12, 2023
5 checks passed
@vladbologa vladbologa deleted the vbologa/ROX-18427-database-id-override branch September 12, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants