Skip to content

Commit

Permalink
Stabilize dockerfile heredoc support
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc committed Feb 10, 2022
1 parent 9fb13f7 commit e3fd4a6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 31 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ run:

build-tags:
- dfrunsecurity
- dfheredoc

linters:
enable:
Expand Down
3 changes: 0 additions & 3 deletions frontend/dockerfile/dockerfile_heredoc_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build dfheredoc
// +build dfheredoc

package dockerfile

import (
Expand Down
3 changes: 0 additions & 3 deletions frontend/dockerfile/instructions/parse_heredoc_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build dfheredoc
// +build dfheredoc

package instructions

import (
Expand Down
13 changes: 11 additions & 2 deletions frontend/dockerfile/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,17 @@ var validDirectives = map[string]struct{}{
}

var (
heredocDirectives map[string]bool // directives allowed to contain heredocs
heredocCompoundDirectives map[string]bool // directives allowed to contain directives containing heredocs
// Directives allowed to contain heredocs
heredocDirectives = map[string]bool{
command.Add: true,
command.Copy: true,
command.Run: true,
}

// Directives allowed to contain directives containing heredocs
heredocCompoundDirectives = map[string]bool{
command.Onbuild: true,
}
)

// directive is the structure used during a build run to hold the state of
Expand Down
18 changes: 0 additions & 18 deletions frontend/dockerfile/parser/parser_heredoc.go

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/dockerfile/parser/parser_heredoc_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build dfheredoc
// +build dfheredoc

package parser

import (
Expand Down
2 changes: 1 addition & 1 deletion frontend/dockerfile/release/labs/tags
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dfrunsecurity dfheredoc
dfrunsecurity

0 comments on commit e3fd4a6

Please sign in to comment.