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 #246

Conversation

zzzeek
Copy link
Contributor

@zzzeek zzzeek commented Mar 7, 2024

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. 184 is merged and replaces from go.mod are removed

Copy link
Contributor

openshift-ci bot commented Mar 7, 2024

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

@zzzeek zzzeek changed the title migrate from databaseUsername to databaseAccount and fully use MariaD… migrate from databaseUsername to databaseAccount and fully use MariaDBAccount Mar 7, 2024
@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 7, 2024

/ok-to-test

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from e8e01c5 to fea9ea1 Compare March 7, 2024 20:31
@zzzeek zzzeek marked this pull request as ready for review March 7, 2024 20:31
@openshift-ci openshift-ci bot requested review from dprince and viroel March 7, 2024 20:31
@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from fea9ea1 to b7ec9fc Compare March 7, 2024 22:45
@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 8, 2024

kuttl is failing because there's too many replicas of ManilaAPI

            manilaAPI:
        +    containerImage: quay.io/podified-antelope-centos9/openstack-manila-api@sha256:8d29a3af3df2b158d4da5bd45be823e769085247102618723c6f7d71987ef7dd
             customServiceConfig: |
               [DEFAULT]
               enabled_share_protocols = cephfs
             override: {}
        -    replicas: 1
        +    replicas: 3
             resources: {} 

3? is this possibly a cleanup issue in the kuttl suite? cc @fmount

@fmount
Copy link
Collaborator

fmount commented Mar 8, 2024

kuttl is failing because there's too many replicas of ManilaAPI

            manilaAPI:
        +    containerImage: quay.io/podified-antelope-centos9/openstack-manila-api@sha256:8d29a3af3df2b158d4da5bd45be823e769085247102618723c6f7d71987ef7dd
             customServiceConfig: |
               [DEFAULT]
               enabled_share_protocols = cephfs
             override: {}
        -    replicas: 1
        +    replicas: 3
             resources: {} 

3? is this possibly a cleanup issue in the kuttl suite? cc @fmount

Hi @zzzeek ,
I think replicas are still 3 (after the first assert the API are scaled out) because the scale down (via patch) is not executed.
This happened because the assert seems to not have the databaseUser.

case.go:366: resource ManilaAPI:manila-kuttl-tests/manila-api: .spec.databaseUser: key is missing from map,
    case.go:366: resource ManilaAPI:manila-kuttl-tests/manila-api: .spec.databaseUser: key is missing from map
   logger.go:42: 23:21:21 | manila-basic | skipping kubernetes event logging
=== CONT  kuttl/harness/manila-tls

// templateParameters := make(map[string]interface{})
templateParameters := map[string]interface{}{
"ServiceUser": instance.Spec.ServiceUser,
"ServicePassword": string(ospSecret.Data[instance.Spec.PasswordSelectors.Service]),
"KeystonePublicURL": keystonePublicURL,
"KeystoneInternalURL": keystoneInternalURL,
"TransportURL": string(transportURLSecret.Data["transport_url"]),
// FIXME(zzzeek) / (mschuppert) - we have added my.cnf to customData
// above. Why is it not being consumed here via read_default_file=/etc/my.cnf?
// this is required for SSL database connections to work
Copy link
Contributor

Choose a reason for hiding this comment

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

I missed it. I can fix that in a follow up

Copy link
Contributor

Choose a reason for hiding this comment

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

@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 8, 2024

3? is this possibly a cleanup issue in the kuttl suite? cc @fmount

Hi @zzzeek , I think replicas are still 3 (after the first assert the API are scaled out) because the scale down (via patch) is not executed. This happened because the assert seems to not have the databaseUser.

oh nice catch, I thought I got all those. a bunch more, thanks!

Copy link

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/openstack-k8s-operators/manila-operator for 246,c2aae1a32696abd2b2bd48bfb3e356bb902034f7

@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 8, 2024

/retest

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/5ca86ddb0d174b678901a149e992c4ab

openstack-k8s-operators-content-provider RETRY_LIMIT in 31m 06s
⚠️ manila-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

@zzzeek zzzeek force-pushed the integrate_oo_accounts branch from 046f1aa to fa678a6 Compare March 8, 2024 14:56
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://review.rdoproject.org/zuul/buildset/7bd478864a6044cc99363f7bfc570324

openstack-k8s-operators-content-provider TIMED_OUT in 30m 56s
⚠️ manila-operator-kuttl SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider (non-voting)

@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 8, 2024

recheck

@zzzeek
Copy link
Contributor Author

zzzeek commented Mar 8, 2024

Ok this is ready

Copy link
Collaborator

@fmount fmount left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented Mar 9, 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 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit bcf4e9f into openstack-k8s-operators:main Mar 9, 2024
9 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.

4 participants