mirror of https://github.com/kubernetes/kops.git
Merge pull request #14609 from johngmyers/v1alpha3-misc
Miscellaneous non-user-visible API changes
This commit is contained in:
commit
168d918a45
|
|
@ -5531,8 +5531,8 @@ spec:
|
|||
this subnet
|
||||
type: string
|
||||
id:
|
||||
description: ProviderID is the cloud provider id for the objects
|
||||
associated with the zone (the subnet on AWS)
|
||||
description: ID is the cloud provider ID for the objects associated
|
||||
with the zone (the subnet on AWS).
|
||||
type: string
|
||||
ipv6CIDR:
|
||||
description: IPv6CIDR is the IPv6 CIDR block assigned to the
|
||||
|
|
|
|||
|
|
@ -725,8 +725,8 @@ type ClusterSubnetSpec struct {
|
|||
Zone string `json:"zone,omitempty"`
|
||||
// Region is the region the subnet is in, set for subnets that are regionally scoped
|
||||
Region string `json:"region,omitempty"`
|
||||
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS)
|
||||
ProviderID string `json:"id,omitempty"`
|
||||
// ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
|
||||
ID string `json:"id,omitempty"`
|
||||
// Egress defines the method of traffic egress for this subnet
|
||||
Egress string `json:"egress,omitempty"`
|
||||
// Type define which one if the internal types (public, utility, private) the network is
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ type InstanceGroupSpec struct {
|
|||
// SuspendProcesses disables the listed Scaling Policies
|
||||
SuspendProcesses []string `json:"suspendProcesses,omitempty"`
|
||||
// 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 *bool `json:"detailedInstanceMonitoring,omitempty"`
|
||||
// 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
|
||||
type LoadBalancer struct {
|
||||
type LoadBalancerSpec struct {
|
||||
// LoadBalancerName to associate with this instance group (AWS ELB)
|
||||
LoadBalancerName *string `json:"loadBalancerName,omitempty"`
|
||||
// TargetGroupARN to associate with this instance group (AWS ALB/NLB)
|
||||
|
|
|
|||
|
|
@ -699,8 +699,8 @@ type ClusterSubnetSpec struct {
|
|||
// IPv6CIDR is the IPv6 CIDR block assigned to the subnet.
|
||||
IPv6CIDR string `json:"ipv6CIDR,omitempty"`
|
||||
|
||||
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS)
|
||||
ProviderID string `json:"id,omitempty"`
|
||||
// ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Egress defines the method of traffic egress for this subnet
|
||||
Egress string `json:"egress,omitempty"`
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ type InstanceGroupSpec struct {
|
|||
// SuspendProcesses disables the listed Scaling Policies
|
||||
SuspendProcesses []string `json:"suspendProcesses,omitempty"`
|
||||
// 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 *bool `json:"detailedInstanceMonitoring,omitempty"`
|
||||
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
|
||||
|
|
@ -272,7 +272,7 @@ type IAMProfileSpec struct {
|
|||
}
|
||||
|
||||
// LoadBalancer defines a load balancer
|
||||
type LoadBalancer struct {
|
||||
type LoadBalancerSpec struct {
|
||||
// LoadBalancerName to associate with this instance group (AWS ELB)
|
||||
LoadBalancerName *string `json:"loadBalancerName,omitempty"`
|
||||
// TargetGroupARN to associate with this instance group (AWS ALB/NLB)
|
||||
|
|
|
|||
|
|
@ -764,16 +764,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
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 {
|
||||
return Convert_v1alpha2_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope)
|
||||
}); err != nil {
|
||||
|
|
@ -784,6 +774,16 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
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 {
|
||||
return Convert_v1alpha2_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope)
|
||||
}); err != nil {
|
||||
|
|
@ -3253,7 +3253,7 @@ func autoConvert_v1alpha2_ClusterSubnetSpec_To_kops_ClusterSubnetSpec(in *Cluste
|
|||
out.Region = in.Region
|
||||
out.CIDR = in.CIDR
|
||||
out.IPv6CIDR = in.IPv6CIDR
|
||||
out.ProviderID = in.ProviderID
|
||||
out.ID = in.ID
|
||||
out.Egress = in.Egress
|
||||
out.Type = kops.SubnetType(in.Type)
|
||||
out.PublicIP = in.PublicIP
|
||||
|
|
@ -3282,7 +3282,7 @@ func autoConvert_kops_ClusterSubnetSpec_To_v1alpha2_ClusterSubnetSpec(in *kops.C
|
|||
out.IPv6CIDR = in.IPv6CIDR
|
||||
out.Zone = in.Zone
|
||||
out.Region = in.Region
|
||||
out.ProviderID = in.ProviderID
|
||||
out.ID = in.ID
|
||||
out.Egress = in.Egress
|
||||
out.Type = SubnetType(in.Type)
|
||||
out.PublicIP = in.PublicIP
|
||||
|
|
@ -4428,9 +4428,9 @@ func autoConvert_v1alpha2_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *Instan
|
|||
out.SuspendProcesses = in.SuspendProcesses
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]kops.LoadBalancer, len(*in))
|
||||
*out = make([]kops.LoadBalancerSpec, len(*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
|
||||
}
|
||||
}
|
||||
|
|
@ -4613,9 +4613,9 @@ func autoConvert_kops_InstanceGroupSpec_To_v1alpha2_InstanceGroupSpec(in *kops.I
|
|||
out.SuspendProcesses = in.SuspendProcesses
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]LoadBalancer, len(*in))
|
||||
*out = make([]LoadBalancerSpec, len(*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
|
||||
}
|
||||
}
|
||||
|
|
@ -5796,28 +5796,6 @@ func Convert_kops_LeaderElectionConfiguration_To_v1alpha2_LeaderElectionConfigur
|
|||
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 {
|
||||
out.Class = kops.LoadBalancerClass(in.Class)
|
||||
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)
|
||||
}
|
||||
|
||||
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 {
|
||||
out.Name = in.Name
|
||||
out.PrivateIPv4Address = in.PrivateIPv4Address
|
||||
|
|
|
|||
|
|
@ -2536,7 +2536,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
|
|||
}
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]LoadBalancer, len(*in))
|
||||
*out = make([]LoadBalancerSpec, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
|
|
@ -4031,32 +4031,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
|
|||
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.
|
||||
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
|
||||
*out = *in
|
||||
|
|
@ -4110,6 +4084,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
|
|||
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.
|
||||
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
|
||||
*out = *in
|
||||
|
|
|
|||
|
|
@ -661,8 +661,8 @@ type ClusterSubnetSpec struct {
|
|||
// IPv6CIDR is the IPv6 CIDR block assigned to the subnet.
|
||||
IPv6CIDR string `json:"ipv6CIDR,omitempty"`
|
||||
|
||||
// ProviderID is the cloud provider id for the objects associated with the zone (the subnet on AWS)
|
||||
ProviderID string `json:"id,omitempty"`
|
||||
// ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS).
|
||||
ID string `json:"id,omitempty"`
|
||||
|
||||
// Egress defines the method of traffic egress for this subnet
|
||||
Egress string `json:"egress,omitempty"`
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ type InstanceGroupSpec struct {
|
|||
// SuspendProcesses disables the listed Scaling Policies
|
||||
SuspendProcesses []string `json:"suspendProcesses,omitempty"`
|
||||
// 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 *bool `json:"detailedInstanceMonitoring,omitempty"`
|
||||
// IAMProfileSpec defines the identity of the cloud group IAM profile (AWS only).
|
||||
|
|
@ -269,7 +269,7 @@ type IAMProfileSpec struct {
|
|||
}
|
||||
|
||||
// LoadBalancer defines a load balancer
|
||||
type LoadBalancer struct {
|
||||
type LoadBalancerSpec struct {
|
||||
// LoadBalancerName to associate with this instance group (AWS ELB)
|
||||
LoadBalancerName *string `json:"loadBalancerName,omitempty"`
|
||||
// TargetGroupARN to associate with this instance group (AWS ALB/NLB)
|
||||
|
|
|
|||
|
|
@ -844,16 +844,6 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
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 {
|
||||
return Convert_v1alpha3_LoadBalancerAccessSpec_To_kops_LoadBalancerAccessSpec(a.(*LoadBalancerAccessSpec), b.(*kops.LoadBalancerAccessSpec), scope)
|
||||
}); err != nil {
|
||||
|
|
@ -864,6 +854,16 @@ func RegisterConversions(s *runtime.Scheme) error {
|
|||
}); err != nil {
|
||||
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 {
|
||||
return Convert_v1alpha3_LoadBalancerSubnetSpec_To_kops_LoadBalancerSubnetSpec(a.(*LoadBalancerSubnetSpec), b.(*kops.LoadBalancerSubnetSpec), scope)
|
||||
}); err != nil {
|
||||
|
|
@ -3353,7 +3353,7 @@ func autoConvert_v1alpha3_ClusterSubnetSpec_To_kops_ClusterSubnetSpec(in *Cluste
|
|||
out.Region = in.Region
|
||||
out.CIDR = in.CIDR
|
||||
out.IPv6CIDR = in.IPv6CIDR
|
||||
out.ProviderID = in.ProviderID
|
||||
out.ID = in.ID
|
||||
out.Egress = in.Egress
|
||||
out.Type = kops.SubnetType(in.Type)
|
||||
out.PublicIP = in.PublicIP
|
||||
|
|
@ -3382,7 +3382,7 @@ func autoConvert_kops_ClusterSubnetSpec_To_v1alpha3_ClusterSubnetSpec(in *kops.C
|
|||
out.IPv6CIDR = in.IPv6CIDR
|
||||
out.Zone = in.Zone
|
||||
out.Region = in.Region
|
||||
out.ProviderID = in.ProviderID
|
||||
out.ID = in.ID
|
||||
out.Egress = in.Egress
|
||||
out.Type = SubnetType(in.Type)
|
||||
out.PublicIP = in.PublicIP
|
||||
|
|
@ -4589,9 +4589,9 @@ func autoConvert_v1alpha3_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *Instan
|
|||
out.SuspendProcesses = in.SuspendProcesses
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]kops.LoadBalancer, len(*in))
|
||||
*out = make([]kops.LoadBalancerSpec, len(*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
|
||||
}
|
||||
}
|
||||
|
|
@ -4774,9 +4774,9 @@ func autoConvert_kops_InstanceGroupSpec_To_v1alpha3_InstanceGroupSpec(in *kops.I
|
|||
out.SuspendProcesses = in.SuspendProcesses
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]LoadBalancer, len(*in))
|
||||
*out = make([]LoadBalancerSpec, len(*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
|
||||
}
|
||||
}
|
||||
|
|
@ -5955,28 +5955,6 @@ func Convert_kops_LeaderElectionConfiguration_To_v1alpha3_LeaderElectionConfigur
|
|||
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 {
|
||||
out.Class = kops.LoadBalancerClass(in.Class)
|
||||
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)
|
||||
}
|
||||
|
||||
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 {
|
||||
out.Name = in.Name
|
||||
out.PrivateIPv4Address = in.PrivateIPv4Address
|
||||
|
|
|
|||
|
|
@ -2506,7 +2506,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
|
|||
}
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]LoadBalancer, len(*in))
|
||||
*out = make([]LoadBalancerSpec, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
|
|
@ -4001,32 +4001,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
|
|||
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.
|
||||
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
|
||||
*out = *in
|
||||
|
|
@ -4080,6 +4054,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
|
|||
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.
|
||||
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
|
||||
*out = *in
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ func awsValidateCluster(c *kops.Cluster) field.ErrorList {
|
|||
for i, subnet := range c.Spec.Subnets {
|
||||
f := field.NewPath("spec", "subnets").Index(i)
|
||||
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"))
|
||||
} else if subnet.Type != kops.SubnetTypePrivate {
|
||||
allErrs = append(allErrs, field.Invalid(f, subnet, "additional routes can only be added on private subnets"))
|
||||
|
|
|
|||
|
|
@ -825,7 +825,7 @@ func TestAWSAdditionalRoutes(t *testing.T) {
|
|||
NetworkCIDR: test.clusterCidr,
|
||||
Subnets: []kops.ClusterSubnetSpec{
|
||||
{
|
||||
ProviderID: test.providerId,
|
||||
ID: test.providerId,
|
||||
Type: test.subnetType,
|
||||
AdditionalRoutes: test.route,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ func validateIGCloudLabels(ig *kops.InstanceGroup, fldPath *field.Path) (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{}
|
||||
|
||||
if lb.LoadBalancerName != nil && lb.TargetGroupARN != nil {
|
||||
|
|
|
|||
|
|
@ -464,9 +464,9 @@ func validateSubnets(cluster *kops.ClusterSpec, fieldPath *field.Path) field.Err
|
|||
|
||||
// cannot mix subnets with specified ID and without specified id
|
||||
if len(subnets) > 0 {
|
||||
hasID := subnets[0].ProviderID != ""
|
||||
hasID := subnets[0].ID != ""
|
||||
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"))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,14 +138,14 @@ func TestValidateSubnets(t *testing.T) {
|
|||
},
|
||||
{
|
||||
Input: []kops.ClusterSubnetSpec{
|
||||
{Name: "a", ProviderID: "a", Type: kops.SubnetTypePublic},
|
||||
{Name: "b", ProviderID: "b", Type: kops.SubnetTypePublic},
|
||||
{Name: "a", ID: "a", Type: kops.SubnetTypePublic},
|
||||
{Name: "b", ID: "b", Type: kops.SubnetTypePublic},
|
||||
},
|
||||
},
|
||||
{
|
||||
Input: []kops.ClusterSubnetSpec{
|
||||
{Name: "a", ProviderID: "a", Type: kops.SubnetTypePublic},
|
||||
{Name: "b", ProviderID: "", Type: kops.SubnetTypePublic},
|
||||
{Name: "a", ID: "a", Type: kops.SubnetTypePublic},
|
||||
{Name: "b", ID: "", Type: kops.SubnetTypePublic},
|
||||
},
|
||||
ExpectedErrors: []string{"Forbidden::subnets[1].id"},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2669,7 +2669,7 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
|
|||
}
|
||||
if in.ExternalLoadBalancers != nil {
|
||||
in, out := &in.ExternalLoadBalancers, &out.ExternalLoadBalancers
|
||||
*out = make([]LoadBalancer, len(*in))
|
||||
*out = make([]LoadBalancerSpec, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
|
|
@ -4196,32 +4196,6 @@ func (in *LeaderElectionConfiguration) DeepCopy() *LeaderElectionConfiguration {
|
|||
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.
|
||||
func (in *LoadBalancerAccessSpec) DeepCopyInto(out *LoadBalancerAccessSpec) {
|
||||
*out = *in
|
||||
|
|
@ -4275,6 +4249,32 @@ func (in *LoadBalancerAccessSpec) DeepCopy() *LoadBalancerAccessSpec {
|
|||
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.
|
||||
func (in *LoadBalancerSubnetSpec) DeepCopyInto(out *LoadBalancerSubnetSpec) {
|
||||
*out = *in
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
|
||||
for i := range b.Cluster.Spec.Subnets {
|
||||
subnetSpec := &b.Cluster.Spec.Subnets[i]
|
||||
sharedSubnet := subnetSpec.ProviderID != ""
|
||||
sharedSubnet := subnetSpec.ID != ""
|
||||
if !sharedSubnet {
|
||||
allSubnetsShared = false
|
||||
allSubnetsSharedInZone[subnetSpec.Zone] = false
|
||||
|
|
@ -225,7 +225,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
|
||||
for i := range b.Cluster.Spec.Subnets {
|
||||
subnetSpec := &b.Cluster.Spec.Subnets[i]
|
||||
sharedSubnet := subnetSpec.ProviderID != ""
|
||||
sharedSubnet := subnetSpec.ID != ""
|
||||
subnetName := subnetSpec.Name + "." + b.ClusterName()
|
||||
tags := map[string]string{}
|
||||
|
||||
|
|
@ -293,8 +293,8 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
}
|
||||
subnet.IPv6CIDR = fi.PtrTo(subnetSpec.IPv6CIDR)
|
||||
}
|
||||
if subnetSpec.ProviderID != "" {
|
||||
subnet.ID = fi.PtrTo(subnetSpec.ProviderID)
|
||||
if subnetSpec.ID != "" {
|
||||
subnet.ID = fi.PtrTo(subnetSpec.ID)
|
||||
}
|
||||
c.AddTask(subnet)
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
func subnetNotSpecified(sn kops.LoadBalancerSubnetSpec, subnets []kops.ClusterSubnetSpec) bool {
|
||||
for _, csn := range subnets {
|
||||
if csn.Name == sn.Name || csn.ProviderID == sn.Name {
|
||||
if csn.Name == sn.Name || csn.ID == sn.Name {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ func (c *GCEModelContext) NameForIPAliasRange(key string) string {
|
|||
|
||||
// LinkToSubnet returns a link to the GCE subnet object
|
||||
func (c *GCEModelContext) LinkToSubnet(subnet *kops.ClusterSubnetSpec) *gcetasks.Subnet {
|
||||
name := subnet.ProviderID
|
||||
name := subnet.ID
|
||||
if name == "" {
|
||||
name = gce.ClusterSuffixedName(subnet.Name, c.Cluster.ObjectMeta.Name, 63)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
for i := range b.Cluster.Spec.Subnets {
|
||||
subnet := &b.Cluster.Spec.Subnets[i]
|
||||
|
||||
sharedSubnet := subnet.ProviderID != ""
|
||||
sharedSubnet := subnet.ID != ""
|
||||
|
||||
network, err := b.LinkToNetwork()
|
||||
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 subnet.ProviderID != "" {
|
||||
if subnet.ID != "" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ func (c *OpenstackModelContext) GetNetworkName() (string, error) {
|
|||
func (c *OpenstackModelContext) findSubnetClusterSpec(subnet string) (string, error) {
|
||||
for _, sp := range c.Cluster.Spec.Subnets {
|
||||
if sp.Name == subnet {
|
||||
name, err := c.findSubnetNameByID(sp.ProviderID, sp.Name)
|
||||
name, err := c.findSubnetNameByID(sp.ID, sp.Name)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,10 +61,10 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
routerName := strings.Replace(clusterName, ".", "-", -1)
|
||||
for _, sp := range b.Cluster.Spec.Subnets {
|
||||
// assumes that we do not need to create routers if we use existing subnets
|
||||
if sp.ProviderID != "" {
|
||||
if sp.ID != "" {
|
||||
needRouter = false
|
||||
}
|
||||
subnetName, err := b.findSubnetNameByID(sp.ProviderID, sp.Name)
|
||||
subnetName, err := b.findSubnetNameByID(sp.ID, sp.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ func (b *ServerGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
|
|||
var err error
|
||||
for _, sp := range b.Cluster.Spec.Subnets {
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ func performSubnetAssignments(ctx context.Context, c *kops.Cluster, cloudObj fi.
|
|||
needCIDR := 0
|
||||
for i := range c.Spec.Subnets {
|
||||
subnet := &c.Spec.Subnets[i]
|
||||
if subnet.ProviderID != "" {
|
||||
if subnet.ID != "" {
|
||||
continue
|
||||
}
|
||||
if subnet.CIDR == "" {
|
||||
|
|
@ -212,7 +212,7 @@ func performSubnetAssignments(ctx context.Context, c *kops.Cluster, cloudObj fi.
|
|||
|
||||
for i := range c.Spec.Subnets {
|
||||
subnet := &c.Spec.Subnets[i]
|
||||
if subnet.ProviderID != "" {
|
||||
if subnet.ID != "" {
|
||||
continue
|
||||
}
|
||||
if subnet.CIDR != "" {
|
||||
|
|
|
|||
|
|
@ -643,8 +643,7 @@ func setupZones(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.Stri
|
|||
if len(opt.SubnetIDs) != 1 {
|
||||
return nil, fmt.Errorf("expected exactly one subnet for GCE, got %d", len(opt.SubnetIDs))
|
||||
}
|
||||
providerID := opt.SubnetIDs[0]
|
||||
subnet.ProviderID = providerID
|
||||
subnet.ID = opt.SubnetIDs[0]
|
||||
}
|
||||
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,
|
||||
}
|
||||
if subnetID, ok := zoneToSubnetProviderID[zoneName]; ok {
|
||||
subnet.ProviderID = subnetID
|
||||
subnet.ID = subnetID
|
||||
}
|
||||
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,
|
||||
}
|
||||
if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok {
|
||||
subnet.ProviderID = subnetID
|
||||
subnet.ID = subnetID
|
||||
}
|
||||
dualStackSubnets = append(dualStackSubnets, subnet)
|
||||
}
|
||||
|
|
@ -1253,7 +1252,7 @@ func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.S
|
|||
Region: s.Region,
|
||||
}
|
||||
if subnetID, ok := zoneToSubnetProviderID[s.Zone]; ok {
|
||||
subnet.ProviderID = subnetID
|
||||
subnet.ID = subnetID
|
||||
}
|
||||
utilitySubnets = append(utilitySubnets, subnet)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,22 +68,22 @@ func assignCIDRsToSubnets(c *kops.Cluster, cloud fi.Cloud) error {
|
|||
}
|
||||
for i := range c.Spec.Subnets {
|
||||
subnet := &c.Spec.Subnets[i]
|
||||
if subnet.ProviderID != "" {
|
||||
cloudSubnet := subnetByID[subnet.ProviderID]
|
||||
if subnet.ID != "" {
|
||||
cloudSubnet := subnetByID[subnet.ID]
|
||||
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 == "" {
|
||||
subnet.CIDR = cloudSubnet.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 {
|
||||
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 {
|
||||
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)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue