Do not try to load HTTP resources from FS when error occurs

It is useless and it clogs the error message.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This commit is contained in:
Sylvain Rabot
2021-12-08 18:24:29 +01:00
parent 49b464fd4d
commit e65e571ed1

View File

@@ -366,6 +366,9 @@ func (kt *KustTarget) accumulateResources(
for _, path := range paths {
// try loading resource as file then as base (directory or git repository)
if errF := kt.accumulateFile(ra, path, origin); errF != nil {
if strings.HasPrefix(path, "https://") || strings.HasPrefix(path, "http://") {
return nil, errF
}
ldr, err := kt.ldr.New(path)
if err != nil {
return nil, errors.Wrapf(