mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Svc REST: rename allocClusterIPs -> allocIPs
This commit is contained in:
parent
7d9357b181
commit
8e330eb611
@ -231,7 +231,7 @@ func (al *RESTAllocStuff) txnUpdateNodePorts(service, oldService *api.Service, d
|
|||||||
return txn, nil
|
return txn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (al *RESTAllocStuff) allocClusterIPs(service *api.Service, toAlloc map[api.IPFamily]string, dryRun bool) (map[api.IPFamily]string, error) {
|
func (al *RESTAllocStuff) allocIPs(service *api.Service, toAlloc map[api.IPFamily]string, dryRun bool) (map[api.IPFamily]string, error) {
|
||||||
allocated := make(map[api.IPFamily]string)
|
allocated := make(map[api.IPFamily]string)
|
||||||
|
|
||||||
for family, ip := range toAlloc {
|
for family, ip := range toAlloc {
|
||||||
@ -290,7 +290,7 @@ func (al *RESTAllocStuff) allocServiceClusterIP(service *api.Service, dryRun boo
|
|||||||
// get clusterIP.. empty string if user did not specify an ip
|
// get clusterIP.. empty string if user did not specify an ip
|
||||||
toAlloc[al.defaultServiceIPFamily] = service.Spec.ClusterIP
|
toAlloc[al.defaultServiceIPFamily] = service.Spec.ClusterIP
|
||||||
// alloc
|
// alloc
|
||||||
allocated, err := al.allocClusterIPs(service, toAlloc, dryRun)
|
allocated, err := al.allocIPs(service, toAlloc, dryRun)
|
||||||
|
|
||||||
// set
|
// set
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@ -360,7 +360,7 @@ func (al *RESTAllocStuff) allocServiceClusterIPs(service *api.Service, dryRun bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
// allocate
|
// allocate
|
||||||
allocated, err := al.allocClusterIPs(service, toAlloc, dryRun)
|
allocated, err := al.allocIPs(service, toAlloc, dryRun)
|
||||||
|
|
||||||
// set if successful
|
// set if successful
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@ -491,7 +491,7 @@ func (al *RESTAllocStuff) handleClusterIPsForUpdatedService(oldService *api.Serv
|
|||||||
toAllocate[service.Spec.IPFamilies[1]] = service.Spec.ClusterIPs[1]
|
toAllocate[service.Spec.IPFamilies[1]] = service.Spec.ClusterIPs[1]
|
||||||
|
|
||||||
// allocate
|
// allocate
|
||||||
allocated, err := al.allocClusterIPs(service, toAllocate, dryRun)
|
allocated, err := al.allocIPs(service, toAllocate, dryRun)
|
||||||
// set if successful
|
// set if successful
|
||||||
if err == nil {
|
if err == nil {
|
||||||
service.Spec.ClusterIPs[1] = allocated[service.Spec.IPFamilies[1]]
|
service.Spec.ClusterIPs[1] = allocated[service.Spec.IPFamilies[1]]
|
||||||
|
Loading…
Reference in New Issue
Block a user