Skip to content

Commit

Permalink
Merge pull request #1941 from crazy-max/fix-kube-config
Browse files Browse the repository at this point in the history
k8s: fix missing kubeconfig check from endpoint
  • Loading branch information
crazy-max authored Jul 17, 2023
2 parents 089036d + 4384947 commit fb4c4f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ func (b *Builder) LoadNodes(ctx context.Context, withData bool) (_ []Node, err e
contextStore := b.opts.dockerCli.ContextStore()

var kcc driver.KubeClientConfig
kcc, err = ctxkube.ConfigFromContext(n.Endpoint, contextStore)
kcc, err = ctxkube.ConfigFromEndpoint(n.Endpoint, contextStore)
if err != nil {
// err is returned if n.Endpoint is non-context name like "unix:///var/run/docker.sock".
// try again with name="default".
// FIXME(@AkihiroSuda): n should retain real context name.
kcc, err = ctxkube.ConfigFromContext("default", contextStore)
kcc, err = ctxkube.ConfigFromEndpoint("default", contextStore)
if err != nil {
logrus.Error(err)
}
Expand Down

0 comments on commit fb4c4f0

Please sign in to comment.