func (b *baremetal) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error) {
	baremetalServer, err := b.getServerByName(string(nodeName))
	if err != nil {
		return "", err
	}
	return BuildProviderID(InstanceTypeBaremtal, string(baremetalServer.Zone), baremetalServer.ID), nil
}
InstanceID returns the cloud provider ID of the node with the specified NodeName.
Note that if the instance does not exist, we must return ("", cloudprovider.InstanceNotFound)
package scaleway
import (
	"context"
	scwbaremetal "github.com/scaleway/scaleway-sdk-go/api/baremetal/v1alpha1"
	"github.com/scaleway/scaleway-sdk-go/scw"
	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"
	cloudprovider "k8s.io/cloud-provider"
	"k8s.io/klog/v2"
)
type baremetal struct {
	api BaremetalAPI
}
type BaremetalAPI interface {
	ListServers(req *scwbaremetal.ListServersRequest, opts ...scw.RequestOption) (*scwbaremetal.ListServersResponse, error)
	GetServer(req *scwbaremetal.GetServerRequest, opts ...scw.RequestOption) (*scwbaremetal.Server, error)
	GetOffer(req *scwbaremetal.GetOfferRequest, opts ...scw.RequestOption) (*scwbaremetal.Offer, error)
}
func newBaremetal(client *client) *baremetal {
	return &baremetal{
		api: scwbaremetal.NewAPI(client.scaleway),
	}
}
func (b *baremetal) NodeAddresses(ctx context.Context, name types.NodeName) ([]v1.NodeAddress, error) {
	baremetalServer, err := b.getServerByName(string(name))
	if err != nil {
		return nil, err
	}
	return baremetalAddresses(baremetalServer), nil
}
func (b *baremetal) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error) {
	baremetalServer, err := b.getServerByProviderID(providerID)
	if err != nil {
		return nil, err
	}
	return baremetalAddresses(baremetalServer), nil
}