Skip to content

ADD|COPY option --keep-ownership #4001

Closed
Dexus wants to merge 2 commits intocontainers:mainfrom
Dexus-Forks:copy-keep-ownership
Closed

ADD|COPY option --keep-ownership #4001
Dexus wants to merge 2 commits intocontainers:mainfrom
Dexus-Forks:copy-keep-ownership

Conversation

@Dexus
Copy link
Copy Markdown

@Dexus Dexus commented May 17, 2022

This is the follow-up PR that includes the initial PR from #3767 and is now fulfilled with additional changes, PRs (openshift/imagebuilder/pull/227) and tests.

Please follow the initial conversations in #3767.

What are the the intention for the PR:

ADD or COPY

  • without --chown and --keep-ownership result in root:root for the files.
  • with --chown 123:456 result in 123:456 for the files.
  • with --keep-ownership result in UID:GID for the files, same as the origin source.

Closes #3767

⚠️ Notice:

go.mod needs to add a replace for github.com/openshift/imagebuilder as long openshift/imagebuilder/pull/227 is unmerged

go mod edit -replace github.com/openshift/imagebuilder=github.com/Dexus-Forks/imagebuilder

@Dexus Dexus force-pushed the copy-keep-ownership branch 3 times, most recently from abebc1b to 4e161be Compare May 17, 2022 17:37
@Dexus
Copy link
Copy Markdown
Author

Dexus commented May 17, 2022

/assign @flouthoc
/assign @rhatdan

@Dexus
Copy link
Copy Markdown
Author

Dexus commented May 17, 2022

/assign @lsm5

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 17, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Dexus
To complete the pull request process, please ask for approval from flouthoc after the PR has been reviewed.

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

Details 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

Copy link
Copy Markdown
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Thanks for your PR! One showstopper in the tests, one strong encouragement to rework another.

Comment thread tests/bud.bats Outdated
Comment thread tests/bud.bats Outdated
Comment thread imagebuildah/stage_executor.go Outdated
Comment thread imagebuildah/stage_executor.go Outdated
@flouthoc
Copy link
Copy Markdown
Collaborator

@Dexus Commit title for dc90aed5127822f6b210bf2ed0e2742e98a5e797 is too long could you move PR link in commit title to description please and also please sign the commits in-order to make DCO check happy.

@Dexus
Copy link
Copy Markdown
Author

Dexus commented May 18, 2022

@Dexus Commit title for dc90aed5127822f6b210bf2ed0e2742e98a5e797 is too long could you move PR link in commit title to description please and also please sign the commits in-order to make DCO check happy.

I'm not abel to make DOC happy because the first commit is not from me, I took the first commit from the linked initial PR, from Ruben Jenster r.jenster@drachenfels.de, I'm not sure how can I fix this. Never used the Signed-off-by feature before.

The too long title for the one commit, will I change once I'm back on Place.

@Dexus Dexus force-pushed the copy-keep-ownership branch 2 times, most recently from d060a16 to 99607c2 Compare May 18, 2022 08:08
@Dexus Dexus requested a review from edsantiago May 18, 2022 08:11
@Dexus Dexus force-pushed the copy-keep-ownership branch 3 times, most recently from 6231a0c to 29828b3 Compare May 18, 2022 14:10
@Dexus
Copy link
Copy Markdown
Author

Dexus commented May 18, 2022

So now all tests are green! 🥳
So, what happens next?

@Dexus Dexus requested a review from flouthoc May 18, 2022 15:26
@Dexus Dexus force-pushed the copy-keep-ownership branch from 29828b3 to f990ef0 Compare May 18, 2022 16:50
Dexus and others added 2 commits May 18, 2022 18:54
This exposes the already existing KeepOwnership flag to the
copy and add CLI commands.

Co-authored-by: Ruben Jenster <r.jenster@drachenfels.de>
Signed-off-by: Josef Fröhle <github@josef-froehle.de>
allow to keep the owner uid/gid off added/copied local files

Signed-off-by: Josef Fröhle <github@josef-froehle.de>
@Dexus Dexus force-pushed the copy-keep-ownership branch from f990ef0 to ed44bea Compare May 18, 2022 16:54
@Dexus Dexus marked this pull request as draft May 18, 2022 16:55
@Dexus Dexus marked this pull request as ready for review May 18, 2022 16:56
@Dexus
Copy link
Copy Markdown
Author

Dexus commented May 18, 2022

fresh rebased

@flouthoc
Copy link
Copy Markdown
Collaborator

flouthoc commented May 19, 2022

So now all tests are green! partying_face So, what happens next?

Now we have to wait for this first: openshift/imagebuilder#227 once imagebuilder PR is merged you can rebase this PR and point to upstream imagebuilder.

Comment thread go.mod

replace github.com/opencontainers/image-spec => github.com/opencontainers/image-spec v1.0.2-0.20211123152302-43a7dee1ec31

replace github.com/openshift/imagebuilder => github.com/Dexus-Forks/imagebuilder v1.2.4-0.20220518131701-b5c6586df000
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We'll need to fix this up once the imagebuilder merges and before we merge this PR.

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

One nit request. If you could rename the test Dockerfile* files to Containerfile*, that would be appreciated.

FROM busybox AS basis
RUN echo hello > /newfile && chown 123:456 /newfile
FROM basis
COPY --keep-ownership --from=basis /newfile /newfile_123_456
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The --keep-ownership option is redundant when there's a --from, so I don't know that we need this test.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

you are right

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2022
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 10, 2022

@Dexus: PR needs rebase.

Details

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/test-infra repository.

@github-actions
Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

@flouthoc
Copy link
Copy Markdown
Collaborator

Correct me if i am wrong i think this is on hold because of moby/buildkit#2875 since dockerclient does not implements this yet and imagebuilder would end up with no-op for docker implementation.

@github-actions github-actions Bot removed the stale-pr label Oct 15, 2022
@github-actions
Copy link
Copy Markdown

A friendly reminder that this PR had no activity for 30 days.

@Dexus Dexus closed this Nov 16, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked - please file new issue/PR needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. stale-pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants