Declare TCP default for service port protocol

This commit is contained in:
Jordan Liggitt 2021-01-28 17:45:24 -05:00 committed by Kevin Delgado
parent b418bc83db
commit dab5112240
3 changed files with 8 additions and 0 deletions

View File

@ -913,6 +913,12 @@ func SetObjectDefaults_SecretList(in *v1.SecretList) {
func SetObjectDefaults_Service(in *v1.Service) {
SetDefaults_Service(in)
for i := range in.Spec.Ports {
a := &in.Spec.Ports[i]
if a.Protocol == "" {
a.Protocol = "TCP"
}
}
}
func SetObjectDefaults_ServiceList(in *v1.ServiceList) {

View File

@ -4751,6 +4751,7 @@ message ServicePort {
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
// Default is TCP.
// +default="TCP"
// +optional
optional string protocol = 2;

View File

@ -4265,6 +4265,7 @@ type ServicePort struct {
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
// Default is TCP.
// +default="TCP"
// +optional
Protocol Protocol `json:"protocol,omitempty" protobuf:"bytes,2,opt,name=protocol,casttype=Protocol"`