Skip to content

Commit

Permalink
Use SkipOutput instead of -1 for output indexes to clarify semantics.
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Longo <[email protected]>
  • Loading branch information
benlongo committed Dec 17, 2022
1 parent 6b004d3 commit 97a45ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/llb/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
inputIndex = pb.Empty
}

outputIndex := pb.OutputIndex(-1)
outputIndex := pb.SkipOutput
if !m.noOutput && !m.readonly && m.cacheID == "" && !m.tmpfs {
outputIndex = pb.OutputIndex(outIndex)
outIndex++
Expand Down
2 changes: 1 addition & 1 deletion client/llb/fileop.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
pop.Inputs = state.inputs

for i, st := range state.actions {
output := pb.OutputIndex(-1)
output := pb.SkipOutput
if i+1 == len(state.actions) {
output = 0
}
Expand Down

0 comments on commit 97a45ef

Please sign in to comment.