Closed akirillov closed 3 years ago
What happened: When running kubectl kudo init --verify without KUDO installed results in a runtime error:
kubectl kudo init --verify
$KUDO_HOME has been configured at /Users/user/.kudo panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x18d3ccc] goroutine 1 [running]: k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.(*Unstructured).GetAPIVersion(...) /Users/kensipe/projects/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/apis/meta/v1/unstructured/unstructured.go:218 k8s.io/apimachinery/pkg/apis/meta/v1/unstructured.(*Unstructured).GroupVersionKind(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /Users/kensipe/projects/go/pkg/mod/k8s.io/apimachinery@v0.19.2/pkg/apis/meta/v1/unstructured/unstructured.go:426 +0x6c github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq.validateUnstructuredInstallation(0x2973be0, 0xc000206230, 0x0, 0xc00061aba0, 0x0, 0xc00011c080) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq/webhook.go:394 +0x45 github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq.(*KudoWebHook).verifyWithCertManager(0xc000a21540, 0xc00088e370, 0xc00061aba0, 0xc0001391e0, 0xc000139340) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq/webhook.go:114 +0xed github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq.(*KudoWebHook).VerifyInstallation(0xc000a21540, 0xc00088e370, 0xc00061aba0, 0x0, 0x0) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/prereq/webhook.go:103 +0x85 github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/setup.(*Installer).VerifyInstallation(0xc000534630, 0xc00088e370, 0xc00061aba0, 0x2973be0, 0x29c9aa0) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/setup/setup.go:63 +0x9c github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/setup.VerifyExistingInstallation(0x29a1a60, 0xc000534630, 0xc00088e370, 0x29744c0, 0xc0000aa008, 0x0, 0x0, 0x0) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/kudoinit/setup/setup.go:176 +0x95 github.com/kudobuilder/kudo/pkg/kudoctl/cmd.(*initCmd).verifyExistingInstallation(0xc00046a9c0, 0x29a1a60, 0xc000534630, 0x0, 0x0) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/cmd/init.go:290 +0x69 github.com/kudobuilder/kudo/pkg/kudoctl/cmd.(*initCmd).run(0xc00046a9c0, 0x2758b52, 0x9) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/cmd/init.go:206 +0x3b2 github.com/kudobuilder/kudo/pkg/kudoctl/cmd.newInitCmd.func1(0xc00013cdc0, 0xc00021a990, 0x0, 0x1, 0x0, 0x0) /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/pkg/kudoctl/cmd/init.go:104 +0x12b github.com/spf13/cobra.(*Command).execute(0xc00013cdc0, 0xc00021a970, 0x1, 0x1, 0xc00013cdc0, 0xc00021a970) /Users/kensipe/projects/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x47c github.com/spf13/cobra.(*Command).ExecuteC(0xc00013c840, 0x0, 0x249f3e0, 0xc000096058) /Users/kensipe/projects/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /Users/kensipe/projects/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887 main.main() /Users/kensipe/projects/go/src/github.com/kudobuilder/kudo/cmd/kubectl-kudo/main.go:24 +0x2a
What you expected to happen: A human-readable message about the KUDO Controller not being installed displayed instead.
How to reproduce it (as minimally and precisely as possible): Run kubectl kudo init --verify on a cluster without KUDO installed.
Environment:
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0", GitCommit:"af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38", GitTreeState:"clean", BuildDate:"2020-12-08T17:59:43Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.10", GitCommit:"62876fc6d93e891aa7fbe19771e6a6c03773b0f7", GitTreeState:"clean", BuildDate:"2020-10-15T01:43:56Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
KUDO Version: version.Info{GitVersion:"0.18.0-rc1", GitCommit:"63fbe531", BuildDate:"2020-12-16T21:24:05Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64", KubernetesClientVersion:"v0.19.2"}
uname -a
What happened: When running
kubectl kudo init --verify
without KUDO installed results in a runtime error:What you expected to happen: A human-readable message about the KUDO Controller not being installed displayed instead.
How to reproduce it (as minimally and precisely as possible): Run
kubectl kudo init --verify
on a cluster without KUDO installed.Environment:
uname -a
): Darwin Kernel Version 18.0.0