Skip to content

Conversation

marmijo
Copy link
Member

@marmijo marmijo commented Oct 3, 2025

The current logic always considers the aws-winli buildmeta key when present, which causes WinLI AMIs to be replicated in both the standard AWS and GovCloud cases.

Restore aws_run_ore_replicate [1] to only work on the 'amis' buildmeta key and switch to aws-winli when --winli is used. This ensures WinLI replication happens only when explicitly requested. Also update the CLI help text for --winli to clarify that it applies to replication as well as creation.

[1]: a5bfbde

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly modifies the AWS replication logic to only replicate Windows License Included (WinLI) AMIs when the --winli flag is specified, which resolves an issue where they were always replicated if present. The logic is now cleaner and correctly tied to the command-line flag. The update to the CLI help text is also a good clarification. I've added a few minor suggestions to improve code conciseness.

Comment on lines 35 to 38
meta_key = "amis"
# only replicate WinLI AMIs if `--winli` is used
if args.winli:
meta_key = "aws-winli"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better conciseness, you can use a conditional expression to assign meta_key. The comment on line 36 can then be moved to this new line as an inline comment.

Suggested change
meta_key = "amis"
# only replicate WinLI AMIs if `--winli` is used
if args.winli:
meta_key = "aws-winli"
meta_key = "aws-winli" if args.winli else "amis"

Copy link
Member

Choose a reason for hiding this comment

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

seems reasonable

Copy link
Member Author

Choose a reason for hiding this comment

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

changed!

dustymabe
dustymabe previously approved these changes Oct 6, 2025
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

The current logic always considers the `aws-winli` buildmeta key when
present, which causes WinLI AMIs to be replicated in both the standard
AWS and GovCloud cases.

Restore `aws_run_ore_replicate`[1] to only work on the 'amis' buildmeta
key and switch to aws-winli when `--winli` is used. This ensures WinLI
replication happens only when explicitly requested. Also update the
CLI help text for `--winli` to clarify that it applies to replication
as well as creation.

[1]: coreos@a5bfbde
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@dustymabe dustymabe enabled auto-merge (rebase) October 6, 2025 16:31
@dustymabe dustymabe merged commit 4f2e2b8 into coreos:main Oct 6, 2025
6 checks passed
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.

2 participants