Skip to content

Commit

Permalink
🌱 fix unit tests (config-gen bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmogBaku committed Apr 1, 2022
1 parent 9edd734 commit 31c029f
Show file tree
Hide file tree
Showing 12 changed files with 2,268 additions and 1,266 deletions.
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ require (
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff
k8s.io/apimachinery v0.23.5 // for `kubebuilder alpha config-gen`
sigs.k8s.io/controller-runtime v0.11.2
sigs.k8s.io/controller-tools v0.7.0 // for `kubebuilder alpha config-gen`
sigs.k8s.io/kustomize/kyaml v0.10.21 // for `kubebuilder alpha config-gen`
sigs.k8s.io/controller-tools v0.8.0 // for `kubebuilder alpha config-gen`
sigs.k8s.io/kustomize/kyaml v0.13.6 // for `kubebuilder alpha config-gen`
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
Expand All @@ -44,10 +45,12 @@ require (
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
Expand Down
46 changes: 18 additions & 28 deletions go.sum

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion pkg/cli/alpha/config-gen/controller-gen-filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ func (cgr ControllerGenFilter) Filter(input []*yaml.RNode) ([]*yaml.RNode, error

// set the directory
b := bufferedGenerator{}
rt, _ := gens.ForRoots(cgr.Spec.CRDs.SourceDirectory) // ignore the spurious error
rt, err := gens.ForRoots(cgr.Spec.CRDs.SourceDirectory)
if err != nil {
return nil, errors.WrapPrefixf(err, "failed to produce a Runtime to run the generators against %s", cgr.Spec.CRDs.SourceDirectory)
}
rt.OutputRules = genall.OutputRules{Default: &b}

// run the generators
Expand Down
Loading

0 comments on commit 31c029f

Please sign in to comment.