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

defaults, migrations: host-containers default version bumps and migrations #1030

Merged

Conversation

etungsten
Copy link
Contributor

@etungsten etungsten commented Aug 11, 2020

Issue number:
N/A

Description of changes:

Author: Erikson Tung <[email protected]>
Date:   Tue Aug 11 15:40:09 2020 -0700

    defaults: update default versions for host containers
    
    Set default admin container version to v0.5.1
    Set default control container version to v0.4.1
Author: Erikson Tung <[email protected]>
Date:   Tue Aug 11 13:04:30 2020 -0700

    migrations: host-containers default version migrations
    
    Migrates default version for the admin container from v0.5.0 to v0.5.1
    Migrates default version for the control container from v0.4.0 to v0.4.1

Testing done:
Created a local datastore for testing purposes with storewolf.
For the admin container migration:

Initial admin.source.template and admin.source

$ cat ~/thar/testing/ds/current/live/settings/host-containers/admin/source
"328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.0"
$ cat ~/thar/testing/ds/current/live/settings/host-containers/admin/source.template 
"328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0"

Run the admin container forward migration:

     Running `migrate-admin-container-v0-5-1 --source-datastore ~/thar/testing/ds/current --target-datastore ~/thar/testing/ds/next --forward`
Updating template and value of 'settings.host-containers.admin.source' on upgrade
Changing template of 'settings.host-containers.admin.source' from '328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0' to '328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.1'
Changing value of 'settings.host-containers.admin.source' from '328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.0' to '328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.1'
Found no 'settings.host-containers.admin.source' to change on upgrade

See that the admin.source.template and admin.source got updated:

$ cat ~/thar/testing/ds/next/live/settings/host-containers/admin/source
"328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.1"
$ cat ~/thar/testing/ds/next/live/settings/host-containers/admin/source.template "328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.1"

Run the admin container backward migration:

$ VARIANT=aws-k8s-1.17 cargo run -- --source-datastore ~/thar/testing/ds/next --target-datastore ~/thar/testing/ds/next-backward --backward
Updating template and value of 'settings.host-containers.admin.source' on downgrade
Changing template of 'settings.host-containers.admin.source' from '328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.1' to '328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0'
Changing value of 'settings.host-containers.admin.source' from '328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.1' to '328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.0'
Found no 'settings.host-containers.admin.source' to change on downgrade

See that the admin.source.template and admin.source are back to their original values:

$ cat ~/thar/testing/ds/next-backward/live/settings/host-containers/admin/source.template 
"328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0"
$ cat ~/thar/testing/ds/next-backward/live/settings/host-containers/admin/source 
"328549459982.dkr.ecr.us-west-2.amazonaws.com/bottlerocket-admin:v0.5.0"

Same test results for the control container migration.

Will flip from draft mode once bottlerocket-os/bottlerocket-control-container#5 (review) and bottlerocket-os/bottlerocket-admin-container#12 are merged and ready.

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.

@etungsten etungsten requested a review from tjkirch August 11, 2020 22:41
@etungsten etungsten changed the title migrations: host-containers default version migrations defaults, migrations: host-containers default version bumps and migrations Aug 11, 2020
Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

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

nit: "contaienr" typo in the default version migrations commit

Migrates default version for the admin container from v0.5.0 to v0.5.1
Migrates default version for the control container from v0.4.0 to v0.4.1
Set default admin container version to v0.5.1
Set default control container version to v0.4.1
@etungsten
Copy link
Contributor Author

Fixes typo in commit message.

@etungsten etungsten marked this pull request as ready for review August 12, 2020 20:10
@etungsten etungsten merged commit 83a2bcb into bottlerocket-os:develop Aug 12, 2020
@etungsten etungsten deleted the host-container-migrations branch August 12, 2020 20:11
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