Error while retrieving the connections string from the K8s service that is pointing to master pod

Viewed 144

I am trying to retrieve the connections string from the K8s service that is pointing to the master pod in Minikube.

I tried to execute this :

export HOST_PORT=$(minikube service acid-minimal-cluster --url | sed 's,.*/,,')

But I got the below error :

panic: runtime error: index out of range [3] with length 3

goroutine 1 [running]:
k8s.io/minikube/cmd/minikube/cmd.glob..func35(0x40d5be0, {0xc000305080, 0x1, 0x2})
        /app/cmd/minikube/cmd/service.go:138 +0x645
github.com/spf13/cobra.(*Command).execute(0x40d5be0, {0xc000305060, 0x2, 0x2})    
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x40d56e0)
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/cobra@v1.3.0/command.go:902
k8s.io/minikube/cmd/minikube/cmd.Execute()
        /app/cmd/minikube/cmd/root.go:157 +0x9df
main.main()
        /app/cmd/minikube/main.go:86 +0x1f5
1 Answers

According to the error it seems to be an issue within your code syntax, not your minukube or postgresql.

As we cannot see your code, I'm not explaining it into detail but I found this post where there's 2 useful answers that explain the error.

Related