HomePhabricator

Simplify Docker instruction compilation

Description

Simplify Docker instruction compilation

Summary:
After adding a number of new instructions, it seemed there was a lot of
redundant implementation between concrete types. This refactor uses just
one concrete unexported type and a few options for determining the
output format instead of one struct type per possible Docker
instruction.

The exported docker.Instruction interface and signature of
docker.NewInstruction is unchanged with this refactor. Unit tests for
Docker instruction compilation were simplified to not make type
assertions but were otherwise left to ensure no regression.

Depends on D984

Test Plan: Run go test ./....

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

Reviewed By: thcipriani, Release-Engineering-Team

Tags: Release-Engineering-Team

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

Details

Provenance
dduvallAuthored on Feb 28 2018, 12:30 AM
Reviewer
Release-Engineering-Team
Differential Revision
D990: Simplify Docker instruction compilation
Parents
rGBLBR47526283fea7: Fix application files/runtime permissions scheme
Branches
Unknown
Tags
Unknown
ChangeId
None