Skip to content

Commit

Permalink
systest fixing and misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Tie authored and unclejack committed Jan 5, 2018
1 parent 53d7e29 commit 78c1aa4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions install/k8s/contiv/contiv_devtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
# container programs network policy and routes on each
# host.
- name: contiv-netplugin
image: contiv/netplugin:k8s_devtest
image: contiv/netplugin:latest
env:
- name: CONTIV_ROLE
value: netplugin
Expand Down Expand Up @@ -236,7 +236,7 @@ spec:
hostPID: true
containers:
- name: contiv-netmaster
image: contiv/netplugin:k8s_devtest
image: contiv/netplugin:latest
env:
- name: CONTIV_ROLE
value: netmaster
Expand Down
29 changes: 28 additions & 1 deletion test/systemtests/kubeadm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,34 @@ func (k *kubePod) runCommandUntilNoNetmasterError() error {
}

processCheckCmd := `kubectl -n kube-system exec ` + podName + ` -- pgrep netmaster`
return k8sMaster.runCommandUntilNoError(processCheckCmd)
if err := k8sMaster.runCommandUntilNoError(processCheckCmd); err != nil {
return err
}
return waitUntilAllPodsReady()
}

func waitUntilAllPodsReady() error {
// ensure all pods are running
var cliErr error
var badPodNum string
// wait up to 10 min
for retry := 120; retry > 0; retry-- {
// can't use --no-headers because it will have non-zero return code
badPodNum, cliErr = k8sMaster.tbnode.RunCommandWithOutput(`kubectl -n kube-system get pods -owide |grep -c -v Running`)
if cliErr != nil {
logrus.Warnf("Got error %q while fetching pod status, retry in 5 sec", cliErr.Error())
} else if strings.TrimSpace(badPodNum) != "1" {
logrus.Warnf("Found %q pods are not running, retry in 5 sec", strings.TrimSpace(badPodNum))
} else {
return nil
}
time.Sleep(5 * time.Second)
}

if cliErr != nil {
return cliErr
}
return errors.New("Failed to wait all pods to runnning status")
}

func (k *kubePod) runCommandUntilNoNetpluginError() error {
Expand Down

1 comment on commit 78c1aa4

@magic7s
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting this error from netplugin.
container_linux.go:247: starting container process caused "exec: \"/contiv/scripts/contivNet.sh\": stat /contiv/scripts/contivNet.sh: no such file or directory"

Please sign in to comment.