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

migrate from databaseUsername to databaseAccount and fully use MariaDBAccount #426

Conversation

zzzeek
Copy link
Contributor

@zzzeek zzzeek commented Jan 29, 2024

This moves glance to fully use MariaDBAccount based on the dev work being done for mariadb-operator:

Lead Jira: OSPRH-4095

  1. controller calls EnsureMariaDBAccount up front to make sure MariaDBAccount is present
  2. error code from EnsureMariaDBAccount is handled, Conditions are amended when error is returned
  3. controller calls NewDatabaseForAccount instead of NewDatabase
  4. GetAccountAndSecret is used to retrieve account /secret to populate template
  5. GetDatabaseByName() , normally used for delete finalizers, replaced with GetDatabaseByNameAndAccount
  6. CreateOrPatchAll() used to patch the Database, replacing CreateOrPatchDB / CreateOrPatchDBByName
  7. controller calls DeleteUnusedMariaDBAccountFinalizers when launched pods are definitely running on a new MariaDBAccount, returns error code if present
  8. PasswordSelectors that refer to database are removed
  9. all databaseUser replaced with databaseAccount inside of all XYZ_types.go
  10. all databaseUser replaced with databaseAccount inside of all kuttl/*.yaml
  11. all default databaseUser names become databaseAccount, replacing underscores with dashes inside of all XYZ_types.go
  12. all default databaseUser names become databaseAccount, replacing underscores with dashes inside of all kuttl/*.yaml
  13. MariaDBAccountSuiteTests are used in controller ginkgo tests if it has them
  14. Use configsecrets for database URLs; remove from job hash - was already like this
  15. 184 is merged and replaces from go.mod are removed

@zzzeek zzzeek marked this pull request as draft January 29, 2024 20:59
@openshift-ci openshift-ci bot requested review from lewisdenny and viroel January 29, 2024 21:00
@zzzeek zzzeek requested review from gibizer and SeanMooney January 29, 2024 21:00
go.mod Outdated Show resolved Hide resolved
Copy link
Contributor

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

Looks good to me

go.mod Outdated Show resolved Hide resolved
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch 2 times, most recently from 5a47593 to 54ea98b Compare February 5, 2024 20:40
@zzzeek zzzeek marked this pull request as ready for review February 5, 2024 20:40
@openshift-ci openshift-ci bot requested a review from olliewalsh February 5, 2024 20:41
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch 2 times, most recently from ad33ccb to d0326ff Compare February 5, 2024 22:51
config/samples/glance_v1beta1_glanceapi.yaml Outdated Show resolved Hide resolved
controllers/glance_controller.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@zzzeek
Copy link
Contributor Author

zzzeek commented Feb 6, 2024

/retest

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch 2 times, most recently from 57997de to 8b93abb Compare February 6, 2024 17:18
@zzzeek
Copy link
Contributor Author

zzzeek commented Feb 6, 2024

so to get a build to pass:

a. we aren't allowed to have replace directives in go.mod, which means
.... deleted stuff ...

update: add "//allow-merging" after each replace that will be skipped by the linter

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from 8b93abb to fcd44f7 Compare February 6, 2024 19:31
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from 388efab to afabfa2 Compare February 19, 2024 19:44
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from afabfa2 to 509c5b3 Compare February 19, 2024 20:49
zzzeek added a commit to zzzeek/openstack-operator that referenced this pull request Feb 19, 2024
This provides a link to install the mariadb image built
against the version in
openstack-k8s-operators/mariadb-operator#184.

This adds rotatable username/password flow to the mariadb operator
with associated client functions to be called in each downstream
operator.

follows steps at:

openstack-k8s-operators/glance-operator#426 (comment)
ctx, h, instance.Spec.DatabaseAccount,
instance.Namespace, false,
)

if err != nil {
return err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can add status here

@zzzeek
Copy link
Contributor Author

zzzeek commented Feb 22, 2024

/retest

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from 652fa59 to a2e8bb5 Compare February 27, 2024 04:19
zzzeek added a commit to zzzeek/openstack-operator that referenced this pull request Mar 4, 2024
This provides a link to install the mariadb image built
against the version in
openstack-k8s-operators/mariadb-operator#184.

This adds rotatable username/password flow to the mariadb operator
with associated client functions to be called in each downstream
operator.

follows steps at:

openstack-k8s-operators/glance-operator#426 (comment)
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from a2e8bb5 to 178eaa0 Compare March 5, 2024 21:08
@zzzeek zzzeek requested a review from fmount March 5, 2024 21:33
@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 5, 2024

this is all set assuming tests fully pass

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from 178eaa0 to 7011a4c Compare March 5, 2024 22:27
@openshift-ci openshift-ci bot added the lgtm label Mar 6, 2024
Copy link
Contributor

openshift-ci bot commented Mar 6, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmount, zzzeek

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 label Mar 6, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 6b5d600 into openstack-k8s-operators:main Mar 6, 2024
7 checks passed
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.

5 participants