Skip to content

COPY --chown: expand the conformance test#3095

Merged
openshift-merge-robot merged 2 commits intocontainers:masterfrom
nalind:user-spec
Mar 23, 2021
Merged

COPY --chown: expand the conformance test#3095
openshift-merge-robot merged 2 commits intocontainers:masterfrom
nalind:user-spec

Conversation

@nalind
Copy link
Copy Markdown
Member

@nalind nalind commented Mar 22, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

Expand conformance test coverage for COPY --chown, and correct our behavior when the argument is a single number: instead of assuming the number is the UID and the GID = 0, the GID should be the same as the UID.

How to verify it

New conformance test!

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Grew out of the conformance tests for openshift/imagebuilder#188.

Does this PR introduce a user-facing change?

When `COPY --chown` specifies an owner that's just a single number (e.g. "12"), the UID on copied content is set to the specified value, and the GID was previously set to 0.  This changes the GID to be set to the same value as the UID.

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. approved labels Mar 22, 2021
@nalind nalind force-pushed the user-spec branch 3 times, most recently from 9dfb6ab to bec92c7 Compare March 22, 2021 18:02
Copy link
Copy Markdown
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci-robot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, nalind

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

The pull request process is described 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

Use a bufio Scanner rather than our own cobbled-together
read-a-line-at-a-time function.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Expand conformance test coverage for COPY --chown, and correct our
behavior when the argument is a single number: instead of assuming the
number is the UID and GID = 0, the GID should be the same as the UID.

This means that we can't quite use the same function for parsing the
arguments for COPY --chown and USER, as they evidently have different
defaults for the case where the argument is a single number.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@TomSweeneyRedHat
Copy link
Copy Markdown
Member

LGTM

@TomSweeneyRedHat
Copy link
Copy Markdown
Member

/lgtm

@openshift-merge-robot openshift-merge-robot merged commit 70a27a7 into containers:master Mar 23, 2021
@nalind nalind deleted the user-spec branch March 23, 2021 18:14
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved kind/bug Categorizes issue or PR as related to a bug. lgtm locked - please file new issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants