Skip to content

panic on using --build-branch and default docker-compose file given #369

Closed
@surajssd

Description

~/go/src/github.com/kubernetes-incubator/kompose/examples/buildconfig [master L|✔] 
11:11 $ kompose --provider openshift convert --build-repo https://github.com/kubernetes-incubator/kompose
panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x19e8000, 0xc4200101a0)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/kubernetes-incubator/kompose/pkg/transformer/openshift.getComposeFileDir(0x29e2610, 0x0, 0x0, 0x1, 0x2, 0xc420188a80, 0x1)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/pkg/transformer/openshift/openshift.go:118 +0x198
github.com/kubernetes-incubator/kompose/pkg/transformer/openshift.(*OpenShift).Transform(0xc4201d0d90, 0xc4201ebce0, 0x1c08af8, 0x7, 0x100000000, 0x7ffd10d112c1, 0x2f, 0x0, 0x0, 0x0, ...)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/pkg/transformer/openshift/openshift.go:338 +0xf82
github.com/kubernetes-incubator/kompose/pkg/app.Convert(0x100000000, 0x7ffd10d112c1, 0x2f, 0x0, 0x0, 0x0, 0x1, 0x29e2610, 0x0, 0x0, ...)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/pkg/app/app.go:201 +0x22d
github.com/kubernetes-incubator/kompose/cmd.glob..func2(0x29b4380, 0xc4200a8100, 0x0, 0x4)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/cmd/convert.go:80 +0x3f
github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra.(*Command).execute(0x29b4380, 0xc4200a80c0, 0x4, 0x4, 0x29b4380, 0xc4200a80c0)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra/command.go:636 +0x443
github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x29b47c0, 0xc42000c118, 0x0, 0xc4204dfed0)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra/command.go:722 +0x367
github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra.(*Command).Execute(0x29b47c0, 0x0, 0x0)
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/vendor/github.com/spf13/cobra/command.go:681 +0x2b
github.com/kubernetes-incubator/kompose/cmd.Execute()
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/cmd/root.go:86 +0x31
main.main()
        /home/hummer/go/src/github.com/kubernetes-incubator/kompose/main.go:22 +0x14

but if given a file with -f flag as following everything works fine

✘-2 ~/go/src/github.com/kubernetes-incubator/kompose/examples/buildconfig [master L|✔] 
11:12 $ kompose --provider openshift -f docker-compose.yml convert --build-repo https://github.com/kubernetes-incubator/kompose
WARN[0000] [foo] Service cannot be created because of missing port. 
INFO[0000] Buildconfig using https://github.com/kubernetes-incubator/kompose::master as source. 
INFO[0000] file "foo-deploymentconfig.yaml" created     
INFO[0000] file "foo-imagestream.yaml" created          
INFO[0000] file "foo-buildconfig.yaml" created          

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions