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

containerd: share duplicate configs #1538

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

tjkirch
Copy link
Contributor

@tjkirch tjkirch commented Apr 29, 2021

Issue number:

Fixes #1511 (comment)

Description of changes:

containerd: share duplicate configs
    
Rather than naming the config file after the variant, use a more generic name,
and have each variant pick which generic config applies.  We only have two
different configs, so this immediately saves some duplication.
Add migration for containerd config template

Testing done:

For each of aws-k8s-1.19, aws-ecs-1, and aws-dev:

  • Build and start a 1.0.8 image without these changes
  • Confirm the original filenames in /usr/share/templates and that /etc/containerd/config.toml is correct
  • Upgrade to 1.1.0 with these changes and migration
  • Confirm the new (fewer) filenames in /usr/share/templates and that /etc/containerd/config.toml is still correct
  • Confirm basic health of system (running pods/tasks/containers, API, services, etc.)
  • Downgrade to 1.0.8, confirm old files again
  • Confirm health again

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.

@tjkirch tjkirch requested review from bcressey and zmrow April 29, 2021 05:03
const SETTING: &'static str = "configuration-files.containerd-config-toml.template-path";

lazy_static! {
static ref TEMPLATE_CHANGES: &'static [(&'static str, &'static str)] = &[
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be a candidate for a plural version of our ReplaceStringMigration. I guess we haven't needed that yet because we haven't changed settings that differ across variants. We could also wait until we need it once more and then use this as a template for making a common migration.

Rather than naming the config file after the variant, use a more generic name,
and have each variant pick which generic config applies.  We only have two
different configs, so this immediately saves some duplication.
@tjkirch
Copy link
Contributor Author

tjkirch commented Apr 29, 2021

^ rebase on develop to fix conflicts.

@tjkirch tjkirch requested a review from etungsten April 29, 2021 18:17
@tjkirch tjkirch merged commit 2587bda into bottlerocket-os:develop Apr 30, 2021
@tjkirch tjkirch deleted the refactor-ctrd-configs branch April 30, 2021 17:12
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