Return ProviderID in URI format

The InstancesV1 interface handled this for us by combining the ProviderName and InstanceID values; the new interface requires us to do it manually

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2022-10-17 15:38:29 +00:00 committed by Brad Davidson
parent 64403978cd
commit 3c0cd6f2dc

View File

@ -2,6 +2,7 @@ package cloudprovider
import (
"context"
"fmt"
"strings"
"github.com/k3s-io/k3s/pkg/version"
@ -70,7 +71,7 @@ func (k *k3s) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovid
}
return &cloudprovider.InstanceMetadata{
ProviderID: version.Program,
ProviderID: fmt.Sprintf("%s://%s", version.Program, node.Name),
InstanceType: version.Program,
NodeAddresses: addresses,
Zone: "",