-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Trim container-image configuration values #19958
Conversation
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 185c130
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: extensions/container-image/deployment
! Skipped: docs extensions/container-image/container-image-docker/deployment extensions/container-image/container-image-jib/deployment and 12 more 📦 extensions/container-image/deployment✖
⚙️ JVM Tests - JDK 11 Windows #- Failing: extensions/container-image/deployment
! Skipped: docs extensions/container-image/container-image-docker/deployment extensions/container-image/container-image-jib/deployment and 12 more 📦 extensions/container-image/deployment✖
⚙️ JVM Tests - JDK 16 #- Failing: extensions/container-image/deployment
! Skipped: docs extensions/container-image/container-image-docker/deployment extensions/container-image/container-image-jib/deployment and 12 more 📦 extensions/container-image/deployment✖
|
Failures are related. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -102,6 +106,9 @@ | |||
if (group.isPresent()) { | |||
String originalGroup = group.get(); | |||
if (originalGroup.equals(System.getProperty("user.name"))) { | |||
if (originalGroup.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. So the converter makes the string always present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be the case... cc @radcortez
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is, that's definitely not what I expected. I would have expected the Optional to stay empty if no string is defined. Let's wait for @radcortez 's opinion on this :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is that the Converter must return null
if there is no value. From the Config rules, an empty String ""
is automatically converted to null
, but in the case of this TrimmedStringConverter
the conversion is the empty String again, which is then passed to the Optional, so you get a non empty Optional.
The TrimmedStringConverter
must return a null
if the resulting String is an empty String. Now we may need to recheck other usages of this converter to make sure we don't break it.
These values must be trimmed or else the container-image build fails.
Fixes: #19956