Skip to content

Commit e6b8258

Browse files
authored
Revert "Support resource copy into Fn Docker image via func.yaml (#591)" (#597)
This reverts commit bee9a5b.
1 parent 788dad2 commit e6b8258

File tree

3 files changed

+0
-94
lines changed

3 files changed

+0
-94
lines changed

common/common.go

-19
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"os/exec"
1616
"os/signal"
1717
"path/filepath"
18-
"strconv"
1918
"strings"
2019
"time"
2120
"unicode"
@@ -389,15 +388,6 @@ func writeTmpDockerfile(helper langs.LangHelper, dir string, ff *FuncFile) (stri
389388
dfLines = append(dfLines, fmt.Sprintf("FROM %s", ri))
390389
dfLines = append(dfLines, "WORKDIR /function")
391390
dfLines = append(dfLines, helper.DockerfileCopyCmds()...)
392-
393-
resources := ff.CopyResources
394-
for _, resource := range resources {
395-
if Exists(resource.From) {
396-
dfLines = append(dfLines, fmt.Sprintf("COPY %s %s", strconv.Quote(resource.From), strconv.Quote(resource.To)))
397-
} else {
398-
return "", errors.New(fmt.Sprintf("Filepath %s does not exist", resource.From))
399-
}
400-
}
401391
}
402392
if ff.Entrypoint != "" {
403393
dfLines = append(dfLines, fmt.Sprintf("ENTRYPOINT [%s]", stringToSlice(ff.Entrypoint)))
@@ -452,15 +442,6 @@ func writeTmpDockerfileV20180708(helper langs.LangHelper, dir string, ff *FuncFi
452442
dfLines = append(dfLines, fmt.Sprintf("FROM %s", ri))
453443
dfLines = append(dfLines, "WORKDIR /function")
454444
dfLines = append(dfLines, helper.DockerfileCopyCmds()...)
455-
456-
resources := ff.CopyResources
457-
for _, resource := range resources {
458-
if Exists(resource.From) {
459-
dfLines = append(dfLines, fmt.Sprintf("COPY %s %s", strconv.Quote(resource.From), strconv.Quote(resource.To)))
460-
} else {
461-
return "", errors.New(fmt.Sprintf("Filepath %s does not exist", resource.From))
462-
}
463-
}
464445
}
465446
if ff.Entrypoint != "" {
466447
dfLines = append(dfLines, fmt.Sprintf("ENTRYPOINT [%s]", stringToSlice(ff.Entrypoint)))

common/funcfile.go

-10
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ type Expects struct {
5252
Config []inputVar `yaml:"config" json:"config"`
5353
}
5454

55-
type copyResources struct {
56-
From string `yaml:"from,omitempty" json:"from,omitempty"`
57-
To string `yaml:"to,omitempty" json:"to,omitempty"`
58-
}
59-
6055
// FuncFile defines the internal structure of a func.yaml/json/yml
6156
type FuncFile struct {
6257
// just for posterity, this won't be set on old files, but we can check that
@@ -75,9 +70,6 @@ type FuncFile struct {
7570
RunImage string `yaml:"run_image,omitempty" json:"run_image,omitempty"` // Image to use for running
7671
ContentType string `yaml:"content_type,omitempty" json:"content_type,omitempty"`
7772

78-
//Allows resource copy
79-
CopyResources []copyResources `yaml:"copy_resources,omitempty" json:"copy_resources,omitempty"`
80-
8173
// Route params
8274
// TODO embed models.Route
8375
Type string `yaml:"type,omitempty" json:"type,omitempty"`
@@ -110,8 +102,6 @@ type FuncFileV20180708 struct {
110102
Timeout *int32 `yaml:"timeout,omitempty" json:"timeout,omitempty"`
111103
IDLE_timeout *int32 `yaml:"idle_timeout,omitempty" json:"idle_timeout,omitempty"`
112104

113-
CopyResources []copyResources `yaml:"copy_resources,omitempty" json:"copy_resources,omitempty"`
114-
115105
Config map[string]string `yaml:"config,omitempty" json:"config,omitempty"`
116106
Annotations map[string]interface{} `yaml:"annotations,omitempty" json:"annotations,omitempty"`
117107

test/cli_copy_resource_test.go

-65
This file was deleted.

0 commit comments

Comments
 (0)