Skip to content

Commit 6e1ff0b

Browse files
committed
cli/command/image/build: deprecate WriteTempDockerfile util
It was only used internal in the package. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent c52fa07 commit 6e1ff0b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cli/command/image/build/context.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,16 @@ func detectArchiveReader(input io.ReadCloser) (rc io.ReadCloser, ok bool, err er
130130
// WriteTempDockerfile writes a Dockerfile stream to a temporary file with a
131131
// name specified by defaultDockerfileName and returns the path to the
132132
// temporary directory containing the Dockerfile.
133+
//
134+
// Deprecated: this utility was only used internally, and will be removed in the next release.
133135
func WriteTempDockerfile(rc io.ReadCloser) (dockerfileDir string, err error) {
136+
return writeTempDockerfile(rc)
137+
}
138+
139+
// writeTempDockerfile writes a Dockerfile stream to a temporary file with a
140+
// name specified by defaultDockerfileName and returns the path to the
141+
// temporary directory containing the Dockerfile.
142+
func writeTempDockerfile(rc io.ReadCloser) (dockerfileDir string, err error) {
134143
// err is a named return value, due to the defer call below.
135144
dockerfileDir, err = os.MkdirTemp("", "docker-build-tempdockerfile-")
136145
if err != nil {
@@ -175,7 +184,7 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC
175184
return nil, "", errors.New("ambiguous Dockerfile source: both stdin and flag correspond to Dockerfiles")
176185
}
177186

178-
dockerfileDir, err := WriteTempDockerfile(rc)
187+
dockerfileDir, err := writeTempDockerfile(rc)
179188
if err != nil {
180189
return nil, "", err
181190
}

0 commit comments

Comments
 (0)