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

schnauzer: add v1->v2 template guide, resolve migration bugs #3488

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

cbgbt
Copy link
Contributor

@cbgbt cbgbt commented Sep 25, 2023

Issue number:

#3133

Description of changes:
As part of moving to the new template system, this adds a guide to help folks rewrite templates to be schnauzer v2 compatible.

This also resolves two bugs in the migrations:

  • The container versions in the migrations were incorrect and not fixed during the last rebase
  • One of the generator lines was missing an = character when specifying helpers.

Testing done:

  • Tested the fixed migrations on aws-k8s-1.28

After the migration, I ran $ apiclient raw -u '/metadata/setting-generators' | jq:

{
  "settings.kubernetes.pod-infra-container-image": "schnauzer-v2 render --requires 'aws@v1' --requires 'kubernetes@v1(helpers=[pause-prefix])' --template '{{ pause-prefix settings.aws.region }}/eks/pause:3.1-eksbuild.1'",
  "settings.host-containers.admin.source": "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.0'",
  "settings.host-containers.control.source": "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.4'",
  "settings.updates.metadata-base-url": "schnauzer-v2 render --requires 'aws@v1' --requires 'updates@v1(helpers=[metadata-prefix, tuf-prefix])' --template '{{ tuf-prefix settings.aws.region }}{{ metadata-prefix settings.aws.region }}/2020-07-07/{{ os.variant_id }}/{{ os.arch }}/'",
  "settings.updates.targets-base-url": "schnauzer-v2 render --requires 'aws@v1' --requires 'updates@v1(helpers=[tuf-prefix])' --template '{{ tuf-prefix settings.aws.region }}/targets/'",
}

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.

Comment on lines +54 to +59
The setting generator allows the user to specify any template requirements via the CLI, rather
than requiring frontmatter, e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "rather than requiring frontmatter" something that should also be mentioned where frontmatter is introduced above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I'll add this in a separate commit.

@cbgbt cbgbt marked this pull request as ready for review September 25, 2023 21:55
# The rest of the template now goes after the `+++` frontmatter delimiter.
```

NOTE: `schnauzer-v2` was merged into Bottlerocket prior to the complete introduciton of settings
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
NOTE: `schnauzer-v2` was merged into Bottlerocket prior to the complete introduciton of settings
NOTE: `schnauzer-v2` was merged into Bottlerocket prior to the complete introduction of settings

The container versions in the previously merged migrations were not
updated on rebase. Additionally, one of the migrations was missing a '='
character in the helper specification.
@cbgbt
Copy link
Contributor Author

cbgbt commented Sep 27, 2023

Fix typo pointed out by @bcressey

@cbgbt cbgbt merged commit 71438e4 into bottlerocket-os:develop Sep 27, 2023
48 checks passed
@cbgbt cbgbt deleted the migration-guide branch September 27, 2023 20:55
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