kubernetes/kops · error

FindVPCInfo not implemented on azureCloud, use FindVNetInfo

Error message

FindVPCInfo not implemented on azureCloud, use FindVNetInfo instead

What it means

fi.Cloud.FindVPCInfo looks up a VPC by id; on Azure there is no VPC concept, so azureCloudImplementation returns this error and directs callers to FindVNetInfo, its Azure-specific equivalent backed by the vnetsClient.

Source

Thrown at upup/pkg/fi/cloudup/azure/azure_cloud.go:190

	CacheAzureCloudInstance(subscriptionID, resourceGroupName, azureCloudImpl)

	return azureCloudImpl, nil
}

func (c *azureCloudImplementation) Region() string {
	return c.location
}

func (c *azureCloudImplementation) ProviderID() kops.CloudProviderID {
	return kops.CloudProviderAzure
}

func (c *azureCloudImplementation) DNS() (dnsprovider.Interface, error) {
	return nil, errors.New("DNS not implemented on azureCloud")
}

func (c *azureCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {
	return nil, errors.New("FindVPCInfo not implemented on azureCloud, use FindVNetInfo instead")
}

func (c *azureCloudImplementation) FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) {
	vnets, err := c.vnetsClient.List(context.TODO(), resourceGroup)
	if err != nil {
		return nil, err
	}
	for _, vnet := range vnets {
		if *vnet.ID != id {
			continue
		}
		if vnet.Properties == nil {
			continue
		}
		subnets := make([]*fi.SubnetInfo, 0)
		for _, subnet := range vnet.Properties.Subnets {
			if subnet.Properties == nil {
				continue

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Call FindVNetInfo(id, resourceGroup) instead, passing the VNet id and its resource group
  2. Refactor caller code to be provider-aware and use the Azure-specific network lookup
  3. If implementing generic support, add a FindVPCInfo shim in azureCloudImplementation that delegates to FindVNetInfo

Example fix

// before
vpcInfo, err := cloud.FindVPCInfo(vnetID)
// after
type azCloud interface { FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) }
vpcInfo, err := cloud.(azCloud).FindVNetInfo(vnetID, resourceGroup)
Defensive patterns

Strategy: validation

Validate before calling

if c.ProviderID() == kops.CloudProviderAzure {
	vpcInfo, err := c.(*azure.Cloud).FindVNetInfo(vnetID, resourceGroup)
} else {
	vpcInfo, err := c.FindVPCInfo(id)
}

Type guard

type vnetFinder interface { FindVNetInfo(id, resourceGroup string) (*fi.VPCInfo, error) }
if vf, ok := cloud.(vnetFinder); ok { info, err := vf.FindVNetInfo(id, rg) }

Try / catch

info, err := cloud.FindVPCInfo(id)
if err != nil && strings.Contains(err.Error(), "use FindVNetInfo instead") {
	info, err = azureCloud.FindVNetInfo(id, resourceGroup)
}

Prevention

When it happens

Trigger: Calling FindVPCInfo(id) on an Azure cloud object — e.g. validation or network discovery code paths shared with AWS/GCE that resolve subnets/networks via FindVPCInfo.

Common situations: Porting provider-agnostic network validation code to Azure; utility code or plugins that assume VPC semantics; running kops validate/tooling that hits the generic FindVPCInfo path on an Azure cluster.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/b2ef120c1f883de0. Report an issue: GitHub.