Skip to content

Conversation

@JAVGan
Copy link
Contributor

@JAVGan JAVGan commented Jan 21, 2026

This commit changes the get_image_by_tags and introduce a new optional argument named required_tags, which when present will ensure the tags params must contain all of the required ones before searching for the AMI.

The goal here is to prevent the use of get_image_by_tags without important tags, causing the resulting image to be duplicated.

Then, it changes the publish method to ensure the snapshot_tags is always present when searching for image via tags, since we only consider the snapshot fully imported when this tag is added (see line 638):

add_tags("snapshot_tags", extra_kwargs)

Without requiring the snapshot_tags to be present we may fall in a situation where the snapshot was not properly created and a bad result is returned, mainly leading to duplication of the AMIs for different image types.

Refers to SPSTRAT-615

This commit changes the `get_image_by_tags` and introduce a new optional
argument named `required_tags`, which when present will ensure the
`tags` params must contain all of the required ones before searching for
the AMI.

The goal here is to prevent the use of `get_image_by_tags` without
important tags, causing the resulting image to be duplicated.

Then, it changes the `publish` method to ensure the `snapshot_tags` is
always present when searching for image via tags, since we only consider
the snapshot fully imported when this tag is added (see line 638):

```
add_tags("snapshot_tags", extra_kwargs)
```

Without requiring the `snapshot_tags` to be present we may fall in a
situation where the snapshot was not properly created and a bad result
is returned, mainly leading to duplication of the AMIs for different
image types.

Refers to SPSTRAT-615

Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
@JAVGan JAVGan force-pushed the fix_import_snapshot_issue branch from 8413c6f to 59fa787 Compare January 21, 2026 18:40
@JAVGan
Copy link
Contributor Author

JAVGan commented Jan 21, 2026

@lslebodn @rbikar PTAL

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.88%. Comparing base (57e906f) to head (59fa787).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #43      +/-   ##
==========================================
- Coverage   97.44%   96.88%   -0.57%     
==========================================
  Files           3        3              
  Lines         586      609      +23     
==========================================
+ Hits          571      590      +19     
- Misses         15       19       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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