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

atlasmigration: store migrations.tar.gz in k8s' secrets #175

Merged
merged 8 commits into from
Apr 25, 2024
Merged

Conversation

giautm
Copy link
Member

@giautm giautm commented Apr 19, 2024

No description provided.

@giautm giautm changed the title atlasmigration: store migration.tar in k8s' secrets atlasmigration: store migrations.tar in k8s' secrets Apr 19, 2024
Copy link
Member

@rotemtam rotemtam left a comment

Choose a reason for hiding this comment

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

Shouldn't we delete the previous version of the secret?

Also should secrets be deleted when the migration resource is deleted ?

@giautm
Copy link
Member Author

giautm commented Apr 19, 2024

Also should secrets be deleted when the migration resource is deleted ?

Absolute yes.

Shouldn't we delete the previous version of the secret?

I'm not sure when we need to delete the old version, because if we keep only single version, we only need to delete it when the migration resource was deleted.

If we store more than one version, we may delete the old one when a new deployment was success. But, what if the latest deployment is a migrate down - (with Aborted status?!) ? Or chain of migrate downs?

@giautm giautm force-pushed the g/migrate-dir branch 3 times, most recently from 27f0df7 to a594be7 Compare April 24, 2024 06:14
@giautm giautm changed the title atlasmigration: store migrations.tar in k8s' secrets atlasmigration: store migrations.tar.gz in k8s' secrets Apr 24, 2024
@giautm giautm marked this pull request as ready for review April 24, 2024 16:54
@giautm giautm requested review from rotemtam, a8m, datdao and masseelch April 24, 2024 16:55
@giautm giautm force-pushed the g/migrate-dir branch 4 times, most recently from f30ddf4 to 0a5b2f1 Compare April 24, 2024 18:07
@rotemtam
Copy link
Member

Chain of down migrations is an interesting use case.
If you store that migration dir at the version, after the migrate down is done, I think that it will be OK.

E.g:
User deploys v3 - dir(1,2,3) is stored
The user asks to go down to v2
Down migration applied - dir(1,2) is stored
The user asks to go down to v1
Down migration applied dir(1) is stored.

Re: failed down migration, or aborted down migration, you never replace the stored state, since the state is still the version before you rolled back.

Sounds OK ?

@giautm
Copy link
Member Author

giautm commented Apr 25, 2024

failed down migration, or aborted down migration, you never replace the stored state, since the state is still the version before you rolled back.

This need to be check/update to expected in the PR #167; for now, we just save the dir-state after successful reconcile, whatever flow it did.

@giautm giautm requested a review from rotemtam April 25, 2024 03:45
Co-authored-by: Dat. Ba Dao <datdao@ariga.io>
@giautm giautm requested a review from datdao April 25, 2024 04:15
@giautm giautm force-pushed the g/migrate-dir branch 2 times, most recently from f65b12e to aa19cea Compare April 25, 2024 09:14
@giautm giautm merged commit 74c7bca into master Apr 25, 2024
5 checks passed
@giautm giautm deleted the g/migrate-dir branch April 25, 2024 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants