Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kubectl): Allow port-forwarding if there is nothing to deploy #9497

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/skaffold/deploy/kubectl/kubectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []graph.Art
}

if len(manifests) == 0 {
return fmt.Errorf("nothing to deploy")
return nil
}

// Add debug transformations
Expand Down
8 changes: 3 additions & 5 deletions pkg/skaffold/deploy/kubectl/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ func TestKubectlV1RenderDeploy(t *testing.T) {
envs map[string]string
}{
{
description: "no manifest should error now since there is nothing to deploy",
kubectl: latest.KubectlDeploy{},
shouldErr: true,
waitForDeletions: true,
description: "no manifest should not error",
kubectl: latest.KubectlDeploy{},
commands: testutil.
CmdRunOutOnce("kubectl config view --minify -o jsonpath='{..namespace}'", "default"),
},
Expand Down Expand Up @@ -409,7 +407,7 @@ func TestKubectlRedeploy(t *testing.T) {
{ImageName: "leeroy-web", Tag: "leeroy-web:v1"},
{ImageName: "leeroy-app", Tag: "leeroy-app:v2"},
}, emptyManifestList)
t.CheckErrorContains("nothing to deploy", err)
t.CheckNoError(err)
})
}

Expand Down