Skip to content

Commit

Permalink
Merge pull request #772 from r2d4/grace-period
Browse files Browse the repository at this point in the history
kubectl: set grace-period=1 on cleanup
  • Loading branch information
dgageot authored Jun 29, 2018
2 parents 984dfa8 + 5ddffff commit b6172b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/skaffold/deploy/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (k *KubectlDeployer) Cleanup(ctx context.Context, out io.Writer) error {
return errors.Wrap(err, "reading manifests")
}

if err := kubectl(manifests.reader(), out, k.kubeContext, "delete", "--ignore-not-found=true", "-f", "-"); err != nil {
if err := kubectl(manifests.reader(), out, k.kubeContext, "delete", "--grace-period=1", "--ignore-not-found=true", "-f", "-"); err != nil {
return errors.Wrap(err, "deleting manifests")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/deploy/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ func TestKubectlCleanup(t *testing.T) {
cfg: &v1alpha2.KubectlDeploy{
Manifests: []string{"test/deployment.yaml"},
},
command: testutil.NewFakeCmd("kubectl --context kubecontext delete --ignore-not-found=true -f -", nil),
command: testutil.NewFakeCmd("kubectl --context kubecontext delete --grace-period=1 --ignore-not-found=true -f -", nil),
},
{
description: "cleanup error",
cfg: &v1alpha2.KubectlDeploy{
Manifests: []string{"test/deployment.yaml"},
},
command: testutil.NewFakeCmd("kubectl --context kubecontext delete --ignore-not-found=true -f -", errors.New("BUG")),
command: testutil.NewFakeCmd("kubectl --context kubecontext delete --grace-period=1 --ignore-not-found=true -f -", errors.New("BUG")),
shouldErr: true,
},
}
Expand Down

0 comments on commit b6172b3

Please sign in to comment.