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

control-service: add enabled flag of deployments to the database #421

Merged
merged 4 commits into from
Oct 20, 2021

Conversation

tpalashki
Copy link
Contributor

Currently, the enabled status of data job deployments is inferred from
their respective cronjob in Kubernetes. This has multiple implications,
including the fact that when we need to know whether a deployment
is enabled, we need to query the Kubernetes API. It is also strange
to not have the complete state of the data jobs in the database and
instead rely for this on Kubernetes.

This commit is a small step towards moving the deployment state entirely
in the database by adding the enabled status of deployments (currently
in the data_job table, but subsequently in a separate table dedicated
to deployments).

Testing done: Manually tested the change by first starting the service
with the new Flyway script and observing that the new column is added
to the data_job table. Validated that the existing jobs have true as
a value of the newly added column. Then, created, and deployed a new job.
Finally disabled, enabled, and deleted the deployment and verified
that the enabled value changed accordingly.

Also, extended the unit tests to verify that the enabled flag is
persisted when it should.

Signed-off-by: Tsvetomir Palashki [email protected]

Currently, the enabled status of data job deployments is inferred from
their respective cronjob in Kubernetes. This has multiple implications,
including the fact that when we need to know whether a deployment
is enabled, we need to query the Kubernetes API. It is also strange
to not have the complete state of the data jobs in the database and
instead rely for this on Kubernetes.

This commit is a small step towards moving the deployment state entirely
in the database by adding the enabled status of deployments (currently
in the data_job table, but subsequently in a separate table dedicated
to deployments).

Testing done: Manually tested the change by first starting the service
with the new Flyway script and observing that the new column is added
to the data_job table. Validated that the existing jobs have true as
a value of the newly added column. Then, created, and deployed a new job.
Finally disabled, enabled, and deleted the deployment and verified
that the enabled value changed accordingly.

Also, extended the unit tests to verify that the enabled flag is
persisted when it should.

Signed-off-by: Tsvetomir Palashki <[email protected]>
@tpalashki tpalashki force-pushed the person/tpalashki/control-service branch from e93da4f to eb4325a Compare October 20, 2021 07:16
@mivanov1988
Copy link
Collaborator

Please add unit test for JobsRepository.updateDataJobEnabledByName().

@tpalashki tpalashki enabled auto-merge (squash) October 20, 2021 07:40
@tpalashki tpalashki merged commit 4810b59 into main Oct 20, 2021
@tpalashki tpalashki deleted the person/tpalashki/control-service branch October 20, 2021 08:24
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