diff --git a/hack/.linted_packages b/hack/.linted_packages index df10c78f4e..cf5d004aa3 100644 --- a/hack/.linted_packages +++ b/hack/.linted_packages @@ -257,6 +257,7 @@ pkg/util/netsh pkg/util/rand pkg/util/runtime pkg/util/sets +pkg/util/sets/types pkg/util/tail pkg/util/validation pkg/util/validation/field diff --git a/pkg/util/sets/types/BUILD b/pkg/util/sets/types/BUILD index 6109f467f1..deefdcef3c 100644 --- a/pkg/util/sets/types/BUILD +++ b/pkg/util/sets/types/BUILD @@ -9,7 +9,7 @@ load( go_library( name = "go_default_library", - srcs = ["types.go"], + srcs = ["doc.go"], tags = ["automanaged"], ) diff --git a/pkg/util/sets/types/doc.go b/pkg/util/sets/types/doc.go new file mode 100644 index 0000000000..5fe6f4f9eb --- /dev/null +++ b/pkg/util/sets/types/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package sets only exists until heapster rebases +// TODO genericapiserver remove this empty package. Godep fails without this because heapster relies +// on this package. This will allow us to start splitting packages, but will force +// heapster to update on their next kube rebase. +package sets diff --git a/staging/src/k8s.io/apimachinery/pkg/util/sets/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/sets/BUILD index 6fa1f76fb8..97b4bb9082 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/sets/BUILD +++ b/staging/src/k8s.io/apimachinery/pkg/util/sets/BUILD @@ -2,19 +2,13 @@ package(default_visibility = ["//visibility:public"]) licenses(["notice"]) +load("@io_kubernetes_build//defs:go.bzl", "go_genrule") load( "@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", ) -go_test( - name = "go_default_test", - srcs = ["set_test.go"], - library = ":go_default_library", - tags = ["automanaged"], -) - go_library( name = "go_default_library", srcs = [ @@ -27,3 +21,38 @@ go_library( ], tags = ["automanaged"], ) + +go_genrule( + name = "set-gen", + srcs = [ + "//hack/boilerplate:boilerplate.go.txt", + ], + outs = [ + "byte.go", + "doc.go", + "empty.go", + "int.go", + "int64.go", + "string.go", + ], + cmd = """ +$(location //cmd/libs/go2idl/set-gen) \ + --input-dirs ./vendor/k8s.io/apimachinery/pkg/util/sets/types \ + --output-base $(GENDIR)/vendor/k8s.io/apimachinery/pkg/util \ + --go-header-file $(location //hack/boilerplate:boilerplate.go.txt) \ + --output-package sets + """, + go_deps = [ + "//vendor/k8s.io/apimachinery/pkg/util/sets/types:go_default_library", + ], + tools = [ + "//cmd/libs/go2idl/set-gen", + ], +) + +go_test( + name = "go_default_test", + srcs = ["set_test.go"], + library = ":go_default_library", + tags = ["automanaged"], +) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/sets/types/BUILD b/staging/src/k8s.io/apimachinery/pkg/util/sets/types/BUILD new file mode 100644 index 0000000000..7afc7f5cc1 --- /dev/null +++ b/staging/src/k8s.io/apimachinery/pkg/util/sets/types/BUILD @@ -0,0 +1,14 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = ["types.go"], + tags = ["automanaged"], +) diff --git a/pkg/util/sets/types/types.go b/staging/src/k8s.io/apimachinery/pkg/util/sets/types/types.go similarity index 100% rename from pkg/util/sets/types/types.go rename to staging/src/k8s.io/apimachinery/pkg/util/sets/types/types.go