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

Skip the deployment if no manifests are defined #832

Merged
merged 1 commit into from
Jul 20, 2018
Merged
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
Skip the deployment if no manifests are defined
ccojocar committed Jul 19, 2018
commit 66f9acd32d3cf3630a403099dd123d67cf37415d
8 changes: 8 additions & 0 deletions pkg/skaffold/deploy/kubectl.go
Original file line number Diff line number Diff line change
@@ -70,6 +70,10 @@ func (k *KubectlDeployer) Deploy(ctx context.Context, out io.Writer, builds []bu
return nil, errors.Wrap(err, "reading manifests")
}

if manifests.Empty() {
return []Artifact{}, nil
}

manifests, err = manifests.replaceImages(builds)
if err != nil {
return nil, errors.Wrap(err, "replacing images in manifests")
@@ -215,6 +219,10 @@ func (l *manifestList) String() string {
return str
}

func (l *manifestList) Empty() bool {
return len(*l) == 0
}

func (l *manifestList) reader() io.Reader {
return strings.NewReader(l.String())
}