Skip to content
Merged
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
22 changes: 12 additions & 10 deletions internal/kustomize/kustomize.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,20 @@ func (k *Kustomize) paths(path string) error {
}

for _, resource := range kz.Resources {
p := filepath.Join(path, resource)
file, err := os.Stat(p)
if err != nil {
return err
}
if file.IsDir() {
p = convertPath(p)
if err := k.paths(p); err != nil {
if !isRemoteFile(resource) {
p := filepath.Join(path, resource)
file, err := os.Stat(p)
if err != nil {
return err
}
if err := k.addPath(p); err != nil {
return err
if file.IsDir() {
p = convertPath(p)
if err := k.paths(p); err != nil {
return err
}
if err := k.addPath(p); err != nil {
return err
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions internal/kustomize/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kustomize

import (
"fmt"
"net/url"
"os"
"path/filepath"

Expand Down Expand Up @@ -33,3 +34,8 @@ func kustomizeFile(path string) (types.Kustomization, error) {
}
return kz, fmt.Errorf("no kustomization file found in %v", path)
}

func isRemoteFile(path string) bool {
u, err := url.Parse(path)
return err == nil && (u.Scheme == "http" || u.Scheme == "https")
}