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

migrations: migration to add 'version-lock' & 'ignore-waves' settings #959

Merged

Conversation

etungsten
Copy link
Contributor

Issue number:
N/A

Description of changes:

Author: Erikson Tung <etung@amazon.com>
Date:   Mon Jun 29 12:01:27 2020 -0700

    migrations: migration to add 'version-lock' & 'ignore-waves' settings
    
    Adds a migration for adding two new update settings: 'version-lock' and
    'ignore-waves'

Testing done:
Basically the same testing done in #958

The source datastore has the following content for update settings:

$ ls -al ds/current/live/settings/updates
total 32
drwxr-xr-x 2 etung domain^users 4096 Jun 25 14:05 .
drwxr-xr-x 6 etung domain^users 4096 Jun 25 14:05 ..
-rw-r--r-- 1 etung domain^users    5 Jun 25 14:05 ignore-waves
-rw-r--r-- 1 etung domain^users   46 Jun 25 14:01 metadata-base-url.setting-generator
-rw-r--r-- 1 etung domain^users   80 Jun 25 14:01 metadata-base-url.template
-rw-r--r-- 1 etung domain^users   11 Jun 25 14:01 seed.setting-generator
-rw-r--r-- 1 etung domain^users   43 Jun 25 14:05 targets-base-url
-rw-r--r-- 1 etung domain^users    8 Jun 25 14:05 version-lock

Forward migration:

     Running `add-version-lock-ignore-waves --source-datastore ~/thar/testing/ds/current --target-datastore ~/thar/testing/ds/next --forward`
AddSettingsMigration(["settings.updates.version-lock", "settings.updates.version-lock"]) has no work to do on upgrade.

Observed that the temporary datastore created matches the source datastore, which is expected.

Backwards migration:

     Running `add-version-lock-ignore-waves --source-datastore ~/thar/testing/ds/current --target-datastore ~/thar/testing/ds/next --backward`
Removed settings.updates.version-lock, which was set to '"latest"'
Removed settings.updates.ignore-waves, which was set to 'false'

Observed that the temporary datastore no longer has the version-lock and ignore-waves settings.

$ ls -al ds/next/live/settings/updates
total 24
drwxr-xr-x 2 etung domain^users 4096 Jun 29 11:50 .
drwxr-xr-x 6 etung domain^users 4096 Jun 29 11:50 ..
-rw-r--r-- 1 etung domain^users   46 Jun 29 11:50 metadata-base-url.setting-generator
-rw-r--r-- 1 etung domain^users   80 Jun 29 11:50 metadata-base-url.template
-rw-r--r-- 1 etung domain^users   11 Jun 29 11:50 seed.setting-generator
-rw-r--r-- 1 etung domain^users   43 Jun 29 11:50 targets-base-url

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Adds a migration for adding two new update settings: 'version-lock' and
'ignore-waves'
Copy link
Contributor

@webern webern left a comment

Choose a reason for hiding this comment

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

Should we add migrations to Release.toml when they are created, or later?

@etungsten
Copy link
Contributor Author

Should we add migrations to Release.toml when they are created, or later?

Later. When we cut the next release, the migration would then need to be added to Release.toml.

@etungsten etungsten added this to the v0.5.0 milestone Jun 29, 2020
@etungsten etungsten merged commit f1a645c into bottlerocket-os:develop Jun 30, 2020
@etungsten etungsten deleted the update-settings-migration branch June 30, 2020 19:19
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.

3 participants