Page MenuHomePhabricator

Fix ownership on artifact copies
ClosedPublic

Authored by dduvall on Mar 9 2018, 11:56 PM.
Referenced Files
F37748832: D1002.id.diff
Fri, Sep 22, 3:48 AM
Unknown Object (File)
Tue, Sep 12, 4:21 PM
Unknown Object (File)
Aug 16 2023, 9:27 PM
Unknown Object (File)
Aug 16 2023, 7:06 PM
Unknown Object (File)
Aug 16 2023, 10:43 AM
Unknown Object (File)
Aug 13 2023, 6:16 AM
Unknown Object (File)
Aug 13 2023, 4:14 AM
Unknown Object (File)
May 16 2023, 7:12 PM
Subscribers
None

Details

Reviewers
thcipriani
mmodell
hashar
demon
Group Reviewers
Release-Engineering-Team
Commits
rGBLBR50c5793952a7: Fix ownership on artifact copies
Patch without arc
git checkout -b D1002 && curl -L https://phabricator.wikimedia.org/D1002?download=true | git apply
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.

Diff Detail

Repository
rGBLBR Blubber
Branch
fix/artifacts-ownership
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2862
Build 4775: arc lint + arc unit

Event Timeline

dduvall edited the summary of this revision. (Show Details)

Refactored build.CopyAs to use a generic Instruction anonymouse field instread of separate fields for Copy and CopyFrom usage.

Works. Refactor makes building a CopyAs cleaner than having 2 embedded structs.

This revision is now accepted and ready to land.Mar 22 2018, 5:50 PM
This revision was automatically updated to reflect the committed changes.