Skip to content

Commit

Permalink
Support kubectl deploy absolute manifest files
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxi He <xxhe@alauda.io>
  • Loading branch information
tossmilestone committed Apr 24, 2019
1 parent a756680 commit 2d63f6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/skaffold/deploy/kubectl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ spec:
WithRunOut("kubectl --context kubecontext --namespace testNamespace create --dry-run -oyaml -f "+tmpDir.Path("deployment-app.yaml")+" -f "+tmpDir.Path("deployment-web.yaml"), deploymentAppYAML+"\n"+deploymentWebYAML)

cfg := &latest.KubectlDeploy{
Manifests: []string{"*.yaml"},
Manifests: []string{tmpDir.Path("deployment-app.yaml"), "deployment-web.yaml"},
}
deployer := NewKubectlDeployer(&runcontext.RunContext{
WorkingDir: tmpDir.Root(),
Expand Down
6 changes: 6 additions & 0 deletions pkg/skaffold/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func StrSliceContains(sl []string, s string) bool {
func ExpandPathsGlob(workingDir string, paths []string) ([]string, error) {
expandedPaths := make(map[string]bool)
for _, p := range paths {
if _, err := os.Stat(p); err == nil {
// This is a absolute file reference
expandedPaths[p] = true
continue
}

path := filepath.Join(workingDir, p)

if _, err := os.Stat(path); err == nil {
Expand Down

0 comments on commit 2d63f6f

Please sign in to comment.