NO-ISSUE-fix-broken-build: Fix broken build due to base image change.
The image registry.access.redhat.com/ubi9/go-toolset:1.20 does not default to the root user as registry.ci.openshift.org/openshift/release:golang-1.20 used to This results in a permissions issue when attempting to run go mod download
By setting the user directive prior to this operation, this PR resolves that issue
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 59.90%. Comparing base (
cda0ded) to head (1194e6d). Report is 1 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #761 +/- ##
==========================================
- Coverage 59.95% 59.90% -0.06%
==========================================
Files 74 74
Lines 3731 3731
==========================================
- Hits 2237 2235 -2
- Misses 1334 1335 +1
- Partials 160 161 +1
/lgtm
/approve
/hold
where is this failing?
/hold
where is this failing?
When you try to build the agent image, using
skipper make build-image
You will encounter an error message
go: updating go.sum: open /go/src/github.com/openshift/assisted-installer-agent/go.sum: permission denied
Further investigation shows that when running under the new base image, the user name is default when it used to be root in the old image, the default user does not have permission to access /go/src/github.com/openshift/assisted-installer-agent/go.sum
If you add the line
USER 0
The user is changed to root where it is able to access /go/src/github.com/openshift/assisted-installer-agent/go.sum
Note that this permission change only affects the build container and not the final agent image as this is a multi stage docker build, so from a security perspective, this change does not introduce concerns, especially since the build container is discarded after production of the final image.
For the records we discuss this and it happens also outside skipper, due to misalignment of permissions.
/lgtm /approve
/unhold
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: danmanor, paul-maidment, rccrdpccl
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [danmanor,paul-maidment,rccrdpccl]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
why not just use root in the base image as done initially ? @rccrdpccl @paul-maidment
why not just use root in the base image as done initially ? @rccrdpccl @paul-maidment The base image is meant to be used differently, using the home folder instead of pre-go mod style of folder for the module being compiled. I think it would be easier to understand to use it that way and there is no real need to use root user.
That said, in this specific case it's not a real disadvantage using root.
/retest
/hold Let's make sure we agree on the solution before unholding I'm ok with both but I think the current one (using the home directory) is better.
/retest
flake
/retest
@paul-maidment: all tests passed!
Full PR test history. Your PR dashboard.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
/lgtm
@paul-maidment: This pull request references MGMT-18837 which is a valid jira issue.
Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set.
In response to this:
The image registry.access.redhat.com/ubi9/go-toolset:1.20 does not default to the root user as registry.ci.openshift.org/openshift/release:golang-1.20 used to This results in a permissions issue when attempting to run
go mod downloadBy setting the user directive prior to this operation, this PR resolves that issue
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.
/unhold
[ART PR BUILD NOTIFIER]
Distgit: ose-agent-installer-node-agent This PR has been included in build ose-agent-installer-node-agent-container-v4.18.0-202409051243.p0.g06360b0.assembly.stream.el9. All builds following this will include this PR.