Add node.k8s.io/v1beta1 API

This commit is contained in:
Tim Allclair
2019-02-27 11:19:02 -08:00
parent 63f61a6714
commit 820a1dc96b
27 changed files with 407 additions and 4 deletions

View File

@@ -29,6 +29,7 @@ filegroup(
":package-srcs",
"//pkg/apis/node/install:all-srcs",
"//pkg/apis/node/v1alpha1:all-srcs",
"//pkg/apis/node/v1beta1:all-srcs",
"//pkg/apis/node/validation:all-srcs",
],
tags = ["automanaged"],

View File

@@ -9,6 +9,7 @@ go_library(
"//pkg/api/legacyscheme:go_default_library",
"//pkg/apis/node:go_default_library",
"//pkg/apis/node/v1alpha1:go_default_library",
"//pkg/apis/node/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
],

View File

@@ -24,6 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/node"
"k8s.io/kubernetes/pkg/apis/node/v1alpha1"
"k8s.io/kubernetes/pkg/apis/node/v1beta1"
)
func init() {
@@ -34,5 +35,6 @@ func init() {
func Install(scheme *runtime.Scheme) {
utilruntime.Must(node.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
utilruntime.Must(v1beta1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion))
}

View File

@@ -0,0 +1,33 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"register.go",
"zz_generated.conversion.go",
],
importpath = "k8s.io/kubernetes/pkg/apis/node/v1beta1",
visibility = ["//visibility:public"],
deps = [
"//pkg/apis/node:go_default_library",
"//staging/src/k8s.io/api/node/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,22 @@
/*
Copyright 2019 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.
*/
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/node
// +k8s:conversion-gen-external-types=k8s.io/api/node/v1beta1
// +groupName=node.k8s.io
package v1beta1 // import "k8s.io/kubernetes/pkg/apis/node/v1beta1"

View File

@@ -0,0 +1,39 @@
/*
Copyright 2019 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 v1beta1
import (
nodev1beta1 "k8s.io/api/node/v1beta1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName for node API
const GroupName = "node.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
localSchemeBuilder = &nodev1beta1.SchemeBuilder
// AddToScheme node API registration
AddToScheme = localSchemeBuilder.AddToScheme
)