Refactor openAPI

Refactor global openapi
This commit is contained in:
Phani Teja Marupaka
2020-11-10 12:50:24 -08:00
parent b2ba82a0bd
commit b6a4dd446a
27 changed files with 178 additions and 503 deletions

View File

@@ -7,13 +7,11 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/go-errors/errors"
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/cmd/config/ext"
"sigs.k8s.io/kustomize/kyaml/openapi"
"sigs.k8s.io/kustomize/kyaml/pathutil"
)
@@ -73,14 +71,6 @@ func (e ExecuteCmdOnPkgs) Execute() error {
func (e ExecuteCmdOnPkgs) processPkg(pkgPath string) error {
// Add schema present in openAPI file for current package
if e.NeedOpenAPI {
clean, err := openapi.AddSchemaFromFile(filepath.Join(pkgPath, ext.KRMFileName()))
if err != nil {
return err
}
defer clean()
}
if !e.SkipPkgPathPrint {
fmt.Fprintf(e.Writer, "%s/\n", pkgPath)
}