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-13666: Split dbclient.EnsureDBProvisioned() into two functions #742

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

vladbologa
Copy link
Contributor

@vladbologa vladbologa commented Jan 18, 2023

Description

The EnsureDBProvisioned() was doing two things:

  • ensures that the DB was provisioned
  • obtains and returns the data necessary to connect to the DB (host name, etc)

It should be possible to do these things independently of each other, and this PR addresses that.

This will be needed in a follow-up PR, to use non-privileged Postgres users for ACS instances.

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Evaluated and added CHANGELOG.md entry if required
  • 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.

Test manual

Tested locally by verifying that a DB was provisioned, and that the Central was able to connect:
INSTALL_OPERATOR=NO MANAGED_DB_ENABLED=TRUE ./dev/env/scripts/up.sh
./scripts/create-central.sh

To test locally, I have to make the DB publicly accessible. I added a new VPC, security group and DB subnet group in dev on AWS for this purpose.

# 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

@vladbologa vladbologa temporarily deployed to development January 18, 2023 17:59 — with GitHub Actions Inactive
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 18, 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 force-pushed the vbologa/ROX-13666-non-privileged-db-user branch from 1fd746b to 6131638 Compare January 18, 2023 18:46
@vladbologa vladbologa temporarily deployed to development January 18, 2023 18:47 — with GitHub Actions Inactive
@vladbologa vladbologa changed the title Refactor: Split EnsureDBProvisioned into two functions [WIP] ROX-13666: Create non-privileged Postgres users for ACS instances Jan 18, 2023
@vladbologa vladbologa temporarily deployed to development January 18, 2023 19:15 — with GitHub Actions Inactive
@vladbologa vladbologa changed the title [WIP] ROX-13666: Create non-privileged Postgres users for ACS instances ROX-13666: Split dbclient.EnsureDBProvisioned() into two functions Jan 18, 2023
@vladbologa vladbologa marked this pull request as ready for review January 18, 2023 19:40
@vladbologa vladbologa temporarily deployed to development January 18, 2023 19:40 — with GitHub Actions Inactive
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kovayur, SimonBaeumer, 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 [SimonBaeumer,kovayur,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 512c4dc into main Jan 19, 2023
@vladbologa vladbologa deleted the vbologa/ROX-13666-non-privileged-db-user branch January 19, 2023 13:44
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.

3 participants