metadata: clarify networking variables

This commit is contained in:
Leonard Cohnen 2022-10-26 00:27:40 +02:00 committed by 3u13r
parent 0430336fdf
commit b69d19c3d6
3 changed files with 9 additions and 6 deletions

View File

@ -120,7 +120,7 @@ func (k *KubeWrapper) InitCluster(
nodeName = k8sCompliantHostname(instance.Name)
providerID = instance.ProviderID
nodeIP = instance.VPCIP
subnetworkPodCIDR = instance.SubnetworkCIDR
subnetworkPodCIDR = instance.SecondaryIPRange
if len(instance.AliasIPRanges) > 0 {
nodePodCIDR = instance.AliasIPRanges[0]

View File

@ -92,7 +92,7 @@ func (m *Metadata) Self(ctx context.Context) (metadata.InstanceMetadata, error)
if err != nil {
return metadata.InstanceMetadata{}, err
}
instance.SubnetworkCIDR = subnetCIDR
instance.SecondaryIPRange = subnetCIDR
return instance, nil
}

View File

@ -24,14 +24,17 @@ type InstanceMetadata struct {
// VPCIP is the primary IP address of the instance in the VPC.
VPCIP string
// PublicIP is the primary public IP of the instance, if available, empty string otherwise.
PublicIP string
AliasIPRanges []string
PublicIP string
// SSHKeys maps usernames to ssh public keys.
SSHKeys map[string][]string
// SubnetworkCIDR is the CIDR of the subnetwork the instance is in.
// SecondaryIPRange is the VPC wide CIDR from which subnets are attached to VMs as AliasIPRanges.
// May be empty on certain CSPs.
SubnetworkCIDR string
SecondaryIPRange string
// AliasIPRanges is a list of IP ranges that are attached.
// May be empty on certain CSPs.
AliasIPRanges []string
}
type InstanceSelfer interface {