Skip to content

Commit

Permalink
fix: avoid conflict when init
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Oct 13, 2019
1 parent f00a6d5 commit d33685e
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.8.0
v0.9.0-pre
16 changes: 0 additions & 16 deletions cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ func main() {
klog.Fatal(http.ListenAndServe(fmt.Sprintf("localhost:%d", config.PprofPort), nil))
}()

if err = controller.InitClusterRouter(config); err != nil {
klog.Fatalf("init cluster router failed %v", err)
}

if err = controller.InitLoadBalancer(config); err != nil {
klog.Fatalf("init load balancer failed %v", err)
}

if err = controller.InitNodeSwitch(config); err != nil {
klog.Fatalf("init node switch failed %v", err)
}

if err = controller.InitDefaultLogicalSwitch(config); err != nil {
klog.Fatalf("init default switch failed %v", err)
}

ctl := controller.NewController(config)
ctl.Run(stopCh)
}
Expand Down
17 changes: 17 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,23 @@ func (c *Controller) Run(stopCh <-chan struct{}) error {
}
time.Sleep(1 * time.Second)
}

if err := InitClusterRouter(c.config); err != nil {
klog.Fatalf("init cluster router failed %v", err)
}

if err := InitLoadBalancer(c.config); err != nil {
klog.Fatalf("init load balancer failed %v", err)
}

if err := InitNodeSwitch(c.config); err != nil {
klog.Fatalf("init node switch failed %v", err)
}

if err := InitDefaultLogicalSwitch(c.config); err != nil {
klog.Fatalf("init default switch failed %v", err)
}

c.informerFactory.Start(stopCh)
c.kubeovnInformerFactory.Start(stopCh)

Expand Down
2 changes: 1 addition & 1 deletion pkg/ovs/ovn-nbctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ func (c Client) SetLogicalSwitchExcludeIPS(logicalSwtich string, excludeIPS []st
return err
}

func (c Client) GetLogicalSwitchPortByLogicalSwich(logicalSwitch string) ([]string, error) {
func (c Client) GetLogicalSwitchPortByLogicalSwitch(logicalSwitch string) ([]string, error) {
output, err := c.ovnNbCommand("lsp-list", logicalSwitch)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/static_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (v *ValidatingHook) PodCreateHook(ctx context.Context, req admission.Reques
}
}
// Get all logical switch port address
lsps, err := v.ovnClient.GetLogicalSwitchPortByLogicalSwich(lsName)
lsps, err := v.ovnClient.GetLogicalSwitchPortByLogicalSwitch(lsName)
if err != nil {
return ctrlwebhook.Errored(http.StatusBadRequest, err)
}
Expand Down Expand Up @@ -294,7 +294,7 @@ func (v *ValidatingHook) podControllerCreate(ctx context.Context, staticIPSAnno,
}
}
// Get all logical switch port address
lsps, err := v.ovnClient.GetLogicalSwitchPortByLogicalSwich(lsName)
lsps, err := v.ovnClient.GetLogicalSwitchPortByLogicalSwitch(lsName)
if err != nil {
return ctrlwebhook.Errored(http.StatusBadRequest, err)
}
Expand Down
8 changes: 4 additions & 4 deletions yamls/kube-ovn-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
hostNetwork: true
containers:
- name: kube-ovn-controller
image: "index.alauda.cn/alaudak8s/kube-ovn-controller:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-controller:v0.9.0-pre"
imagePullPolicy: Always
command:
- /kube-ovn/start-controller.sh
Expand Down Expand Up @@ -109,7 +109,7 @@ spec:
hostPID: true
initContainers:
- name: install-cni
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.0-pre"
imagePullPolicy: Always
command: ["/kube-ovn/install-cni.sh"]
volumeMounts:
Expand All @@ -119,7 +119,7 @@ spec:
name: cni-bin
containers:
- name: cni-server
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.0-pre"
command: ["sh", "/kube-ovn/start-cniserver.sh"]
args:
- --enable-mirror=false
Expand Down Expand Up @@ -202,7 +202,7 @@ spec:
hostPID: true
containers:
- name: pinger
image: "index.alauda.cn/alaudak8s/kube-ovn-pinger:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-pinger:v0.9.0-pre"
imagePullPolicy: Always
securityContext:
runAsUser: 0
Expand Down
8 changes: 4 additions & 4 deletions yamls/kube-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
hostNetwork: true
containers:
- name: kube-ovn-controller
image: "index.alauda.cn/alaudak8s/kube-ovn-controller:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-controller:v0.9.0-pre"
imagePullPolicy: Always
command:
- /kube-ovn/start-controller.sh
Expand Down Expand Up @@ -112,7 +112,7 @@ spec:
hostPID: true
initContainers:
- name: install-cni
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.0-pre"
imagePullPolicy: Always
command: ["/kube-ovn/install-cni.sh"]
volumeMounts:
Expand All @@ -122,7 +122,7 @@ spec:
name: cni-bin
containers:
- name: cni-server
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-cni:v0.9.0-pre"
imagePullPolicy: Always
command:
- sh
Expand Down Expand Up @@ -206,7 +206,7 @@ spec:
hostPID: true
containers:
- name: pinger
image: "index.alauda.cn/alaudak8s/kube-ovn-pinger:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-pinger:v0.9.0-pre"
imagePullPolicy: Always
securityContext:
runAsUser: 0
Expand Down
4 changes: 2 additions & 2 deletions yamls/ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ spec:
hostNetwork: true
containers:
- name: ovn-central
image: "index.alauda.cn/alaudak8s/kube-ovn-db:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-db:v0.9.0-pre"
imagePullPolicy: Always
env:
- name: POD_IP
Expand Down Expand Up @@ -245,7 +245,7 @@ spec:
hostPID: true
containers:
- name: openvswitch
image: "index.alauda.cn/alaudak8s/kube-ovn-node:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-node:v0.9.0-pre"
imagePullPolicy: Always
securityContext:
runAsUser: 0
Expand Down
2 changes: 1 addition & 1 deletion yamls/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
hostNetwork: true
containers:
- name: kube-ovn-webhook
image: "index.alauda.cn/alaudak8s/kube-ovn-webhook:v0.8.0"
image: "index.alauda.cn/alaudak8s/kube-ovn-webhook:v0.9.0-pre"
imagePullPolicy: Always
command:
- /kube-ovn/start-webhook.sh
Expand Down

0 comments on commit d33685e

Please sign in to comment.