chore: clearer error message

Error now clearly indicates the reasoning for the error message.
Previously the error message suggested a kubelet flag was not set even
when it may have been.

Signed-off-by: Daniel J. Holmes (jaitaiwan) <dan@jaitaiwan.dev>
This commit is contained in:
Daniel J. Holmes (jaitaiwan)
2025-06-13 16:34:47 +10:00
committed by Serge
parent 7aba46727d
commit 628e7d6500

View File

@@ -198,7 +198,10 @@ func (i *instances) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloud
}, nil }, nil
} }
klog.InfoS("instances.InstanceMetadata() is kubelet has args: --cloud-provider=external on the node?", node, klog.KRef("", node.Name)) klog.InfoS(fmt.Sprintf(
"instances.InstanceMetadata() called: label %s missing from node. Was kubelet started without --cloud-provider=external?",
cloudproviderapi.AnnotationAlphaProvidedIPAddr),
node, klog.KRef("", node.Name))
return &cloudprovider.InstanceMetadata{}, nil return &cloudprovider.InstanceMetadata{}, nil
} }