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

Create the Watcher database schema #29

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

amoralej
Copy link
Contributor

@amoralej amoralej commented Dec 18, 2024

This PR is implementing the database schema population using watcher-db-manage upgrade . To do it it emplements two features:

  • Creates the RBAC elements (serviceaccount, role and rolebinding)
  • Creates a DBSync job with the required minimal configuration and execute the command.

This PR also adds all functional and kuttl tests for both.

Related: OSPRH-11422

@amoralej
Copy link
Contributor Author

I will rebase on top of #27 and #25

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://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/f1e9d0c1e7064ed19c588186f7f2ef0c

✔️ noop SUCCESS in 0s
✔️ openstack-meta-content-provider SUCCESS in 1h 44m 03s
✔️ watcher-operator-validation SUCCESS in 1h 28m 59s
watcher-operator-kuttl FAILURE in 49m 46s

@amoralej amoralej force-pushed the dbsync branch 2 times, most recently from 0f71676 to 6b20bc4 Compare December 19, 2024 11:58
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/watcher-operator for 29,6b20bc4984e9c470d8c8093d6148bff609749172

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://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3bd641c8f255441ea7a304571759680e

✔️ noop SUCCESS in 0s
✔️ openstack-meta-content-provider SUCCESS in 1h 51m 11s
✔️ watcher-operator-validation SUCCESS in 1h 27m 52s
watcher-operator-kuttl FAILURE in 39m 58s

@amoralej
Copy link
Contributor Author

/test functional

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://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3c93a45c0fc1482599ac151597bf76e5

✔️ noop SUCCESS in 0s
✔️ openstack-meta-content-provider SUCCESS in 1h 36m 48s
✔️ watcher-operator-validation SUCCESS in 1h 26m 22s
watcher-operator-kuttl FAILURE in 42m 12s

This patch creates ServiceAccount, Role and Rolebinding for the Watcher
service.
This patch is adding a test to check RBAC elements created by Watcher
controller and modifying existing ones to include new conditions.
Copy link
Contributor

@cescgina cescgina 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

@raukadah raukadah left a comment

Choose a reason for hiding this comment

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

Overall Looks good.

/approve

templates/watcher/config/00-default.conf Outdated Show resolved Hide resolved
---
# Check for Container Image environment variables
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
commands:
- script: |
set -euxo pipefail
# If we are running the container locally, skip this test
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for fixing it.

Copy link

openshift-ci bot commented Dec 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: raukadah

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

This commit is implementing db schema creation (dbsync) via Job
following the same pattern as other operators.

It introduces some spec and status changes required and initial
configuration with only the required configuration required to run the
dbsync (just the database connection and transport which will be
required later to pass it to the subCRs).

This patch is also adding a new functional scenario test to test the
Watcher controller when using non-default values.

Finally, this patch is also skipping two new error types in the
crd-schema-checker as it complains about perserveJobs for being a
boolean type and Hash to be a map. However we want to keep them with
those types for consistency with the rest of operators.
It checks the dbsync job is properly executed and conditions and hash
created.

And apply some fixes to be able to run kuttl tests easily when running
the operator locally instead of in a container.
@cescgina
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 20, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 20ecc51 into openstack-k8s-operators:main Dec 20, 2024
6 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