mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 01:39:06 +00:00
fix from lint error
This commit is contained in:
@@ -122,7 +122,7 @@ func AddGenerateDockerfile(cmd *cobra.Command) {
|
|||||||
Use: "gen [DIR]",
|
Use: "gen [DIR]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return ioutil.WriteFile(filepath.Join(args[0], "Dockerfile"), []byte(`FROM golang:1.16-alpine as builder
|
if err := ioutil.WriteFile(filepath.Join(args[0], "Dockerfile"), []byte(`FROM golang:1.18-alpine as builder
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
@@ -133,7 +133,10 @@ RUN go build -ldflags '-w -s' -v -o /usr/local/bin/function ./
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
COPY --from=builder /usr/local/bin/function /usr/local/bin/function
|
COPY --from=builder /usr/local/bin/function /usr/local/bin/function
|
||||||
ENTRYPOINT ["function"]
|
ENTRYPOINT ["function"]
|
||||||
`), 0600)
|
`), 0600); err != nil {
|
||||||
|
return fmt.Errorf("%w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cmd.AddCommand(gen)
|
cmd.AddCommand(gen)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func TestCommand_dockerfile(t *testing.T) {
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
|
|
||||||
expected := `FROM golang:1.16-alpine as builder
|
expected := `FROM golang:1.18-alpine as builder
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func TestIgnoreFilesMatcher_readIgnoreFile(t *testing.T) {
|
|||||||
fsMakers := map[string]func(bool) (string, filesys.FileSystem){
|
fsMakers := map[string]func(bool) (string, filesys.FileSystem){
|
||||||
// onDisk creates a temp directory and returns a nil FileSystem, testing
|
// onDisk creates a temp directory and returns a nil FileSystem, testing
|
||||||
// the normal conditions under which ignoreFileMatcher is used.
|
// the normal conditions under which ignoreFileMatcher is used.
|
||||||
"onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) { //nolint:unparam
|
"onDisk": func(writeIgnoreFile bool) (string, filesys.FileSystem) {
|
||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
|
|
||||||
if writeIgnoreFile {
|
if writeIgnoreFile {
|
||||||
|
|||||||
Reference in New Issue
Block a user