mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00
k8s: fix missing kubeconfig check from endpoint
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com> (cherry picked from commit 4384947be15c7e3827fff79cc83dc22e7a3a3db8)
This commit is contained in:
parent
a8790788d1
commit
3305f18ce5
@ -82,12 +82,12 @@ func (b *Builder) LoadNodes(ctx context.Context, withData bool) (_ []Node, err e
|
|||||||
contextStore := b.opts.dockerCli.ContextStore()
|
contextStore := b.opts.dockerCli.ContextStore()
|
||||||
|
|
||||||
var kcc driver.KubeClientConfig
|
var kcc driver.KubeClientConfig
|
||||||
kcc, err = ctxkube.ConfigFromContext(n.Endpoint, contextStore)
|
kcc, err = ctxkube.ConfigFromEndpoint(n.Endpoint, contextStore)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// err is returned if n.Endpoint is non-context name like "unix:///var/run/docker.sock".
|
// err is returned if n.Endpoint is non-context name like "unix:///var/run/docker.sock".
|
||||||
// try again with name="default".
|
// try again with name="default".
|
||||||
// FIXME(@AkihiroSuda): n should retain real context name.
|
// FIXME(@AkihiroSuda): n should retain real context name.
|
||||||
kcc, err = ctxkube.ConfigFromContext("default", contextStore)
|
kcc, err = ctxkube.ConfigFromEndpoint("default", contextStore)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user