HomePhabricator

Fix ownership on artifact copies

Description

Fix ownership on artifact copies

Summary:
The implementation of D984 did not include enforcing ownership for
build.CopyFrom instruction and so artifacts copied from one image to
another via copies: were problematically owned as root.

In order to fix this behavior:

  1. config.ArtifactConfig build.CopyFrom instructions are now injected duration build.PhaseInstall
  2. config.VariantConfig calls build.ApplyUser for these artifact instructions as well using the runs.as user
  3. build.CopyAs was refactored to wrap any build.Instruction which should only really be used with build.Copy or build.CopyFrom.

Test Plan:
Run go test ./.... Run blubber against configuration with a variant that
uses copies and verify that the COPY --from instructions also include a
--chown flag.

Reviewers: thcipriani, mmodell, hashar, Release-Engineering-Team, demon

Reviewed By: thcipriani, Release-Engineering-Team

Tags: Release-Engineering-Team

Differential Revision: https://phabricator.wikimedia.org/D1002

Details

Provenance
dduvallAuthored on Mar 9 2018, 11:46 PM
Reviewer
Release-Engineering-Team
Differential Revision
D1002: Fix ownership on artifact copies
Parents
rGBLBReb9b69dd3d71: Allow for configuration policies
Branches
Unknown
Tags
Unknown
ChangeId
None