mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #67058 from hanxiaoshuai/fix0806
Automatic merge from submit-queue (batch tested with PRs 67058, 67083, 67220, 67222, 67209). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. use const v1.ProtocolTCP replace of string TCP **What this PR does / why we need it**: use const v1.ProtocolTCP replace of string TCP **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
This commit is contained in:
commit
422f9cb9b7
@ -548,7 +548,7 @@ func (f *Framework) CreateServiceForSimpleApp(contPort, svcPort int, appName str
|
|||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
return []v1.ServicePort{{
|
return []v1.ServicePort{{
|
||||||
Protocol: "TCP",
|
Protocol: v1.ProtocolTCP,
|
||||||
Port: int32(svcPort),
|
Port: int32(svcPort),
|
||||||
TargetPort: intstr.FromInt(contPort),
|
TargetPort: intstr.FromInt(contPort),
|
||||||
}}
|
}}
|
||||||
|
@ -254,7 +254,7 @@ func (j *ServiceTestJig) CreateOnlyLocalNodePortService(namespace, serviceName s
|
|||||||
svc := j.CreateTCPServiceOrFail(namespace, func(svc *v1.Service) {
|
svc := j.CreateTCPServiceOrFail(namespace, func(svc *v1.Service) {
|
||||||
svc.Spec.Type = v1.ServiceTypeNodePort
|
svc.Spec.Type = v1.ServiceTypeNodePort
|
||||||
svc.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeLocal
|
svc.Spec.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicyTypeLocal
|
||||||
svc.Spec.Ports = []v1.ServicePort{{Protocol: "TCP", Port: 80}}
|
svc.Spec.Ports = []v1.ServicePort{{Protocol: v1.ProtocolTCP, Port: 80}}
|
||||||
})
|
})
|
||||||
|
|
||||||
if createPod {
|
if createPod {
|
||||||
@ -1414,7 +1414,7 @@ func CreateServiceSpec(serviceName, externalName string, isHeadless bool, select
|
|||||||
headlessService.Spec.ExternalName = externalName
|
headlessService.Spec.ExternalName = externalName
|
||||||
} else {
|
} else {
|
||||||
headlessService.Spec.Ports = []v1.ServicePort{
|
headlessService.Spec.Ports = []v1.ServicePort{
|
||||||
{Port: 80, Name: "http", Protocol: "TCP"},
|
{Port: 80, Name: "http", Protocol: v1.ProtocolTCP},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if isHeadless {
|
if isHeadless {
|
||||||
|
@ -64,7 +64,7 @@ func CreateStatefulSetService(name string, labels map[string]string) *v1.Service
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
headlessService.Spec.Ports = []v1.ServicePort{
|
headlessService.Spec.Ports = []v1.ServicePort{
|
||||||
{Port: 80, Name: "http", Protocol: "TCP"},
|
{Port: 80, Name: "http", Protocol: v1.ProtocolTCP},
|
||||||
}
|
}
|
||||||
headlessService.Spec.ClusterIP = "None"
|
headlessService.Spec.ClusterIP = "None"
|
||||||
return headlessService
|
return headlessService
|
||||||
|
Loading…
Reference in New Issue
Block a user