Skip to content

Commit

Permalink
fix loading CRDs from multiple directories in envtests
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed May 17, 2022
1 parent 3f265c3 commit 6eae7d8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/envtest/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,6 @@ func CreateCRDs(config *rest.Config, crds []*apiextensionsv1.CustomResourceDefin

// renderCRDs iterate through options.Paths and extract all CRD files.
func renderCRDs(options *CRDInstallOptions) ([]*apiextensionsv1.CustomResourceDefinition, error) {
var (
err error
info os.FileInfo
files []string
)

type GVKN struct {
GVK schema.GroupVersionKind
Name string
Expand All @@ -292,7 +286,12 @@ func renderCRDs(options *CRDInstallOptions) ([]*apiextensionsv1.CustomResourceDe
crds := map[GVKN]*apiextensionsv1.CustomResourceDefinition{}

for _, path := range options.Paths {
var filePath = path
var (
err error
info os.FileInfo
files []string
filePath = path
)

// Return the error if ErrorIfPathMissing exists
if info, err = os.Stat(path); os.IsNotExist(err) {
Expand Down

0 comments on commit 6eae7d8

Please sign in to comment.