-
Notifications
You must be signed in to change notification settings - Fork 528
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 (jkube-kit/config) : docker.buildArg.*
properties not taken into account in OpenShift plugins
#2996
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #2996 (2024-04-30T18:20:53Z) ⚙️ JKube E2E Tests (8899552796)
|
@@ -133,7 +134,7 @@ protected static BuildStrategy createBuildStrategy( | |||
.withNamespace(StringUtils.isEmpty(fromNamespace) ? null : fromNamespace) | |||
.endFrom() | |||
.withEnv(checkForEnv(imageConfig)) | |||
.withBuildArgs(Optional.ofNullable(buildConfig.getArgs()).orElse(Collections.emptyMap()).entrySet().stream() | |||
.withBuildArgs(Optional.of(mergeBuildArgs(imageConfig, jKubeServiceHub.getConfiguration())).orElse(Collections.emptyMap()).entrySet().stream() |
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.
as far as I remember, mergeBuildArgs is also taking build args from the local docker config which is not applicable for openshift remote docker build.
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.
You're right. How shall we handle this situation? Maybe add a boolean
parameter in mergeBuildArgs
to check whether to read local docker config or not?
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.
I've added a separate method BuildArgResolverUtil.mergeBuildArgsWithoutLocalDockerConfigProxySettings
for providing build args from ImageConfig, system properties, project properties, and plugin configuration.
Not sure whether it's the best way to do it, I tried moving common sources to a separate method but it seemed a big ugly to me.
c284d14
to
02a912d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2996 +/- ##
=============================================
+ Coverage 59.36% 70.85% +11.49%
- Complexity 4586 5086 +500
=============================================
Files 500 490 -10
Lines 21211 19590 -1621
Branches 2830 2526 -304
=============================================
+ Hits 12591 13881 +1290
+ Misses 7370 4481 -2889
+ Partials 1250 1228 -22 ☔ View full report in Codecov by Sentry. |
02a912d
to
00bf004
Compare
…o account in OpenShift plugins Added call to resolve build args from all sources in OpenShiftBuildServiceUtils so that build args get resolved from all the available sources (compared to just ImageConfig) Signed-off-by: Rohan Kumar <[email protected]>
00bf004
to
acbd181
Compare
Quality Gate passedIssues Measures |
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, thx!
Description
Added call to resolve build args from all sources in OpenShiftBuildServiceUtils so that build args get resolved from all the available sources (compared to just ImageConfig)
Fixes #2904
Type of change
test, version modification, documentation, etc.)
Checklist