diff --git a/go.mod b/go.mod index aed53238f..6acc9866b 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,6 @@ require ( github.com/go-openapi/swag v0.19.0 // indirect github.com/go-sql-driver/mysql v1.4.1 // indirect github.com/gocql/gocql v0.0.0-20190402132108-0e1d5de854df // indirect - github.com/gogo/protobuf v1.2.0 // indirect github.com/golang/protobuf v1.3.1 // indirect github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect github.com/google/btree v1.0.0 // indirect @@ -60,16 +59,14 @@ require ( github.com/keybase/go-crypto v0.0.0-20190403132359-d65b6b94177f // indirect github.com/kr/pretty v0.1.0 github.com/lib/pq v1.0.0 // indirect - github.com/mattn/go-colorable v0.1.1 // indirect - github.com/mattn/go-isatty v0.0.7 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab // indirect github.com/miekg/dns v0.0.0-20170721150254-0f3adef2e220 github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20190414153302-2ae31c8b6b30 // indirect - github.com/onsi/ginkgo v1.7.0 - github.com/onsi/gomega v1.4.3 + github.com/onsi/ginkgo v1.8.0 + github.com/onsi/gomega v1.5.0 github.com/opencontainers/go-digest v1.0.0-rc1 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/opencontainers/runc v0.1.1 // indirect @@ -81,17 +78,14 @@ require ( github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sethgrid/pester v0.0.0-20190127155807-68a33a018ad0 // indirect - github.com/spf13/cobra v0.0.0-20180319062004-c439c4fa0937 - github.com/spf13/pflag v1.0.2 + github.com/spf13/cobra v0.0.3 + github.com/spf13/pflag v1.0.3 github.com/stretchr/testify v1.3.0 github.com/tent/http-link-go v0.0.0-20130702225549-ac974c61c2f9 // indirect golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 golang.org/x/net v0.0.0-20190502183928-7f726cade0ab golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a - golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect - golang.org/x/text v0.3.2 // indirect golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect - golang.org/x/tools v0.0.0-20190501045030-23463209683d // indirect google.golang.org/api v0.4.0 google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect google.golang.org/grpc v1.20.1 // indirect @@ -109,8 +103,9 @@ require ( k8s.io/klog v0.3.1 k8s.io/kube-aggregator v0.0.0-20190222095010-0b78038fe9e5 k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 - k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 + k8s.io/utils v0.0.0-20190607212802-c55fbcfc754a sigs.k8s.io/controller-runtime v0.2.0-beta.4 + sigs.k8s.io/controller-tools v0.2.0-beta.4 sigs.k8s.io/testing_frameworks v0.1.1 ) @@ -137,3 +132,5 @@ replace k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190612205613-18d replace k8s.io/component-base => k8s.io/component-base v0.0.0-20190718183727-0ececfbe9772 replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.0.0-20190718184434-a064d4d1ed7a + +replace sigs.k8s.io/controller-tools => github.com/munnerz/controller-tools v0.1.10-0.20190723151506-0264a5324181 diff --git a/hack/BUILD.bazel b/hack/BUILD.bazel index 87984bb23..6da0ef29e 100644 --- a/hack/BUILD.bazel +++ b/hack/BUILD.bazel @@ -128,7 +128,7 @@ sh_binary( name = "update-crds", srcs = ["update-crds.sh"], data = [ - "//hack/bin:gencrd", + "//hack/bin:controller-gen", "//pkg/apis:all-srcs", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:all-srcs", @@ -142,7 +142,7 @@ sh_test( data = [ ":update-crds", "//deploy:all-srcs", - "//hack/bin:gencrd", + "//hack/bin:controller-gen", "//pkg/apis:all-srcs", ], ) diff --git a/hack/bin/BUILD.bazel b/hack/bin/BUILD.bazel index ec85449a2..e846fcce8 100644 --- a/hack/bin/BUILD.bazel +++ b/hack/bin/BUILD.bazel @@ -182,9 +182,9 @@ genrule( ) genrule( - name = "fetch_gencrd", - srcs = ["@io_kubernetes_sigs_controller-tools//cmd/crd"], - outs = ["gencrd"], + name = "fetch_controller-gen", + srcs = ["//vendor/sigs.k8s.io/controller-tools/cmd/controller-gen"], + outs = ["controller-gen"], cmd = "cp $(SRCS) $@", visibility = ["//visibility:public"], ) diff --git a/hack/bin/deps.bzl b/hack/bin/deps.bzl index ecaa9cdf1..5e4d450fa 100644 --- a/hack/bin/deps.bzl +++ b/hack/bin/deps.bzl @@ -39,13 +39,6 @@ def install_misc(): urls = ["https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64"], ) - # Load the controller-tools repository in order to build the crd generator tool - go_repository( - name = "io_kubernetes_sigs_controller-tools", - commit = "538db3af1387ce55d50b93e500a49925a5768c82", - importpath = "sigs.k8s.io/controller-tools", - ) - # Install dependencies used by the controller-runtime integration test framework def install_integration_test_dependencies(): http_file( diff --git a/hack/bin/tools.go b/hack/bin/tools.go index dc43805f9..bb2e34445 100644 --- a/hack/bin/tools.go +++ b/hack/bin/tools.go @@ -30,4 +30,5 @@ import ( _ "k8s.io/code-generator/cmd/informer-gen" _ "k8s.io/code-generator/cmd/lister-gen" _ "k8s.io/kube-openapi/cmd/openapi-gen" + _ "sigs.k8s.io/controller-tools/cmd/controller-gen" ) diff --git a/hack/update-crds.sh b/hack/update-crds.sh index 4fe399f93..421fed8ba 100755 --- a/hack/update-crds.sh +++ b/hack/update-crds.sh @@ -25,9 +25,10 @@ export PATH="${runfiles}/hack/bin:${PATH}" cd "${REPO_ROOT}" output="$(mktemp -d)" -gencrd generate \ - --domain "k8s.io" \ - --output-dir "${output}" +controller-gen \ + paths=./pkg/apis/... \ + crd:trivialVersions=true \ + output:crd:dir="${output}" echo "Copying files to output file" out="deploy/manifests/00-crds.yaml"