Skip to content

Commit

Permalink
break long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
chenchun committed Oct 24, 2019
1 parent e312e29 commit 1d03a19
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
16 changes: 0 additions & 16 deletions cmd/galaxy-ipam/galaxy-ipam.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
Copyright 2016 The Gaia Authors All rights reserved.
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 main

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/galaxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ func parseExtendedCNIArgs(pod *corev1.Pod) (map[string]map[string]json.RawMessag

func (g *Galaxy) setupIPtables() error {
// filter all running pods on node
pods, err := g.client.CoreV1().Pods(v1.NamespaceAll).List(v1.ListOptions{FieldSelector: fields.OneTermEqualSelector("spec.nodeName", k8s.GetHostname()).String()})
pods, err := g.client.CoreV1().Pods(v1.NamespaceAll).List(v1.ListOptions{
FieldSelector: fields.OneTermEqualSelector("spec.nodeName", k8s.GetHostname()).String()})
if err != nil {
return fmt.Errorf("failed to get pods on node: %v", err)
}
Expand Down
7 changes: 5 additions & 2 deletions pkg/ipam/api/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ func (c *PoolController) Get(req *restful.Request, resp *restful.Response) {
httputil.InternalError(resp, err)
return
}
resp.WriteEntity(GetPoolResp{Resp: httputil.NewResp(http.StatusOK, ""), Pool: Pool{Name: pool.Name, Size: pool.Size, PreAllocateIP: pool.PreAllocateIP}})
resp.WriteEntity(GetPoolResp{Resp: httputil.NewResp(http.StatusOK, ""), Pool: Pool{
Name: pool.Name, Size: pool.Size, PreAllocateIP: pool.PreAllocateIP}})
}

type UpdatePoolResp struct {
Expand Down Expand Up @@ -154,7 +155,9 @@ func (c *PoolController) preAllocateIP(req *restful.Request, resp *restful.Respo
} else if err == floatingip.ErrNoEnoughIP {
j++
if j == len(subnets) {
resp.WriteHeaderAndEntity(http.StatusAccepted, UpdatePoolResp{Resp: httputil.NewResp(http.StatusAccepted, "No enough IPs"), RealPoolSize: pool.Size - needAllocateIPs + i})
resp.WriteHeaderAndEntity(http.StatusAccepted, UpdatePoolResp{
Resp: httputil.NewResp(http.StatusAccepted, "No enough IPs"),
RealPoolSize: pool.Size - needAllocateIPs + i})
return
}
_, subnetIPNet, _ = net.ParseCIDR(subnets[j])
Expand Down
3 changes: 2 additions & 1 deletion pkg/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ func (p *PolicyManager) syncPods() {
} else {
// PodInformerFactory not started meaning there isn't any network policy right now, ensure pods' chains
// are deleted
list, err := p.client.CoreV1().Pods(v1.NamespaceAll).List(v1.ListOptions{FieldSelector: fields.OneTermEqualSelector("spec.nodeName", k8s.GetHostname()).String()})
list, err := p.client.CoreV1().Pods(v1.NamespaceAll).List(v1.ListOptions{
FieldSelector: fields.OneTermEqualSelector("spec.nodeName", k8s.GetHostname()).String()})
if err != nil {
glog.Warningf("failed to list pods: %v", err)
return
Expand Down

0 comments on commit 1d03a19

Please sign in to comment.