Merge pull request #14609 from johngmyers/v1alpha3-misc

Miscellaneous non-user-visible API changes
This commit is contained in:
Kubernetes Prow Robot 2022-11-20 22:10:30 -08:00 committed by GitHub
commit 168d918a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 204 additions and 205 deletions

View File

@ -5531,8 +5531,8 @@ spec:
this subnet this subnet
type: string type: string
id: id:
description: ProviderID is the cloud provider id for the objects description: ID is the cloud provider ID for the objects associated
associated with the zone (the subnet on AWS) with the zone (the subnet on AWS).
type: string type: string
ipv6CIDR: ipv6CIDR:
description: IPv6CIDR is the IPv6 CIDR block assigned to the description: IPv6CIDR is the IPv6 CIDR block assigned to the

View File

@ -725,8 +725,8 @@ type ClusterSubnetSpec struct {
Zone string `json:"zone,omitempty"` Zone string `json:"zone,omitempty"`
// Region is the region the subnet is in, set for subnets that are regionally scoped // Region is the region the subnet is in, set for subnets that are regionally scoped
Region string `json:"region,omitempty"` Region string `json:"region,omitempty"`
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS) // ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
ProviderID string `json:"id,omitempty"` ID string `json:"id,omitempty"`
// Egress defines the method of traffic egress for this subnet // Egress defines the method of traffic egress for this subnet
Egress string `json:"egress,omitempty"` Egress string `json:"egress,omitempty"`
// Type define which one if the internal types (public, utility, private) the network is // Type define which one if the internal types (public, utility, private) the network is

View File

