зеркало из https://github.com/Azure/draft-classic.git
gofmtd pack.go and pack_test.go
This commit is contained in:
Родитель
bbbf5cc658
Коммит
b3b3e88d49
|
@ -41,7 +41,7 @@ const (
|
||||||
TargetTasksFileName = ".draft-tasks.toml"
|
TargetTasksFileName = ".draft-tasks.toml"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PackFile struct{
|
type PackFile struct {
|
||||||
file io.ReadCloser
|
file io.ReadCloser
|
||||||
perm os.FileMode
|
perm os.FileMode
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ package pack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"k8s.io/helm/pkg/proto/hapi/chart"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
"k8s.io/helm/pkg/proto/hapi/chart"
|
)
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
const testDockerfile = `FROM nginx:latest
|
const testDockerfile = `FROM nginx:latest
|
||||||
`
|
`
|
||||||
|
@ -32,8 +32,8 @@ func TestSaveDir(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Files: map[string]PackFile{
|
Files: map[string]PackFile{
|
||||||
dockerfileName: PackFile{ioutil.NopCloser(bytes.NewBufferString(testDockerfile)), dockerPerm},
|
dockerfileName: {ioutil.NopCloser(bytes.NewBufferString(testDockerfile)), dockerPerm},
|
||||||
TasksFileName: PackFile{ioutil.NopCloser(bytes.NewBufferString(testTasksFile)), tasksPerm},
|
TasksFileName: {ioutil.NopCloser(bytes.NewBufferString(testTasksFile)), tasksPerm},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
dir, err := ioutil.TempDir("", "draft-pack-test")
|
dir, err := ioutil.TempDir("", "draft-pack-test")
|
||||||
|
@ -59,7 +59,6 @@ func TestSaveDir(t *testing.T) {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasksPath := filepath.Join(dir, TargetTasksFileName)
|
tasksPath := filepath.Join(dir, TargetTasksFileName)
|
||||||
fInfo, err = os.Stat(tasksPath)
|
fInfo, err = os.Stat(tasksPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -91,7 +90,7 @@ func TestSaveDirDockerfileExistsInAppDir(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Files: map[string]PackFile{
|
Files: map[string]PackFile{
|
||||||
dockerfileName: PackFile{ioutil.NopCloser(bytes.NewBufferString(testDockerfile)), 664},
|
dockerfileName: {ioutil.NopCloser(bytes.NewBufferString(testDockerfile)), 664},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
dir, err := ioutil.TempDir("", "draft-pack-test")
|
dir, err := ioutil.TempDir("", "draft-pack-test")
|
||||||
|
|
Загрузка…
Ссылка в новой задаче