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 2, 2022
1 parent 1fa0449 commit 8ed8a7e
Show file tree
Hide file tree
Showing 13 changed files with 2,259 additions and 1,254 deletions.
10 changes: 7 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ 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 golang.org/x/text v0.3.7

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 +47,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 All @@ -62,7 +67,6 @@ require (
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // 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 generator's Runtime against %s", cgr.Spec.CRDs.SourceDirectory)
}
rt.OutputRules = genall.OutputRules{Default: &b}

// run the generators
Expand Down
Loading

0 comments on commit 8ed8a7e

Please sign in to comment.