Skip to content

Commit

Permalink
Revert "Support resource copy into Fn Docker image via func.yaml (#591)…
Browse files Browse the repository at this point in the history
…" (#597)

This reverts commit bee9a5b.
  • Loading branch information
rikgibson authored Oct 2, 2019
1 parent 788dad2 commit e6b8258
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 94 deletions.
19 changes: 0 additions & 19 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"os/exec"
"os/signal"
"path/filepath"
"strconv"
"strings"
"time"
"unicode"
Expand Down Expand Up @@ -389,15 +388,6 @@ func writeTmpDockerfile(helper langs.LangHelper, dir string, ff *FuncFile) (stri
dfLines = append(dfLines, fmt.Sprintf("FROM %s", ri))
dfLines = append(dfLines, "WORKDIR /function")
dfLines = append(dfLines, helper.DockerfileCopyCmds()...)

resources := ff.CopyResources
for _, resource := range resources {
if Exists(resource.From) {
dfLines = append(dfLines, fmt.Sprintf("COPY %s %s", strconv.Quote(resource.From), strconv.Quote(resource.To)))
} else {
return "", errors.New(fmt.Sprintf("Filepath %s does not exist", resource.From))
}
}
}
if ff.Entrypoint != "" {
dfLines = append(dfLines, fmt.Sprintf("ENTRYPOINT [%s]", stringToSlice(ff.Entrypoint)))
Expand Down Expand Up @@ -452,15 +442,6 @@ func writeTmpDockerfileV20180708(helper langs.LangHelper, dir string, ff *FuncFi
dfLines = append(dfLines, fmt.Sprintf("FROM %s", ri))
dfLines = append(dfLines, "WORKDIR /function")
dfLines = append(dfLines, helper.DockerfileCopyCmds()...)

resources := ff.CopyResources
for _, resource := range resources {
if Exists(resource.From) {
dfLines = append(dfLines, fmt.Sprintf("COPY %s %s", strconv.Quote(resource.From), strconv.Quote(resource.To)))
} else {
return "", errors.New(fmt.Sprintf("Filepath %s does not exist", resource.From))
}
}
}
if ff.Entrypoint != "" {
dfLines = append(dfLines, fmt.Sprintf("ENTRYPOINT [%s]", stringToSlice(ff.Entrypoint)))
Expand Down
10 changes: 0 additions & 10 deletions common/funcfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ type Expects struct {
Config []inputVar `yaml:"config" json:"config"`
}

type copyResources struct {
From string `yaml:"from,omitempty" json:"from,omitempty"`
To string `yaml:"to,omitempty" json:"to,omitempty"`
}

// FuncFile defines the internal structure of a func.yaml/json/yml
type FuncFile struct {
// just for posterity, this won't be set on old files, but we can check that
Expand All @@ -75,9 +70,6 @@ type FuncFile struct {
RunImage string `yaml:"run_image,omitempty" json:"run_image,omitempty"` // Image to use for running
ContentType string `yaml:"content_type,omitempty" json:"content_type,omitempty"`

//Allows resource copy
CopyResources []copyResources `yaml:"copy_resources,omitempty" json:"copy_resources,omitempty"`

// Route params
// TODO embed models.Route
Type string `yaml:"type,omitempty" json:"type,omitempty"`
Expand Down Expand Up @@ -110,8 +102,6 @@ type FuncFileV20180708 struct {
Timeout *int32 `yaml:"timeout,omitempty" json:"timeout,omitempty"`
IDLE_timeout *int32 `yaml:"idle_timeout,omitempty" json:"idle_timeout,omitempty"`

CopyResources []copyResources `yaml:"copy_resources,omitempty" json:"copy_resources,omitempty"`

Config map[string]string `yaml:"config,omitempty" json:"config,omitempty"`
Annotations map[string]interface{} `yaml:"annotations,omitempty" json:"annotations,omitempty"`

Expand Down
65 changes: 0 additions & 65 deletions test/cli_copy_resource_test.go

This file was deleted.

0 comments on commit e6b8258

Please sign in to comment.