mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
fix from lint error
This commit is contained in:
@@ -122,7 +122,7 @@ func AddGenerateDockerfile(cmd *cobra.Command) {
|
||||
Use: "gen [DIR]",
|
||||
Args: cobra.ExactArgs(1),
|
||||
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
|
||||
WORKDIR /go/src/
|
||||
COPY go.mod go.sum ./
|
||||
@@ -133,7 +133,10 @@ RUN go build -ldflags '-w -s' -v -o /usr/local/bin/function ./
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /usr/local/bin/function /usr/local/bin/function
|
||||
ENTRYPOINT ["function"]
|
||||
`), 0600)
|
||||
`), 0600); err != nil {
|
||||
return fmt.Errorf("%w", err)
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
cmd.AddCommand(gen)
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestCommand_dockerfile(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
expected := `FROM golang:1.16-alpine as builder
|
||||
expected := `FROM golang:1.18-alpine as builder
|
||||
ENV CGO_ENABLED=0
|
||||
WORKDIR /go/src/
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
@@ -41,7 +41,7 @@ func TestIgnoreFilesMatcher_readIgnoreFile(t *testing.T) {
|
||||
fsMakers := map[string]func(bool) (string, filesys.FileSystem){
|
||||
// onDisk creates a temp directory and returns a nil FileSystem, testing
|
||||
// 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()
|
||||
|
||||
if writeIgnoreFile {
|
||||
|
||||
Reference in New Issue
Block a user