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

fix: error when base image doesn't support target platforms #3707

Merged
merged 2 commits into from Jul 18, 2022

Conversation

gsquared94
Copy link
Contributor

@gsquared94 gsquared94 commented Jul 7, 2022

Fixes #3563: Converts warnings to exceptions.

@elefeint
Copy link
Contributor

elefeint commented Jul 8, 2022

Thank you; we'll review next week.

Copy link
Contributor

@mpeddada1 mpeddada1 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix @gsquared94! The macos failure is related to some kokoro changes we recently made. Rebasing with main should help address this.

Copy link
Contributor

@mpeddada1 mpeddada1 left a comment

Choose a reason for hiding this comment

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

Almost there! I had one minor comment remaining. Could we also rebase this PR with main (or "master")? It will pick up the recent kokoro macos changes which should help make the check green.

Comment on lines 73 to 74
public void testCheckManifestPlatform_noWarningIfDefaultAmd64Linux()
throws PlatformNotFoundInBaseImageException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops sorry I missed this earlier. This test no longer performs an assertion so just invoking the method in the test may not give us many insights into what is expected from the method's behavior. How about we replace this test with the following?: testCheckManifestPlatform_arm64Linux where the architecture doesn't match but the os matches. This will help us test the && in the following condition: !(platform.getArchitecture().equals("amd64") && platform.getOs().equals("linux"))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just invoking the method in the test may not give us many insights into what is expected from the method's behavior

On the contrary I think that the passing test implies the expectation that it should not throw any exception. Also this yaqs answer recommends that.

@sonarcloud
Copy link

sonarcloud bot commented Jul 18, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@mpeddada1
Copy link
Contributor

LGTM! Thanks again @gsquared94!

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.

multiplatform build should fail when base image not available for a specified platform
4 participants