@ -160,7 +160,7 @@ type InstanceGroupSpec struct {
// SuspendProcesses disables the listed Scaling Policies // SuspendProcesses disables the listed Scaling Policies
SuspendProcesses []string `json:"suspendProcesses,omitempty"` SuspendProcesses []string `json:"suspendProcesses,omitempty"`
// ExternalLoadBalancers define loadbalancers that should be attached to this instance group // ExternalLoadBalancers define loadbalancers that should be attached to this instance group
ExternalLoadBalancers []LoadBalancer `json:"externalLoadBalancers,omitempty"` ExternalLoadBalancers []LoadBalancerSpec `json:"externalLoadBalancers,omitempty"`
// DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only) // DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only)
DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"` DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"`
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only). // IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
@ -370,7 +370,7 @@ func (g *InstanceGroup) AddInstanceGroupNodeLabel() {
} }
// LoadBalancer defines a load balancer // LoadBalancer defines a load balancer
type LoadBalancer struct { type LoadBalancerSpec struct {
// LoadBalancerName to associate with this instance group (AWS ELB) // LoadBalancerName to associate with this instance group (AWS ELB)
LoadBalancerName *string `json:"loadBalancerName,omitempty"` LoadBalancerName *string `json:"loadBalancerName,omitempty"`
// TargetGroupARN to associate with this instance group (AWS ALB/NLB) // TargetGroupARN to associate with this instance group (AWS ALB/NLB)

View File

@ -699,8 +699,8 @@ type ClusterSubnetSpec struct {
// IPv6CIDR is the IPv6 CIDR block assigned to the subnet. // IPv6CIDR is the IPv6 CIDR block assigned to the subnet.
IPv6CIDR string `json:"ipv6CIDR,omitempty"` IPv6CIDR string `json:"ipv6CIDR,omitempty"`
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS) // ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
ProviderID string `json:"id,omitempty"` ID string `json:"id,omitempty"`
// Egress defines the method of traffic egress for this subnet // Egress defines the method of traffic egress for this subnet
Egress string `json:"egress,omitempty"` Egress string `json:"egress,omitempty"`

View File

@ -126,7 +126,7 @@ type InstanceGroupSpec struct {
// SuspendProcesses disables the listed Scaling Policies // SuspendProcesses disables the listed Scaling Policies
SuspendProcesses []string `json:"suspendProcesses,omitempty"` SuspendProcesses []string `json:"suspendProcesses,omitempty"`
// ExternalLoadBalancers define loadbalancers that should be attached to this instance group // ExternalLoadBalancers define loadbalancers that should be attached to this instance group
ExternalLoadBalancers []LoadBalancer `json:"externalLoadBalancers,omitempty"` ExternalLoadBalancers []LoadBalancerSpec `json:"externalLoadBalancers,omitempty"`
// DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only) // DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only)
DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"` DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"`
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only). // IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
@ -272,7 +272,7 @@ type IAMProfileSpec struct {
} }
// LoadBalancer defines a load balancer // LoadBalancer defines a load balancer
type LoadBalancer struct { type LoadBalancerSpec struct {
// LoadBalancerName to associate with this instance group (AWS ELB) // LoadBalancerName to associate with this instance group (AWS ELB)
LoadBalancerName *string `json:"loadBalancerName,omitempty"` LoadBalancerName *string `json:"loadBalancerName,omitempty"`
// TargetGroupARN to associate with this instance group (AWS ALB/NLB) // TargetGroupARN to associate with this instance group (AWS ALB/NLB)

View File

@ -764,16 +764,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*kops.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_LoadBalancer_To_kops_LoadBalancer(a.(*LoadBalancer), b.(*kops.LoadBalancer), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_LoadBalancer_To_v1alpha2_LoadBalancer(a.(*kops.LoadBalancer), b.(*LoadBalancer), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*LoadBalancerAccessSpec)(nil), (*kops.LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*LoadBalancerAccessSpec)(nil), (*kops.LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope) return Convert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope)
}); err != nil { }); err != nil {
@ -784,6 +774,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*LoadBalancerSpec)(nil), (*kops.LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec(a.(*LoadBalancerSpec), b.(*kops.LoadBalancerSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.LoadBalancerSpec)(nil), (*LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec(a.(*kops.LoadBalancerSpec), b.(*LoadBalancerSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*LoadBalancerSubnetSpec)(nil), (*kops.LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*LoadBalancerSubnetSpec)(nil), (*kops.LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha2_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope) return Convert_v1alpha2_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope)
}); err != nil { }); err != nil {
@ -3253,7 +3253,7 @@ func autoConvert_v1alpha2_ClusterSubnetSpec_To_kops_ClusterSubnetSpec(in *Cluste
out.Region = in.Region out.Region = in.Region
out.CIDR = in.CIDR out.CIDR = in.CIDR
out.IPv6CIDR = in.IPv6CIDR out.IPv6CIDR = in.IPv6CIDR
out.ProviderID = in.ProviderID out.ID = in.ID
out.Egress = in.Egress out.Egress = in.Egress
out.Type = kops.SubnetType(in.Type) out.Type = kops.SubnetType(in.Type)
out.PublicIP = in.PublicIP out.PublicIP = in.PublicIP
@ -3282,7 +3282,7 @@ func autoConvert_kops_ClusterSubnetSpec_To_v1alpha2_ClusterSubnetSpec(in *kops.C
out.IPv6CIDR = in.IPv6CIDR out.IPv6CIDR = in.IPv6CIDR
out.Zone = in.Zone out.Zone = in.Zone
out.Region = in.Region out.Region = in.Region
out.ProviderID = in.ProviderID out.ID = in.ID
out.Egress = in.Egress out.Egress = in.Egress
out.Type = SubnetType(in.Type) out.Type = SubnetType(in.Type)
out.PublicIP = in.PublicIP out.PublicIP = in.PublicIP
@ -4428,9 +4428,9 @@ func autoConvert_v1alpha2_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *Instan
out.SuspendProcesses = in.SuspendProcesses out.SuspendProcesses = in.SuspendProcesses
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]kops.LoadBalancer, len(*in)) *out = make([]kops.LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
if err := Convert_v1alpha2_LoadBalancer_To_kops_LoadBalancer(&(*in)[i], &(*out)[i], s); err != nil { if err := Convert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec(&(*in)[i], &(*out)[i], s); err != nil {
return err return err
} }
} }
@ -4613,9 +4613,9 @@ func autoConvert_kops_InstanceGroupSpec_To_v1alpha2_InstanceGroupSpec(in *kops.I
out.SuspendProcesses = in.SuspendProcesses out.SuspendProcesses = in.SuspendProcesses
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]LoadBalancer, len(*in)) *out = make([]LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
if err := Convert_kops_LoadBalancer_To_v1alpha2_LoadBalancer(&(*in)[i], &(*out)[i], s); err != nil { if err := Convert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec(&(*in)[i], &(*out)[i], s); err != nil {
return err return err
} }
} }
@ -5796,28 +5796,6 @@ func Convert_kops_LeaderElectionConfiguration_To_v1alpha2_LeaderElectionConfigur
return autoConvert_kops_LeaderElectionConfiguration_To_v1alpha2_LeaderElectionConfiguration(in, out, s) return autoConvert_kops_LeaderElectionConfiguration_To_v1alpha2_LeaderElectionConfiguration(in, out, s)
} }
func autoConvert_v1alpha2_LoadBalancer_To_kops_LoadBalancer(in *LoadBalancer, out *kops.LoadBalancer, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_v1alpha2_LoadBalancer_To_kops_LoadBalancer is an autogenerated conversion function.
func Convert_v1alpha2_LoadBalancer_To_kops_LoadBalancer(in *LoadBalancer, out *kops.LoadBalancer, s conversion.Scope) error {
return autoConvert_v1alpha2_LoadBalancer_To_kops_LoadBalancer(in, out, s)
}
func autoConvert_kops_LoadBalancer_To_v1alpha2_LoadBalancer(in *kops.LoadBalancer, out *LoadBalancer, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_kops_LoadBalancer_To_v1alpha2_LoadBalancer is an autogenerated conversion function.
func Convert_kops_LoadBalancer_To_v1alpha2_LoadBalancer(in *kops.LoadBalancer, out *LoadBalancer, s conversion.Scope) error {
return autoConvert_kops_LoadBalancer_To_v1alpha2_LoadBalancer(in, out, s)
}
func autoConvert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(in *LoadBalancerAccessSpec, out *kops.LoadBalancerAccessSpec, s conversion.Scope) error { func autoConvert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(in *LoadBalancerAccessSpec, out *kops.LoadBalancerAccessSpec, s conversion.Scope) error {
out.Class = kops.LoadBalancerClass(in.Class) out.Class = kops.LoadBalancerClass(in.Class)
out.Type = kops.LoadBalancerType(in.Type) out.Type = kops.LoadBalancerType(in.Type)
@ -5894,6 +5872,28 @@ func Convert_kops_LoadBalancerAccessSpec_To_v1alpha2_LoadBalancerAccessSpec(in *
return autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha2_LoadBalancerAccessSpec(in, out, s) return autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha2_LoadBalancerAccessSpec(in, out, s)
} }
func autoConvert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec(in *LoadBalancerSpec, out *kops.LoadBalancerSpec, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec is an autogenerated conversion function.
func Convert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec(in *LoadBalancerSpec, out *kops.LoadBalancerSpec, s conversion.Scope) error {
return autoConvert_v1alpha2_LoadBalancerSpec_To_kops_LoadBalancerSpec(in, out, s)
}
func autoConvert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec(in *kops.LoadBalancerSpec, out *LoadBalancerSpec, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec is an autogenerated conversion function.
func Convert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec(in *kops.LoadBalancerSpec, out *LoadBalancerSpec, s conversion.Scope) error {
return autoConvert_kops_LoadBalancerSpec_To_v1alpha2_LoadBalancerSpec(in, out, s)
}
func autoConvert_v1alpha2_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(in *LoadBalancerSubnetSpec, out *kops.LoadBalancerSubnetSpec, s conversion.Scope) error { func autoConvert_v1alpha2_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(in *LoadBalancerSubnetSpec, out *kops.LoadBalancerSubnetSpec, s conversion.Scope) error {
out.Name = in.Name out.Name = in.Name
out.PrivateIPv4Address = in.PrivateIPv4Address out.PrivateIPv4Address = in.PrivateIPv4Address

View File

@ -2536,7 +2536,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
} }
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]LoadBalancer, len(*in)) *out = make([]LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i]) (*in)[i].DeepCopyInto(&(*out)[i])
} }
@ -4031,32 +4031,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer.
func (in *LoadBalancer) DeepCopy() *LoadBalancer {
if in == nil {
return nil
}
out := new(LoadBalancer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) { func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
*out = *in *out = *in
@ -4110,6 +4084,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec.
func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec {
if in == nil {
return nil
}
out := new(LoadBalancerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) { func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
*out = *in *out = *in

View File

@ -661,8 +661,8 @@ type ClusterSubnetSpec struct {
// IPv6CIDR is the IPv6 CIDR block assigned to the subnet. // IPv6CIDR is the IPv6 CIDR block assigned to the subnet.
IPv6CIDR string `json:"ipv6CIDR,omitempty"` IPv6CIDR string `json:"ipv6CIDR,omitempty"`
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS) // ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
ProviderID string `json:"id,omitempty"` ID string `json:"id,omitempty"`
// Egress defines the method of traffic egress for this subnet // Egress defines the method of traffic egress for this subnet
Egress string `json:"egress,omitempty"` Egress string `json:"egress,omitempty"`

View File

@ -123,7 +123,7 @@ type InstanceGroupSpec struct {
// SuspendProcesses disables the listed Scaling Policies // SuspendProcesses disables the listed Scaling Policies
SuspendProcesses []string `json:"suspendProcesses,omitempty"` SuspendProcesses []string `json:"suspendProcesses,omitempty"`
// ExternalLoadBalancers define loadbalancers that should be attached to this instance group // ExternalLoadBalancers define loadbalancers that should be attached to this instance group
ExternalLoadBalancers []LoadBalancer `json:"externalLoadBalancers,omitempty"` ExternalLoadBalancers []LoadBalancerSpec `json:"externalLoadBalancers,omitempty"`
// DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only) // DetailedInstanceMonitoring defines if detailed-monitoring is enabled (AWS only)
DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"` DetailedInstanceMonitoring *bool `json:"detailedInstanceMonitoring,omitempty"`
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only). // IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
@ -269,7 +269,7 @@ type IAMProfileSpec struct {
} }
// LoadBalancer defines a load balancer // LoadBalancer defines a load balancer
type LoadBalancer struct { type LoadBalancerSpec struct {
// LoadBalancerName to associate with this instance group (AWS ELB) // LoadBalancerName to associate with this instance group (AWS ELB)
LoadBalancerName *string `json:"loadBalancerName,omitempty"` LoadBalancerName *string `json:"loadBalancerName,omitempty"`
// TargetGroupARN to associate with this instance group (AWS ALB/NLB) // TargetGroupARN to associate with this instance group (AWS ALB/NLB)

View File

@ -844,16 +844,6 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*LoadBalancer)(nil), (*kops.LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_LoadBalancer_To_kops_LoadBalancer(a.(*LoadBalancer), b.(*kops.LoadBalancer), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.LoadBalancer)(nil), (*LoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_LoadBalancer_To_v1alpha3_LoadBalancer(a.(*kops.LoadBalancer), b.(*LoadBalancer), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*LoadBalancerAccessSpec)(nil), (*kops.LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*LoadBalancerAccessSpec)(nil), (*kops.LoadBalancerAccessSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope) return Convert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope)
}); err != nil { }); err != nil {
@ -864,6 +854,16 @@ func RegisterConversions(s *runtime.Scheme) error {
}); err != nil { }); err != nil {
return err return err
} }
if err := s.AddGeneratedConversionFunc((*LoadBalancerSpec)(nil), (*kops.LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(a.(*LoadBalancerSpec), b.(*kops.LoadBalancerSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*kops.LoadBalancerSpec)(nil), (*LoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(a.(*kops.LoadBalancerSpec), b.(*LoadBalancerSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*LoadBalancerSubnetSpec)(nil), (*kops.LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { if err := s.AddGeneratedConversionFunc((*LoadBalancerSubnetSpec)(nil), (*kops.LoadBalancerSubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope) return Convert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope)
}); err != nil { }); err != nil {
@ -3353,7 +3353,7 @@ func autoConvert_v1alpha3_ClusterSubnetSpec_To_kops_ClusterSubnetSpec(in *Cluste
out.Region = in.Region out.Region = in.Region
out.CIDR = in.CIDR out.CIDR = in.CIDR
out.IPv6CIDR = in.IPv6CIDR out.IPv6CIDR = in.IPv6CIDR
out.ProviderID = in.ProviderID out.ID = in.ID
out.Egress = in.Egress out.Egress = in.Egress
out.Type = kops.SubnetType(in.Type) out.Type = kops.SubnetType(in.Type)
out.PublicIP = in.PublicIP out.PublicIP = in.PublicIP
@ -3382,7 +3382,7 @@ func autoConvert_kops_ClusterSubnetSpec_To_v1alpha3_ClusterSubnetSpec(in *kops.C
out.IPv6CIDR = in.IPv6CIDR out.IPv6CIDR = in.IPv6CIDR
out.Zone = in.Zone out.Zone = in.Zone
out.Region = in.Region out.Region = in.Region
out.ProviderID = in.ProviderID out.ID = in.ID
out.Egress = in.Egress out.Egress = in.Egress
out.Type = SubnetType(in.Type) out.Type = SubnetType(in.Type)
out.PublicIP = in.PublicIP out.PublicIP = in.PublicIP
@ -4589,9 +4589,9 @@ func autoConvert_v1alpha3_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *Instan
out.SuspendProcesses = in.SuspendProcesses out.SuspendProcesses = in.SuspendProcesses
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]kops.LoadBalancer, len(*in)) *out = make([]kops.LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
if err := Convert_v1alpha3_LoadBalancer_To_kops_LoadBalancer(&(*in)[i], &(*out)[i], s); err != nil { if err := Convert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(&(*in)[i], &(*out)[i], s); err != nil {
return err return err
} }
} }
@ -4774,9 +4774,9 @@ func autoConvert_kops_InstanceGroupSpec_To_v1alpha3_InstanceGroupSpec(in *kops.I
out.SuspendProcesses = in.SuspendProcesses out.SuspendProcesses = in.SuspendProcesses
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]LoadBalancer, len(*in)) *out = make([]LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
if err := Convert_kops_LoadBalancer_To_v1alpha3_LoadBalancer(&(*in)[i], &(*out)[i], s); err != nil { if err := Convert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(&(*in)[i], &(*out)[i], s); err != nil {
return err return err
} }
} }
@ -5955,28 +5955,6 @@ func Convert_kops_LeaderElectionConfiguration_To_v1alpha3_LeaderElectionConfigur
return autoConvert_kops_LeaderElectionConfiguration_To_v1alpha3_LeaderElectionConfiguration(in, out, s) return autoConvert_kops_LeaderElectionConfiguration_To_v1alpha3_LeaderElectionConfiguration(in, out, s)
} }
func autoConvert_v1alpha3_LoadBalancer_To_kops_LoadBalancer(in *LoadBalancer, out *kops.LoadBalancer, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_v1alpha3_LoadBalancer_To_kops_LoadBalancer is an autogenerated conversion function.
func Convert_v1alpha3_LoadBalancer_To_kops_LoadBalancer(in *LoadBalancer, out *kops.LoadBalancer, s conversion.Scope) error {
return autoConvert_v1alpha3_LoadBalancer_To_kops_LoadBalancer(in, out, s)
}
func autoConvert_kops_LoadBalancer_To_v1alpha3_LoadBalancer(in *kops.LoadBalancer, out *LoadBalancer, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_kops_LoadBalancer_To_v1alpha3_LoadBalancer is an autogenerated conversion function.
func Convert_kops_LoadBalancer_To_v1alpha3_LoadBalancer(in *kops.LoadBalancer, out *LoadBalancer, s conversion.Scope) error {
return autoConvert_kops_LoadBalancer_To_v1alpha3_LoadBalancer(in, out, s)
}
func autoConvert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(in *LoadBalancerAccessSpec, out *kops.LoadBalancerAccessSpec, s conversion.Scope) error { func autoConvert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(in *LoadBalancerAccessSpec, out *kops.LoadBalancerAccessSpec, s conversion.Scope) error {
out.Class = kops.LoadBalancerClass(in.Class) out.Class = kops.LoadBalancerClass(in.Class)
out.Type = kops.LoadBalancerType(in.Type) out.Type = kops.LoadBalancerType(in.Type)
@ -6053,6 +6031,28 @@ func Convert_kops_LoadBalancerAccessSpec_To_v1alpha3_LoadBalancerAccessSpec(in *
return autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha3_LoadBalancerAccessSpec(in, out, s) return autoConvert_kops_LoadBalancerAccessSpec_To_v1alpha3_LoadBalancerAccessSpec(in, out, s)
} }
func autoConvert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(in *LoadBalancerSpec, out *kops.LoadBalancerSpec, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec is an autogenerated conversion function.
func Convert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(in *LoadBalancerSpec, out *kops.LoadBalancerSpec, s conversion.Scope) error {
return autoConvert_v1alpha3_LoadBalancerSpec_To_kops_LoadBalancerSpec(in, out, s)
}
func autoConvert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(in *kops.LoadBalancerSpec, out *LoadBalancerSpec, s conversion.Scope) error {
out.LoadBalancerName = in.LoadBalancerName
out.TargetGroupARN = in.TargetGroupARN
return nil
}
// Convert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec is an autogenerated conversion function.
func Convert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(in *kops.LoadBalancerSpec, out *LoadBalancerSpec, s conversion.Scope) error {
return autoConvert_kops_LoadBalancerSpec_To_v1alpha3_LoadBalancerSpec(in, out, s)
}
func autoConvert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(in *LoadBalancerSubnetSpec, out *kops.LoadBalancerSubnetSpec, s conversion.Scope) error { func autoConvert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(in *LoadBalancerSubnetSpec, out *kops.LoadBalancerSubnetSpec, s conversion.Scope) error {
out.Name = in.Name out.Name = in.Name
out.PrivateIPv4Address = in.PrivateIPv4Address out.PrivateIPv4Address = in.PrivateIPv4Address

View File

@ -2506,7 +2506,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
} }
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]LoadBalancer, len(*in)) *out = make([]LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i]) (*in)[i].DeepCopyInto(&(*out)[i])
} }
@ -4001,32 +4001,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer.
func (in *LoadBalancer) DeepCopy() *LoadBalancer {
if in == nil {
return nil
}
out := new(LoadBalancer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) { func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
*out = *in *out = *in
@ -4080,6 +4054,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec.
func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec {
if in == nil {
return nil
}
out := new(LoadBalancerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) { func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
*out = *in *out = *in

View File

@ -51,7 +51,7 @@ func awsValidateCluster(c *kops.Cluster) field.ErrorList {
for i, subnet := range c.Spec.Subnets { for i, subnet := range c.Spec.Subnets {
f := field.NewPath("spec", "subnets").Index(i) f := field.NewPath("spec", "subnets").Index(i)
if subnet.AdditionalRoutes != nil { if subnet.AdditionalRoutes != nil {
if len(subnet.ProviderID) > 0 { if len(subnet.ID) > 0 {
allErrs = append(allErrs, field.Invalid(f, subnet, "additional routes cannot be added if the subnet is shared")) allErrs = append(allErrs, field.Invalid(f, subnet, "additional routes cannot be added if the subnet is shared"))
} else if subnet.Type != kops.SubnetTypePrivate { } else if subnet.Type != kops.SubnetTypePrivate {
allErrs = append(allErrs, field.Invalid(f, subnet, "additional routes can only be added on private subnets")) allErrs = append(allErrs, field.Invalid(f, subnet, "additional routes can only be added on private subnets"))

View File

@ -825,7 +825,7 @@ func TestAWSAdditionalRoutes(t *testing.T) {
NetworkCIDR: test.clusterCidr, NetworkCIDR: test.clusterCidr,
Subnets: []kops.ClusterSubnetSpec{ Subnets: []kops.ClusterSubnetSpec{
{ {
ProviderID: test.providerId, ID: test.providerId,
Type: test.subnetType, Type: test.subnetType,
AdditionalRoutes: test.route, AdditionalRoutes: test.route,
}, },

View File

@ -381,7 +381,7 @@ func validateIGCloudLabels(ig *kops.InstanceGroup, fldPath *field.Path) (allErrs
return allErrs return allErrs
} }
func validateExternalLoadBalancer(lb *kops.LoadBalancer, fldPath *field.Path) field.ErrorList { func validateExternalLoadBalancer(lb *kops.LoadBalancerSpec, fldPath *field.Path) field.ErrorList {
allErrs := field.ErrorList{} allErrs := field.ErrorList{}
if lb.LoadBalancerName != nil && lb.TargetGroupARN != nil { if lb.LoadBalancerName != nil && lb.TargetGroupARN != nil {

View File

@ -464,9 +464,9 @@ func validateSubnets(cluster *kops.ClusterSpec, fieldPath *field.Path) field.Err
// cannot mix subnets with specified ID and without specified id // cannot mix subnets with specified ID and without specified id
if len(subnets) > 0 { if len(subnets) > 0 {
hasID := subnets[0].ProviderID != "" hasID := subnets[0].ID != ""
for i := range subnets { for i := range subnets {
if (subnets[i].ProviderID != "") != hasID { if (subnets[i].ID != "") != hasID {
allErrs = append(allErrs, field.Forbidden(fieldPath.Index(i).Child("id"), "cannot mix subnets with specified ID and unspecified ID")) allErrs = append(allErrs, field.Forbidden(fieldPath.Index(i).Child("id"), "cannot mix subnets with specified ID and unspecified ID"))
} }
} }

View File

@ -138,14 +138,14 @@ func TestValidateSubnets(t *testing.T) {
}, },
{ {
Input: []kops.ClusterSubnetSpec{ Input: []kops.ClusterSubnetSpec{
{Name: "a", ProviderID: "a", Type: kops.SubnetTypePublic}, {Name: "a", ID: "a", Type: kops.SubnetTypePublic},
{Name: "b", ProviderID: "b", Type: kops.SubnetTypePublic}, {Name: "b", ID: "b", Type: kops.SubnetTypePublic},
}, },
}, },
{ {
Input: []kops.ClusterSubnetSpec{ Input: []kops.ClusterSubnetSpec{
{Name: "a", ProviderID: "a", Type: kops.SubnetTypePublic}, {Name: "a", ID: "a", Type: kops.SubnetTypePublic},
{Name: "b", ProviderID: "", Type: kops.SubnetTypePublic}, {Name: "b", ID: "", Type: kops.SubnetTypePublic},
}, },
ExpectedErrors: []string{"Forbidden::subnets[1].id"}, ExpectedErrors: []string{"Forbidden::subnets[1].id"},
}, },

View File

@ -2669,7 +2669,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
} }
if in.ExternalLoadBalancers != nil { if in.ExternalLoadBalancers != nil {
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
*out = make([]LoadBalancer, len(*in)) *out = make([]LoadBalancerSpec, len(*in))
for i := range *in { for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i]) (*in)[i].DeepCopyInto(&(*out)[i])
} }
@ -4196,32 +4196,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancer.
func (in *LoadBalancer) DeepCopy() *LoadBalancer {
if in == nil {
return nil
}
out := new(LoadBalancer)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) { func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
*out = *in *out = *in
@ -4275,6 +4249,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
return out return out
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) {
*out = *in
if in.LoadBalancerName != nil {
in, out := &in.LoadBalancerName, &out.LoadBalancerName
*out = new(string)
**out = **in
}
if in.TargetGroupARN != nil {
in, out := &in.TargetGroupARN, &out.TargetGroupARN
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec.
func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec {
if in == nil {
return nil
}
out := new(LoadBalancerSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) { func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
*out = *in *out = *in

View File

@ -150,7 +150,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
for i := range b.Cluster.Spec.Subnets { for i := range b.Cluster.Spec.Subnets {
subnetSpec := &b.Cluster.Spec.Subnets[i] subnetSpec := &b.Cluster.Spec.Subnets[i]
sharedSubnet := subnetSpec.ProviderID != "" sharedSubnet := subnetSpec.ID != ""
if !sharedSubnet { if !sharedSubnet {
allSubnetsShared = false allSubnetsShared = false
allSubnetsSharedInZone[subnetSpec.Zone] = false allSubnetsSharedInZone[subnetSpec.Zone] = false
@ -225,7 +225,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
for i := range b.Cluster.Spec.Subnets { for i := range b.Cluster.Spec.Subnets {
subnetSpec := &b.Cluster.Spec.Subnets[i] subnetSpec := &b.Cluster.Spec.Subnets[i]
sharedSubnet := subnetSpec.ProviderID != "" sharedSubnet := subnetSpec.ID != ""
subnetName := subnetSpec.Name + "." + b.ClusterName() subnetName := subnetSpec.Name + "." + b.ClusterName()
tags := map[string]string{} tags := map[string]string{}
@ -293,8 +293,8 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
} }
subnet.IPv6CIDR = fi.PtrTo(subnetSpec.IPv6CIDR) subnet.IPv6CIDR = fi.PtrTo(subnetSpec.IPv6CIDR)
} }
if subnetSpec.ProviderID != "" { if subnetSpec.ID != "" {
subnet.ID = fi.PtrTo(subnetSpec.ProviderID) subnet.ID = fi.PtrTo(subnetSpec.ID)
} }
c.AddTask(subnet) c.AddTask(subnet)

View File

@ -194,7 +194,7 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
// subnetNotSpecified returns true if the given LB subnet is not listed in the list of cluster subnets. // subnetNotSpecified returns true if the given LB subnet is not listed in the list of cluster subnets.
func subnetNotSpecified(sn kops.LoadBalancerSubnetSpec, subnets []kops.ClusterSubnetSpec) bool { func subnetNotSpecified(sn kops.LoadBalancerSubnetSpec, subnets []kops.ClusterSubnetSpec) bool {
for _, csn := range subnets { for _, csn := range subnets {
if csn.Name == sn.Name || csn.ProviderID == sn.Name { if csn.Name == sn.Name || csn.ID == sn.Name {
return false return false
} }
} }

View File

@ -59,7 +59,7 @@ func (c *GCEModelContext) NameForIPAliasRange(key string) string {
// LinkToSubnet returns a link to the GCE subnet object // LinkToSubnet returns a link to the GCE subnet object
func (c *GCEModelContext) LinkToSubnet(subnet *kops.ClusterSubnetSpec) *gcetasks.Subnet { func (c *GCEModelContext) LinkToSubnet(subnet *kops.ClusterSubnetSpec) *gcetasks.Subnet {
name := subnet.ProviderID name := subnet.ID
if name == "" { if name == "" {
name = gce.ClusterSuffixedName(subnet.Name, c.Cluster.ObjectMeta.Name, 63) name = gce.ClusterSuffixedName(subnet.Name, c.Cluster.ObjectMeta.Name, 63)
} }

View File

@ -54,7 +54,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
for i := range b.Cluster.Spec.Subnets { for i := range b.Cluster.Spec.Subnets {
subnet := &b.Cluster.Spec.Subnets[i] subnet := &b.Cluster.Spec.Subnets[i]
sharedSubnet := subnet.ProviderID != "" sharedSubnet := subnet.ID != ""
network, err := b.LinkToNetwork() network, err := b.LinkToNetwork()
if err != nil { if err != nil {
@ -104,7 +104,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
} }
// If we're in an existing subnet, we assume egress is already configured. // If we're in an existing subnet, we assume egress is already configured.
if subnet.ProviderID != "" { if subnet.ID != "" {
continue continue
} }

View File

@ -76,7 +76,7 @@ func (c *OpenstackModelContext) GetNetworkName() (string, error) {
func (c *OpenstackModelContext) findSubnetClusterSpec(subnet string) (string, error) { func (c *OpenstackModelContext) findSubnetClusterSpec(subnet string) (string, error) {
for _, sp := range c.Cluster.Spec.Subnets { for _, sp := range c.Cluster.Spec.Subnets {
if sp.Name == subnet { if sp.Name == subnet {
name, err := c.findSubnetNameByID(sp.ProviderID, sp.Name) name, err := c.findSubnetNameByID(sp.ID, sp.Name)
if err != nil { if err != nil {
return "", err return "", err
} }

View File

@ -61,10 +61,10 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
routerName := strings.Replace(clusterName, ".", "-", -1) routerName := strings.Replace(clusterName, ".", "-", -1)
for _, sp := range b.Cluster.Spec.Subnets { for _, sp := range b.Cluster.Spec.Subnets {
// assumes that we do not need to create routers if we use existing subnets // assumes that we do not need to create routers if we use existing subnets
if sp.ProviderID != "" { if sp.ID != "" {
needRouter = false needRouter = false
} }
subnetName, err := b.findSubnetNameByID(sp.ProviderID, sp.Name) subnetName, err := b.findSubnetNameByID(sp.ID, sp.Name)
if err != nil { if err != nil {
return err return err
} }

View File

@ -274,7 +274,7 @@ func (b *ServerGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
var err error var err error
for _, sp := range b.Cluster.Spec.Subnets { for _, sp := range b.Cluster.Spec.Subnets {
if sp.Type == kops.SubnetTypeDualStack || sp.Type == kops.SubnetTypePrivate { if sp.Type == kops.SubnetTypeDualStack || sp.Type == kops.SubnetTypePrivate {
lbSubnetName, err = b.findSubnetNameByID(sp.ProviderID, sp.Name) lbSubnetName, err = b.findSubnetNameByID(sp.ID, sp.Name)
if err != nil { if err != nil {
return err return err
} }

View File

@ -190,7 +190,7 @@ func performSubnetAssignments(ctx context.Context, c *kops.Cluster, cloudObj fi.
needCIDR := 0 needCIDR := 0
for i := range c.Spec.Subnets { for i := range c.Spec.Subnets {
subnet := &c.Spec.Subnets[i] subnet := &c.Spec.Subnets[i]
if subnet.ProviderID != "" { if subnet.ID != "" {
continue continue
} }
if subnet.CIDR == "" { if subnet.CIDR == "" {
@ -212,7 +212,7 @@ func performSubnetAssignments(ctx context.Context, c *kops.Cluster, cloudObj fi.
for i := range c.Spec.Subnets { for i := range c.Spec.Subnets {
subnet := &c.Spec.Subnets[i] subnet := &c.Spec.Subnets[i]
if subnet.ProviderID != "" { if subnet.ID != "" {
continue continue
} }
if subnet.CIDR != "" { if subnet.CIDR != "" {

View File

@ -643,8 +643,7 @@ func setupZones(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.Stri
if len(opt.SubnetIDs) != 1 { if len(opt.SubnetIDs) != 1 {
return nil, fmt.Errorf("expected exactly one subnet for GCE, got %d", len(opt.SubnetIDs)) return nil, fmt.Errorf("expected exactly one subnet for GCE, got %d", len(opt.SubnetIDs))
} }
providerID := opt.SubnetIDs[0] subnet.ID = opt.SubnetIDs[0]
subnet.ProviderID = providerID
} }
cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet) cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet)
} }
@ -736,7 +735,7 @@ func setupZones(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.Stri
Egress: opt.Egress, Egress: opt.Egress,
} }
if subnetID, ok := zoneToSubnetProviderID[zoneName]; ok { if subnetID, ok := zoneToSubnetProviderID[zoneName]; ok {
subnet.ProviderID = subnetID subnet.ID = subnetID
} }
cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet) cluster.Spec.Subnets = append(cluster.Spec.Subnets, *subnet)
} }
@ -1225,7 +1224,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
Region: s.Region, Region: s.Region,
} }
if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok { if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok {
subnet.ProviderID = subnetID subnet.ID = subnetID
} }
dualStackSubnets = append(dualStackSubnets, subnet) dualStackSubnets = append(dualStackSubnets, subnet)
} }
@ -1253,7 +1252,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
Region: s.Region, Region: s.Region,
} }
if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok { if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok {
subnet.ProviderID = subnetID subnet.ID = subnetID
} }
utilitySubnets = append(utilitySubnets, subnet) utilitySubnets = append(utilitySubnets, subnet)
} }

View File

@ -68,22 +68,22 @@ func assignCIDRsToSubnets(c *kops.Cluster, cloud fi.Cloud) error {
} }
for i := range c.Spec.Subnets { for i := range c.Spec.Subnets {
subnet := &c.Spec.Subnets[i] subnet := &c.Spec.Subnets[i]
if subnet.ProviderID != "" { if subnet.ID != "" {
cloudSubnet := subnetByID[subnet.ProviderID] cloudSubnet := subnetByID[subnet.ID]
if cloudSubnet == nil { if cloudSubnet == nil {
return fmt.Errorf("Subnet %q not found in VPC %q", subnet.ProviderID, c.Spec.NetworkID) return fmt.Errorf("Subnet %q not found in VPC %q", subnet.ID, c.Spec.NetworkID)
} }
if subnet.CIDR == "" { if subnet.CIDR == "" {
subnet.CIDR = cloudSubnet.CIDR subnet.CIDR = cloudSubnet.CIDR
if subnet.CIDR == "" { if subnet.CIDR == "" {
return fmt.Errorf("Subnet %q did not have CIDR", subnet.ProviderID) return fmt.Errorf("Subnet %q did not have CIDR", subnet.ID)
} }
} else if subnet.CIDR != cloudSubnet.CIDR { } else if subnet.CIDR != cloudSubnet.CIDR {
return fmt.Errorf("Subnet %q has configured CIDR %q, but the actual CIDR found was %q", subnet.ProviderID, subnet.CIDR, cloudSubnet.CIDR) return fmt.Errorf("Subnet %q has configured CIDR %q, but the actual CIDR found was %q", subnet.ID, subnet.CIDR, cloudSubnet.CIDR)
} }
if subnet.Zone != cloudSubnet.Zone { if subnet.Zone != cloudSubnet.Zone {
return fmt.Errorf("Subnet %q has configured Zone %q, but the actual Zone found was %q", subnet.ProviderID, subnet.Zone, cloudSubnet.Zone) return fmt.Errorf("Subnet %q has configured Zone %q, but the actual Zone found was %q", subnet.ID, subnet.Zone, cloudSubnet.Zone)
} }
} }