Add support for remote OpenAPI schema

This commit is contained in:
Mário Bezerra
2022-04-04 15:31:59 -03:00
parent 9d5491c2e2
commit 94af647556
2 changed files with 2 additions and 5 deletions

View File

@@ -6,7 +6,6 @@ package target
import (
"encoding/json"
"fmt"
"path/filepath"
"strings"
"github.com/pkg/errors"
@@ -478,9 +477,8 @@ func (kt *KustTarget) accumulateDirectory(
subKt.kustomization.BuildMetadata = kt.kustomization.BuildMetadata
subKt.origin = kt.origin
var bytes []byte
path := ldr.Root()
if openApiPath, exists := subKt.Kustomization().OpenAPI["path"]; exists {
bytes, err = ldr.Load(filepath.Join(path, openApiPath))
bytes, err = ldr.Load(openApiPath)
if err != nil {
return nil, err
}