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

Updated git-clone task #2469

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

matejvasek
Copy link
Contributor

@matejvasek matejvasek commented Aug 27, 2024

Changes

  • Updated git fetch task to newer version that is now rootless.

This changes are also already included in the "Go s2i on cluster build" PR.

Copy link

knative-prow bot commented Aug 27, 2024

@matejvasek: The label(s) kind/<kind> cannot be applied, because the repository doesn't have them.

In response to this:

Changes

/kind

Fixes #

Release Note


Docs


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.

@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 27, 2024
Copy link

knative-prow bot commented Aug 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

knative-prow bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2024
@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 27, 2024
Copy link

codecov bot commented Aug 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.64%. Comparing base (8f7dd2c) to head (20bd907).

❗ There is a different number of reports uploaded between BASE (8f7dd2c) and HEAD (20bd907). Click for more details.

HEAD has 6 uploads less than BASE
Flag BASE (8f7dd2c) HEAD (20bd907)
unit-tests-macos-latest 1 0
unit-tests-ubuntu-latest 1 0
unit-tests-windows-latest 1 0
e2e-test 1 0
integration-tests 1 0
e2e-test-oncluster 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2469       +/-   ##
===========================================
- Coverage   61.19%   50.64%   -10.56%     
===========================================
  Files         130      128        -2     
  Lines       15354    11933     -3421     
===========================================
- Hits         9396     6043     -3353     
- Misses       5032     5183      +151     
+ Partials      926      707      -219     
Flag Coverage Δ
e2e-test ?
e2e-test-oncluster ?
integration-tests ?
unit-tests-macos-latest ?
unit-tests-ubuntu-latest ?
unit-tests-windows-latest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 27, 2024
@matejvasek matejvasek force-pushed the matejvasek-updated-git-clone-task branch from 825d5ca to 2242f30 Compare August 27, 2024 16:16
@matejvasek matejvasek force-pushed the matejvasek-updated-git-clone-task branch from ded4ed3 to 20bd907 Compare August 27, 2024 20:11
@matejvasek matejvasek requested review from matzew, lkingland and gauron99 and removed request for rhuss August 27, 2024 20:12
@matejvasek matejvasek marked this pull request as ready for review August 27, 2024 20:20
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 27, 2024
@knative-prow knative-prow bot requested review from dsimansk and rhuss August 27, 2024 20:20
@matejvasek
Copy link
Contributor Author

PTAL @lkingland @matzew @gauron99

@matejvasek matejvasek removed the request for review from rhuss August 27, 2024 20:21
@matejvasek
Copy link
Contributor Author

/hold

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 27, 2024
@@ -66,7 +66,7 @@ spec:
default: "1001"
- name: GROUP_ID
description: The group ID of the builder image user.
default: "0"
default: "65532"
Copy link
Member

@lkingland lkingland Aug 28, 2024

Choose a reason for hiding this comment

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

What happens if this setting were just removed? This default group ID, and runAsGroup below, and the fsGroup setting? Is it possible that explicitly setting these to 0 is what caused the problem in the first place?

Copy link
Contributor Author

@matejvasek matejvasek Aug 28, 2024

Choose a reason for hiding this comment

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

The primary problem is that that uid is changed, not gid. This causes that git-fetch task on second run cannot clean up the volume. I fixed it by setting gid to match gid of git-fetch task (and also fsGroup) and by setting write access to said group on line 111.

TBH I have no idea why the gid here was set to 0 here. Zbynek implemented it that way long ago.
IMO the gid should be 1000 to match buildpack builder, but it works also with 65532.

I suspect I could just s/65532/1000/g on this PR and it still would work. But I am not sure.

Copy link
Contributor Author

@matejvasek matejvasek Aug 28, 2024

Choose a reason for hiding this comment

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

This whole ceremony here can be ignored on OCP. OCP automatically sets fsGroup and also adds write perms for the group.
Actually on OCP you must not set podTemplate.securityContext, otherwise there will be error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary problem is that that uid is changed, not gid.

This and the fact that set gid works oddly or not at all.

@matejvasek
Copy link
Contributor Author

matejvasek commented Aug 28, 2024

@lkingland we may also opt not to do this update and keep rootfull git-clone. We just will have to also make func-utils image rootfull to. See #2471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants