Commit d2cbdbd7 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39806 from deads2k/generic-21-move-generic-validation

Automatic merge from submit-queue fixup some apimachinery packages Moves the meta/v1/validation to apimachinery (since its logically shared) and moves the funny `apimachinery/pkg/genericapiserver/openapi/common` to `apimachinery/pkg/openapi`. @kubernetes/sig-api-machinery-misc
parents 6cd0592a 7993e7c8
......@@ -4,7 +4,7 @@
"SelectorRegexp": "k8s[.]io",
"AllowedPrefixes": [
"k8s.io/kubernetes/cmd/libs/go2idl",
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"k8s.io/apimachinery/pkg/openapi",
"k8s.io/gengo",
"k8s.io/kubernetes/third_party",
"k8s.io/apimachinery/third_party",
......
......@@ -14,7 +14,7 @@ go_library(
tags = ["automanaged"],
deps = [
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/gengo/args",
"//vendor:k8s.io/gengo/generator",
"//vendor:k8s.io/gengo/namer",
......
......@@ -25,7 +25,7 @@ import (
"sort"
"strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"k8s.io/gengo/args"
"k8s.io/gengo/generator"
"k8s.io/gengo/namer"
......@@ -127,7 +127,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
const (
specPackagePath = "github.com/go-openapi/spec"
openAPICommonPackagePath = "k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
openAPICommonPackagePath = "k8s.io/apimachinery/pkg/openapi"
)
// openApiGen produces a file with auto-generated OpenAPI functions.
......@@ -334,7 +334,7 @@ func (g openAPITypeWriter) generate(t *types.Type) error {
sort.Strings(keys)
for _, k := range keys {
v := g.refTypes[k]
if t, _ := common.GetOpenAPITypeFormat(v.String()); t != "" {
if t, _ := openapi.GetOpenAPITypeFormat(v.String()); t != "" {
// This is a known type, we do not need a reference to it
// Will eliminate special case of time.Time
continue
......@@ -405,7 +405,7 @@ func (g openAPITypeWriter) generateProperty(m *types.Member) error {
}
t := resolveAliasAndPtrType(m.Type)
// If we can get a openAPI type and format for this type, we consider it to be simple property
typeString, format := common.GetOpenAPITypeFormat(t.String())
typeString, format := openapi.GetOpenAPITypeFormat(t.String())
if typeString != "" {
g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n", nil)
......@@ -471,7 +471,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error {
}
g.Do("Type: []string{\"object\"},\n", nil)
g.Do("AdditionalProperties: &spec.SchemaOrBool{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil)
typeString, format := common.GetOpenAPITypeFormat(elemType.String())
typeString, format := openapi.GetOpenAPITypeFormat(elemType.String())
if typeString != "" {
g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n},\n", nil)
......@@ -495,7 +495,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error {
elemType := resolveAliasAndPtrType(t.Elem)
g.Do("Type: []string{\"array\"},\n", nil)
g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\n", nil)
typeString, format := common.GetOpenAPITypeFormat(elemType.String())
typeString, format := openapi.GetOpenAPITypeFormat(elemType.String())
if typeString != "" {
g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n},\n", nil)
......
......@@ -25,7 +25,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/spf13/pflag",
"//vendor:gopkg.in/inf.v0",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......
......@@ -29,7 +29,7 @@ import (
"github.com/go-openapi/spec"
inf "gopkg.in/inf.v0"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
)
// Quantity is a fixed-point representation of a number.
......@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity {
}
// OpenAPIDefinition returns openAPI definition for this type.
func (_ Quantity) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ Quantity) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
......@@ -18,7 +18,7 @@ go_library(
deps = [
"//vendor:github.com/go-openapi/spec",
"//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......
......@@ -20,7 +20,7 @@ import (
"encoding/json"
"time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec"
"github.com/google/gofuzz"
......@@ -141,8 +141,8 @@ func (t Time) MarshalJSON() ([]byte, error) {
return json.Marshal(t.UTC().Format(time.RFC3339))
}
func (_ Time) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
......@@ -24,7 +24,6 @@ go_library(
"//pkg/api/service:go_default_library",
"//pkg/api/util:go_default_library",
"//pkg/api/validation/genericvalidation:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//pkg/apis/storage/util:go_default_library",
"//pkg/capabilities:go_default_library",
"//pkg/security/apparmor:go_default_library",
......@@ -36,6 +35,7 @@ go_library(
"//vendor:k8s.io/apimachinery/pkg/api/meta",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/util/errors",
......
......@@ -18,8 +18,8 @@ go_library(
deps = [
"//pkg/api:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
"//vendor:k8s.io/apimachinery/pkg/util/validation",
......
......@@ -21,13 +21,13 @@ import (
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
v1validation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
)
// TODO: delete this global variable when we enable the validation of common
......
......@@ -29,6 +29,7 @@ import (
"github.com/golang/glog"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
......@@ -38,7 +39,6 @@ import (
"k8s.io/kubernetes/pkg/api/resource"
apiservice "k8s.io/kubernetes/pkg/api/service"
"k8s.io/kubernetes/pkg/api/validation/genericvalidation"
unversionedvalidation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
storageutil "k8s.io/kubernetes/pkg/apis/storage/util"
"k8s.io/kubernetes/pkg/capabilities"
"k8s.io/kubernetes/pkg/security/apparmor"
......
......@@ -16,8 +16,8 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api/validation:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
......
......@@ -20,12 +20,12 @@ import (
"reflect"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
apivalidation "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/apis/apps"
unversionedvalidation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
)
// ValidateStatefulSetName can be used to check whether the given StatefulSet name is valid.
......
......@@ -16,9 +16,9 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api/validation:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//vendor:github.com/robfig/cron",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
......
......@@ -20,12 +20,12 @@ import (
"github.com/robfig/cron"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
apivalidation "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/apis/batch"
unversionedvalidation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
)
// TODO: generalize for other controller objects that will follow the same pattern, such as ReplicaSet and DaemonSet, and
......
......@@ -16,12 +16,12 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api/validation:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//pkg/security/apparmor:go_default_library",
"//pkg/security/podsecuritypolicy/seccomp:go_default_library",
"//pkg/security/podsecuritypolicy/util:go_default_library",
"//pkg/util/intstr:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
"//vendor:k8s.io/apimachinery/pkg/util/validation",
......
......@@ -25,6 +25,7 @@ import (
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation"
......@@ -32,7 +33,6 @@ import (
"k8s.io/kubernetes/pkg/api"
apivalidation "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/apis/extensions"
unversionedvalidation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
"k8s.io/kubernetes/pkg/security/apparmor"
"k8s.io/kubernetes/pkg/security/podsecuritypolicy/seccomp"
psputil "k8s.io/kubernetes/pkg/security/podsecuritypolicy/util"
......
......@@ -77,7 +77,6 @@ filegroup(
srcs = [
":package-srcs",
"//pkg/apis/meta/v1/unstructured:all-srcs",
"//pkg/apis/meta/v1/validation:all-srcs",
],
tags = ["automanaged"],
)
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
name = "go_default_library",
srcs = ["validation.go"],
tags = ["automanaged"],
deps = [
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/util/validation",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
)
go_test(
name = "go_default_test",
srcs = ["validation_test.go"],
library = ":go_default_library",
tags = ["automanaged"],
deps = ["//vendor:k8s.io/apimachinery/pkg/util/validation/field"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
......@@ -15,8 +15,8 @@ go_library(
deps = [
"//pkg/api/validation:go_default_library",
"//pkg/apis/extensions/validation:go_default_library",
"//pkg/apis/meta/v1/validation:go_default_library",
"//pkg/apis/policy:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
)
......
......@@ -19,10 +19,10 @@ package validation
import (
"reflect"
unversionedvalidation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
apivalidation "k8s.io/kubernetes/pkg/api/validation"
extensionsvalidation "k8s.io/kubernetes/pkg/apis/extensions/validation"
unversionedvalidation "k8s.io/kubernetes/pkg/apis/meta/v1/validation"
"k8s.io/kubernetes/pkg/apis/policy"
)
......
......@@ -18,7 +18,7 @@ go_library(
"//pkg/api/resource:go_default_library",
"//pkg/util/intstr:go_default_library",
"//vendor:github.com/go-openapi/spec",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......
......@@ -22,12 +22,12 @@ package openapi
import (
spec "github.com/go-openapi/spec"
common "k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
openapi "k8s.io/apimachinery/pkg/openapi"
resource "k8s.io/kubernetes/pkg/api/resource"
intstr "k8s.io/kubernetes/pkg/util/intstr"
)
var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
var OpenAPIDefinitions *openapi.OpenAPIDefinitions = &openapi.OpenAPIDefinitions{
"intstr.IntOrString": intstr.IntOrString{}.OpenAPIDefinition(), "resource.Quantity": resource.Quantity{}.OpenAPIDefinition(), "resource.int64Amount": {
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
......
......@@ -52,7 +52,7 @@ go_library(
"//vendor:gopkg.in/natefinch/lumberjack.v2",
"//vendor:k8s.io/apimachinery/pkg/apimachinery",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
......
......@@ -37,7 +37,7 @@ import (
"gopkg.in/natefinch/lumberjack.v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
openapicommon "k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
openapicommon "k8s.io/apimachinery/pkg/openapi"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/authentication/authenticator"
......
......@@ -32,7 +32,7 @@ import (
"k8s.io/apimachinery/pkg/apimachinery"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
openapicommon "k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
openapicommon "k8s.io/apimachinery/pkg/openapi"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilnet "k8s.io/apimachinery/pkg/util/net"
......
......@@ -21,7 +21,7 @@ go_library(
"//pkg/util:go_default_library",
"//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/util/json",
],
)
......@@ -35,7 +35,7 @@ go_test(
"//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......
......@@ -25,7 +25,7 @@ import (
"github.com/emicklei/go-restful"
"github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"k8s.io/apimachinery/pkg/util/json"
genericmux "k8s.io/kubernetes/pkg/genericapiserver/mux"
"k8s.io/kubernetes/pkg/util"
......@@ -36,14 +36,14 @@ const (
)
type openAPI struct {
config *common.Config
config *openapi.Config
swagger *spec.Swagger
protocolList []string
servePath string
}
// RegisterOpenAPIService registers a handler to provides standard OpenAPI specification.
func RegisterOpenAPIService(servePath string, webServices []*restful.WebService, config *common.Config, container *genericmux.APIContainer) (err error) {
func RegisterOpenAPIService(servePath string, webServices []*restful.WebService, config *openapi.Config, container *genericmux.APIContainer) (err error) {
o := openAPI{
config: config,
servePath: servePath,
......@@ -312,7 +312,7 @@ func (o *openAPI) findCommonParameters(routes []restful.Route) (map[interface{}]
}
func (o *openAPI) toSchema(typeName string, model interface{}) (_ *spec.Schema, err error) {
if openAPIType, openAPIFormat := common.GetOpenAPITypeFormat(typeName); openAPIType != "" {
if openAPIType, openAPIFormat := openapi.GetOpenAPITypeFormat(typeName); openAPIType != "" {
return &spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{openAPIType},
......@@ -362,7 +362,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData) (ret spec.Para
default:
return ret, fmt.Errorf("unknown restful operation kind : %v", restParam.Kind)
}
openAPIType, openAPIFormat := common.GetOpenAPITypeFormat(restParam.DataType)
openAPIType, openAPIFormat := openapi.GetOpenAPITypeFormat(restParam.DataType)
if openAPIType == "" {
return ret, fmt.Errorf("non-body Restful parameter type should be a simple type, but got : %v", restParam.DataType)
}
......
......@@ -24,7 +24,7 @@ import (
"github.com/emicklei/go-restful"
"github.com/go-openapi/spec"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
)
// setUp is a convenience function for setting up for (most) tests.
......@@ -63,7 +63,7 @@ type TestOutput struct {
Count int `json:"count,omitempty"`
}
func (_ TestInput) OpenAPIDefinition() *common.OpenAPIDefinition {
func (_ TestInput) OpenAPIDefinition() *openapi.OpenAPIDefinition {
schema := spec.Schema{}
schema.Description = "Test input"
schema.Properties = map[string]spec.Schema{
......@@ -96,13 +96,13 @@ func (_ TestInput) OpenAPIDefinition() *common.OpenAPIDefinition {
},
},
}
return &common.OpenAPIDefinition{
return &openapi.OpenAPIDefinition{
Schema: schema,
Dependencies: []string{},
}
}
func (_ TestOutput) OpenAPIDefinition() *common.OpenAPIDefinition {
func (_ TestOutput) OpenAPIDefinition() *openapi.OpenAPIDefinition {
schema := spec.Schema{}
schema.Description = "Test output"
schema.Properties = map[string]spec.Schema{
......@@ -121,14 +121,14 @@ func (_ TestOutput) OpenAPIDefinition() *common.OpenAPIDefinition {
},
},
}
return &common.OpenAPIDefinition{
return &openapi.OpenAPIDefinition{
Schema: schema,
Dependencies: []string{},
}
}
var _ common.OpenAPIDefinitionGetter = TestInput{}
var _ common.OpenAPIDefinitionGetter = TestOutput{}
var _ openapi.OpenAPIDefinitionGetter = TestInput{}
var _ openapi.OpenAPIDefinitionGetter = TestOutput{}
func getTestRoute(ws *restful.WebService, method string, additionalParams bool, opPrefix string) *restful.RouteBuilder {
ret := ws.Method(method).
......@@ -150,7 +150,7 @@ func getTestRoute(ws *restful.WebService, method string, additionalParams bool,
return ret
}
func getConfig(fullMethods bool) (*common.Config, *restful.Container) {
func getConfig(fullMethods bool) (*openapi.Config, *restful.Container) {
mux := http.NewServeMux()
container := restful.NewContainer()
container.ServeMux = mux
......@@ -178,7 +178,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) {
}
container.Add(ws)
return &common.Config{
return &openapi.Config{
ProtocolList: []string{"https"},
Info: &spec.Info{
InfoProps: spec.InfoProps{
......@@ -186,7 +186,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) {
Description: "Test API",
},
},
Definitions: &common.OpenAPIDefinitions{
Definitions: &openapi.OpenAPIDefinitions{
"openapi.TestInput": *TestInput{}.OpenAPIDefinition(),
"openapi.TestOutput": *TestOutput{}.OpenAPIDefinition(),
},
......
......@@ -32,7 +32,7 @@ go_library(
"//vendor:github.com/golang/glog",
"//vendor:github.com/prometheus/client_golang/prometheus",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apiserver/pkg/metrics",
"//vendor:k8s.io/apiserver/pkg/storage/etcd/metrics",
],
......
......@@ -17,21 +17,21 @@ limitations under the License.
package routes
import (
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"k8s.io/kubernetes/pkg/genericapiserver/mux"
"k8s.io/kubernetes/pkg/genericapiserver/openapi"
apiserveropenapi "k8s.io/kubernetes/pkg/genericapiserver/openapi"
"github.com/golang/glog"
)
// OpenAPI installs spec endpoints for each web service.
type OpenAPI struct {
Config *common.Config
Config *openapi.Config
}
// Install adds the SwaggerUI webservice to the given mux.
func (oa OpenAPI) Install(c *mux.APIContainer) {
err := openapi.RegisterOpenAPIService("/swagger.json", c.RegisteredWebServices(), oa.Config, c)
err := apiserveropenapi.RegisterOpenAPIService("/swagger.json", c.RegisteredWebServices(), oa.Config, c)
if err != nil {
glog.Fatalf("Failed to register open api spec for root: %v", err)
}
......
......@@ -20,7 +20,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/golang/glog",
"//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......
......@@ -24,7 +24,7 @@ import (
"strconv"
"strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec"
"github.com/golang/glog"
......@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
}
}
func (_ IntOrString) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ IntOrString) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
......@@ -20,7 +20,7 @@ import (
"encoding/json"
"time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec"
"github.com/google/gofuzz"
......@@ -145,8 +145,8 @@ func (t Time) MarshalJSON() ([]byte, error) {
return json.Marshal(t.UTC().Format(time.RFC3339))
}
func (_ Time) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package common
package openapi
import (
"github.com/emicklei/go-restful"
......
......@@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// package common holds shared codes and types between open API code generator and spec generator.
package common
// package openapi holds shared codes and types between open API code generator and spec generator.
package openapi
......@@ -324,131 +324,135 @@
},
{
"ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/openapi",
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878"
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}
]
}
......@@ -19,7 +19,6 @@ package registered
import (
"fmt"
"os"
"sort"
"strings"
......@@ -31,10 +30,6 @@ import (
"k8s.io/apimachinery/pkg/util/sets"
)
var (
DefaultAPIRegistrationManager = NewOrDie(os.Getenv("KUBE_API_VERSIONS"))
)
// APIRegistrationManager provides the concept of what API groups are enabled.
//
// TODO: currently, it also provides a "registered" concept. But it's wrong to
......@@ -99,28 +94,6 @@ func NewOrDie(kubeAPIVersions string) *APIRegistrationManager {
return m
}
// People are calling global functions. Let them continue to do that (for now).
var (
ValidateEnvRequestedVersions = DefaultAPIRegistrationManager.ValidateEnvRequestedVersions
AllPreferredGroupVersions = DefaultAPIRegistrationManager.AllPreferredGroupVersions
RESTMapper = DefaultAPIRegistrationManager.RESTMapper
GroupOrDie = DefaultAPIRegistrationManager.GroupOrDie
AddThirdPartyAPIGroupVersions = DefaultAPIRegistrationManager.AddThirdPartyAPIGroupVersions
IsThirdPartyAPIGroupVersion = DefaultAPIRegistrationManager.IsThirdPartyAPIGroupVersion
RegisteredGroupVersions = DefaultAPIRegistrationManager.RegisteredGroupVersions
IsRegisteredVersion = DefaultAPIRegistrationManager.IsRegisteredVersion
IsRegistered = DefaultAPIRegistrationManager.IsRegistered
Group = DefaultAPIRegistrationManager.Group
EnabledVersionsForGroup = DefaultAPIRegistrationManager.EnabledVersionsForGroup
EnabledVersions = DefaultAPIRegistrationManager.EnabledVersions
IsEnabledVersion = DefaultAPIRegistrationManager.IsEnabledVersion
IsAllowedVersion = DefaultAPIRegistrationManager.IsAllowedVersion
EnableVersions = DefaultAPIRegistrationManager.EnableVersions
RegisterGroup = DefaultAPIRegistrationManager.RegisterGroup
RegisterVersions = DefaultAPIRegistrationManager.RegisterVersions
InterfacesFor = DefaultAPIRegistrationManager.InterfacesFor
)
// RegisterVersions adds the given group versions to the list of registered group versions.
func (m *APIRegistrationManager) RegisterVersions(availableVersions []schema.GroupVersion) {
for _, v := range availableVersions {
......
......@@ -20,7 +20,7 @@ import (
"encoding/json"
"time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec"
"github.com/google/gofuzz"
......
......@@ -29,8 +29,6 @@ import (
"fmt"
"strings"
"github.com/ugorji/go/codec"
"k8s.io/apimachinery/pkg/types"
)
......@@ -445,27 +443,6 @@ func (vs Verbs) String() string {
return fmt.Sprintf("%v", []string(vs))
}
// CodecEncodeSelf is part of the codec.Selfer interface.
func (vs *Verbs) CodecEncodeSelf(encoder *codec.Encoder) {
encoder.Encode(vs)
}
// CodecDecodeSelf is part of the codec.Selfer interface. It is overwritten here to make sure
// that an empty verbs list is not decoded as nil. On the other hand, an undefined verbs list
// will lead to nil because this decoding for Verbs is not invoked.
//
// TODO(sttts): this is due to a ugorji regression: https://github.com/ugorji/go/issues/119. Remove the
// workaround when the regression is fixed.
func (vs *Verbs) CodecDecodeSelf(decoder *codec.Decoder) {
m := []string{}
decoder.Decode(&m)
if len(m) == 0 {
*vs = []string{}
} else {
*vs = m
}
}
// APIResourceList is a list of APIResource, it is used to expose the name of the
// resources supported in a specific group and version, and if the resource
// is namespaced.
......
......@@ -486,20 +486,6 @@ const (
UnsafeSysctlsPodAnnotationKey string = "security.alpha.kubernetes.io/unsafe-sysctls"
)
// GetAffinityFromPod gets the json serialized affinity data from Pod.Annotations
// and converts it to the Affinity type in api.
func GetAffinityFromPodAnnotations(annotations map[string]string) (*Affinity, error) {
if len(annotations) > 0 && annotations[AffinityAnnotationKey] != "" {
var affinity Affinity
err := json.Unmarshal([]byte(annotations[AffinityAnnotationKey]), &affinity)
if err != nil {
return nil, err
}
return &affinity, nil
}
return nil, nil
}
// GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations
// and converts it to the []Toleration type in api.
func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]Toleration, error) {
......
......@@ -29,7 +29,7 @@ import (
"github.com/go-openapi/spec"
inf "gopkg.in/inf.v0"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
)
// Quantity is a fixed-point representation of a number.
......@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity {
}
// OpenAPIDefinition returns openAPI definition for this type.
func (_ Quantity) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ Quantity) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -38,8 +38,6 @@ option go_package = "v1beta1";
// The StatefulSet guarantees that a given network identity will always
// map to the same storage identity.
message StatefulSet {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -55,8 +53,6 @@ message StatefulSet {
// StatefulSetList is a collection of StatefulSets.
message StatefulSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
......@@ -44,8 +44,6 @@ message ExtraValue {
// Note: TokenReview requests may be cached by the webhook token authenticator
// plugin in the kube-apiserver.
message TokenReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
......@@ -44,8 +44,6 @@ message ExtraValue {
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
// checking.
message LocalSubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -107,8 +105,6 @@ message ResourceAttributes {
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able
// to check whether they can perform an action
message SelfSubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -134,8 +130,6 @@ message SelfSubjectAccessReviewSpec {
// SubjectAccessReview checks whether or not a user or group can perform an action.
message SubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
......@@ -46,8 +46,6 @@ message CrossVersionObjectReference {
// configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -63,8 +61,6 @@ message HorizontalPodAutoscaler {
// list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -117,8 +113,6 @@ message HorizontalPodAutoscalerStatus {
// Scale represents a scaling request for a resource.
message Scale {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
......@@ -33,8 +33,6 @@ option go_package = "v1";
// Job represents the configuration of a single job.
message Job {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -78,8 +76,6 @@ message JobCondition {
// JobList is a collection of jobs.
message JobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......
......@@ -33,8 +33,6 @@ option go_package = "v2alpha1";
// CronJob represents the configuration of a single cron job.
message CronJob {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -53,8 +51,6 @@ message CronJob {
// CronJobList is a collection of cron jobs.
message CronJobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -101,8 +97,6 @@ message CronJobStatus {
// Job represents the configuration of a single job.
message Job {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -146,8 +140,6 @@ message JobCondition {
// JobList is a collection of jobs.
message JobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -240,8 +232,6 @@ message JobStatus {
// JobTemplate describes a template for creating copies of a predefined pod.
message JobTemplate {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......
/*
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 v1alpha1
import "k8s.io/apimachinery/pkg/runtime"
func addDefaultingFuncs(scheme *runtime.Scheme) error {
RegisterDefaults(scheme)
return scheme.AddDefaultingFuncs(
SetDefaults_CertificateSigningRequestSpec,
)
}
func SetDefaults_CertificateSigningRequestSpec(obj *CertificateSigningRequestSpec) {
if obj.Usages == nil {
obj.Usages = []KeyUsage{UsageDigitalSignature, UsageKeyEncipherment}
}
}
......@@ -33,8 +33,6 @@ option go_package = "v1alpha1";
// Describes a certificate signing request
message CertificateSigningRequest {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -65,8 +63,6 @@ message CertificateSigningRequestCondition {
}
message CertificateSigningRequestList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
/*
Copyright 2016 The Kubernetes Authors.
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.
......@@ -40,7 +40,7 @@ func Resource(resource string) schema.GroupResource {
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs)
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs)
AddToScheme = SchemeBuilder.AddToScheme
)
......
......@@ -28,5 +28,20 @@ import (
// Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error {
scheme.AddTypeDefaultingFunc(&CertificateSigningRequest{}, func(obj interface{}) { SetObjectDefaults_CertificateSigningRequest(obj.(*CertificateSigningRequest)) })
scheme.AddTypeDefaultingFunc(&CertificateSigningRequestList{}, func(obj interface{}) {
SetObjectDefaults_CertificateSigningRequestList(obj.(*CertificateSigningRequestList))
})
return nil
}
func SetObjectDefaults_CertificateSigningRequest(in *CertificateSigningRequest) {
SetDefaults_CertificateSigningRequestSpec(&in.Spec)
}
func SetObjectDefaults_CertificateSigningRequestList(in *CertificateSigningRequestList) {
for i := range in.Items {
a := &in.Items[i]
SetObjectDefaults_CertificateSigningRequest(a)
}
}
......@@ -48,6 +48,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&KubeProxyConfiguration{},
&KubeSchedulerConfiguration{},
&KubeletConfiguration{},
&AdmissionConfiguration{},
)
return nil
}
......@@ -55,3 +56,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeSchedulerConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
......@@ -18,6 +18,7 @@ package componentconfig
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/api"
utilconfig "k8s.io/client-go/pkg/util/config"
)
......@@ -601,6 +602,13 @@ type LeaderElectionConfiguration struct {
type KubeControllerManagerConfiguration struct {
metav1.TypeMeta
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
// '-foo' means "disable 'foo'"
// first item for a particular name wins
Controllers []string
// port is the port that the controller-manager's http service runs on.
Port int32
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
......@@ -828,3 +836,28 @@ type PersistentVolumeRecyclerConfiguration struct {
// in a multi-node cluster.
IncrementTimeoutHostPath int32
}
// AdmissionConfiguration provides versioned configuration for admission controllers.
type AdmissionConfiguration struct {
metav1.TypeMeta
// Plugins allows specifying a configuration per admission control plugin.
Plugins []AdmissionPluginConfiguration
}
// AdmissionPluginConfiguration provides the configuration for a single plug-in.
type AdmissionPluginConfiguration struct {
// Name is the name of the admission controller.
// It must match the registered admission plugin name.
Name string
// Path is the path to a configuration file that contains the plugin's
// configuration
// +optional
Path string
// Configuration is an embedded configuration object to be used as the plugin's
// configuration. If present, it will be used instead of the path to the configuration file.
// +optional
Configuration runtime.Object
}
......@@ -37,6 +37,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&KubeProxyConfiguration{},
&KubeSchedulerConfiguration{},
&KubeletConfiguration{},
&AdmissionConfiguration{},
)
return nil
}
......@@ -44,3 +45,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeSchedulerConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
......@@ -18,6 +18,7 @@ package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/api/v1"
)
......@@ -578,3 +579,29 @@ type KubeletAnonymousAuthentication struct {
// Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated.
Enabled *bool `json:"enabled"`
}
// AdmissionConfiguration provides versioned configuration for admission controllers.
type AdmissionConfiguration struct {
metav1.TypeMeta `json:",inline"`
// Plugins allows specifying a configuration per admission control plugin.
// +optional
Plugins []AdmissionPluginConfiguration `json:"plugins"`
}
// AdmissionPluginConfiguration provides the configuration for a single plug-in.
type AdmissionPluginConfiguration struct {
// Name is the name of the admission controller.
// It must match the registered admission plugin name.
Name string `json:"name"`
// Path is the path to a configuration file that contains the plugin's
// configuration
// +optional
Path string `json:"path"`
// Configuration is an embedded configuration object to be used as the plugin's
// configuration. If present, it will be used instead of the path to the configuration file.
// +optional
Configuration runtime.RawExtension `json:"configuration"`
}
......@@ -38,6 +38,10 @@ func init() {
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1alpha1_AdmissionConfiguration_To_componentconfig_AdmissionConfiguration,
Convert_componentconfig_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration,
Convert_v1alpha1_AdmissionPluginConfiguration_To_componentconfig_AdmissionPluginConfiguration,
Convert_componentconfig_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration,
Convert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration,
Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration,
Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration,
......@@ -61,6 +65,70 @@ func RegisterConversions(scheme *runtime.Scheme) error {
)
}
func autoConvert_v1alpha1_AdmissionConfiguration_To_componentconfig_AdmissionConfiguration(in *AdmissionConfiguration, out *componentconfig.AdmissionConfiguration, s conversion.Scope) error {
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]componentconfig.AdmissionPluginConfiguration, len(*in))
for i := range *in {
if err := Convert_v1alpha1_AdmissionPluginConfiguration_To_componentconfig_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Plugins = nil
}
return nil
}
func Convert_v1alpha1_AdmissionConfiguration_To_componentconfig_AdmissionConfiguration(in *AdmissionConfiguration, out *componentconfig.AdmissionConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_AdmissionConfiguration_To_componentconfig_AdmissionConfiguration(in, out, s)
}
func autoConvert_componentconfig_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration(in *componentconfig.AdmissionConfiguration, out *AdmissionConfiguration, s conversion.Scope) error {
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]AdmissionPluginConfiguration, len(*in))
for i := range *in {
if err := Convert_componentconfig_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Plugins = nil
}
return nil
}
func Convert_componentconfig_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration(in *componentconfig.AdmissionConfiguration, out *AdmissionConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_AdmissionConfiguration_To_v1alpha1_AdmissionConfiguration(in, out, s)
}
func autoConvert_v1alpha1_AdmissionPluginConfiguration_To_componentconfig_AdmissionPluginConfiguration(in *AdmissionPluginConfiguration, out *componentconfig.AdmissionPluginConfiguration, s conversion.Scope) error {
out.Name = in.Name
out.Path = in.Path
if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&in.Configuration, &out.Configuration, s); err != nil {
return err
}
return nil
}
func Convert_v1alpha1_AdmissionPluginConfiguration_To_componentconfig_AdmissionPluginConfiguration(in *AdmissionPluginConfiguration, out *componentconfig.AdmissionPluginConfiguration, s conversion.Scope) error {
return autoConvert_v1alpha1_AdmissionPluginConfiguration_To_componentconfig_AdmissionPluginConfiguration(in, out, s)
}
func autoConvert_componentconfig_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(in *componentconfig.AdmissionPluginConfiguration, out *AdmissionPluginConfiguration, s conversion.Scope) error {
out.Name = in.Name
out.Path = in.Path
if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&in.Configuration, &out.Configuration, s); err != nil {
return err
}
return nil
}
func Convert_componentconfig_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(in *componentconfig.AdmissionPluginConfiguration, out *AdmissionPluginConfiguration, s conversion.Scope) error {
return autoConvert_componentconfig_AdmissionPluginConfiguration_To_v1alpha1_AdmissionPluginConfiguration(in, out, s)
}
func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error {
out.BindAddress = in.BindAddress
out.ClusterCIDR = in.ClusterCIDR
......
......@@ -35,6 +35,8 @@ func init() {
// to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_AdmissionConfiguration, InType: reflect.TypeOf(&AdmissionConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_AdmissionPluginConfiguration, InType: reflect.TypeOf(&AdmissionPluginConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeSchedulerConfiguration, InType: reflect.TypeOf(&KubeSchedulerConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAnonymousAuthentication, InType: reflect.TypeOf(&KubeletAnonymousAuthentication{})},
......@@ -48,6 +50,38 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
)
}
func DeepCopy_v1alpha1_AdmissionConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionConfiguration)
out := out.(*AdmissionConfiguration)
*out = *in
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]AdmissionPluginConfiguration, len(*in))
for i := range *in {
if err := DeepCopy_v1alpha1_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
return nil
}
}
func DeepCopy_v1alpha1_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionPluginConfiguration)
out := out.(*AdmissionPluginConfiguration)
*out = *in
if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
return err
} else {
out.Configuration = *newVal.(*runtime.RawExtension)
}
return nil
}
}
func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*KubeProxyConfiguration)
......
......@@ -36,6 +36,8 @@ func init() {
// to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_AdmissionConfiguration, InType: reflect.TypeOf(&AdmissionConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_AdmissionPluginConfiguration, InType: reflect.TypeOf(&AdmissionPluginConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_IPVar, InType: reflect.TypeOf(&IPVar{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeControllerManagerConfiguration, InType: reflect.TypeOf(&KubeControllerManagerConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})},
......@@ -54,6 +56,41 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
)
}
func DeepCopy_componentconfig_AdmissionConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionConfiguration)
out := out.(*AdmissionConfiguration)
*out = *in
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]AdmissionPluginConfiguration, len(*in))
for i := range *in {
if err := DeepCopy_componentconfig_AdmissionPluginConfiguration(&(*in)[i], &(*out)[i], c); err != nil {
return err
}
}
}
return nil
}
}
func DeepCopy_componentconfig_AdmissionPluginConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*AdmissionPluginConfiguration)
out := out.(*AdmissionPluginConfiguration)
*out = *in
// in.Configuration is kind 'Interface'
if in.Configuration != nil {
if newVal, err := c.DeepCopy(&in.Configuration); err != nil {
return err
} else {
out.Configuration = *newVal.(*runtime.Object)
}
}
return nil
}
}
func DeepCopy_componentconfig_IPVar(in interface{}, out interface{}, c *conversion.Cloner) error {
{
in := in.(*IPVar)
......@@ -73,6 +110,11 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in interface{},
in := in.(*KubeControllerManagerConfiguration)
out := out.(*KubeControllerManagerConfiguration)
*out = *in
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
return nil
}
}
......
......@@ -71,8 +71,6 @@ message CustomMetricTargetList {
// DaemonSet represents the configuration of a daemon set.
message DaemonSet {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -94,8 +92,6 @@ message DaemonSet {
// DaemonSetList is a collection of daemon sets.
message DaemonSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -150,8 +146,6 @@ message DaemonSetStatus {
// Deployment enables declarative updates for Pods and ReplicaSets.
message Deployment {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -188,8 +182,6 @@ message DeploymentCondition {
// DeploymentList is a list of Deployments.
message DeploymentList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -200,8 +192,6 @@ message DeploymentList {
// DeploymentRollback stores the information required to rollback a deployment.
message DeploymentRollback {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Required: This must match the Name of a deployment.
optional string name = 1;
......@@ -349,8 +339,6 @@ message HTTPIngressRuleValue {
// configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -366,8 +354,6 @@ message HorizontalPodAutoscaler {
// list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -442,8 +428,6 @@ message IDRange {
// externally-reachable urls, load balance traffic, terminate SSL, offer name
// based virtual hosting etc.
message Ingress {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -471,8 +455,6 @@ message IngressBackend {
// IngressList is a collection of Ingress.
message IngressList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -568,8 +550,6 @@ message IngressTLS {
}
message NetworkPolicy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -605,8 +585,6 @@ message NetworkPolicyIngressRule {
// Network Policy List is a list of NetworkPolicy objects.
message NetworkPolicyList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -671,8 +649,6 @@ message NetworkPolicySpec {
// Pod Security Policy governs the ability to make requests that affect the Security Context
// that will be applied to a pod and container.
message PodSecurityPolicy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -685,8 +661,6 @@ message PodSecurityPolicy {
// Pod Security Policy List is a list of PodSecurityPolicy objects.
message PodSecurityPolicyList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -763,8 +737,6 @@ message PodSecurityPolicySpec {
// ReplicaSet represents the configuration of a ReplicaSet.
message ReplicaSet {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// If the Labels of a ReplicaSet are empty, they are defaulted to
// be the same as the Pod(s) that the ReplicaSet manages.
// Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
......@@ -808,8 +780,6 @@ message ReplicaSetCondition {
// ReplicaSetList is a collection of ReplicaSets.
message ReplicaSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
......@@ -878,7 +848,6 @@ message ReplicaSetStatus {
// Dummy definition
message ReplicationControllerDummy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 1;
}
message RollbackConfig {
......@@ -940,8 +909,6 @@ message SELinuxStrategyOptions {
// represents a scaling request for a resource.
message Scale {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -1015,8 +982,6 @@ message SupplementalGroupsStrategyOptions {
// A ThirdPartyResource is a generic representation of a resource, it is used by add-ons and plugins to add new resource
// types to the API. It consists of one or more Versions of the api.
message ThirdPartyResource {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -1032,8 +997,6 @@ message ThirdPartyResource {
// An internal object, used for versioned storage in etcd. Not exposed to the end user.
message ThirdPartyResourceData {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -1045,8 +1008,6 @@ message ThirdPartyResourceData {
// ThirdPartyResrouceDataList is a list of ThirdPartyResourceData.
message ThirdPartyResourceDataList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -1058,8 +1019,6 @@ message ThirdPartyResourceDataList {
// ThirdPartyResourceList is a list of ThirdPartyResources.
message ThirdPartyResourceList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
......@@ -114,14 +114,6 @@ func (m *ImageReview) MarshalTo(data []byte) (int, error) {
return 0, err
}
i += n3
data[i] = 0x22
i++
i = encodeVarintGenerated(data, i, uint64(m.TypeMeta.Size()))
n4, err := m.TypeMeta.MarshalTo(data[i:])
if err != nil {
return 0, err
}
i += n4
return i, nil
}
......@@ -264,8 +256,6 @@ func (m *ImageReview) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l))
l = m.Status.Size()
n += 1 + l + sovGenerated(uint64(l))
l = m.TypeMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
return n
}
......@@ -329,7 +319,6 @@ func (this *ImageReview) String() string {
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ImageReviewSpec", "ImageReviewSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "ImageReviewStatus", "ImageReviewStatus", 1), `&`, ``, 1) + `,`,
`TypeMeta:` + strings.Replace(strings.Replace(this.TypeMeta.String(), "TypeMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.TypeMeta", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
......@@ -504,36 +493,6 @@ func (m *ImageReview) Unmarshal(data []byte) error {
return err
}
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TypeMeta", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := data[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := m.TypeMeta.Unmarshal(data[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(data[iNdEx:])
......@@ -1060,44 +1019,42 @@ var (
)
var fileDescriptorGenerated = []byte{
// 622 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0xd3, 0x40,
0x14, 0xc7, 0xe3, 0xa6, 0x3f, 0x92, 0x0b, 0xd0, 0xf6, 0x60, 0xb0, 0x32, 0xb8, 0x55, 0x90, 0x50,
0x41, 0x70, 0xa7, 0x54, 0x08, 0x55, 0x0c, 0x94, 0x1a, 0x31, 0x74, 0x00, 0xc4, 0xc1, 0x80, 0x10,
0xcb, 0xc5, 0x7d, 0x75, 0xdc, 0xd8, 0x77, 0x96,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 0x04, 0x00, 0x00, 0xff, 0xff, 0x46, 0xf3, 0x4f, 0x24, 0xd1, 0x05, 0x00, 0x00,
// 588 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0x13, 0x31,
0x14, 0xc7, 0x73, 0x49, 0x7f, 0xc5, 0x01, 0xda, 0x1a, 0x86, 0x28, 0xc3, 0xb5, 0x0a, 0x12, 0x2a,
0x08, 0x6c, 0xa5, 0x42, 0xa8, 0x62, 0xa0, 0xf4, 0x10, 0x43, 0x07, 0x40, 0x98, 0x05, 0xb1, 0x39,
0xd7, 0xd7, 0x8b, 0x9b, 0x3b, 0xfb, 0x74, 0xf6, 0xa5, 0xca, 0x80, 0xc4, 0xc8, 0xc0, 0xc0, 0x7f,
0xc3, 0xbf, 0xd0, 0xb1, 0x23, 0x53, 0x45, 0xc3, 0x3f, 0x82, 0xce, 0x77, 0xe9, 0x1d, 0x4d, 0x23,
0x84, 0xb2, 0xf9, 0xf9, 0xf9, 0x7d, 0xbe, 0x5f, 0xbf, 0xf7, 0xd0, 0xfe, 0x70, 0x4f, 0x13, 0xa1,
0xe8, 0x30, 0xed, 0x43, 0x22, 0xc1, 0x80, 0xa6, 0xf1, 0x30, 0xa0, 0x3c, 0x16, 0x9a, 0x8a, 0x88,
0x07, 0x10, 0xab, 0x50, 0xf8, 0x63, 0x3a, 0xea, 0xf1, 0x30, 0x1e, 0xf0, 0x1e, 0x0d, 0x40, 0x42,
0xc2, 0x0d, 0x1c, 0x91, 0x38, 0x51, 0x46, 0x61, 0x9a, 0x03, 0x48, 0x09, 0x20, 0xf1, 0x30, 0x20,
0x19, 0x80, 0x54, 0x00, 0x64, 0x0a, 0xe8, 0x3c, 0x09, 0x84, 0x19, 0xa4, 0x7d, 0xe2, 0xab, 0x88,
0x06, 0x2a, 0x50, 0xd4, 0x72, 0xfa, 0xe9, 0xb1, 0x8d, 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, 0x96, 0x15, 0x59, 0xef, 0xd1, 0xd9, 0xa5, 0x5b,
0x3b, 0xbf, 0x74, 0x6b, 0x3f, 0x2f, 0xdd, 0xda, 0x97, 0x89, 0xeb, 0x9c, 0x4d, 0x5c, 0xe7, 0x7c,
0xe2, 0x3a, 0xbf, 0x26, 0xae, 0xf3, 0xfd, 0xb7, 0x5b, 0xfb, 0xb4, 0x36, 0xed, 0xe3, 0x9f, 0x00,
0x00, 0x00, 0xff, 0xff, 0x85, 0x95, 0xf8, 0x16, 0x73, 0x05, 0x00, 0x00,
}
......@@ -33,8 +33,6 @@ option go_package = "v1alpha1";
// ImageReview checks if the set of images in a pod are allowed.
message ImageReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
......@@ -35,8 +35,6 @@ option go_package = "v1beta1";
// This is a subresource of Pod. A request to cause such an eviction is
// created by POSTing to .../pods/<pod name>/evictions.
message Eviction {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// ObjectMeta describes the pod that is being evicted.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -46,8 +44,6 @@ message Eviction {
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
message PodDisruptionBudget {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget.
......@@ -59,8 +55,6 @@ message PodDisruptionBudget {
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
message PodDisruptionBudgetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated PodDisruptionBudget items = 2;
......
......@@ -33,8 +33,6 @@ option go_package = "v1alpha1";
// ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
message ClusterRole {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -46,8 +44,6 @@ message ClusterRole {
// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace,
// and adds who information via Subject.
message ClusterRoleBinding {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -70,8 +66,6 @@ message ClusterRoleBindingBuilder {
// ClusterRoleBindingList is a collection of ClusterRoleBindings
message ClusterRoleBindingList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -82,8 +76,6 @@ message ClusterRoleBindingList {
// ClusterRoleList is a collection of ClusterRoles
message ClusterRoleList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -134,8 +126,6 @@ message PolicyRuleBuilder {
// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
message Role {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -148,8 +138,6 @@ message Role {
// It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given
// namespace only have effect in that namespace.
message RoleBinding {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......@@ -164,8 +152,6 @@ message RoleBinding {
// RoleBindingList is a collection of RoleBindings
message RoleBindingList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......@@ -176,8 +162,6 @@ message RoleBindingList {
// RoleList is a collection of Roles
message RoleList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
......@@ -37,8 +37,6 @@ option go_package = "v1beta1";
// StorageClasses are non-namespaced; the name of the storage class
// according to etcd is in ObjectMeta.Name.
message StorageClass {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -55,8 +53,6 @@ message StorageClass {
// StorageClassList is a collection of storage classes.
message StorageClassList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......
......@@ -33,8 +33,6 @@ option go_package = "v1beta1";
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
message Cluster {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
......@@ -76,8 +74,6 @@ message ClusterCondition {
// A list of all the kubernetes clusters registered to the federation
message ClusterList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional
......
......@@ -24,7 +24,7 @@ import (
"strconv"
"strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common"
"k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec"
"github.com/golang/glog"
......@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
}
}
func (_ IntOrString) OpenAPIDefinition() common.OpenAPIDefinition {
return common.OpenAPIDefinition{
func (_ IntOrString) OpenAPIDefinition() openapi.OpenAPIDefinition {
return openapi.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
......
......@@ -17,14 +17,12 @@ limitations under the License.
package labels
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Clones the given map and returns a new map with the given key and value added.
// Returns the given map, if labelKey is empty.
func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint32) map[string]string {
func CloneAndAddLabel(labels map[string]string, labelKey, labelValue string) map[string]string {
if labelKey == "" {
// Don't need to add a label.
return labels
......@@ -34,7 +32,7 @@ func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint
for key, value := range labels {
newLabels[key] = value
}
newLabels[labelKey] = fmt.Sprintf("%d", labelValue)
newLabels[labelKey] = labelValue
return newLabels
}
......@@ -55,7 +53,7 @@ func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]s
}
// AddLabel returns a map with the given key and value added to the given map.
func AddLabel(labels map[string]string, labelKey string, labelValue string) map[string]string {
func AddLabel(labels map[string]string, labelKey, labelValue string) map[string]string {
if labelKey == "" {
// Don't need to add a label.
return labels
......@@ -69,7 +67,7 @@ func AddLabel(labels map[string]string, labelKey string, labelValue string) map[
// Clones the given selector and returns a new selector with the given key and value added.
// Returns the given selector, if labelKey is empty.
func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, labelValue uint32) *metav1.LabelSelector {
func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey, labelValue string) *metav1.LabelSelector {
if labelKey == "" {
// Don't need to add a label.
return selector
......@@ -85,7 +83,7 @@ func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, l
newSelector.MatchLabels[key] = val
}
}
newSelector.MatchLabels[labelKey] = fmt.Sprintf("%d", labelValue)
newSelector.MatchLabels[labelKey] = labelValue
if selector.MatchExpressions != nil {
newMExps := make([]metav1.LabelSelectorRequirement, len(selector.MatchExpressions))
......@@ -108,7 +106,7 @@ func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, l
}
// AddLabelToSelector returns a selector with the given key and value added to the given selector's MatchLabels.
func AddLabelToSelector(selector *metav1.LabelSelector, labelKey string, labelValue string) *metav1.LabelSelector {
func AddLabelToSelector(selector *metav1.LabelSelector, labelKey, labelValue string) *metav1.LabelSelector {
if labelKey == "" {
// Don't need to add a label.
return selector
......
......@@ -70,6 +70,7 @@ type controller struct {
type Controller interface {
Run(stopCh <-chan struct{})
HasSynced() bool
LastSyncResourceVersion() string
}
// New makes a new Controller from the given Config.
......
......@@ -211,10 +211,10 @@ func (s *sharedIndexInformer) LastSyncResourceVersion() string {
s.startedLock.Lock()
defer s.startedLock.Unlock()
if s.controller == nil || s.controller.reflector == nil {
if s.controller == nil {
return ""
}
return s.controller.reflector.LastSyncResourceVersion()
return s.controller.LastSyncResourceVersion()
}
func (s *sharedIndexInformer) GetStore() Store {
......
......@@ -9502,7 +9502,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/spf13/pflag",
"//vendor:gopkg.in/inf.v0",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......@@ -9983,6 +9983,7 @@ go_library(
name = "k8s.io/client-go/pkg/apis/certificates/v1alpha1",
srcs = [
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/conversion.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/defaults.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/doc.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/generated.pb.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go",
......@@ -10711,7 +10712,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/golang/glog",
"//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/openapi",
],
)
......@@ -11860,8 +11861,8 @@ go_library(
"//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/conversion",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/selection",
......@@ -11933,19 +11934,6 @@ go_test(
],
)
go_library(
name = "k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
srcs = [
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common/common.go",
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common/doc.go",
],
tags = ["automanaged"],
deps = [
"//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec",
],
)
go_test(
name = "k8s.io/apimachinery/pkg/labels_test",
srcs = [
......@@ -12764,10 +12752,9 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/google/gofuzz",
"//vendor:github.com/ugorji/go/codec",
"//vendor:k8s.io/apimachinery/pkg/conversion",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/selection",
......@@ -13322,3 +13309,35 @@ go_library(
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
)
go_test(
name = "k8s.io/apimachinery/pkg/apis/meta/v1/validation_test",
srcs = ["k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation_test.go"],
library = ":k8s.io/apimachinery/pkg/apis/meta/v1/validation",
tags = ["automanaged"],
deps = ["//vendor:k8s.io/apimachinery/pkg/util/validation/field"],
)
go_library(
name = "k8s.io/apimachinery/pkg/apis/meta/v1/validation",
srcs = ["k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go"],
tags = ["automanaged"],
deps = [
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/util/validation",
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
],
)
go_library(
name = "k8s.io/apimachinery/pkg/openapi",
srcs = [
"k8s.io/apimachinery/pkg/openapi/common.go",
"k8s.io/apimachinery/pkg/openapi/doc.go",
],
tags = ["automanaged"],
deps = [
"//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec",
],
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment