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

add controller to create and delete individual usernames in mariadb / galera #166

Merged

Conversation

zzzeek
Copy link
Contributor

@zzzeek zzzeek commented Oct 30, 2023

this is a "create /drop account" controller that is separate from the main "create/drop database" controller, for the purpose of producing rotating username/passwords. The background for the change is based on discussions surrounding https://issues.redhat.com/browse/OSPRH-92 where internal control plane services such as Galera , Rabbit, Redis etc. would provide interfaces to add /remove arbitrary usernames, where a "password rotation" would involve adding a new username/password and having services switch there, retiring the old account once all finalizers have been removed.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 30, 2023

Hi @zzzeek. Thanks for your PR.

I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor Author

@zzzeek zzzeek left a comment

Choose a reason for hiding this comment

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

we should add a sample file that includes a MariaDBAccount and a Secret

api/v1beta1/mariadbaccount_types.go Outdated Show resolved Hide resolved
@zzzeek zzzeek marked this pull request as ready for review November 13, 2023 19:19
@openshift-ci openshift-ci bot requested review from dprince and stuggi November 13, 2023 19:20
@zzzeek
Copy link
Contributor Author

zzzeek commented Nov 13, 2023

not sure if I should keep this in draft, the folks I wanted to see it first were @dciabrin , @SeanMooney and @gibizer

@SeanMooney
Copy link
Contributor

/ok-to-test

controllers/galera_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
api/v1beta1/mariadbaccount_types.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
@zzzeek
Copy link
Contributor Author

zzzeek commented Nov 21, 2023

/retest

@zzzeek
Copy link
Contributor Author

zzzeek commented Nov 21, 2023

/retest hold-the-node

Copy link
Contributor

openshift-ci bot commented Nov 21, 2023

@zzzeek: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test images
  • /test mariadb-operator-build-deploy-kuttl
  • /test precommit-check
  • /test unit

The following commands are available to trigger optional jobs:

  • /test mariadb-operator-build-deploy

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openstack-k8s-operators-mariadb-operator-main-images
  • pull-ci-openstack-k8s-operators-mariadb-operator-main-mariadb-operator-build-deploy-kuttl
  • pull-ci-openstack-k8s-operators-mariadb-operator-main-precommit-check
  • pull-ci-openstack-k8s-operators-mariadb-operator-main-unit

In response to this:

/retest hold-the-node

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zzzeek
Copy link
Contributor Author

zzzeek commented Nov 21, 2023

/test mariadb-operator-build-deploy-kuttl

hold-the-node

@zzzeek
Copy link
Contributor Author

zzzeek commented Nov 21, 2023

/test mariadb-operator-build-deploy-kuttl

main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@SeanMooney SeanMooney left a comment

Choose a reason for hiding this comment

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

im conflicted on how to procedd with reviewing this.

we are not meant to use sqash merges in any of the repos which means you should not be breaking out the commits the way you are.

each commit should be indepently correct and when you need to make fixes you should interactivly rebase the fixes into the approate commits.

so I'm not sure there is value in doing an review of the implementation until that is done

i can take a look at the design side i guess but can you try cleaning this set of commits up in the 3-5 that it probably should be.

i would start with having the first commit introduce the API type/CRD
then the controller and samples
followed by kuttle tests and then ideally envtest
i realise that the mariadb-operator currently does not have envtest coverage which is why that should be last and likely in a sepeata pr since it will require some infra to be set up in the repo first

api/v1beta1/mariadbaccount_types.go Outdated Show resolved Hide resolved
api/v1beta1/mariadbaccount_types.go Outdated Show resolved Hide resolved
@zzzeek zzzeek marked this pull request as draft November 22, 2023 17:09
@zzzeek zzzeek force-pushed the add_mdb_account branch 2 times, most recently from 670f352 to 4471b1e Compare November 22, 2023 17:22
@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 6, 2023

/retest

@dprince
Copy link
Contributor

dprince commented Dec 13, 2023

I will let @dciabrin merge it but I think it looks good what you have here

@dprince
Copy link
Contributor

dprince commented Dec 13, 2023

@zzzeek one thing I noticed locally with this. Can you run 'make bundle' and commit the modifications to config/manifests/bases/mariadb-operator.clusterserviceversion.yaml as part of this PR?

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 13, 2023

@zzzeek one thing I noticed locally with this. Can you run 'make bundle' and commit the modifications to config/manifests/bases/mariadb-operator.clusterserviceversion.yaml as part of this PR?

OK will do that now, hopefully it makes it all the way through

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 13, 2023

ok thats up now, just added an entry to a yaml file

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 13, 2023

OK so I also have to add this API to the PROJECT file, is that generated from something ?

edit: nm, operator-sdk did it

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 13, 2023

operator-sdk did it already

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.

This looks good I'm OK to land this and do my remaining comments in a follow up.

controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
controllers/mariadbaccount_controller.go Outdated Show resolved Hide resolved
@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 14, 2023

This looks good I'm OK to land this and do my remaining comments in a follow up.

OK it should just be ensuring the secret is immutable change subsequent to this

@gibizer
Copy link
Contributor

gibizer commented Dec 14, 2023

/lgtm
Thanks for the quick respin!

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 14, 2023

/retest

@zzzeek
Copy link
Contributor Author

zzzeek commented Dec 14, 2023

/lgtm

Copy link
Contributor

openshift-ci bot commented Dec 14, 2023

@zzzeek: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@zzzeek zzzeek requested review from frenzyfriday and removed request for frenzyfriday December 14, 2023 21:38
@dciabrin
Copy link
Contributor

/lgtm

@dciabrin
Copy link
Contributor

/approved

@dciabrin
Copy link
Contributor

/approve

Copy link
Contributor

openshift-ci bot commented Dec 14, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dciabrin, 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-merge-bot openshift-merge-bot bot merged commit 4cd7b3f into openstack-k8s-operators:main Dec 14, 2023
6 checks passed
@zzzeek zzzeek deleted the add_mdb_account branch January 25, 2024 20:29
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.

7 participants