Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
run: fix the reset with apply (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienBalestra authored Jul 2, 2018
1 parent 2a030b6 commit 56d511c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ jobs:
name: sonobuoy
command: ./.ci/sonobuoy.sh

- run:
name: reset
command: ./pupernetes reset default kube-system --apply

- run:
name: validation
command: ./.ci/pupernetes-validation.sh

workflows:
version: 2
tests:
Expand Down
5 changes: 0 additions & 5 deletions pkg/run/readiness.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import (
)

func (r *Runtime) applyManifests() error {
if r.state.IsKubectlApplied() {
glog.V(5).Infof("Kubectl is already applied")
return nil
}
glog.Infof("Calling kubectl apply -f %s ...", r.env.GetManifestsPathToApply())
b, err := exec.Command(r.env.GetHyperkubePath(), "kubectl", "--kubeconfig", r.env.GetKubeconfigInsecurePath(), "apply", "-f", r.env.GetManifestsPathToApply()).CombinedOutput()
output := string(b)
Expand All @@ -27,7 +23,6 @@ func (r *Runtime) applyManifests() error {
return err
}
glog.V(2).Infof("Successfully applied manifests:\n%s", output)
r.state.SetKubectlApplied()
return nil
}

Expand Down
15 changes: 9 additions & 6 deletions pkg/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,15 @@ func (r *Runtime) Run() error {
continue
}
// kubectl apply -f manifests-api
err = r.applyManifests()
if err != nil {
// TODO do we trigger an exit at some point
// TODO because it's almost a deadlock if the user didn't set a short --timeoutTimer
glog.Errorf("Cannot apply manifests in %s", r.env.GetManifestsPathToApply())
continue
if !r.state.IsKubectlApplied() {
err = r.applyManifests()
if err != nil {
// TODO do we trigger an exit at some point
// TODO because it's almost a deadlock if the user didn't set a short --timeoutTimer
glog.Errorf("Cannot apply manifests in %s", r.env.GetManifestsPathToApply())
continue
}
r.state.SetKubectlApplied()
}
err = r.checkInClusterDNS()
if err != nil {
Expand Down

0 comments on commit 56d511c

Please sign in to comment.