Merge pull request #64122 from ixdy/update-rules_go-and-gazelle

Automatic merge from submit-queue (batch tested with PRs 64122, 64936, 65288, 65383). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update to rules_go 0.12.1 and gazelle 0.12.0 and perform related cleanups

**What this PR does / why we need it**: my initial intent was to simply update to rules_go 0.12.1 and gazelle 0.12.0.

A few internal changes / deprecations meant that I finally needed to clean up some technical debt. This also fixes #64122.
I've attempted to keep the steps as separate commits to make it easier to review:

1. Disable gazelle proto rule generation; legacy proto rules are deprecated, and we don't (currently) build protos at build time anyway, instead generating them with `hack/update-generated-protobuf.sh` and then checking them in. We can revisit this in the future if we'd like.
2. Remove the legacy `go_default_library_protos` filegroups using [buildozer](https://github.com/bazelbuild/buildtools/tree/master/buildozer). We don't use these, anyway.
3. Update the rules_go bazel workspace dependency to 0.12.1.
4. Vendor gazelle 0.12.0 and update BUILD files with `hack/update-bazel.sh`. This causes a lot of diffs, because `select()`s are no longer used in `srcs` attributes, external tests are folded into non-external tests, and vendored targets get an `importmap` attribute.
5. Set `gazelle:prefix` on `staging/src/BUILD` to make gazelle treat these correctly(ish). This allows us to remove the sed rewrite hack in `hack/update-bazel.sh`.
6. Explicitly set `# gazelle:importmap_prefix k8s.io/kubernetes/vendor` on `vendor/`, so that all vendored dependencies get the right importmap. gazelle 0.12.0 uses the bazel workspace name + `vendor/` as a prefix, which doesn't work with native go. Newer gazelle will use the go prefix (https://github.com/bazelbuild/bazel-gazelle/pull/207), but it's not released yet. Setting this correctly now also fixes later `BUILD` churn.
7. Re-run `hack/update-bazel.sh`. This causes a bunch of diffs, since anything under `staging/src` now uses the `staging/src/` path instead of `vendor/`. (Both would work for bazel, but gazelle uses the former, since `vendor/` uses symlinks.) Also `importmap`s under `vendor/` are fixed.
8. Reformat a few files (using [buildifier](https://github.com/bazelbuild/buildtools/tree/master/buildifier)) to make later diffs easier to read.
9. Rework the `go_genrule` rules to use the new `go_genrule` from https://github.com/kubernetes/repo-infra/pull/72, which is more bazely, since it uses the rules_go `go_path` rule instead of lots of shell.
10. Remove the deprecated `go_prefix` rule from the root BUILD.bazel file.
11. Set `# gazelle:importmap_prefix k8s.io/kubernetes/vendor` on `staging/src` as well, which ensures that these repos are treated as vendored dependencies. (It's basically the bazel-y way of doing the `vendor/k8s.io` symlinks.)
12. Run `hack/update-bazel.sh` one last time to fix all of the `importmap`s under `staging/src`.

Note re: point 6 above - we're pretty much ignoring the `vendor/k8s.io` symlinks entirely now under bazel. Using the `gazelle:prefix` directive ensures these get mapped into the right go importpath, and the `go_path` rule installs these correctly now too.

**Special notes for your reviewer**: this should not be submitted before https://github.com/kubernetes/repo-infra/pull/72, obviously.

**Release note**:

```release-note
NONE
```

/assign @BenTheElder @fejta @thockin
cc @cblecker @jayconrod

Kubernetes-commit: 1ad1c8c7f80d99b9625924b2102a04a555162bfb
This commit is contained in:
Kubernetes Publisher 2018-06-22 19:03:12 -07:00
commit 615dfd3eb0

160
Godeps/Godeps.json generated
View File

@ -268,323 +268,323 @@
},
{
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/admissionregistration/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/apps/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/authentication/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/authorization/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/batch/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/core/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/events/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/imagepolicy/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/networking/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/rbac/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/scheduling/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/storage/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/storage/v1alpha1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1beta1",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream/spdy",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/remotecommand",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "e622339dc5f39d70f000c70867b4dd20435d48ff"
"Rev": "00c78f6603af046dfcada47ba511ddc94e7a64ce"
},
{
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto",