From 6e6d41799332214c21d0d833fb6d343128ee22d6 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 21:52:17 -0400 Subject: [PATCH 1/7] endpointslice API: add accepting and terminating conditions Signed-off-by: Andrew Sy Kim --- api/openapi-spec/swagger.json | 10 +- pkg/apis/discovery/types.go | 15 +- .../v1alpha1/zz_generated.conversion.go | 4 + .../v1beta1/zz_generated.conversion.go | 4 + pkg/apis/discovery/zz_generated.deepcopy.go | 10 ++ .../api/discovery/v1alpha1/generated.pb.go | 168 +++++++++++++----- .../api/discovery/v1alpha1/generated.proto | 15 +- .../k8s.io/api/discovery/v1alpha1/types.go | 15 +- .../v1alpha1/types_swagger_doc_generated.go | 6 +- .../v1alpha1/zz_generated.deepcopy.go | 10 ++ .../api/discovery/v1beta1/generated.pb.go | 168 +++++++++++++----- .../api/discovery/v1beta1/generated.proto | 15 +- .../src/k8s.io/api/discovery/v1beta1/types.go | 15 +- .../v1beta1/types_swagger_doc_generated.go | 6 +- .../v1beta1/zz_generated.deepcopy.go | 10 ++ 15 files changed, 365 insertions(+), 106 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index a618dc27427..f6ed9151e67 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -10913,8 +10913,16 @@ "io.k8s.api.discovery.v1beta1.EndpointConditions": { "description": "EndpointConditions represents the current condition of an endpoint.", "properties": { + "accepting": { + "description": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "type": "boolean" + }, "ready": { - "description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready.", + "description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", + "type": "boolean" + }, + "terminating": { + "description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", "type": "boolean" } }, diff --git a/pkg/apis/discovery/types.go b/pkg/apis/discovery/types.go index 9cc410cc806..6534218b36d 100644 --- a/pkg/apis/discovery/types.go +++ b/pkg/apis/discovery/types.go @@ -114,8 +114,21 @@ type EndpointConditions struct { // ready indicates that this endpoint is prepared to receive traffic, // according to whatever system is managing the endpoint. A nil value // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. + // unknown state as ready. For compatibility reasons, ready should never be + // "true" for terminating endpoints. Ready *bool + + // accepting is identical to ready except that it is set regardless of the terminating + // state of endpoints. This condition should be set to true for a ready endpoint that + // is terminating. If nil, consumers should defer to the ready condition. + // +optional + Accepting *bool + + // terminating indicates that this endpoint is terminating. A nil value indicates an + // unknown state. Consumers should interpret this unknown state to mean that the + // endpoint is not terminating. + // +optional + Terminating *bool } // EndpointPort represents a Port used by an EndpointSlice. diff --git a/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go b/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go index 236ba256733..9ab78314e18 100644 --- a/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go @@ -125,6 +125,8 @@ func Convert_discovery_Endpoint_To_v1alpha1_Endpoint(in *discovery.Endpoint, out func autoConvert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1alpha1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) + out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } @@ -135,6 +137,8 @@ func Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1a func autoConvert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(in *discovery.EndpointConditions, out *v1alpha1.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) + out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } diff --git a/pkg/apis/discovery/v1beta1/zz_generated.conversion.go b/pkg/apis/discovery/v1beta1/zz_generated.conversion.go index c7eb5cd62da..f56917613b8 100644 --- a/pkg/apis/discovery/v1beta1/zz_generated.conversion.go +++ b/pkg/apis/discovery/v1beta1/zz_generated.conversion.go @@ -125,6 +125,8 @@ func Convert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint, out func autoConvert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(in *v1beta1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) + out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } @@ -135,6 +137,8 @@ func Convert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(in *v1be func autoConvert_discovery_EndpointConditions_To_v1beta1_EndpointConditions(in *discovery.EndpointConditions, out *v1beta1.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) + out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } diff --git a/pkg/apis/discovery/zz_generated.deepcopy.go b/pkg/apis/discovery/zz_generated.deepcopy.go index 483988691a9..160343ea6f0 100644 --- a/pkg/apis/discovery/zz_generated.deepcopy.go +++ b/pkg/apis/discovery/zz_generated.deepcopy.go @@ -72,6 +72,16 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } + if in.Accepting != nil { + in, out := &in.Accepting, &out.Accepting + *out = new(bool) + **out = **in + } + if in.Terminating != nil { + in, out := &in.Terminating, &out.Terminating + *out = new(bool) + **out = **in + } return } diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go b/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go index 45c4382cf5f..875bcc76f5a 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go @@ -200,54 +200,56 @@ func init() { } var fileDescriptor_772f83c5b34e07a5 = []byte{ - // 746 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4b, 0x6f, 0xd3, 0x4a, - 0x14, 0x8e, 0x9b, 0x5a, 0xb2, 0x27, 0x8d, 0x6e, 0x3b, 0xba, 0x8b, 0x28, 0xf7, 0x5e, 0x3b, 0xca, - 0x5d, 0x10, 0xa9, 0x30, 0x26, 0x15, 0x45, 0x15, 0xac, 0x6a, 0x28, 0x0f, 0x89, 0x47, 0x18, 0xba, - 0x40, 0x88, 0x05, 0x13, 0x7b, 0xea, 0x98, 0x24, 0x1e, 0xcb, 0x9e, 0x44, 0xca, 0x8e, 0x9f, 0xc0, - 0x0f, 0x62, 0x89, 0x50, 0x97, 0x5d, 0x76, 0x65, 0x51, 0xf7, 0x5f, 0x74, 0x85, 0x66, 0xfc, 0x4a, - 0x09, 0x8f, 0xec, 0x66, 0xbe, 0x39, 0xdf, 0x77, 0xce, 0xf9, 0xe6, 0x1c, 0xf0, 0x68, 0x7c, 0x10, - 0x23, 0x9f, 0x59, 0xe3, 0xd9, 0x90, 0x46, 0x01, 0xe5, 0x34, 0xb6, 0xe6, 0x34, 0x70, 0x59, 0x64, - 0xe5, 0x0f, 0x24, 0xf4, 0x2d, 0xd7, 0x8f, 0x1d, 0x36, 0xa7, 0xd1, 0xc2, 0x9a, 0xf7, 0xc9, 0x24, - 0x1c, 0x91, 0xbe, 0xe5, 0xd1, 0x80, 0x46, 0x84, 0x53, 0x17, 0x85, 0x11, 0xe3, 0x0c, 0xfe, 0x97,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 0x54, 0x48, 0xe0, 0x4c, 0xc9, 0x46, 0xa7, 0x17, 0x46, 0xed, 0xec, 0xc2, 0xa8, - 0x9d, 0x5f, 0x18, 0xb5, 0x8f, 0xa9, 0xa1, 0x9c, 0xa6, 0x86, 0x72, 0x96, 0x1a, 0xca, 0x79, 0x6a, - 0x28, 0xdf, 0x52, 0x43, 0xf9, 0x74, 0x69, 0xd4, 0xde, 0x6a, 0x85, 0xe6, 0xf7, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x65, 0x85, 0x5a, 0x9b, 0x75, 0x06, 0x00, 0x00, + // 781 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x8f, 0xe3, 0x44, + 0x10, 0x8d, 0x27, 0x63, 0xc9, 0xee, 0x6c, 0xc4, 0x6e, 0x8b, 0x43, 0x14, 0xc0, 0x8e, 0xc2, 0x81, + 0x48, 0x03, 0x6d, 0x32, 0x02, 0xb4, 0x82, 0xd3, 0x18, 0x96, 0x0f, 0x89, 0x8f, 0xd0, 0xe4, 0x80, + 0x10, 0x07, 0x3a, 0x76, 0xad, 0x63, 0x12, 0xbb, 0x2d, 0xbb, 0x13, 0x29, 0x37, 0x7e, 0x02, 0x17, + 0xfe, 0x0d, 0x47, 0x84, 0xe6, 0xb8, 0xc7, 0x39, 0x59, 0x8c, 0xe7, 0x5f, 0xcc, 0x09, 0x75, 0xfb, + 0x73, 0x08, 0xb0, 0xb9, 0x75, 0xbf, 0xae, 0xf7, 0xaa, 0x5e, 0x75, 0x15, 0xfa, 0x74, 0xf3, 0x34, + 0x23, 0x21, 0x77, 0x36, 0xbb, 0x15, 0xa4, 0x31, 0x08, 0xc8, 0x9c, 0x3d, 0xc4, 0x3e, 0x4f, 0x9d, + 0xea, 0x81, 0x25, 0xa1, 0xe3, 0x87, 0x99, 0xc7, 0xf7, 0x90, 0x1e, 0x9c, 0xfd, 0x9c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 0x55, + 0x7e, 0x84, 0x3b, 0xac, 0x94, 0x75, 0x79, 0xcb, 0x68, 0x29, 0x34, 0xfd, 0x43, 0x43, 0x4f, 0x1e, + 0x74, 0xf9, 0xcb, 0x30, 0x13, 0xf8, 0xc7, 0xa3, 0x4e, 0x93, 0xd3, 0x3a, 0x2d, 0xd9, 0xaa, 0xcf, + 0xcd, 0xde, 0xd5, 0x48, 0xa7, 0xcb, 0xdf, 0x22, 0x3d, 0x14, 0x10, 0xd5, 0xbd, 0x79, 0xfb, 0x44, + 0x17, 0xaa, 0xbc, 0xd6, 0xc6, 0x17, 0x52, 0x82, 0x96, 0x4a, 0x2e, 0xb9, 0xbe, 0xb5, 0x7a, 0x2f, + 0x6e, 0xad, 0xde, 0xcd, 0xad, 0xd5, 0xfb, 0xa5, 0xb0, 0xb4, 0xeb, 0xc2, 0xd2, 0x5e, 0x14, 0x96, + 0x76, 0x53, 0x58, 0xda, 0x5f, 0x85, 0xa5, 0xfd, 0x7a, 0x67, 0xf5, 0x7e, 0x30, 0x6a, 0xcd, 0xbf, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xea, 0x19, 0xfd, 0x6e, 0xd6, 0x06, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -355,6 +357,26 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Terminating != nil { + i-- + if *m.Terminating { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Accepting != nil { + i-- + if *m.Accepting { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } if m.Ready != nil { i-- if *m.Ready { @@ -583,6 +605,12 @@ func (m *EndpointConditions) Size() (n int) { if m.Ready != nil { n += 2 } + if m.Accepting != nil { + n += 2 + } + if m.Terminating != nil { + n += 2 + } return n } @@ -688,6 +716,8 @@ func (this *EndpointConditions) String() string { } s := strings.Join([]string{`&EndpointConditions{`, `Ready:` + valueToStringGenerated(this.Ready) + `,`, + `Accepting:` + valueToStringGenerated(this.Accepting) + `,`, + `Terminating:` + valueToStringGenerated(this.Terminating) + `,`, `}`, }, "") return s @@ -1116,6 +1146,48 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.Ready = &b + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Accepting", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Accepting = &b + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Terminating", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Terminating = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto b/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto index 3d9c0f82879..f5e1ea5308f 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto @@ -76,9 +76,22 @@ message EndpointConditions { // ready indicates that this endpoint is prepared to receive traffic, // according to whatever system is managing the endpoint. A nil value // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. + // unknown state as ready. For compatibility reasons, ready should never be + // "true" for terminating endpoints. // +optional optional bool ready = 1; + + // accepting is identical to ready except that it is set regardless of the terminating + // state of endpoints. This condition should be set to true for a ready endpoint that + // is terminating. If nil, consumers should defer to the ready condition. + // +optional + optional bool accepting = 2; + + // terminating indicates that this endpoint is terminating. A nil value indicates an + // unknown state. Consumers should interpret this unknown state to mean that the + // endpoint is not terminating. + // +optional + optional bool terminating = 3; } // EndpointPort represents a Port used by an EndpointSlice diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/types.go b/staging/src/k8s.io/api/discovery/v1alpha1/types.go index 2db55d81e6e..007915a73dd 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/types.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/types.go @@ -115,9 +115,22 @@ type EndpointConditions struct { // ready indicates that this endpoint is prepared to receive traffic, // according to whatever system is managing the endpoint. A nil value // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. + // unknown state as ready. For compatibility reasons, ready should never be + // "true" for terminating endpoints. // +optional Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` + + // accepting is identical to ready except that it is set regardless of the terminating + // state of endpoints. This condition should be set to true for a ready endpoint that + // is terminating. If nil, consumers should defer to the ready condition. + // +optional + Accepting *bool `json:"accepting,omitempty" protobuf:"bytes,2,name=accepting"` + + // terminating indicates that this endpoint is terminating. A nil value indicates an + // unknown state. Consumers should interpret this unknown state to mean that the + // endpoint is not terminating. + // +optional + Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"` } // EndpointPort represents a Port used by an EndpointSlice diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go index 0d88340d511..8f4988d17a5 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go @@ -41,8 +41,10 @@ func (Endpoint) SwaggerDoc() map[string]string { } var map_EndpointConditions = map[string]string{ - "": "EndpointConditions represents the current condition of an endpoint.", - "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready.", + "": "EndpointConditions represents the current condition of an endpoint.", + "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", + "accepting": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", } func (EndpointConditions) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go index c72f64acfd0..dd0d76309a0 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go @@ -72,6 +72,16 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } + if in.Accepting != nil { + in, out := &in.Accepting, &out.Accepting + *out = new(bool) + **out = **in + } + if in.Terminating != nil { + in, out := &in.Terminating, &out.Terminating + *out = new(bool) + **out = **in + } return } diff --git a/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go b/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go index ce0046c5199..7727eb1c4bc 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go @@ -200,54 +200,56 @@ func init() { } var fileDescriptor_ece80bbc872d519b = []byte{ - // 745 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6b, 0xdb, 0x48, - 0x14, 0xb6, 0xe2, 0x88, 0x95, 0xc6, 0x31, 0x9b, 0x0c, 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 0x47, 0xad, 0x80, 0x51, 0xa9, 0xdb, 0xfe, 0x17, 0x34, - 0xd7, 0x82, 0xe1, 0x3e, 0xa8, 0x8f, 0xc9, 0xa2, 0xa5, 0x88, 0x5e, 0x91, 0x38, 0xc2, 0x5f, 0x80, - 0x3a, 0xc7, 0x93, 0x19, 0x91, 0x1e, 0xeb, 0x28, 0xbb, 0xfc, 0xb3, 0x73, 0xa6, 0x74, 0xff, 0x02, - 0x70, 0xd3, 0x52, 0x68, 0x02, 0x35, 0x26, 0xd8, 0xcb, 0x34, 0x34, 0x47, 0x4f, 0x13, 0x53, 0x45, - 0x02, 0x40, 0x19, 0xde, 0xfd, 0xa0, 0x80, 0xbd, 0x82, 0x37, 0xa0, 0x31, 0x87, 0x87, 0x60, 0x57, - 0x1a, 0x2c, 0x93, 0x3a, 0x5a, 0x9a, 0x98, 0xbb, 0x4f, 0x85, 0xb9, 0x12, 0x85, 0x0f, 0x80, 0x26, - 0x67, 0xc5, 0xa5, 0x93, 0xac, 0x04, 0xe7, 0x48, 0x34, 0x33, 0xc8, 0xb1, 0xfb, 0xc4, 0xfc, 0x75, - 0x73, 0x0f, 0xac, 0xe2, 0x19, 0x95, 0x64, 0x91, 0x26, 0xa2, 0x31, 0x97, 0xff, 0xa8, 0x66, 0x69, - 0x44, 0x7a, 0x24, 0x51, 0xd8, 0x07, 0x0d, 0x1c, 0x45, 0x05, 0x4d, 0xfe, 0xa0, 0xee, 0xfc, 0x9c, - 0x26, 0x66, 0xe3, 0xbc, 0x82, 0xd1, 0x6a, 0x4c, 0x77, 0xb9, 0x03, 0x9a, 0x45, 0x23, 0xcf, 0x26, - 0x81, 0x4b, 0xe0, 0x2b, 0xa0, 0x89, 0x95, 0xf2, 0x30, 0xc7, 0xb2, 0x9b, 0xf5, 0x91, 0x2c, 0x37, - 0xc3, 0x8a, 0xc6, 0xbe, 0x00, 0x98, 0x25, 0xa2, 0xab, 0xa9, 0x78, 0x42, 0x38, 0xae, 0x46, 0xb2, - 0xc2, 0x50, 0xa9, 0x0a, 0xff, 0x07, 0x8d, 0x7c, 0x07, 0xae, 0x16, 0x11, 0xc9, 0xcb, 0xec, 0xe6, - 0x94, 0xc6, 0x79, 0xf5, 0x74, 0xbf, 0x7e, 0x45, 0xab, 0x34, 0xf8, 0x1c, 0xe8, 0x24, 0x2f, 0x5c, - 0xec, 0x8e, 0x98, 0xad, 0xdf, 0xb7, 0x9b, 0x2d, 0xe7, 0x20, 0xcf, 0xa5, 0x17, 0x08, 0x43, 0x95, - 0x16, 0xbc, 0x04, 0xaa, 0x70, 0x93, 0xb5, 0xea, 0x52, 0xf4, 0x8f, 0xed, 0x44, 0xc5, 0x37, 0x38, - 0xcd, 0x5c, 0x58, 0x15, 0x37, 0x86, 0x32, 0x9d, 0xee, 0x7b, 0x05, 0x1c, 0xac, 0x79, 0xfc, 0x38, - 0x60, 0x1c, 0xbe, 0xdc, 0xf0, 0xd9, 0xda, 0xce, 0x67, 0xc1, 0x96, 0x2e, 0x97, 0x4b, 0x51, 0x20, - 0x2b, 0x1e, 0x0f, 0x80, 0x1a, 0x70, 0x32, 0x2d, 0x9c, 0x39, 0xda, 0xae, 0x09, 0x59, 0x5d, 0xd5, - 0xc5, 0x23, 0xa1, 0x80, 0x32, 0x21, 0xe7, 0xf8, 0x66, 0x69, 0xd4, 0x6e, 0x97, 0x46, 0xed, 0x6e, - 0x69, 0xd4, 0xde, 0xa4, 0x86, 0x72, 0x93, 0x1a, 0xca, 0x6d, 0x6a, 0x28, 0x77, 0xa9, 0xa1, 0x7c, - 0x4c, 0x0d, 0xe5, 0xed, 0x27, 0xa3, 0xf6, 0xe2, 0xa7, 0x5c, 0xf2, 0x73, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x29, 0x1a, 0xa2, 0x6f, 0x6d, 0x06, 0x00, 0x00, + // 778 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x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ba, 0x78, 0xe1, 0x0b, 0x20, 0xb5, 0x43, 0xe0, 0xf4, 0xdf, 0x58, 0xf6, 0x7f, + 0xb1, 0x92, 0x55, 0xc4, 0x83, 0x10, 0x0e, 0x08, 0x1f, 0xbd, 0x89, 0x90, 0xba, 0x73, 0x08, 0xe9, + 0x3f, 0x79, 0xc3, 0xdf, 0xda, 0x48, 0xbb, 0x8b, 0xbc, 0x98, 0x05, 0x11, 0xc7, 0x17, 0x48, 0xa7, + 0x9e, 0x97, 0x40, 0x9a, 0x42, 0xda, 0x53, 0x06, 0xed, 0x91, 0xee, 0x74, 0xf3, 0xcc, 0xd4, 0x6f, + 0x2b, 0x90, 0x34, 0xef, 0xd8, 0x43, 0xc8, 0x65, 0x91, 0x17, 0xf0, 0x80, 0x45, 0x69, 0xef, 0x64, + 0xa0, 0x8c, 0x3a, 0x57, 0x1f, 0x5a, 0xff, 0xd7, 0x5e, 0xab, 0x4a, 0xf4, 0x69, 0xcd, 0x73, 0xf0, + 0x63, 0x66, 0xb6, 0xf2, 0xcc, 0x44, 0x0d, 0x46, 0x76, 0x74, 0xf1, 0x08, 0x69, 0x73, 0x96, 0xf2, + 0x88, 0x86, 0xd0, 0x6b, 0x0f, 0x94, 0x91, 0xee, 0xbc, 0xca, 0x33, 0x53, 0xfb, 0xa2, 0xc4, 0x48, + 0xfd, 0x8a, 0x27, 0x48, 0xe7, 0x34, 0xf1, 0x81, 0x13, 0x78, 0xe8, 0x9d, 0xca, 0x72, 0xde, 0xdb, + 0x2d, 0x47, 0x7c, 0x90, 0xb5, 0x1e, 0x5b, 0xf7, 0xb3, 0x9f, 0xc0, 0x15, 0x41, 0x90, 0x40, 0xe4, + 0x42, 0xe1, 0x70, 0x5a, 0x31, 0x49, 0x23, 0x82, 0x67, 0x48, 0xe3, 0x2c, 0x66, 0x4b, 0xe6, 0x6f, + 0x7a, 0xea, 0xa0, 0x3d, 0xea, 0x5c, 0x5d, 0x1f, 0xe7, 0xcf, 0x9a, 0x96, 0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 0xf2, 0x94, 0x1b, 0xca, 0x73, 0x6e, 0x28, + 0x7f, 0xe6, 0x86, 0xf2, 0xcb, 0x5f, 0x46, 0xeb, 0xfb, 0xb7, 0x4a, 0xc9, 0xbf, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xd8, 0x47, 0x63, 0x91, 0xce, 0x06, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -355,6 +357,26 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Terminating != nil { + i-- + if *m.Terminating { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Accepting != nil { + i-- + if *m.Accepting { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } if m.Ready != nil { i-- if *m.Ready { @@ -583,6 +605,12 @@ func (m *EndpointConditions) Size() (n int) { if m.Ready != nil { n += 2 } + if m.Accepting != nil { + n += 2 + } + if m.Terminating != nil { + n += 2 + } return n } @@ -688,6 +716,8 @@ func (this *EndpointConditions) String() string { } s := strings.Join([]string{`&EndpointConditions{`, `Ready:` + valueToStringGenerated(this.Ready) + `,`, + `Accepting:` + valueToStringGenerated(this.Accepting) + `,`, + `Terminating:` + valueToStringGenerated(this.Terminating) + `,`, `}`, }, "") return s @@ -1116,6 +1146,48 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } b := bool(v != 0) m.Ready = &b + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Accepting", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Accepting = &b + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Terminating", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Terminating = &b default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) diff --git a/staging/src/k8s.io/api/discovery/v1beta1/generated.proto b/staging/src/k8s.io/api/discovery/v1beta1/generated.proto index 3a6c3940cc3..6483b57562d 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/discovery/v1beta1/generated.proto @@ -76,9 +76,22 @@ message EndpointConditions { // ready indicates that this endpoint is prepared to receive traffic, // according to whatever system is managing the endpoint. A nil value // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. + // unknown state as ready. For compatibility reasons, ready should never be + // "true" for terminating endpoints. // +optional optional bool ready = 1; + + // accepting is identical to ready except that it is set regardless of the terminating + // state of endpoints. This condition should be set to true for a ready endpoint that + // is terminating. If nil, consumers should defer to the ready condition. + // +optional + optional bool accepting = 2; + + // terminating indicates that this endpoint is terminating. A nil value indicates an + // unknown state. Consumers should interpret this unknown state to mean that the + // endpoint is not terminating. + // +optional + optional bool terminating = 3; } // EndpointPort represents a Port used by an EndpointSlice diff --git a/staging/src/k8s.io/api/discovery/v1beta1/types.go b/staging/src/k8s.io/api/discovery/v1beta1/types.go index 5aecd36eb9e..e9a3d1b8689 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/types.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/types.go @@ -117,9 +117,22 @@ type EndpointConditions struct { // ready indicates that this endpoint is prepared to receive traffic, // according to whatever system is managing the endpoint. A nil value // indicates an unknown state. In most cases consumers should interpret this - // unknown state as ready. + // unknown state as ready. For compatibility reasons, ready should never be + // "true" for terminating endpoints. // +optional Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` + + // accepting is identical to ready except that it is set regardless of the terminating + // state of endpoints. This condition should be set to true for a ready endpoint that + // is terminating. If nil, consumers should defer to the ready condition. + // +optional + Accepting *bool `json:"accepting,omitempty" protobuf:"bytes,2,name=accepting"` + + // terminating indicates that this endpoint is terminating. A nil value indicates an + // unknown state. Consumers should interpret this unknown state to mean that the + // endpoint is not terminating. + // +optional + Terminating *bool `json:"terminating,omitempty" protobuf:"bytes,3,name=terminating"` } // EndpointPort represents a Port used by an EndpointSlice diff --git a/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go index abdd07340f2..1cbd09cfee8 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -41,8 +41,10 @@ func (Endpoint) SwaggerDoc() map[string]string { } var map_EndpointConditions = map[string]string{ - "": "EndpointConditions represents the current condition of an endpoint.", - "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready.", + "": "EndpointConditions represents the current condition of an endpoint.", + "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", + "accepting": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", } func (EndpointConditions) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go index 8490ec73fb2..abdf9eeea99 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go @@ -72,6 +72,16 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } + if in.Accepting != nil { + in, out := &in.Accepting, &out.Accepting + *out = new(bool) + **out = **in + } + if in.Terminating != nil { + in, out := &in.Terminating, &out.Terminating + *out = new(bool) + **out = **in + } return } From 9a7c3c4c344ad2fbd3191aadf6b4ed4e61083b3b Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 22:57:22 -0400 Subject: [PATCH 2/7] feature gate: add gate EndpointSliceTerminatingCondition Signed-off-by: Andrew Sy Kim --- pkg/features/kube_features.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index ab6d4867533..d228da03205 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -651,6 +651,12 @@ const ( // Allows kube-controller-manager to publish kube-root-ca.crt configmap to // every namespace. This feature is a prerequisite of BoundServiceAccountTokenVolume. RootCAConfigMap featuregate.Feature = "RootCAConfigMap" + + // owner: @andrewsykim + // alpha: v1.20 + // + // Enable Terminating condition in Endpoint Slices. + EndpointSliceTerminatingCondition featuregate.Feature = "EndpointSliceTerminatingCondition" ) func init() { @@ -731,6 +737,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS IPv6DualStack: {Default: false, PreRelease: featuregate.Alpha}, EndpointSlice: {Default: true, PreRelease: featuregate.Beta}, EndpointSliceProxying: {Default: true, PreRelease: featuregate.Beta}, + EndpointSliceTerminatingCondition: {Default: false, PreRelease: featuregate.Alpha}, WindowsEndpointSliceProxying: {Default: false, PreRelease: featuregate.Alpha}, EvenPodsSpread: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21 StartupProbe: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21 From 1c603e90ef0dc8190f3787e0bdc77ce5d1b69f81 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 23:24:01 -0400 Subject: [PATCH 3/7] endpointslice controller: set new conditions 'accepting' and 'terminating' Signed-off-by: Andrew Sy Kim --- pkg/controller/endpointslice/BUILD | 5 + .../endpointslice_controller_test.go | 12 +- pkg/controller/endpointslice/reconciler.go | 5 +- .../endpointslice/reconciler_test.go | 74 ++++++--- pkg/controller/endpointslice/utils.go | 13 +- pkg/controller/endpointslice/utils_test.go | 141 ++++++++++++++++-- .../util/endpoint/controller_utils.go | 8 +- .../util/endpoint/controller_utils_test.go | 23 ++- 8 files changed, 229 insertions(+), 52 deletions(-) diff --git a/pkg/controller/endpointslice/BUILD b/pkg/controller/endpointslice/BUILD index 6bbe6bb7065..42288c69b9c 100644 --- a/pkg/controller/endpointslice/BUILD +++ b/pkg/controller/endpointslice/BUILD @@ -19,6 +19,7 @@ go_library( "//pkg/controller:go_default_library", "//pkg/controller/endpointslice/metrics:go_default_library", "//pkg/controller/util/endpoint:go_default_library", + "//pkg/features:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/discovery/v1beta1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", @@ -31,6 +32,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", "//staging/src/k8s.io/client-go/informers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/informers/discovery/v1beta1:go_default_library", "//staging/src/k8s.io/client-go/kubernetes:go_default_library", @@ -61,6 +63,7 @@ go_test( "//pkg/controller:go_default_library", "//pkg/controller/endpointslice/metrics:go_default_library", "//pkg/controller/util/endpoint:go_default_library", + "//pkg/features:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/discovery/v1beta1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", @@ -71,11 +74,13 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/rand:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", "//staging/src/k8s.io/client-go/informers:go_default_library", "//staging/src/k8s.io/client-go/kubernetes/fake:go_default_library", "//staging/src/k8s.io/client-go/listers/core/v1:go_default_library", "//staging/src/k8s.io/client-go/testing:go_default_library", "//staging/src/k8s.io/client-go/tools/cache:go_default_library", + "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library", "//staging/src/k8s.io/component-base/metrics/testutil:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/utils/pointer:go_default_library", diff --git a/pkg/controller/endpointslice/endpointslice_controller_test.go b/pkg/controller/endpointslice/endpointslice_controller_test.go index 9c17c499c6d..bc2d113cb5e 100644 --- a/pkg/controller/endpointslice/endpointslice_controller_test.go +++ b/pkg/controller/endpointslice/endpointslice_controller_test.go @@ -186,11 +186,11 @@ func TestSyncServicePodSelection(t *testing.T) { client, esController := newController([]string{"node-1"}, time.Duration(0)) ns := metav1.NamespaceDefault - pod1 := newPod(1, ns, true, 0) + pod1 := newPod(1, ns, true, 0, false) esController.podStore.Add(pod1) // ensure this pod will not match the selector - pod2 := newPod(2, ns, true, 0) + pod2 := newPod(2, ns, true, 0, false) pod2.Labels["foo"] = "boo" esController.podStore.Add(pod2) @@ -341,11 +341,11 @@ func TestSyncServiceFull(t *testing.T) { namespace := metav1.NamespaceDefault serviceName := "all-the-protocols" - pod1 := newPod(1, namespace, true, 0) + pod1 := newPod(1, namespace, true, 0, false) pod1.Status.PodIPs = []v1.PodIP{{IP: "1.2.3.4"}} esController.podStore.Add(pod1) - pod2 := newPod(2, namespace, true, 0) + pod2 := newPod(2, namespace, true, 0, false) pod2.Status.PodIPs = []v1.PodIP{{IP: "1.2.3.5"}, {IP: "1234::5678:0000:0000:9abc:def0"}} esController.podStore.Add(pod2) @@ -499,7 +499,7 @@ func TestPodAddsBatching(t *testing.T) { for i, add := range tc.adds { time.Sleep(add.delay) - p := newPod(i, ns, true, 0) + p := newPod(i, ns, true, 0, false) esController.podStore.Add(p) esController.addPod(p) } @@ -789,7 +789,7 @@ func TestPodDeleteBatching(t *testing.T) { func addPods(t *testing.T, esController *endpointSliceController, namespace string, podsCount int) { t.Helper() for i := 0; i < podsCount; i++ { - pod := newPod(i, namespace, true, 0) + pod := newPod(i, namespace, true, 0, false) esController.podStore.Add(pod) } } diff --git a/pkg/controller/endpointslice/reconciler.go b/pkg/controller/endpointslice/reconciler.go index 147c62d4c8b..1694844dd30 100644 --- a/pkg/controller/endpointslice/reconciler.go +++ b/pkg/controller/endpointslice/reconciler.go @@ -29,10 +29,12 @@ import ( "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" + utilfeature "k8s.io/apiserver/pkg/util/feature" clientset "k8s.io/client-go/kubernetes" corelisters "k8s.io/client-go/listers/core/v1" "k8s.io/kubernetes/pkg/controller/endpointslice/metrics" endpointutil "k8s.io/kubernetes/pkg/controller/util/endpoint" + "k8s.io/kubernetes/pkg/features" ) // reconciler is responsible for transforming current EndpointSlice state into @@ -136,7 +138,8 @@ func (r *reconciler) reconcileByAddressType(service *corev1.Service, pods []*cor numDesiredEndpoints := 0 for _, pod := range pods { - if !endpointutil.ShouldPodBeInEndpoints(pod, service.Spec.PublishNotReadyAddresses) { + includeTerminating := service.Spec.PublishNotReadyAddresses || utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) + if !endpointutil.ShouldPodBeInEndpointSlice(pod, includeTerminating) { continue } diff --git a/pkg/controller/endpointslice/reconciler_test.go b/pkg/controller/endpointslice/reconciler_test.go index 4710348712b..608b7314450 100644 --- a/pkg/controller/endpointslice/reconciler_test.go +++ b/pkg/controller/endpointslice/reconciler_test.go @@ -32,13 +32,16 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/intstr" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" corelisters "k8s.io/client-go/listers/core/v1" k8stesting "k8s.io/client-go/testing" + featuregatetesting "k8s.io/component-base/featuregate/testing" "k8s.io/component-base/metrics/testutil" "k8s.io/kubernetes/pkg/controller" "k8s.io/kubernetes/pkg/controller/endpointslice/metrics" + "k8s.io/kubernetes/pkg/features" utilpointer "k8s.io/utils/pointer" ) @@ -95,7 +98,7 @@ func TestReconcile1Pod(t *testing.T) { dualStackSvc.Spec.ClusterIP = "10.0.0.10" dualStackSvc.Spec.ClusterIPs = []string{"10.0.0.10", "2000::1"} - pod1 := newPod(1, namespace, true, 1) + pod1 := newPod(1, namespace, true, 1, false) pod1.Status.PodIPs = []corev1.PodIP{{IP: "1.2.3.4"}, {IP: "1234::5678:0000:0000:9abc:def0"}} pod1.Spec.Hostname = "example-hostname" node1 := &corev1.Node{ @@ -114,6 +117,7 @@ func TestReconcile1Pod(t *testing.T) { expectedEndpoint discovery.Endpoint expectedLabels map[string]string expectedEndpointPerSlice map[discovery.AddressType][]discovery.Endpoint + terminatingGateEnabled bool }{ "no-family-service": { service: noFamilyService, @@ -140,7 +144,6 @@ func TestReconcile1Pod(t *testing.T) { discovery.LabelServiceName: "foo", }, }, - "ipv4": { service: svcv4, expectedEndpointPerSlice: map[discovery.AddressType][]discovery.Endpoint{ @@ -167,6 +170,37 @@ func TestReconcile1Pod(t *testing.T) { corev1.IsHeadlessService: "", }, }, + "ipv4-with-terminating-gate-enabled": { + service: svcv4, + expectedEndpointPerSlice: map[discovery.AddressType][]discovery.Endpoint{ + discovery.AddressTypeIPv4: { + { + Addresses: []string{"1.2.3.4"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + Topology: map[string]string{ + "kubernetes.io/hostname": "node-1", + "topology.kubernetes.io/zone": "us-central1-a", + "topology.kubernetes.io/region": "us-central1", + }, + TargetRef: &corev1.ObjectReference{ + Kind: "Pod", + Namespace: namespace, + Name: "pod1", + }, + }, + }, + }, + expectedLabels: map[string]string{ + discovery.LabelManagedBy: controllerName, + discovery.LabelServiceName: "foo", + corev1.IsHeadlessService: "", + }, + terminatingGateEnabled: true, + }, "ipv4-clusterip": { service: svcv4ClusterIP, expectedEndpointPerSlice: map[discovery.AddressType][]discovery.Endpoint{ @@ -389,6 +423,8 @@ func TestReconcile1Pod(t *testing.T) { for name, testCase := range testCases { t.Run(name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testCase.terminatingGateEnabled)() + client := newClientset() setupMetrics() triggerTime := time.Now() @@ -496,7 +532,7 @@ func TestReconcile1EndpointSlicePublishNotReadyAddresses(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 50; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -530,7 +566,7 @@ func TestReconcileManyPods(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -563,7 +599,7 @@ func TestReconcileEndpointSlicesSomePreexisting(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } // have approximately 1/4 in first slice @@ -619,7 +655,7 @@ func TestReconcileEndpointSlicesSomePreexistingWorseAllocation(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 300; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } // have approximately 1/4 in first slice @@ -665,7 +701,7 @@ func TestReconcileEndpointSlicesUpdating(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -698,7 +734,7 @@ func TestReconcileEndpointSlicesServicesLabelsUpdating(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -742,7 +778,7 @@ func TestReconcileEndpointSlicesServicesReservedLabels(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -776,7 +812,7 @@ func TestReconcileEndpointSlicesRecycling(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 300; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } // generate 10 existing slices with 30 pods/endpoints each @@ -827,7 +863,7 @@ func TestReconcileEndpointSlicesUpdatePacking(t *testing.T) { slice1 := newEmptyEndpointSlice(1, namespace, endpointMeta, svc) for i := 0; i < 80; i++ { - pod := newPod(i, namespace, true, 1) + pod := newPod(i, namespace, true, 1, false) slice1.Endpoints = append(slice1.Endpoints, podToEndpoint(pod, &corev1.Node{}, &svc, discovery.AddressTypeIPv4)) pods = append(pods, pod) } @@ -835,7 +871,7 @@ func TestReconcileEndpointSlicesUpdatePacking(t *testing.T) { slice2 := newEmptyEndpointSlice(2, namespace, endpointMeta, svc) for i := 100; i < 120; i++ { - pod := newPod(i, namespace, true, 1) + pod := newPod(i, namespace, true, 1, false) slice2.Endpoints = append(slice2.Endpoints, podToEndpoint(pod, &corev1.Node{}, &svc, discovery.AddressTypeIPv4)) pods = append(pods, pod) } @@ -856,7 +892,7 @@ func TestReconcileEndpointSlicesUpdatePacking(t *testing.T) { // add a few additional endpoints - no more than could fit in either slice. for i := 200; i < 215; i++ { - pods = append(pods, newPod(i, namespace, true, 1)) + pods = append(pods, newPod(i, namespace, true, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) @@ -888,7 +924,7 @@ func TestReconcileEndpointSlicesReplaceDeprecated(t *testing.T) { slice1 := newEmptyEndpointSlice(1, namespace, endpointMeta, svc) for i := 0; i < 80; i++ { - pod := newPod(i, namespace, true, 1) + pod := newPod(i, namespace, true, 1, false) slice1.Endpoints = append(slice1.Endpoints, podToEndpoint(pod, &corev1.Node{}, &corev1.Service{Spec: corev1.ServiceSpec{}}, discovery.AddressTypeIPv4)) pods = append(pods, pod) } @@ -896,7 +932,7 @@ func TestReconcileEndpointSlicesReplaceDeprecated(t *testing.T) { slice2 := newEmptyEndpointSlice(2, namespace, endpointMeta, svc) for i := 100; i < 150; i++ { - pod := newPod(i, namespace, true, 1) + pod := newPod(i, namespace, true, 1, false) slice2.Endpoints = append(slice2.Endpoints, podToEndpoint(pod, &corev1.Node{}, &corev1.Service{Spec: corev1.ServiceSpec{}}, discovery.AddressTypeIPv4)) pods = append(pods, pod) } @@ -955,7 +991,7 @@ func TestReconcileEndpointSlicesRecreation(t *testing.T) { svc, endpointMeta := newServiceAndEndpointMeta("foo", namespace) slice := newEmptyEndpointSlice(1, namespace, endpointMeta, svc) - pod := newPod(1, namespace, true, 1) + pod := newPod(1, namespace, true, 1, false) slice.Endpoints = append(slice.Endpoints, podToEndpoint(pod, &corev1.Node{}, &corev1.Service{Spec: corev1.ServiceSpec{}}, discovery.AddressTypeIPv4)) if !tc.ownedByService { @@ -1023,7 +1059,7 @@ func TestReconcileEndpointSlicesNamedPorts(t *testing.T) { for i := 0; i < 300; i++ { ready := !(i%3 == 0) portOffset := i % 5 - pod := newPod(i, namespace, ready, 1) + pod := newPod(i, namespace, ready, 1, false) pod.Spec.Containers[0].Ports = []corev1.ContainerPort{{ Name: portNameIntStr.StrVal, ContainerPort: int32(8080 + portOffset), @@ -1073,7 +1109,7 @@ func TestReconcileMaxEndpointsPerSlice(t *testing.T) { pods := []*corev1.Pod{} for i := 0; i < 250; i++ { ready := !(i%3 == 0) - pods = append(pods, newPod(i, namespace, ready, 1)) + pods = append(pods, newPod(i, namespace, ready, 1, false)) } testCases := []struct { @@ -1125,7 +1161,7 @@ func TestReconcileEndpointSlicesMetrics(t *testing.T) { // start with 20 pods pods := []*corev1.Pod{} for i := 0; i < 20; i++ { - pods = append(pods, newPod(i, namespace, true, 1)) + pods = append(pods, newPod(i, namespace, true, 1, false)) } r := newReconciler(client, []*corev1.Node{{ObjectMeta: metav1.ObjectMeta{Name: "node-1"}}}, defaultMaxEndpointsPerSlice) diff --git a/pkg/controller/endpointslice/utils.go b/pkg/controller/endpointslice/utils.go index 83cfc028633..03aa71da8dc 100644 --- a/pkg/controller/endpointslice/utils.go +++ b/pkg/controller/endpointslice/utils.go @@ -27,6 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/tools/cache" "k8s.io/klog/v2" podutil "k8s.io/kubernetes/pkg/api/v1/pod" @@ -34,6 +35,7 @@ import ( helper "k8s.io/kubernetes/pkg/apis/core/v1/helper" "k8s.io/kubernetes/pkg/apis/discovery/validation" endpointutil "k8s.io/kubernetes/pkg/controller/util/endpoint" + "k8s.io/kubernetes/pkg/features" utilnet "k8s.io/utils/net" ) @@ -60,7 +62,11 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service, } } - ready := service.Spec.PublishNotReadyAddresses || podutil.IsPodReady(pod) + accepting := podutil.IsPodReady(pod) + terminating := pod.DeletionTimestamp != nil + // For compatibility reasons, "ready" should never be "true" if a pod is terminatng, unless + // publishNotReadyAddresses was set. + ready := service.Spec.PublishNotReadyAddresses || (accepting && !terminating) ep := discovery.Endpoint{ Addresses: getEndpointAddresses(pod.Status, service, addressType), Conditions: discovery.EndpointConditions{ @@ -76,6 +82,11 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service, }, } + if utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) { + ep.Conditions.Accepting = &accepting + ep.Conditions.Terminating = &terminating + } + if endpointutil.ShouldSetHostname(pod, service) { ep.Hostname = &pod.Spec.Hostname } diff --git a/pkg/controller/endpointslice/utils_test.go b/pkg/controller/endpointslice/utils_test.go index a84c8caa37d..e42fb53c280 100644 --- a/pkg/controller/endpointslice/utils_test.go +++ b/pkg/controller/endpointslice/utils_test.go @@ -20,6 +20,7 @@ import ( "fmt" "reflect" "testing" + "time" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" @@ -30,8 +31,11 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/rand" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/kubernetes/fake" k8stesting "k8s.io/client-go/testing" + featuregatetesting "k8s.io/component-base/featuregate/testing" + "k8s.io/kubernetes/pkg/features" utilpointer "k8s.io/utils/pointer" ) @@ -219,13 +223,15 @@ func TestPodToEndpoint(t *testing.T) { svcPublishNotReady, _ := newServiceAndEndpointMeta("publishnotready", ns) svcPublishNotReady.Spec.PublishNotReadyAddresses = true - readyPod := newPod(1, ns, true, 1) - readyPodHostname := newPod(1, ns, true, 1) + readyPod := newPod(1, ns, true, 1, false) + readyTerminatingPod := newPod(1, ns, true, 1, true) + readyPodHostname := newPod(1, ns, true, 1, false) readyPodHostname.Spec.Subdomain = svc.Name readyPodHostname.Spec.Hostname = "example-hostname" - unreadyPod := newPod(1, ns, false, 1) - multiIPPod := newPod(1, ns, true, 1) + unreadyPod := newPod(1, ns, false, 1, false) + unreadyTerminatingPod := newPod(1, ns, false, 1, true) + multiIPPod := newPod(1, ns, true, 1, false) multiIPPod.Status.PodIPs = []v1.PodIP{{IP: "1.2.3.4"}, {IP: "1234::5678:0000:0000:9abc:def0"}} node1 := &v1.Node{ @@ -245,6 +251,7 @@ func TestPodToEndpoint(t *testing.T) { svc *v1.Service expectedEndpoint discovery.Endpoint publishNotReadyAddresses bool + terminatingGateEnabled bool }{ { name: "Ready pod", @@ -381,13 +388,121 @@ func TestPodToEndpoint(t *testing.T) { }, }, }, + { + name: "Ready pod, terminating gate enabled", + pod: readyPod, + svc: &svc, + expectedEndpoint: discovery.Endpoint{ + Addresses: []string{"1.2.3.5"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + TargetRef: &v1.ObjectReference{ + Kind: "Pod", + Namespace: ns, + Name: readyPod.Name, + UID: readyPod.UID, + ResourceVersion: readyPod.ResourceVersion, + }, + }, + terminatingGateEnabled: true, + }, + { + name: "Ready terminating pod, terminating gate disabled", + pod: readyTerminatingPod, + svc: &svc, + expectedEndpoint: discovery.Endpoint{ + Addresses: []string{"1.2.3.5"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + }, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + TargetRef: &v1.ObjectReference{ + Kind: "Pod", + Namespace: ns, + Name: readyPod.Name, + UID: readyPod.UID, + ResourceVersion: readyPod.ResourceVersion, + }, + }, + terminatingGateEnabled: false, + }, + { + name: "Ready terminating pod, terminating gate enabled", + pod: readyTerminatingPod, + svc: &svc, + expectedEndpoint: discovery.Endpoint{ + Addresses: []string{"1.2.3.5"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + TargetRef: &v1.ObjectReference{ + Kind: "Pod", + Namespace: ns, + Name: readyPod.Name, + UID: readyPod.UID, + ResourceVersion: readyPod.ResourceVersion, + }, + }, + terminatingGateEnabled: true, + }, + { + name: "Not ready terminating pod, terminating gate disabled", + pod: unreadyTerminatingPod, + svc: &svc, + expectedEndpoint: discovery.Endpoint{ + Addresses: []string{"1.2.3.5"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + }, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + TargetRef: &v1.ObjectReference{ + Kind: "Pod", + Namespace: ns, + Name: readyPod.Name, + UID: readyPod.UID, + ResourceVersion: readyPod.ResourceVersion, + }, + }, + terminatingGateEnabled: false, + }, + { + name: "Not ready terminating pod, terminating gate enabled", + pod: unreadyTerminatingPod, + svc: &svc, + expectedEndpoint: discovery.Endpoint{ + Addresses: []string{"1.2.3.5"}, + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + Accepting: utilpointer.BoolPtr(false), + Terminating: utilpointer.BoolPtr(true), + }, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + TargetRef: &v1.ObjectReference{ + Kind: "Pod", + Namespace: ns, + Name: readyPod.Name, + UID: readyPod.UID, + ResourceVersion: readyPod.ResourceVersion, + }, + }, + terminatingGateEnabled: true, + }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testCase.terminatingGateEnabled)() + endpoint := podToEndpoint(testCase.pod, testCase.node, testCase.svc, discovery.AddressTypeIPv4) if !reflect.DeepEqual(testCase.expectedEndpoint, endpoint) { - t.Errorf("Expected endpoint: %v, got: %v", testCase.expectedEndpoint, endpoint) + t.Errorf("Expected endpoint: %+v, got: %+v", testCase.expectedEndpoint, endpoint) } }) } @@ -811,18 +926,26 @@ func TestSetEndpointSliceLabels(t *testing.T) { // Test helpers -func newPod(n int, namespace string, ready bool, nPorts int) *v1.Pod { +func newPod(n int, namespace string, ready bool, nPorts int, terminating bool) *v1.Pod { status := v1.ConditionTrue if !ready { status = v1.ConditionFalse } + var deletionTimestamp *metav1.Time + if terminating { + deletionTimestamp = &metav1.Time{ + Time: time.Now(), + } + } + p := &v1.Pod{ TypeMeta: metav1.TypeMeta{APIVersion: "v1"}, ObjectMeta: metav1.ObjectMeta{ - Namespace: namespace, - Name: fmt.Sprintf("pod%d", n), - Labels: map[string]string{"foo": "bar"}, + Namespace: namespace, + Name: fmt.Sprintf("pod%d", n), + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: deletionTimestamp, }, Spec: v1.PodSpec{ Containers: []v1.Container{{ diff --git a/pkg/controller/util/endpoint/controller_utils.go b/pkg/controller/util/endpoint/controller_utils.go index d1744441bec..bd57d46a76a 100644 --- a/pkg/controller/util/endpoint/controller_utils.go +++ b/pkg/controller/util/endpoint/controller_utils.go @@ -122,14 +122,14 @@ func DeepHashObjectToString(objectToWrite interface{}) string { return hex.EncodeToString(hasher.Sum(nil)[0:]) } -// ShouldPodBeInEndpoints returns true if a specified pod should be in an -// endpoints object. Terminating pods are only included if publishNotReady is true. -func ShouldPodBeInEndpoints(pod *v1.Pod, publishNotReady bool) bool { +// ShouldPodBeInEndpointSlice returns true if a specified pod should be in an EndpointSlice object. +// Terminating pods are only included if includeTerminating is true +func ShouldPodBeInEndpointSlice(pod *v1.Pod, includeTerminating bool) bool { if len(pod.Status.PodIP) == 0 && len(pod.Status.PodIPs) == 0 { return false } - if !publishNotReady && pod.DeletionTimestamp != nil { + if !includeTerminating && pod.DeletionTimestamp != nil { return false } diff --git a/pkg/controller/util/endpoint/controller_utils_test.go b/pkg/controller/util/endpoint/controller_utils_test.go index df118e0a7af..85d20544dd3 100644 --- a/pkg/controller/util/endpoint/controller_utils_test.go +++ b/pkg/controller/util/endpoint/controller_utils_test.go @@ -100,12 +100,12 @@ func TestDetermineNeededServiceUpdates(t *testing.T) { // There are 3*5 possibilities(3 types of RestartPolicy by 5 types of PodPhase). // Not listing them all here. Just listing all of the 3 false cases and 3 of the // 12 true cases. -func TestShouldPodBeInEndpoints(t *testing.T) { +func TestShouldPodBeInEndpointSlice(t *testing.T) { testCases := []struct { - name string - pod *v1.Pod - publishNotReady bool - expected bool + name string + pod *v1.Pod + expected bool + includeTerminating bool }{ // Pod should not be in endpoints: { @@ -162,7 +162,7 @@ func TestShouldPodBeInEndpoints(t *testing.T) { expected: false, }, { - name: "Terminating Pod", + name: "Terminating Pod with includeTerminating=false", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ DeletionTimestamp: &metav1.Time{ @@ -175,8 +175,7 @@ func TestShouldPodBeInEndpoints(t *testing.T) { PodIP: "1.2.3.4", }, }, - publishNotReady: false, - expected: false, + expected: false, }, // Pod should be in endpoints: { @@ -245,7 +244,7 @@ func TestShouldPodBeInEndpoints(t *testing.T) { expected: true, }, { - name: "Terminating Pod with publish not ready", + name: "Terminating Pod with includeTerminating=true", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ DeletionTimestamp: &metav1.Time{ @@ -258,14 +257,14 @@ func TestShouldPodBeInEndpoints(t *testing.T) { PodIP: "1.2.3.4", }, }, - publishNotReady: true, - expected: true, + expected: true, + includeTerminating: true, }, } for _, test := range testCases { t.Run(test.name, func(t *testing.T) { - result := ShouldPodBeInEndpoints(test.pod, test.publishNotReady) + result := ShouldPodBeInEndpointSlice(test.pod, test.includeTerminating) if result != test.expected { t.Errorf("expected: %t, got: %t", test.expected, result) } From 80046582d7d5b1166bd939e8f2e57a5335526e65 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 23:27:28 -0400 Subject: [PATCH 4/7] endpointslice API strategy: drop disabled fields 'accepting' and 'terminating' Signed-off-by: Andrew Sy Kim --- pkg/registry/discovery/endpointslice/BUILD | 18 +- .../discovery/endpointslice/strategy.go | 45 ++ .../discovery/endpointslice/strategy_test.go | 448 ++++++++++++++++++ 3 files changed, 510 insertions(+), 1 deletion(-) create mode 100644 pkg/registry/discovery/endpointslice/strategy_test.go diff --git a/pkg/registry/discovery/endpointslice/BUILD b/pkg/registry/discovery/endpointslice/BUILD index 9646eb83d7b..53821cb6d34 100644 --- a/pkg/registry/discovery/endpointslice/BUILD +++ b/pkg/registry/discovery/endpointslice/BUILD @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "go_default_library", @@ -12,11 +12,13 @@ go_library( "//pkg/api/legacyscheme:go_default_library", "//pkg/apis/discovery:go_default_library", "//pkg/apis/discovery/validation:go_default_library", + "//pkg/features:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", "//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", ], ) @@ -36,3 +38,17 @@ filegroup( tags = ["automanaged"], visibility = ["//visibility:public"], ) + +go_test( + name = "go_default_test", + srcs = ["strategy_test.go"], + embed = [":go_default_library"], + deps = [ + "//pkg/apis/discovery:go_default_library", + "//pkg/features:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library", + "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", + "//staging/src/k8s.io/component-base/featuregate/testing:go_default_library", + "//vendor/k8s.io/utils/pointer:go_default_library", + ], +) diff --git a/pkg/registry/discovery/endpointslice/strategy.go b/pkg/registry/discovery/endpointslice/strategy.go index ee50a67063a..949eab9c984 100644 --- a/pkg/registry/discovery/endpointslice/strategy.go +++ b/pkg/registry/discovery/endpointslice/strategy.go @@ -24,9 +24,11 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apiserver/pkg/storage/names" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/apis/discovery" "k8s.io/kubernetes/pkg/apis/discovery/validation" + "k8s.io/kubernetes/pkg/features" ) // endpointSliceStrategy implements verification logic for Replication. @@ -47,6 +49,8 @@ func (endpointSliceStrategy) NamespaceScoped() bool { func (endpointSliceStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) { endpointSlice := obj.(*discovery.EndpointSlice) endpointSlice.Generation = 1 + + dropDisabledConditionsOnCreate(endpointSlice) } // PrepareForUpdate clears fields that are not allowed to be set by end users on update. @@ -67,6 +71,8 @@ func (endpointSliceStrategy) PrepareForUpdate(ctx context.Context, obj, old runt newEPS.ObjectMeta = ogNewMeta oldEPS.ObjectMeta = ogOldMeta + + dropDisabledConditionsOnUpdate(oldEPS, newEPS) } // Validate validates a new EndpointSlice. @@ -96,3 +102,42 @@ func (endpointSliceStrategy) ValidateUpdate(ctx context.Context, new, old runtim func (endpointSliceStrategy) AllowUnconditionalUpdate() bool { return true } + +// dropDisabledConditionsOnCreate will drop the terminating condition if the +// EndpointSliceTerminatingCondition is disabled. Otherwise the field is left untouched. +func dropDisabledConditionsOnCreate(endpointSlice *discovery.EndpointSlice) { + if utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) { + return + } + + // Always drop the accepting / terminating conditions on create when feature gate is disabled. + for i := range endpointSlice.Endpoints { + endpointSlice.Endpoints[i].Conditions.Accepting = nil + endpointSlice.Endpoints[i].Conditions.Terminating = nil + } +} + +// dropDisabledConditionsOnUpdate will drop the terminating condition field if the EndpointSliceTerminatingCondition +// feature gate is disabled unless an existing EndpointSlice object has the field already set. This ensures +// the field is not dropped on rollback. +func dropDisabledConditionsOnUpdate(oldEPS, newEPS *discovery.EndpointSlice) { + if utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) { + return + } + + // Only drop the accepting/terminating condition if the existing EndpointSlice doesn't have it set. + dropConditions := true + for _, ep := range oldEPS.Endpoints { + if ep.Conditions.Accepting != nil || ep.Conditions.Terminating != nil { + dropConditions = false + break + } + } + + if dropConditions { + for i := range newEPS.Endpoints { + newEPS.Endpoints[i].Conditions.Accepting = nil + newEPS.Endpoints[i].Conditions.Terminating = nil + } + } +} diff --git a/pkg/registry/discovery/endpointslice/strategy_test.go b/pkg/registry/discovery/endpointslice/strategy_test.go new file mode 100644 index 00000000000..ff2e628fcba --- /dev/null +++ b/pkg/registry/discovery/endpointslice/strategy_test.go @@ -0,0 +1,448 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package endpointslice + +import ( + "testing" + + apiequality "k8s.io/apimachinery/pkg/api/equality" + utilfeature "k8s.io/apiserver/pkg/util/feature" + featuregatetesting "k8s.io/component-base/featuregate/testing" + "k8s.io/kubernetes/pkg/apis/discovery" + "k8s.io/kubernetes/pkg/features" + utilpointer "k8s.io/utils/pointer" +) + +func Test_dropConditionsOnCreate(t *testing.T) { + testcases := []struct { + name string + terminatingGateEnabled bool + eps *discovery.EndpointSlice + expectedEPS *discovery.EndpointSlice + }{ + { + name: "gate enabled, field should be allowed", + terminatingGateEnabled: true, + eps: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + }, + { + name: "gate disabled, field should be set to nil", + terminatingGateEnabled: false, + eps: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + }, + } + + for _, testcase := range testcases { + t.Run(testcase.name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testcase.terminatingGateEnabled)() + + dropDisabledConditionsOnCreate(testcase.eps) + if !apiequality.Semantic.DeepEqual(testcase.eps, testcase.expectedEPS) { + t.Logf("actual endpointslice: %v", testcase.eps) + t.Logf("expected endpointslice: %v", testcase.expectedEPS) + t.Errorf("unexpected EndpointSlice on create API strategy") + } + }) + } +} + +func Test_dropTerminatingConditionOnUpdate(t *testing.T) { + testcases := []struct { + name string + terminatingGateEnabled bool + oldEPS *discovery.EndpointSlice + newEPS *discovery.EndpointSlice + expectedEPS *discovery.EndpointSlice + }{ + { + name: "gate enabled, field should be allowed", + terminatingGateEnabled: true, + oldEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + newEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + }, + { + name: "gate disabled, and not set on existing EPS", + terminatingGateEnabled: false, + oldEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + newEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + }, + { + name: "gate disabled, and set on existing EPS", + terminatingGateEnabled: false, + oldEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + newEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: nil, + Terminating: nil, + }, + }, + }, + }, + }, + { + name: "gate disabled, and set on existing EPS with new values", + terminatingGateEnabled: false, + oldEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(false), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Terminating: nil, + }, + }, + }, + }, + newEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(false), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Terminating: utilpointer.BoolPtr(false), + }, + }, + }, + }, + expectedEPS: &discovery.EndpointSlice{ + Endpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Accepting: utilpointer.BoolPtr(false), + Terminating: utilpointer.BoolPtr(false), + }, + }, + { + Conditions: discovery.EndpointConditions{ + Terminating: utilpointer.BoolPtr(false), + }, + }, + }, + }, + }, + } + + for _, testcase := range testcases { + t.Run(testcase.name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testcase.terminatingGateEnabled)() + + dropDisabledConditionsOnUpdate(testcase.oldEPS, testcase.newEPS) + if !apiequality.Semantic.DeepEqual(testcase.newEPS, testcase.expectedEPS) { + t.Logf("actual endpointslice: %v", testcase.newEPS) + t.Logf("expected endpointslice: %v", testcase.expectedEPS) + t.Errorf("unexpected EndpointSlice from update API strategy") + } + }) + } +} From 2947f5ce4fa2bf529fe9dae94e9ed96afbe19f38 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 23:45:54 -0400 Subject: [PATCH 5/7] endpointslice controller: refactor TestSyncServiceFull to use test tables Signed-off-by: Andrew Sy Kim --- .../endpointslice_controller_test.go | 319 ++++++++++++++---- 1 file changed, 257 insertions(+), 62 deletions(-) diff --git a/pkg/controller/endpointslice/endpointslice_controller_test.go b/pkg/controller/endpointslice/endpointslice_controller_test.go index bc2d113cb5e..39a34b469b3 100644 --- a/pkg/controller/endpointslice/endpointslice_controller_test.go +++ b/pkg/controller/endpointslice/endpointslice_controller_test.go @@ -33,12 +33,15 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/wait" + utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes/fake" k8stesting "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" + featuregatetesting "k8s.io/component-base/featuregate/testing" "k8s.io/kubernetes/pkg/controller" endpointutil "k8s.io/kubernetes/pkg/controller/util/endpoint" + "k8s.io/kubernetes/pkg/features" utilpointer "k8s.io/utils/pointer" ) @@ -335,76 +338,268 @@ func TestOnEndpointSliceUpdate(t *testing.T) { assert.Equal(t, 1, esController.queue.Len()) } -// Ensure SyncService handles a variety of protocols and IPs appropriately. -func TestSyncServiceFull(t *testing.T) { - client, esController := newController([]string{"node-1"}, time.Duration(0)) - namespace := metav1.NamespaceDefault - serviceName := "all-the-protocols" +func TestSyncService(t *testing.T) { + creationTimestamp := metav1.Now() + deletionTimestamp := metav1.Now() - pod1 := newPod(1, namespace, true, 0, false) - pod1.Status.PodIPs = []v1.PodIP{{IP: "1.2.3.4"}} - esController.podStore.Add(pod1) - - pod2 := newPod(2, namespace, true, 0, false) - pod2.Status.PodIPs = []v1.PodIP{{IP: "1.2.3.5"}, {IP: "1234::5678:0000:0000:9abc:def0"}} - esController.podStore.Add(pod2) - - // create service with all protocols and multiple ports - serviceCreateTime := time.Now() - service := &v1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: serviceName, - Namespace: namespace, - CreationTimestamp: metav1.NewTime(serviceCreateTime), - }, - Spec: v1.ServiceSpec{ - Ports: []v1.ServicePort{ - {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, - {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, - {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + testcases := []struct { + name string + service *v1.Service + pods []*v1.Pod + expectedEndpointPorts []discovery.EndpointPort + expectedEndpoints []discovery.Endpoint + terminatingGateEnabled bool + }{ + { + name: "pods with multiple IPs and Service with ipFamilies=ipv4", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv4Protocol}, + }, + }, + pods: []*v1.Pod{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + { + IP: "fd08::5678:0000:0000:9abc:def0", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.1"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod0"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.2"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod1"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + }, + }, + { + name: "pods with multiple IPs and Service with ipFamilies=ipv6", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv6Protocol}, + }, + }, + pods: []*v1.Pod{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + { + IP: "fd08::5678:0000:0000:9abc:def0", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + }, + Addresses: []string{"fd08::5678:0000:0000:9abc:def0"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod1"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, }, - Selector: map[string]string{"foo": "bar"}, - IPFamilies: []v1.IPFamily{v1.IPv6Protocol}, }, } - esController.serviceStore.Add(service) - _, err := esController.client.CoreV1().Services(namespace).Create(context.TODO(), service, metav1.CreateOptions{}) - assert.Nil(t, err, "Expected no error creating service") - // run through full sync service loop - err = esController.syncService(fmt.Sprintf("%s/%s", namespace, serviceName)) - assert.NoError(t, err) + for _, testcase := range testcases { + t.Run(testcase.name, func(t *testing.T) { + defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EndpointSliceTerminatingCondition, testcase.terminatingGateEnabled)() - // last action should be to create endpoint slice - expectActions(t, client.Actions(), 1, "create", "endpointslices") - sliceList, err := client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.TODO(), metav1.ListOptions{}) - assert.Nil(t, err, "Expected no error fetching endpoint slices") - assert.Len(t, sliceList.Items, 1, "Expected 1 endpoint slices") + client, esController := newController([]string{"node-1"}, time.Duration(0)) - // ensure all attributes of endpoint slice match expected state - slice := sliceList.Items[0] - assert.Len(t, slice.Endpoints, 1, "Expected 1 endpoints in first slice") - assert.Equal(t, slice.Annotations["endpoints.kubernetes.io/last-change-trigger-time"], serviceCreateTime.Format(time.RFC3339Nano)) - assert.EqualValues(t, []discovery.EndpointPort{{ - Name: utilpointer.StringPtr("sctp-example"), - Protocol: protoPtr(v1.ProtocolSCTP), - Port: utilpointer.Int32Ptr(int32(3456)), - }, { - Name: utilpointer.StringPtr("udp-example"), - Protocol: protoPtr(v1.ProtocolUDP), - Port: utilpointer.Int32Ptr(int32(161)), - }, { - Name: utilpointer.StringPtr("tcp-example"), - Protocol: protoPtr(v1.ProtocolTCP), - Port: utilpointer.Int32Ptr(int32(80)), - }}, slice.Ports) + for _, pod := range testcase.pods { + esController.podStore.Add(pod) + } + esController.serviceStore.Add(testcase.service) - assert.ElementsMatch(t, []discovery.Endpoint{{ - Conditions: discovery.EndpointConditions{Ready: utilpointer.BoolPtr(true)}, - Addresses: []string{"1234::5678:0000:0000:9abc:def0"}, - TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: namespace, Name: pod2.Name}, - Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, - }}, slice.Endpoints) + _, err := esController.client.CoreV1().Services(testcase.service.Namespace).Create(context.TODO(), testcase.service, metav1.CreateOptions{}) + assert.Nil(t, err, "Expected no error creating service") + + err = esController.syncService(fmt.Sprintf("%s/%s", testcase.service.Namespace, testcase.service.Name)) + assert.Nil(t, err) + + // last action should be to create endpoint slice + expectActions(t, client.Actions(), 1, "create", "endpointslices") + sliceList, err := client.DiscoveryV1beta1().EndpointSlices(testcase.service.Namespace).List(context.TODO(), metav1.ListOptions{}) + assert.Nil(t, err, "Expected no error fetching endpoint slices") + assert.Len(t, sliceList.Items, 1, "Expected 1 endpoint slices") + + // ensure all attributes of endpoint slice match expected state + slice := sliceList.Items[0] + assert.Equal(t, slice.Annotations["endpoints.kubernetes.io/last-change-trigger-time"], creationTimestamp.Format(time.RFC3339Nano)) + assert.EqualValues(t, testcase.expectedEndpointPorts, slice.Ports) + assert.ElementsMatch(t, testcase.expectedEndpoints, slice.Endpoints) + }) + } } // TestPodAddsBatching verifies that endpoint updates caused by pod addition are batched together. From 17cf1b44159319c72556fe0948e38847ceaab001 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Thu, 29 Oct 2020 23:46:55 -0400 Subject: [PATCH 6/7] endpointslice controller: add test cases to TestSyncServiceFull for terminating endpoints Signed-off-by: Andrew Sy Kim --- .../endpointslice_controller_test.go | 440 ++++++++++++++++++ 1 file changed, 440 insertions(+) diff --git a/pkg/controller/endpointslice/endpointslice_controller_test.go b/pkg/controller/endpointslice/endpointslice_controller_test.go index 39a34b469b3..e12da76d7cc 100644 --- a/pkg/controller/endpointslice/endpointslice_controller_test.go +++ b/pkg/controller/endpointslice/endpointslice_controller_test.go @@ -568,6 +568,446 @@ func TestSyncService(t *testing.T) { }, }, }, + { + name: "Terminating pods with EndpointSliceTerminatingCondition enabled", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv4Protocol}, + }, + }, + pods: []*v1.Pod{ + { + // one ready pod for comparison + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: &deletionTimestamp, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + Addresses: []string{"10.0.0.1"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod0"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.2"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod1"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + }, + terminatingGateEnabled: true, + }, + { + name: "Terminating pods with EndpointSliceTerminatingCondition disabled", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv4Protocol}, + }, + }, + pods: []*v1.Pod{ + { + // one ready pod for comparison + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: &deletionTimestamp, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.1"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod0"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + }, + terminatingGateEnabled: false, + }, + { + name: "Not ready terminating pods with EndpointSliceTerminatingCondition enabled", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv4Protocol}, + }, + }, + pods: []*v1.Pod{ + { + // one ready pod for comparison + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: &deletionTimestamp, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionFalse, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + Accepting: utilpointer.BoolPtr(true), + Terminating: utilpointer.BoolPtr(false), + }, + Addresses: []string{"10.0.0.1"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod0"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(false), + Accepting: utilpointer.BoolPtr(false), + Terminating: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.2"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod1"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + }, + terminatingGateEnabled: true, + }, + { + name: "Not ready terminating pods with EndpointSliceTerminatingCondition disabled", + service: &v1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foobar", + Namespace: "default", + CreationTimestamp: creationTimestamp, + }, + Spec: v1.ServiceSpec{ + Ports: []v1.ServicePort{ + {Name: "tcp-example", TargetPort: intstr.FromInt(80), Protocol: v1.ProtocolTCP}, + {Name: "udp-example", TargetPort: intstr.FromInt(161), Protocol: v1.ProtocolUDP}, + {Name: "sctp-example", TargetPort: intstr.FromInt(3456), Protocol: v1.ProtocolSCTP}, + }, + Selector: map[string]string{"foo": "bar"}, + IPFamilies: []v1.IPFamily{v1.IPv4Protocol}, + }, + }, + pods: []*v1.Pod{ + { + // one ready pod for comparison + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod0", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: nil, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.1", + PodIPs: []v1.PodIP{{ + IP: "10.0.0.1", + }}, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionTrue, + }, + }, + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "pod1", + Labels: map[string]string{"foo": "bar"}, + DeletionTimestamp: &deletionTimestamp, + }, + Spec: v1.PodSpec{ + Containers: []v1.Container{{ + Name: "container-1", + }}, + NodeName: "node-1", + }, + Status: v1.PodStatus{ + PodIP: "10.0.0.2", + PodIPs: []v1.PodIP{ + { + IP: "10.0.0.2", + }, + }, + Conditions: []v1.PodCondition{ + { + Type: v1.PodReady, + Status: v1.ConditionFalse, + }, + }, + }, + }, + }, + expectedEndpointPorts: []discovery.EndpointPort{ + { + Name: utilpointer.StringPtr("sctp-example"), + Protocol: protoPtr(v1.ProtocolSCTP), + Port: utilpointer.Int32Ptr(int32(3456)), + }, + { + Name: utilpointer.StringPtr("udp-example"), + Protocol: protoPtr(v1.ProtocolUDP), + Port: utilpointer.Int32Ptr(int32(161)), + }, + { + Name: utilpointer.StringPtr("tcp-example"), + Protocol: protoPtr(v1.ProtocolTCP), + Port: utilpointer.Int32Ptr(int32(80)), + }, + }, + expectedEndpoints: []discovery.Endpoint{ + { + Conditions: discovery.EndpointConditions{ + Ready: utilpointer.BoolPtr(true), + }, + Addresses: []string{"10.0.0.1"}, + TargetRef: &v1.ObjectReference{Kind: "Pod", Namespace: "default", Name: "pod0"}, + Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, + }, + }, + terminatingGateEnabled: false, + }, } for _, testcase := range testcases { From 7cf19e5fb78587cc1eac9b69a9e935821410c335 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Fri, 30 Oct 2020 22:44:46 -0400 Subject: [PATCH 7/7] endpointslice API: rename 'accepting' condition to 'serving' condition Signed-off-by: Andrew Sy Kim --- api/openapi-spec/swagger.json | 8 +- pkg/apis/discovery/types.go | 4 +- .../v1alpha1/zz_generated.conversion.go | 4 +- .../v1beta1/zz_generated.conversion.go | 4 +- pkg/apis/discovery/zz_generated.deepcopy.go | 4 +- .../endpointslice_controller_test.go | 8 +- .../endpointslice/reconciler_test.go | 2 +- pkg/controller/endpointslice/utils.go | 6 +- pkg/controller/endpointslice/utils_test.go | 6 +- .../discovery/endpointslice/strategy.go | 10 +- .../discovery/endpointslice/strategy_test.go | 90 +++++++------- .../api/discovery/v1alpha1/generated.pb.go | 111 ++++++++--------- .../api/discovery/v1alpha1/generated.proto | 4 +- .../k8s.io/api/discovery/v1alpha1/types.go | 4 +- .../v1alpha1/types_swagger_doc_generated.go | 2 +- .../v1alpha1/zz_generated.deepcopy.go | 4 +- .../api/discovery/v1beta1/generated.pb.go | 112 +++++++++--------- .../api/discovery/v1beta1/generated.proto | 4 +- .../src/k8s.io/api/discovery/v1beta1/types.go | 4 +- .../v1beta1/types_swagger_doc_generated.go | 2 +- .../v1beta1/zz_generated.deepcopy.go | 4 +- 21 files changed, 199 insertions(+), 198 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index f6ed9151e67..894b8eac196 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -10913,14 +10913,14 @@ "io.k8s.api.discovery.v1beta1.EndpointConditions": { "description": "EndpointConditions represents the current condition of an endpoint.", "properties": { - "accepting": { - "description": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", - "type": "boolean" - }, "ready": { "description": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", "type": "boolean" }, + "serving": { + "description": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "type": "boolean" + }, "terminating": { "description": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", "type": "boolean" diff --git a/pkg/apis/discovery/types.go b/pkg/apis/discovery/types.go index 6534218b36d..6fa6624270c 100644 --- a/pkg/apis/discovery/types.go +++ b/pkg/apis/discovery/types.go @@ -118,11 +118,11 @@ type EndpointConditions struct { // "true" for terminating endpoints. Ready *bool - // accepting is identical to ready except that it is set regardless of the terminating + // serving is identical to ready except that it is set regardless of the terminating // state of endpoints. This condition should be set to true for a ready endpoint that // is terminating. If nil, consumers should defer to the ready condition. // +optional - Accepting *bool + Serving *bool // terminating indicates that this endpoint is terminating. A nil value indicates an // unknown state. Consumers should interpret this unknown state to mean that the diff --git a/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go b/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go index 9ab78314e18..46412fd0c52 100644 --- a/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/discovery/v1alpha1/zz_generated.conversion.go @@ -125,7 +125,7 @@ func Convert_discovery_Endpoint_To_v1alpha1_Endpoint(in *discovery.Endpoint, out func autoConvert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1alpha1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) - out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Serving = (*bool)(unsafe.Pointer(in.Serving)) out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } @@ -137,7 +137,7 @@ func Convert_v1alpha1_EndpointConditions_To_discovery_EndpointConditions(in *v1a func autoConvert_discovery_EndpointConditions_To_v1alpha1_EndpointConditions(in *discovery.EndpointConditions, out *v1alpha1.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) - out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Serving = (*bool)(unsafe.Pointer(in.Serving)) out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } diff --git a/pkg/apis/discovery/v1beta1/zz_generated.conversion.go b/pkg/apis/discovery/v1beta1/zz_generated.conversion.go index f56917613b8..f06d2d0ef56 100644 --- a/pkg/apis/discovery/v1beta1/zz_generated.conversion.go +++ b/pkg/apis/discovery/v1beta1/zz_generated.conversion.go @@ -125,7 +125,7 @@ func Convert_discovery_Endpoint_To_v1beta1_Endpoint(in *discovery.Endpoint, out func autoConvert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(in *v1beta1.EndpointConditions, out *discovery.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) - out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Serving = (*bool)(unsafe.Pointer(in.Serving)) out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } @@ -137,7 +137,7 @@ func Convert_v1beta1_EndpointConditions_To_discovery_EndpointConditions(in *v1be func autoConvert_discovery_EndpointConditions_To_v1beta1_EndpointConditions(in *discovery.EndpointConditions, out *v1beta1.EndpointConditions, s conversion.Scope) error { out.Ready = (*bool)(unsafe.Pointer(in.Ready)) - out.Accepting = (*bool)(unsafe.Pointer(in.Accepting)) + out.Serving = (*bool)(unsafe.Pointer(in.Serving)) out.Terminating = (*bool)(unsafe.Pointer(in.Terminating)) return nil } diff --git a/pkg/apis/discovery/zz_generated.deepcopy.go b/pkg/apis/discovery/zz_generated.deepcopy.go index 160343ea6f0..bb6b56c0763 100644 --- a/pkg/apis/discovery/zz_generated.deepcopy.go +++ b/pkg/apis/discovery/zz_generated.deepcopy.go @@ -72,8 +72,8 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } - if in.Accepting != nil { - in, out := &in.Accepting, &out.Accepting + if in.Serving != nil { + in, out := &in.Serving, &out.Serving *out = new(bool) **out = **in } diff --git a/pkg/controller/endpointslice/endpointslice_controller_test.go b/pkg/controller/endpointslice/endpointslice_controller_test.go index e12da76d7cc..c220f919e86 100644 --- a/pkg/controller/endpointslice/endpointslice_controller_test.go +++ b/pkg/controller/endpointslice/endpointslice_controller_test.go @@ -664,7 +664,7 @@ func TestSyncService(t *testing.T) { { Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(true), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, Addresses: []string{"10.0.0.1"}, @@ -674,7 +674,7 @@ func TestSyncService(t *testing.T) { { Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(false), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, Addresses: []string{"10.0.0.2"}, @@ -884,7 +884,7 @@ func TestSyncService(t *testing.T) { { Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(true), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, Addresses: []string{"10.0.0.1"}, @@ -894,7 +894,7 @@ func TestSyncService(t *testing.T) { { Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(false), - Accepting: utilpointer.BoolPtr(false), + Serving: utilpointer.BoolPtr(false), Terminating: utilpointer.BoolPtr(true), }, Addresses: []string{"10.0.0.2"}, diff --git a/pkg/controller/endpointslice/reconciler_test.go b/pkg/controller/endpointslice/reconciler_test.go index 608b7314450..a4d37d7a2f5 100644 --- a/pkg/controller/endpointslice/reconciler_test.go +++ b/pkg/controller/endpointslice/reconciler_test.go @@ -178,7 +178,7 @@ func TestReconcile1Pod(t *testing.T) { Addresses: []string{"1.2.3.4"}, Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(true), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, Topology: map[string]string{ diff --git a/pkg/controller/endpointslice/utils.go b/pkg/controller/endpointslice/utils.go index 03aa71da8dc..29b52c127b5 100644 --- a/pkg/controller/endpointslice/utils.go +++ b/pkg/controller/endpointslice/utils.go @@ -62,11 +62,11 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service, } } - accepting := podutil.IsPodReady(pod) + serving := podutil.IsPodReady(pod) terminating := pod.DeletionTimestamp != nil // For compatibility reasons, "ready" should never be "true" if a pod is terminatng, unless // publishNotReadyAddresses was set. - ready := service.Spec.PublishNotReadyAddresses || (accepting && !terminating) + ready := service.Spec.PublishNotReadyAddresses || (serving && !terminating) ep := discovery.Endpoint{ Addresses: getEndpointAddresses(pod.Status, service, addressType), Conditions: discovery.EndpointConditions{ @@ -83,7 +83,7 @@ func podToEndpoint(pod *corev1.Pod, node *corev1.Node, service *corev1.Service, } if utilfeature.DefaultFeatureGate.Enabled(features.EndpointSliceTerminatingCondition) { - ep.Conditions.Accepting = &accepting + ep.Conditions.Serving = &serving ep.Conditions.Terminating = &terminating } diff --git a/pkg/controller/endpointslice/utils_test.go b/pkg/controller/endpointslice/utils_test.go index e42fb53c280..68f654f9fc4 100644 --- a/pkg/controller/endpointslice/utils_test.go +++ b/pkg/controller/endpointslice/utils_test.go @@ -396,7 +396,7 @@ func TestPodToEndpoint(t *testing.T) { Addresses: []string{"1.2.3.5"}, Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(true), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, @@ -438,7 +438,7 @@ func TestPodToEndpoint(t *testing.T) { Addresses: []string{"1.2.3.5"}, Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(false), - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, @@ -480,7 +480,7 @@ func TestPodToEndpoint(t *testing.T) { Addresses: []string{"1.2.3.5"}, Conditions: discovery.EndpointConditions{ Ready: utilpointer.BoolPtr(false), - Accepting: utilpointer.BoolPtr(false), + Serving: utilpointer.BoolPtr(false), Terminating: utilpointer.BoolPtr(true), }, Topology: map[string]string{"kubernetes.io/hostname": "node-1"}, diff --git a/pkg/registry/discovery/endpointslice/strategy.go b/pkg/registry/discovery/endpointslice/strategy.go index 949eab9c984..9e2c48bc246 100644 --- a/pkg/registry/discovery/endpointslice/strategy.go +++ b/pkg/registry/discovery/endpointslice/strategy.go @@ -110,9 +110,9 @@ func dropDisabledConditionsOnCreate(endpointSlice *discovery.EndpointSlice) { return } - // Always drop the accepting / terminating conditions on create when feature gate is disabled. + // Always drop the serving/terminating conditions on create when feature gate is disabled. for i := range endpointSlice.Endpoints { - endpointSlice.Endpoints[i].Conditions.Accepting = nil + endpointSlice.Endpoints[i].Conditions.Serving = nil endpointSlice.Endpoints[i].Conditions.Terminating = nil } } @@ -125,10 +125,10 @@ func dropDisabledConditionsOnUpdate(oldEPS, newEPS *discovery.EndpointSlice) { return } - // Only drop the accepting/terminating condition if the existing EndpointSlice doesn't have it set. + // Only drop the serving/terminating condition if the existing EndpointSlice doesn't have it set. dropConditions := true for _, ep := range oldEPS.Endpoints { - if ep.Conditions.Accepting != nil || ep.Conditions.Terminating != nil { + if ep.Conditions.Serving != nil || ep.Conditions.Terminating != nil { dropConditions = false break } @@ -136,7 +136,7 @@ func dropDisabledConditionsOnUpdate(oldEPS, newEPS *discovery.EndpointSlice) { if dropConditions { for i := range newEPS.Endpoints { - newEPS.Endpoints[i].Conditions.Accepting = nil + newEPS.Endpoints[i].Conditions.Serving = nil newEPS.Endpoints[i].Conditions.Terminating = nil } } diff --git a/pkg/registry/discovery/endpointslice/strategy_test.go b/pkg/registry/discovery/endpointslice/strategy_test.go index ff2e628fcba..81bb687b8eb 100644 --- a/pkg/registry/discovery/endpointslice/strategy_test.go +++ b/pkg/registry/discovery/endpointslice/strategy_test.go @@ -41,19 +41,19 @@ func Test_dropConditionsOnCreate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -63,19 +63,19 @@ func Test_dropConditionsOnCreate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -89,19 +89,19 @@ func Test_dropConditionsOnCreate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -111,19 +111,19 @@ func Test_dropConditionsOnCreate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -161,19 +161,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -183,19 +183,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -205,19 +205,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -231,19 +231,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -253,19 +253,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -275,19 +275,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -301,19 +301,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -323,19 +323,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -345,19 +345,19 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: nil, + Serving: nil, Terminating: nil, }, }, @@ -371,13 +371,13 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(false), + Serving: utilpointer.BoolPtr(false), Terminating: utilpointer.BoolPtr(false), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, @@ -392,13 +392,13 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(false), + Serving: utilpointer.BoolPtr(false), Terminating: utilpointer.BoolPtr(false), }, }, @@ -413,13 +413,13 @@ func Test_dropTerminatingConditionOnUpdate(t *testing.T) { Endpoints: []discovery.Endpoint{ { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(true), + Serving: utilpointer.BoolPtr(true), Terminating: utilpointer.BoolPtr(true), }, }, { Conditions: discovery.EndpointConditions{ - Accepting: utilpointer.BoolPtr(false), + Serving: utilpointer.BoolPtr(false), Terminating: utilpointer.BoolPtr(false), }, }, diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go b/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go index 875bcc76f5a..4f1f7306690 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/generated.pb.go @@ -200,56 +200,57 @@ func init() { } var fileDescriptor_772f83c5b34e07a5 = []byte{ - // 781 bytes of a gzipped FileDescriptorProto + // 787 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x8f, 0xe3, 0x44, - 0x10, 0x8d, 0x27, 0x63, 0xc9, 0xee, 0x6c, 0xc4, 0x6e, 0x8b, 0x43, 0x14, 0xc0, 0x8e, 0xc2, 0x81, - 0x48, 0x03, 0x6d, 0x32, 0x02, 0xb4, 0x82, 0xd3, 0x18, 0x96, 0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7e, 0xbf, 0xcb, 0x49, 0x59, + 0xb8, 0x48, 0x32, 0xdd, 0x5f, 0xbe, 0x8c, 0x35, 0x20, 0xfd, 0x14, 0x14, 0xfb, 0x37, 0x96, 0xff, + 0x5f, 0x2c, 0xb1, 0xce, 0x54, 0x92, 0xc2, 0x0e, 0xe1, 0xc3, 0x97, 0x11, 0x64, 0xb8, 0x80, 0x94, + 0xfd, 0x93, 0x37, 0xfd, 0x7d, 0x88, 0xec, 0xc7, 0x59, 0x94, 0xf3, 0x24, 0x53, 0xf8, 0x14, 0x39, + 0x2c, 0x8a, 0x04, 0x48, 0x09, 0x72, 0x62, 0x9d, 0x0c, 0x67, 0x4e, 0x70, 0x54, 0x16, 0x9e, 0x73, + 0xde, 0x80, 0xb4, 0x8b, 0x63, 0x40, 0x28, 0xe4, 0x59, 0x94, 0xa8, 0x84, 0x67, 0x72, 0x72, 0x70, + 0x62, 0xcd, 0xc6, 0x67, 0x73, 0xf2, 0xbf, 0xf3, 0x25, 0x4d, 0xa5, 0x4f, 0x5a, 0x62, 0x80, 0xaf, + 0x0b, 0x6f, 0x50, 0x16, 0x1e, 0xea, 0x30, 0xda, 0x13, 0xc6, 0x33, 0x64, 0x2f, 0xb8, 0x54, 0x19, + 0x4b, 0x61, 0x32, 0x3c, 0xb1, 0x66, 0x4e, 0x70, 0xbf, 0x2c, 0x3c, 0xfb, 0x8b, 0x1a, 0xa3, 0x6d, + 0x14, 0x5f, 0x20, 0x47, 0x31, 0x11, 0x83, 0xa2, 0xf0, 0x74, 0x72, 0x68, 0xfa, 0x79, 0xb3, 0xdf, + 0x8f, 0xfe, 0x43, 0x64, 0x33, 0x27, 0xdf, 0x5e, 0xfd, 0x0c, 0xa1, 0x4e, 0x02, 0x01, 0x59, 0x08, + 0x95, 0xc5, 0xcb, 0x86, 0x49, 0x3b, 0x11, 0x1c, 0x22, 0x5b, 0xf1, 0x9c, 0xaf, 0x78, 0xbc, 0x9d, + 0x8c, 0x4e, 0x86, 0xb3, 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 0x5c, 0xdf, 0xb8, 0x83, 0x67, 0x37, 0xee, 0xe0, 0xf9, 0x8d, 0x3b, 0xf8, 0xa5, 0x74, 0xad, + 0xeb, 0xd2, 0xb5, 0x9e, 0x95, 0xae, 0xf5, 0xbc, 0x74, 0xad, 0xbf, 0x4a, 0xd7, 0xfa, 0xed, 0x85, + 0x3b, 0xf8, 0xc1, 0x6e, 0x34, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xa7, 0x11, 0xa7, 0x0f, 0xd0, + 0x06, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -367,9 +368,9 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if m.Accepting != nil { + if m.Serving != nil { i-- - if *m.Accepting { + if *m.Serving { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -605,7 +606,7 @@ func (m *EndpointConditions) Size() (n int) { if m.Ready != nil { n += 2 } - if m.Accepting != nil { + if m.Serving != nil { n += 2 } if m.Terminating != nil { @@ -716,7 +717,7 @@ func (this *EndpointConditions) String() string { } s := strings.Join([]string{`&EndpointConditions{`, `Ready:` + valueToStringGenerated(this.Ready) + `,`, - `Accepting:` + valueToStringGenerated(this.Accepting) + `,`, + `Serving:` + valueToStringGenerated(this.Serving) + `,`, `Terminating:` + valueToStringGenerated(this.Terminating) + `,`, `}`, }, "") @@ -1148,7 +1149,7 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { m.Ready = &b case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Accepting", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Serving", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1166,7 +1167,7 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.Accepting = &b + m.Serving = &b case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Terminating", wireType) diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto b/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto index f5e1ea5308f..dc9a168b1f7 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/discovery/v1alpha1/generated.proto @@ -81,11 +81,11 @@ message EndpointConditions { // +optional optional bool ready = 1; - // accepting is identical to ready except that it is set regardless of the terminating + // serving is identical to ready except that it is set regardless of the terminating // state of endpoints. This condition should be set to true for a ready endpoint that // is terminating. If nil, consumers should defer to the ready condition. // +optional - optional bool accepting = 2; + optional bool serving = 2; // terminating indicates that this endpoint is terminating. A nil value indicates an // unknown state. Consumers should interpret this unknown state to mean that the diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/types.go b/staging/src/k8s.io/api/discovery/v1alpha1/types.go index 007915a73dd..a846cd7cacc 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/types.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/types.go @@ -120,11 +120,11 @@ type EndpointConditions struct { // +optional Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` - // accepting is identical to ready except that it is set regardless of the terminating + // serving is identical to ready except that it is set regardless of the terminating // state of endpoints. This condition should be set to true for a ready endpoint that // is terminating. If nil, consumers should defer to the ready condition. // +optional - Accepting *bool `json:"accepting,omitempty" protobuf:"bytes,2,name=accepting"` + Serving *bool `json:"serving,omitempty" protobuf:"bytes,2,name=serving"` // terminating indicates that this endpoint is terminating. A nil value indicates an // unknown state. Consumers should interpret this unknown state to mean that the diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go index 8f4988d17a5..6e8ada2d0c8 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/types_swagger_doc_generated.go @@ -43,7 +43,7 @@ func (Endpoint) SwaggerDoc() map[string]string { var map_EndpointConditions = map[string]string{ "": "EndpointConditions represents the current condition of an endpoint.", "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", - "accepting": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "serving": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", "terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", } diff --git a/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go index dd0d76309a0..c29e1ac34d7 100644 --- a/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/discovery/v1alpha1/zz_generated.deepcopy.go @@ -72,8 +72,8 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } - if in.Accepting != nil { - in, out := &in.Accepting, &out.Accepting + if in.Serving != nil { + in, out := &in.Serving, &out.Serving *out = new(bool) **out = **in } diff --git a/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go b/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go index 7727eb1c4bc..d01f1351733 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/generated.pb.go @@ -200,56 +200,56 @@ func init() { } var fileDescriptor_ece80bbc872d519b = []byte{ - // 778 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xfb, 0x44, - 0x10, 0x8d, 0x9b, 0x5a, 0x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 0xdf, 0x58, 0xf6, 0x7f, - 0xb1, 0x92, 0x55, 0xc4, 0x83, 0x10, 0x0e, 0x08, 0x1f, 0xbd, 0x89, 0x90, 0xba, 0x73, 0x08, 0xe9, - 0x3f, 0x79, 0xc3, 0xdf, 0xda, 0x48, 0xbb, 0x8b, 0xbc, 0x98, 0x05, 0x11, 0xc7, 0x17, 0x48, 0xa7, - 0x9e, 0x97, 0x40, 0x9a, 0x42, 0xda, 0x53, 0x06, 0xed, 0x91, 0xee, 0x74, 0xf3, 0xcc, 0xd4, 0x6f, - 0x2b, 0x90, 0x34, 0xef, 0xd8, 0x43, 0xc8, 0x65, 0x91, 0x17, 0xf0, 0x80, 0x45, 0x69, 0xef, 0x64, - 0xa0, 0x8c, 0x3a, 0x57, 0x1f, 0x5a, 0xff, 0xd7, 0x5e, 0xab, 0x4a, 0xf4, 0x69, 0xcd, 0x73, 0xf0, - 0x63, 0x66, 0xb6, 0xf2, 0xcc, 0x44, 0x0d, 0x46, 0x76, 0x74, 0xf1, 0x08, 0x69, 0x73, 0x96, 0xf2, - 0x88, 0x86, 0xd0, 0x6b, 0x0f, 0x94, 0x91, 0xee, 0xbc, 0xca, 0x33, 0x53, 0xfb, 0xa2, 0xc4, 0x48, - 0xfd, 0x8a, 0x27, 0x48, 0xe7, 0x34, 0xf1, 0x81, 0x13, 0x78, 0xe8, 0x9d, 0xca, 0x72, 0xde, 0xdb, - 0x2d, 0x47, 0x7c, 0x90, 0xb5, 0x1e, 0x5b, 0xf7, 0xb3, 0x9f, 0xc0, 0x15, 0x41, 0x90, 0x40, 0xe4, - 0x42, 0xe1, 0x70, 0x5a, 0x31, 0x49, 0x23, 0x82, 0x67, 0x48, 0xe3, 0x2c, 0x66, 0x4b, 0xe6, 0x6f, - 0x7a, 0xea, 0xa0, 0x3d, 0xea, 0x5c, 0x5d, 0x1f, 0xe7, 0xcf, 0x9a, 0x96, 0xb4, 0xbb, 0x88, 0x27, - 0x1b, 0xe7, 0x75, 0xe9, 0x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xe6, 0x86, 0xf2, 0xcb, 0x5f, 0x46, 0xeb, 0xfb, 0xb7, 0x4a, 0xc9, 0xbf, 0x03, 0x00, 0x00, - 0xff, 0xff, 0xd8, 0x47, 0x63, 0x91, 0xce, 0x06, 0x00, 0x00, + // 784 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x8f, 0xe3, 0x44, + 0x10, 0x8d, 0x27, 0x63, 0x8d, 0xdd, 0xd9, 0x11, 0xbb, 0x2d, 0x0e, 0xd1, 0xb0, 0xb2, 0x47, 0x41, + 0xa0, 0x88, 0xd1, 0xda, 0xcc, 0x6a, 0x85, 0x56, 0x70, 0x1a, 0xc3, 0x08, 0x90, 0x80, 0x8d, 0x7a, + 0x23, 0x21, 0x21, 0x0e, 0x74, 0xec, 0x5a, 0xc7, 0x24, 0x76, 0x5b, 0xdd, 0x9d, 0x48, 0xb9, 0xf1, + 0x0f, 0xe0, 0xf7, 0x70, 0x45, 0x42, 0x73, 0xdc, 0xe3, 0x9e, 0x2c, 0x62, 0xfe, 0xc5, 0x9c, 0x50, + 0xb7, 0xbf, 0x12, 0xc2, 0x47, 0x6e, 0xee, 0x57, 0xf5, 0x5e, 0xd5, 0x2b, 0x57, 0xa1, 0xdb, 0xc5, + 0x73, 0xe1, 0x25, 0xcc, 0x5f, 0xac, 0x66, 0xc0, 0x33, 0x90, 0x20, 0xfc, 0x35, 0x64, 0x11, 0xe3, + 0x7e, 0x1d, 0xa0, 0x79, 0xe2, 0x47, 0x89, 0x08, 0xd9, 0x1a, 0xf8, 0xc6, 0x5f, 0x5f, 0xcf, 0x40, + 0xd2, 0x6b, 0x3f, 0x86, 0x0c, 0x38, 0x95, 0x10, 0x79, 0x39, 0x67, 0x92, 0xe1, 0xc7, 0x55, 0xb6, + 0x47, 0xf3, 0xc4, 0x6b, 0xb3, 0xbd, 0x3a, 0xfb, 0xe2, 0x49, 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, 0xe3, 0xe6, 0xac, + 0xd8, 0x7a, 0xca, 0xed, 0xbd, 0x35, 0xc8, 0xce, 0x8c, 0x27, 0xc8, 0x4c, 0x24, 0xa4, 0xcd, 0x64, + 0xae, 0x8e, 0x33, 0xa1, 0xbb, 0xeb, 0x5c, 0x7c, 0xa9, 0x14, 0x48, 0x25, 0x14, 0x3c, 0xb9, 0xdb, + 0x3a, 0xbd, 0xd7, 0x5b, 0xa7, 0xf7, 0x66, 0xeb, 0xf4, 0x7e, 0x2a, 0x1d, 0xe3, 0xae, 0x74, 0x8c, + 0xd7, 0xa5, 0x63, 0xbc, 0x29, 0x1d, 0xe3, 0x8f, 0xd2, 0x31, 0x7e, 0xf9, 0xd3, 0xe9, 0x7d, 0x77, + 0x56, 0x4b, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x95, 0x55, 0x4b, 0x65, 0xc8, 0x06, 0x00, 0x00, } func (m *Endpoint) Marshal() (dAtA []byte, err error) { @@ -367,9 +367,9 @@ func (m *EndpointConditions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if m.Accepting != nil { + if m.Serving != nil { i-- - if *m.Accepting { + if *m.Serving { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -605,7 +605,7 @@ func (m *EndpointConditions) Size() (n int) { if m.Ready != nil { n += 2 } - if m.Accepting != nil { + if m.Serving != nil { n += 2 } if m.Terminating != nil { @@ -716,7 +716,7 @@ func (this *EndpointConditions) String() string { } s := strings.Join([]string{`&EndpointConditions{`, `Ready:` + valueToStringGenerated(this.Ready) + `,`, - `Accepting:` + valueToStringGenerated(this.Accepting) + `,`, + `Serving:` + valueToStringGenerated(this.Serving) + `,`, `Terminating:` + valueToStringGenerated(this.Terminating) + `,`, `}`, }, "") @@ -1148,7 +1148,7 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { m.Ready = &b case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Accepting", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Serving", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -1166,7 +1166,7 @@ func (m *EndpointConditions) Unmarshal(dAtA []byte) error { } } b := bool(v != 0) - m.Accepting = &b + m.Serving = &b case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Terminating", wireType) diff --git a/staging/src/k8s.io/api/discovery/v1beta1/generated.proto b/staging/src/k8s.io/api/discovery/v1beta1/generated.proto index 6483b57562d..cdf1a21999b 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/discovery/v1beta1/generated.proto @@ -81,11 +81,11 @@ message EndpointConditions { // +optional optional bool ready = 1; - // accepting is identical to ready except that it is set regardless of the terminating + // serving is identical to ready except that it is set regardless of the terminating // state of endpoints. This condition should be set to true for a ready endpoint that // is terminating. If nil, consumers should defer to the ready condition. // +optional - optional bool accepting = 2; + optional bool serving = 2; // terminating indicates that this endpoint is terminating. A nil value indicates an // unknown state. Consumers should interpret this unknown state to mean that the diff --git a/staging/src/k8s.io/api/discovery/v1beta1/types.go b/staging/src/k8s.io/api/discovery/v1beta1/types.go index e9a3d1b8689..d65a079876a 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/types.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/types.go @@ -122,11 +122,11 @@ type EndpointConditions struct { // +optional Ready *bool `json:"ready,omitempty" protobuf:"bytes,1,name=ready"` - // accepting is identical to ready except that it is set regardless of the terminating + // serving is identical to ready except that it is set regardless of the terminating // state of endpoints. This condition should be set to true for a ready endpoint that // is terminating. If nil, consumers should defer to the ready condition. // +optional - Accepting *bool `json:"accepting,omitempty" protobuf:"bytes,2,name=accepting"` + Serving *bool `json:"serving,omitempty" protobuf:"bytes,2,name=serving"` // terminating indicates that this endpoint is terminating. A nil value indicates an // unknown state. Consumers should interpret this unknown state to mean that the diff --git a/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go index 1cbd09cfee8..07033c48497 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/types_swagger_doc_generated.go @@ -43,7 +43,7 @@ func (Endpoint) SwaggerDoc() map[string]string { var map_EndpointConditions = map[string]string{ "": "EndpointConditions represents the current condition of an endpoint.", "ready": "ready indicates that this endpoint is prepared to receive traffic, according to whatever system is managing the endpoint. A nil value indicates an unknown state. In most cases consumers should interpret this unknown state as ready. For compatibility reasons, ready should never be \"true\" for terminating endpoints.", - "accepting": "accepting is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", + "serving": "serving is identical to ready except that it is set regardless of the terminating state of endpoints. This condition should be set to true for a ready endpoint that is terminating. If nil, consumers should defer to the ready condition.", "terminating": "terminating indicates that this endpoint is terminating. A nil value indicates an unknown state. Consumers should interpret this unknown state to mean that the endpoint is not terminating.", } diff --git a/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go index abdf9eeea99..65c3a017311 100644 --- a/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/discovery/v1beta1/zz_generated.deepcopy.go @@ -72,8 +72,8 @@ func (in *EndpointConditions) DeepCopyInto(out *EndpointConditions) { *out = new(bool) **out = **in } - if in.Accepting != nil { - in, out := &in.Accepting, &out.Accepting + if in.Serving != nil { + in, out := &in.Serving, &out.Serving *out = new(bool) **out = **in }