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 support for update repositories in China #2285

Merged
merged 2 commits into from
Jul 26, 2022

Conversation

jpculp
Copy link
Member

@jpculp jpculp commented Jul 18, 2022

Description of changes:

This adds helpers that settings generators can use to set the updates.metadata-base-url and updates.targets-base-url values to regionalized repositories. For now, this only includes China regions cn-north-1 and cn-northwest-1, while current regions will continue to use the public updates repository, updates.bottlerocket.aws.

Testing done:

Built and launched Bottlerocket and verified the expected updates settings in:

  • us-west-2
  • cn-north-1
  • vmware (thanks, @mchaker!)

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.

@jpculp
Copy link
Member Author

jpculp commented Jul 25, 2022

Added updates.targets-base-url migration.

@jpculp
Copy link
Member Author

jpculp commented Jul 25, 2022

Rebased.

@jpculp jpculp marked this pull request as ready for review July 25, 2022 18:27
@jpculp
Copy link
Member Author

jpculp commented Jul 25, 2022

Added symlinks for k8s-1.23 variants.

@jpculp
Copy link
Member Author

jpculp commented Jul 25, 2022

  • Moved the trailing / out of metadata-prefix and added it to the template instead.
  • Built and launched an aws-k8s-1.23 variant in us-west-2 to verify there isn't a space or something in the rendered setting.

sources/api/schnauzer/src/helpers.rs Outdated Show resolved Hide resolved
Comment on lines 1385 to 1388
match partition {
"aws-cn" => format!("https://{}.s3.{}.amazonaws.com.cn/latest", bucket, region),
_ => format!("https://{}.s3.{}.amazonaws.com/latest", bucket, region),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Per discussion, we should try to use the dual stack endpoints here for forward compatibility with IPv6-only subnets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Rather than just specifying the bucket, I appended .s3.dualstack to the strings directly (and verified it still works for cn-north-1 and cn-northwest-1). In the event that we add a region that does not support dual stack endpoints we can just do <bucket_id>.s3. We could get fancier with the map, but I wanted to keep things simple.

AWS variants now generate the `settings.updates.targets-base-url`
setting based on region.
@jpculp
Copy link
Member Author

jpculp commented Jul 26, 2022

Tweaked the code a bit to support virtual hosted-style dual-stack s3 endpoints for forward compatibility with IPv6-only subnets.

@jpculp jpculp requested a review from bcressey July 26, 2022 03:12
@jpculp jpculp merged commit 4110513 into bottlerocket-os:develop Jul 26, 2022
@jpculp jpculp deleted the regional-tuf-support branch July 26, 2022 20:52
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