Commit 7993e7c8 authored by deads2k's avatar deads2k

move openapi types to pkg/openapi

parent dd7cd951
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"SelectorRegexp": "k8s[.]io", "SelectorRegexp": "k8s[.]io",
"AllowedPrefixes": [ "AllowedPrefixes": [
"k8s.io/kubernetes/cmd/libs/go2idl", "k8s.io/kubernetes/cmd/libs/go2idl",
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common", "k8s.io/apimachinery/pkg/openapi",
"k8s.io/gengo", "k8s.io/gengo",
"k8s.io/kubernetes/third_party", "k8s.io/kubernetes/third_party",
"k8s.io/apimachinery/third_party", "k8s.io/apimachinery/third_party",
......
...@@ -14,7 +14,7 @@ go_library( ...@@ -14,7 +14,7 @@ go_library(
tags = ["automanaged"], tags = ["automanaged"],
deps = [ deps = [
"//vendor:github.com/golang/glog", "//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/args",
"//vendor:k8s.io/gengo/generator", "//vendor:k8s.io/gengo/generator",
"//vendor:k8s.io/gengo/namer", "//vendor:k8s.io/gengo/namer",
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
"sort" "sort"
"strings" "strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"k8s.io/gengo/args" "k8s.io/gengo/args"
"k8s.io/gengo/generator" "k8s.io/gengo/generator"
"k8s.io/gengo/namer" "k8s.io/gengo/namer"
...@@ -127,7 +127,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat ...@@ -127,7 +127,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat
const ( const (
specPackagePath = "github.com/go-openapi/spec" 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. // openApiGen produces a file with auto-generated OpenAPI functions.
...@@ -334,7 +334,7 @@ func (g openAPITypeWriter) generate(t *types.Type) error { ...@@ -334,7 +334,7 @@ func (g openAPITypeWriter) generate(t *types.Type) error {
sort.Strings(keys) sort.Strings(keys)
for _, k := range keys { for _, k := range keys {
v := g.refTypes[k] 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 // This is a known type, we do not need a reference to it
// Will eliminate special case of time.Time // Will eliminate special case of time.Time
continue continue
...@@ -405,7 +405,7 @@ func (g openAPITypeWriter) generateProperty(m *types.Member) error { ...@@ -405,7 +405,7 @@ func (g openAPITypeWriter) generateProperty(m *types.Member) error {
} }
t := resolveAliasAndPtrType(m.Type) t := resolveAliasAndPtrType(m.Type)
// If we can get a openAPI type and format for this type, we consider it to be simple property // 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 != "" { if typeString != "" {
g.generateSimpleProperty(typeString, format) g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n", nil) g.Do("},\n},\n", nil)
...@@ -471,7 +471,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error { ...@@ -471,7 +471,7 @@ func (g openAPITypeWriter) generateMapProperty(t *types.Type) error {
} }
g.Do("Type: []string{\"object\"},\n", nil) g.Do("Type: []string{\"object\"},\n", nil)
g.Do("AdditionalProperties: &spec.SchemaOrBool{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\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 != "" { if typeString != "" {
g.generateSimpleProperty(typeString, format) g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n},\n", nil) g.Do("},\n},\n},\n", nil)
...@@ -495,7 +495,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error { ...@@ -495,7 +495,7 @@ func (g openAPITypeWriter) generateSliceProperty(t *types.Type) error {
elemType := resolveAliasAndPtrType(t.Elem) elemType := resolveAliasAndPtrType(t.Elem)
g.Do("Type: []string{\"array\"},\n", nil) g.Do("Type: []string{\"array\"},\n", nil)
g.Do("Items: &spec.SchemaOrArray{\nSchema: &spec.Schema{\nSchemaProps: spec.SchemaProps{\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 != "" { if typeString != "" {
g.generateSimpleProperty(typeString, format) g.generateSimpleProperty(typeString, format)
g.Do("},\n},\n},\n", nil) g.Do("},\n},\n},\n", nil)
......
...@@ -25,7 +25,7 @@ go_library( ...@@ -25,7 +25,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/spf13/pflag", "//vendor:github.com/spf13/pflag",
"//vendor:gopkg.in/inf.v0", "//vendor:gopkg.in/inf.v0",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common", "//vendor:k8s.io/apimachinery/pkg/openapi",
], ],
) )
......
...@@ -29,7 +29,7 @@ import ( ...@@ -29,7 +29,7 @@ import (
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
inf "gopkg.in/inf.v0" 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. // Quantity is a fixed-point representation of a number.
...@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity { ...@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity {
} }
// OpenAPIDefinition returns openAPI definition for this type. // OpenAPIDefinition returns openAPI definition for this type.
func (_ Quantity) OpenAPIDefinition() common.OpenAPIDefinition { func (_ Quantity) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, Type: []string{"string"},
......
...@@ -18,7 +18,7 @@ go_library( ...@@ -18,7 +18,7 @@ go_library(
deps = [ deps = [
"//vendor:github.com/go-openapi/spec", "//vendor:github.com/go-openapi/spec",
"//vendor:github.com/google/gofuzz", "//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common", "//vendor:k8s.io/apimachinery/pkg/openapi",
], ],
) )
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"time" "time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/google/gofuzz" "github.com/google/gofuzz"
...@@ -141,8 +141,8 @@ func (t Time) MarshalJSON() ([]byte, error) { ...@@ -141,8 +141,8 @@ func (t Time) MarshalJSON() ([]byte, error) {
return json.Marshal(t.UTC().Format(time.RFC3339)) return json.Marshal(t.UTC().Format(time.RFC3339))
} }
func (_ Time) OpenAPIDefinition() common.OpenAPIDefinition { func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, Type: []string{"string"},
......
...@@ -18,7 +18,7 @@ go_library( ...@@ -18,7 +18,7 @@ go_library(
"//pkg/api/resource:go_default_library", "//pkg/api/resource:go_default_library",
"//pkg/util/intstr:go_default_library", "//pkg/util/intstr:go_default_library",
"//vendor:github.com/go-openapi/spec", "//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 ...@@ -22,12 +22,12 @@ package openapi
import ( import (
spec "github.com/go-openapi/spec" 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" resource "k8s.io/kubernetes/pkg/api/resource"
intstr "k8s.io/kubernetes/pkg/util/intstr" 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": { "intstr.IntOrString": intstr.IntOrString{}.OpenAPIDefinition(), "resource.Quantity": resource.Quantity{}.OpenAPIDefinition(), "resource.int64Amount": {
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
......
...@@ -52,7 +52,7 @@ go_library( ...@@ -52,7 +52,7 @@ go_library(
"//vendor:gopkg.in/natefinch/lumberjack.v2", "//vendor:gopkg.in/natefinch/lumberjack.v2",
"//vendor:k8s.io/apimachinery/pkg/apimachinery", "//vendor:k8s.io/apimachinery/pkg/apimachinery",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//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",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
......
...@@ -37,7 +37,7 @@ import ( ...@@ -37,7 +37,7 @@ import (
"gopkg.in/natefinch/lumberjack.v2" "gopkg.in/natefinch/lumberjack.v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 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"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/authentication/authenticator"
......
...@@ -32,7 +32,7 @@ import ( ...@@ -32,7 +32,7 @@ import (
"k8s.io/apimachinery/pkg/apimachinery" "k8s.io/apimachinery/pkg/apimachinery"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 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"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
utilnet "k8s.io/apimachinery/pkg/util/net" utilnet "k8s.io/apimachinery/pkg/util/net"
......
...@@ -21,7 +21,7 @@ go_library( ...@@ -21,7 +21,7 @@ go_library(
"//pkg/util:go_default_library", "//pkg/util:go_default_library",
"//vendor:github.com/emicklei/go-restful", "//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec", "//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", "//vendor:k8s.io/apimachinery/pkg/util/json",
], ],
) )
...@@ -35,7 +35,7 @@ go_test( ...@@ -35,7 +35,7 @@ go_test(
"//vendor:github.com/emicklei/go-restful", "//vendor:github.com/emicklei/go-restful",
"//vendor:github.com/go-openapi/spec", "//vendor:github.com/go-openapi/spec",
"//vendor:github.com/stretchr/testify/assert", "//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 ( ...@@ -25,7 +25,7 @@ import (
"github.com/emicklei/go-restful" "github.com/emicklei/go-restful"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"k8s.io/apimachinery/pkg/util/json" "k8s.io/apimachinery/pkg/util/json"
genericmux "k8s.io/kubernetes/pkg/genericapiserver/mux" genericmux "k8s.io/kubernetes/pkg/genericapiserver/mux"
"k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util"
...@@ -36,14 +36,14 @@ const ( ...@@ -36,14 +36,14 @@ const (
) )
type openAPI struct { type openAPI struct {
config *common.Config config *openapi.Config
swagger *spec.Swagger swagger *spec.Swagger
protocolList []string protocolList []string
servePath string servePath string
} }
// RegisterOpenAPIService registers a handler to provides standard OpenAPI specification. // 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{ o := openAPI{
config: config, config: config,
servePath: servePath, servePath: servePath,
...@@ -312,7 +312,7 @@ func (o *openAPI) findCommonParameters(routes []restful.Route) (map[interface{}] ...@@ -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) { 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{ return &spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{openAPIType}, Type: []string{openAPIType},
...@@ -362,7 +362,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData) (ret spec.Para ...@@ -362,7 +362,7 @@ func (o *openAPI) buildParameter(restParam restful.ParameterData) (ret spec.Para
default: default:
return ret, fmt.Errorf("unknown restful operation kind : %v", restParam.Kind) 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 == "" { if openAPIType == "" {
return ret, fmt.Errorf("non-body Restful parameter type should be a simple type, but got : %v", restParam.DataType) return ret, fmt.Errorf("non-body Restful parameter type should be a simple type, but got : %v", restParam.DataType)
} }
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"github.com/emicklei/go-restful" "github.com/emicklei/go-restful"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/stretchr/testify/assert" "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. // setUp is a convenience function for setting up for (most) tests.
...@@ -63,7 +63,7 @@ type TestOutput struct { ...@@ -63,7 +63,7 @@ type TestOutput struct {
Count int `json:"count,omitempty"` Count int `json:"count,omitempty"`
} }
func (_ TestInput) OpenAPIDefinition() *common.OpenAPIDefinition { func (_ TestInput) OpenAPIDefinition() *openapi.OpenAPIDefinition {
schema := spec.Schema{} schema := spec.Schema{}
schema.Description = "Test input" schema.Description = "Test input"
schema.Properties = map[string]spec.Schema{ schema.Properties = map[string]spec.Schema{
...@@ -96,13 +96,13 @@ func (_ TestInput) OpenAPIDefinition() *common.OpenAPIDefinition { ...@@ -96,13 +96,13 @@ func (_ TestInput) OpenAPIDefinition() *common.OpenAPIDefinition {
}, },
}, },
} }
return &common.OpenAPIDefinition{ return &openapi.OpenAPIDefinition{
Schema: schema, Schema: schema,
Dependencies: []string{}, Dependencies: []string{},
} }
} }
func (_ TestOutput) OpenAPIDefinition() *common.OpenAPIDefinition { func (_ TestOutput) OpenAPIDefinition() *openapi.OpenAPIDefinition {
schema := spec.Schema{} schema := spec.Schema{}
schema.Description = "Test output" schema.Description = "Test output"
schema.Properties = map[string]spec.Schema{ schema.Properties = map[string]spec.Schema{
...@@ -121,14 +121,14 @@ func (_ TestOutput) OpenAPIDefinition() *common.OpenAPIDefinition { ...@@ -121,14 +121,14 @@ func (_ TestOutput) OpenAPIDefinition() *common.OpenAPIDefinition {
}, },
}, },
} }
return &common.OpenAPIDefinition{ return &openapi.OpenAPIDefinition{
Schema: schema, Schema: schema,
Dependencies: []string{}, Dependencies: []string{},
} }
} }
var _ common.OpenAPIDefinitionGetter = TestInput{} var _ openapi.OpenAPIDefinitionGetter = TestInput{}
var _ common.OpenAPIDefinitionGetter = TestOutput{} var _ openapi.OpenAPIDefinitionGetter = TestOutput{}
func getTestRoute(ws *restful.WebService, method string, additionalParams bool, opPrefix string) *restful.RouteBuilder { func getTestRoute(ws *restful.WebService, method string, additionalParams bool, opPrefix string) *restful.RouteBuilder {
ret := ws.Method(method). ret := ws.Method(method).
...@@ -150,7 +150,7 @@ func getTestRoute(ws *restful.WebService, method string, additionalParams bool, ...@@ -150,7 +150,7 @@ func getTestRoute(ws *restful.WebService, method string, additionalParams bool,
return ret return ret
} }
func getConfig(fullMethods bool) (*common.Config, *restful.Container) { func getConfig(fullMethods bool) (*openapi.Config, *restful.Container) {
mux := http.NewServeMux() mux := http.NewServeMux()
container := restful.NewContainer() container := restful.NewContainer()
container.ServeMux = mux container.ServeMux = mux
...@@ -178,7 +178,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) { ...@@ -178,7 +178,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) {
} }
container.Add(ws) container.Add(ws)
return &common.Config{ return &openapi.Config{
ProtocolList: []string{"https"}, ProtocolList: []string{"https"},
Info: &spec.Info{ Info: &spec.Info{
InfoProps: spec.InfoProps{ InfoProps: spec.InfoProps{
...@@ -186,7 +186,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) { ...@@ -186,7 +186,7 @@ func getConfig(fullMethods bool) (*common.Config, *restful.Container) {
Description: "Test API", Description: "Test API",
}, },
}, },
Definitions: &common.OpenAPIDefinitions{ Definitions: &openapi.OpenAPIDefinitions{
"openapi.TestInput": *TestInput{}.OpenAPIDefinition(), "openapi.TestInput": *TestInput{}.OpenAPIDefinition(),
"openapi.TestOutput": *TestOutput{}.OpenAPIDefinition(), "openapi.TestOutput": *TestOutput{}.OpenAPIDefinition(),
}, },
......
...@@ -32,7 +32,7 @@ go_library( ...@@ -32,7 +32,7 @@ go_library(
"//vendor:github.com/golang/glog", "//vendor:github.com/golang/glog",
"//vendor:github.com/prometheus/client_golang/prometheus", "//vendor:github.com/prometheus/client_golang/prometheus",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//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/metrics",
"//vendor:k8s.io/apiserver/pkg/storage/etcd/metrics", "//vendor:k8s.io/apiserver/pkg/storage/etcd/metrics",
], ],
......
...@@ -17,21 +17,21 @@ limitations under the License. ...@@ -17,21 +17,21 @@ limitations under the License.
package routes package routes
import ( import (
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"k8s.io/kubernetes/pkg/genericapiserver/mux" "k8s.io/kubernetes/pkg/genericapiserver/mux"
"k8s.io/kubernetes/pkg/genericapiserver/openapi" apiserveropenapi "k8s.io/kubernetes/pkg/genericapiserver/openapi"
"github.com/golang/glog" "github.com/golang/glog"
) )
// OpenAPI installs spec endpoints for each web service. // OpenAPI installs spec endpoints for each web service.
type OpenAPI struct { type OpenAPI struct {
Config *common.Config Config *openapi.Config
} }
// Install adds the SwaggerUI webservice to the given mux. // Install adds the SwaggerUI webservice to the given mux.
func (oa OpenAPI) Install(c *mux.APIContainer) { 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 { if err != nil {
glog.Fatalf("Failed to register open api spec for root: %v", err) glog.Fatalf("Failed to register open api spec for root: %v", err)
} }
......
...@@ -20,7 +20,7 @@ go_library( ...@@ -20,7 +20,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/golang/glog", "//vendor:github.com/golang/glog",
"//vendor:github.com/google/gofuzz", "//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/genericapiserver/openapi/common", "//vendor:k8s.io/apimachinery/pkg/openapi",
], ],
) )
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/golang/glog" "github.com/golang/glog"
...@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) { ...@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
} }
} }
func (_ IntOrString) OpenAPIDefinition() common.OpenAPIDefinition { func (_ IntOrString) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, Type: []string{"string"},
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"time" "time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/google/gofuzz" "github.com/google/gofuzz"
...@@ -145,8 +145,8 @@ func (t Time) MarshalJSON() ([]byte, error) { ...@@ -145,8 +145,8 @@ func (t Time) MarshalJSON() ([]byte, error) {
return json.Marshal(t.UTC().Format(time.RFC3339)) return json.Marshal(t.UTC().Format(time.RFC3339))
} }
func (_ Time) OpenAPIDefinition() common.OpenAPIDefinition { func (_ Time) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, Type: []string{"string"},
......
...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and ...@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package common package openapi
import ( import (
"github.com/emicklei/go-restful" "github.com/emicklei/go-restful"
......
...@@ -14,5 +14,5 @@ See the License for the specific language governing permissions and ...@@ -14,5 +14,5 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
// package common holds shared codes and types between open API code generator and spec generator. // package openapi holds shared codes and types between open API code generator and spec generator.
package common package openapi
...@@ -324,131 +324,135 @@ ...@@ -324,131 +324,135 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/genericapiserver/openapi/common", "ImportPath": "k8s.io/apimachinery/pkg/genericapiserver/openapi/common",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
},
{
"ImportPath": "k8s.io/apimachinery/pkg/openapi",
"Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "66b1ba666d4dbb77b323da06b1cbe86f83414878" "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8"
} }
] ]
} }
...@@ -19,7 +19,6 @@ package registered ...@@ -19,7 +19,6 @@ package registered
import ( import (
"fmt" "fmt"
"os"
"sort" "sort"
"strings" "strings"
...@@ -31,10 +30,6 @@ import ( ...@@ -31,10 +30,6 @@ import (
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
) )
var (
DefaultAPIRegistrationManager = NewOrDie(os.Getenv("KUBE_API_VERSIONS"))
)
// APIRegistrationManager provides the concept of what API groups are enabled. // APIRegistrationManager provides the concept of what API groups are enabled.
// //
// TODO: currently, it also provides a "registered" concept. But it's wrong to // TODO: currently, it also provides a "registered" concept. But it's wrong to
...@@ -99,28 +94,6 @@ func NewOrDie(kubeAPIVersions string) *APIRegistrationManager { ...@@ -99,28 +94,6 @@ func NewOrDie(kubeAPIVersions string) *APIRegistrationManager {
return m 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. // RegisterVersions adds the given group versions to the list of registered group versions.
func (m *APIRegistrationManager) RegisterVersions(availableVersions []schema.GroupVersion) { func (m *APIRegistrationManager) RegisterVersions(availableVersions []schema.GroupVersion) {
for _, v := range availableVersions { for _, v := range availableVersions {
......
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
"encoding/json" "encoding/json"
"time" "time"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/google/gofuzz" "github.com/google/gofuzz"
......
...@@ -29,8 +29,6 @@ import ( ...@@ -29,8 +29,6 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/ugorji/go/codec"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
) )
...@@ -445,27 +443,6 @@ func (vs Verbs) String() string { ...@@ -445,27 +443,6 @@ func (vs Verbs) String() string {
return fmt.Sprintf("%v", []string(vs)) 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 // 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 // resources supported in a specific group and version, and if the resource
// is namespaced. // is namespaced.
......
...@@ -486,20 +486,6 @@ const ( ...@@ -486,20 +486,6 @@ const (
UnsafeSysctlsPodAnnotationKey string = "security.alpha.kubernetes.io/unsafe-sysctls" 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 // GetTolerationsFromPodAnnotations gets the json serialized tolerations data from Pod.Annotations
// and converts it to the []Toleration type in api. // and converts it to the []Toleration type in api.
func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]Toleration, error) { func GetTolerationsFromPodAnnotations(annotations map[string]string) ([]Toleration, error) {
......
...@@ -29,7 +29,7 @@ import ( ...@@ -29,7 +29,7 @@ import (
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
inf "gopkg.in/inf.v0" 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. // Quantity is a fixed-point representation of a number.
...@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity { ...@@ -399,8 +399,8 @@ func (q Quantity) DeepCopy() Quantity {
} }
// OpenAPIDefinition returns openAPI definition for this type. // OpenAPIDefinition returns openAPI definition for this type.
func (_ Quantity) OpenAPIDefinition() common.OpenAPIDefinition { func (_ Quantity) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, 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"; ...@@ -38,8 +38,6 @@ option go_package = "v1beta1";
// The StatefulSet guarantees that a given network identity will always // The StatefulSet guarantees that a given network identity will always
// map to the same storage identity. // map to the same storage identity.
message StatefulSet { message StatefulSet {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -55,8 +53,6 @@ message StatefulSet { ...@@ -55,8 +53,6 @@ message StatefulSet {
// StatefulSetList is a collection of StatefulSets. // StatefulSetList is a collection of StatefulSets.
message StatefulSetList { message StatefulSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
...@@ -44,8 +44,6 @@ message ExtraValue { ...@@ -44,8 +44,6 @@ message ExtraValue {
// Note: TokenReview requests may be cached by the webhook token authenticator // Note: TokenReview requests may be cached by the webhook token authenticator
// plugin in the kube-apiserver. // plugin in the kube-apiserver.
message TokenReview { message TokenReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
...@@ -44,8 +44,6 @@ message ExtraValue { ...@@ -44,8 +44,6 @@ message ExtraValue {
// Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions // Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions
// checking. // checking.
message LocalSubjectAccessReview { message LocalSubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -107,8 +105,6 @@ message ResourceAttributes { ...@@ -107,8 +105,6 @@ message ResourceAttributes {
// spec.namespace means "in all namespaces". Self is a special case, because users should always be able // 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 // to check whether they can perform an action
message SelfSubjectAccessReview { message SelfSubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -134,8 +130,6 @@ message SelfSubjectAccessReviewSpec { ...@@ -134,8 +130,6 @@ message SelfSubjectAccessReviewSpec {
// SubjectAccessReview checks whether or not a user or group can perform an action. // SubjectAccessReview checks whether or not a user or group can perform an action.
message SubjectAccessReview { message SubjectAccessReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
...@@ -46,8 +46,6 @@ message CrossVersionObjectReference { ...@@ -46,8 +46,6 @@ message CrossVersionObjectReference {
// configuration of a horizontal pod autoscaler. // configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler { 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 // Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -63,8 +61,6 @@ message HorizontalPodAutoscaler { ...@@ -63,8 +61,6 @@ message HorizontalPodAutoscaler {
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList { message HorizontalPodAutoscalerList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -117,8 +113,6 @@ message HorizontalPodAutoscalerStatus { ...@@ -117,8 +113,6 @@ message HorizontalPodAutoscalerStatus {
// Scale represents a scaling request for a resource. // Scale represents a scaling request for a resource.
message Scale { 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. // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
...@@ -33,8 +33,6 @@ option go_package = "v1"; ...@@ -33,8 +33,6 @@ option go_package = "v1";
// Job represents the configuration of a single job. // Job represents the configuration of a single job.
message Job { message Job {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -78,8 +76,6 @@ message JobCondition { ...@@ -78,8 +76,6 @@ message JobCondition {
// JobList is a collection of jobs. // JobList is a collection of jobs.
message JobList { message JobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
......
...@@ -33,8 +33,6 @@ option go_package = "v2alpha1"; ...@@ -33,8 +33,6 @@ option go_package = "v2alpha1";
// CronJob represents the configuration of a single cron job. // CronJob represents the configuration of a single cron job.
message CronJob { message CronJob {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -53,8 +51,6 @@ message CronJob { ...@@ -53,8 +51,6 @@ message CronJob {
// CronJobList is a collection of cron jobs. // CronJobList is a collection of cron jobs.
message CronJobList { message CronJobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -101,8 +97,6 @@ message CronJobStatus { ...@@ -101,8 +97,6 @@ message CronJobStatus {
// Job represents the configuration of a single job. // Job represents the configuration of a single job.
message Job { message Job {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -146,8 +140,6 @@ message JobCondition { ...@@ -146,8 +140,6 @@ message JobCondition {
// JobList is a collection of jobs. // JobList is a collection of jobs.
message JobList { message JobList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -240,8 +232,6 @@ message JobStatus { ...@@ -240,8 +232,6 @@ message JobStatus {
// JobTemplate describes a template for creating copies of a predefined pod. // JobTemplate describes a template for creating copies of a predefined pod.
message JobTemplate { message JobTemplate {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +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"; ...@@ -33,8 +33,6 @@ option go_package = "v1alpha1";
// Describes a certificate signing request // Describes a certificate signing request
message CertificateSigningRequest { message CertificateSigningRequest {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -65,8 +63,6 @@ message CertificateSigningRequestCondition { ...@@ -65,8 +63,6 @@ message CertificateSigningRequestCondition {
} }
message CertificateSigningRequestList { message CertificateSigningRequestList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; 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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -40,7 +40,7 @@ func Resource(resource string) schema.GroupResource { ...@@ -40,7 +40,7 @@ func Resource(resource string) schema.GroupResource {
} }
var ( var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs) SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs)
AddToScheme = SchemeBuilder.AddToScheme AddToScheme = SchemeBuilder.AddToScheme
) )
......
...@@ -28,5 +28,20 @@ import ( ...@@ -28,5 +28,20 @@ import (
// Public to allow building arbitrary schemes. // Public to allow building arbitrary schemes.
// All generated defaulters are covering - they call all nested defaulters. // All generated defaulters are covering - they call all nested defaulters.
func RegisterDefaults(scheme *runtime.Scheme) error { 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 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 { ...@@ -48,6 +48,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&KubeProxyConfiguration{}, &KubeProxyConfiguration{},
&KubeSchedulerConfiguration{}, &KubeSchedulerConfiguration{},
&KubeletConfiguration{}, &KubeletConfiguration{},
&AdmissionConfiguration{},
) )
return nil return nil
} }
...@@ -55,3 +56,4 @@ func addKnownTypes(scheme *runtime.Scheme) error { ...@@ -55,3 +56,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeSchedulerConfiguration) 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 *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
...@@ -18,6 +18,7 @@ package componentconfig ...@@ -18,6 +18,7 @@ package componentconfig
import ( import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api"
utilconfig "k8s.io/client-go/pkg/util/config" utilconfig "k8s.io/client-go/pkg/util/config"
) )
...@@ -601,6 +602,13 @@ type LeaderElectionConfiguration struct { ...@@ -601,6 +602,13 @@ type LeaderElectionConfiguration struct {
type KubeControllerManagerConfiguration struct { type KubeControllerManagerConfiguration struct {
metav1.TypeMeta 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 is the port that the controller-manager's http service runs on.
Port int32 Port int32
// address is the IP address to serve on (set to 0.0.0.0 for all interfaces). // address is the IP address to serve on (set to 0.0.0.0 for all interfaces).
...@@ -828,3 +836,28 @@ type PersistentVolumeRecyclerConfiguration struct { ...@@ -828,3 +836,28 @@ type PersistentVolumeRecyclerConfiguration struct {
// in a multi-node cluster. // in a multi-node cluster.
IncrementTimeoutHostPath int32 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 { ...@@ -37,6 +37,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&KubeProxyConfiguration{}, &KubeProxyConfiguration{},
&KubeSchedulerConfiguration{}, &KubeSchedulerConfiguration{},
&KubeletConfiguration{}, &KubeletConfiguration{},
&AdmissionConfiguration{},
) )
return nil return nil
} }
...@@ -44,3 +45,4 @@ func addKnownTypes(scheme *runtime.Scheme) error { ...@@ -44,3 +45,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta } func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *KubeSchedulerConfiguration) 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 *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
...@@ -18,6 +18,7 @@ package v1alpha1 ...@@ -18,6 +18,7 @@ package v1alpha1
import ( import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/api/v1"
) )
...@@ -578,3 +579,29 @@ type KubeletAnonymousAuthentication struct { ...@@ -578,3 +579,29 @@ type KubeletAnonymousAuthentication struct {
// Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated. // Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated.
Enabled *bool `json:"enabled"` 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() { ...@@ -38,6 +38,10 @@ func init() {
// Public to allow building arbitrary schemes. // Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error { func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs( 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_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration,
Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration, Convert_componentconfig_KubeProxyConfiguration_To_v1alpha1_KubeProxyConfiguration,
Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration, Convert_v1alpha1_KubeSchedulerConfiguration_To_componentconfig_KubeSchedulerConfiguration,
...@@ -61,6 +65,70 @@ func RegisterConversions(scheme *runtime.Scheme) error { ...@@ -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 { func autoConvert_v1alpha1_KubeProxyConfiguration_To_componentconfig_KubeProxyConfiguration(in *KubeProxyConfiguration, out *componentconfig.KubeProxyConfiguration, s conversion.Scope) error {
out.BindAddress = in.BindAddress out.BindAddress = in.BindAddress
out.ClusterCIDR = in.ClusterCIDR out.ClusterCIDR = in.ClusterCIDR
......
...@@ -35,6 +35,8 @@ func init() { ...@@ -35,6 +35,8 @@ func init() {
// to allow building arbitrary schemes. // to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error { func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs( 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_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeSchedulerConfiguration, InType: reflect.TypeOf(&KubeSchedulerConfiguration{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeSchedulerConfiguration, InType: reflect.TypeOf(&KubeSchedulerConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAnonymousAuthentication, InType: reflect.TypeOf(&KubeletAnonymousAuthentication{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1alpha1_KubeletAnonymousAuthentication, InType: reflect.TypeOf(&KubeletAnonymousAuthentication{})},
...@@ -48,6 +50,38 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -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 { func DeepCopy_v1alpha1_KubeProxyConfiguration(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
in := in.(*KubeProxyConfiguration) in := in.(*KubeProxyConfiguration)
......
...@@ -36,6 +36,8 @@ func init() { ...@@ -36,6 +36,8 @@ func init() {
// to allow building arbitrary schemes. // to allow building arbitrary schemes.
func RegisterDeepCopies(scheme *runtime.Scheme) error { func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs( 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_IPVar, InType: reflect.TypeOf(&IPVar{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeControllerManagerConfiguration, InType: reflect.TypeOf(&KubeControllerManagerConfiguration{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeControllerManagerConfiguration, InType: reflect.TypeOf(&KubeControllerManagerConfiguration{})},
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_componentconfig_KubeProxyConfiguration, InType: reflect.TypeOf(&KubeProxyConfiguration{})},
...@@ -54,6 +56,41 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { ...@@ -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 { func DeepCopy_componentconfig_IPVar(in interface{}, out interface{}, c *conversion.Cloner) error {
{ {
in := in.(*IPVar) in := in.(*IPVar)
...@@ -73,6 +110,11 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in interface{}, ...@@ -73,6 +110,11 @@ func DeepCopy_componentconfig_KubeControllerManagerConfiguration(in interface{},
in := in.(*KubeControllerManagerConfiguration) in := in.(*KubeControllerManagerConfiguration)
out := out.(*KubeControllerManagerConfiguration) out := out.(*KubeControllerManagerConfiguration)
*out = *in *out = *in
if in.Controllers != nil {
in, out := &in.Controllers, &out.Controllers
*out = make([]string, len(*in))
copy(*out, *in)
}
return nil return nil
} }
} }
......
...@@ -71,8 +71,6 @@ message CustomMetricTargetList { ...@@ -71,8 +71,6 @@ message CustomMetricTargetList {
// DaemonSet represents the configuration of a daemon set. // DaemonSet represents the configuration of a daemon set.
message DaemonSet { message DaemonSet {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -94,8 +92,6 @@ message DaemonSet { ...@@ -94,8 +92,6 @@ message DaemonSet {
// DaemonSetList is a collection of daemon sets. // DaemonSetList is a collection of daemon sets.
message DaemonSetList { message DaemonSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -150,8 +146,6 @@ message DaemonSetStatus { ...@@ -150,8 +146,6 @@ message DaemonSetStatus {
// Deployment enables declarative updates for Pods and ReplicaSets. // Deployment enables declarative updates for Pods and ReplicaSets.
message Deployment { message Deployment {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata. // Standard object metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -188,8 +182,6 @@ message DeploymentCondition { ...@@ -188,8 +182,6 @@ message DeploymentCondition {
// DeploymentList is a list of Deployments. // DeploymentList is a list of Deployments.
message DeploymentList { message DeploymentList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -200,8 +192,6 @@ message DeploymentList { ...@@ -200,8 +192,6 @@ message DeploymentList {
// DeploymentRollback stores the information required to rollback a deployment. // DeploymentRollback stores the information required to rollback a deployment.
message DeploymentRollback { message DeploymentRollback {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Required: This must match the Name of a deployment. // Required: This must match the Name of a deployment.
optional string name = 1; optional string name = 1;
...@@ -349,8 +339,6 @@ message HTTPIngressRuleValue { ...@@ -349,8 +339,6 @@ message HTTPIngressRuleValue {
// configuration of a horizontal pod autoscaler. // configuration of a horizontal pod autoscaler.
message HorizontalPodAutoscaler { 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 // Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -366,8 +354,6 @@ message HorizontalPodAutoscaler { ...@@ -366,8 +354,6 @@ message HorizontalPodAutoscaler {
// list of horizontal pod autoscaler objects. // list of horizontal pod autoscaler objects.
message HorizontalPodAutoscalerList { message HorizontalPodAutoscalerList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -442,8 +428,6 @@ message IDRange { ...@@ -442,8 +428,6 @@ message IDRange {
// externally-reachable urls, load balance traffic, terminate SSL, offer name // externally-reachable urls, load balance traffic, terminate SSL, offer name
// based virtual hosting etc. // based virtual hosting etc.
message Ingress { message Ingress {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -471,8 +455,6 @@ message IngressBackend { ...@@ -471,8 +455,6 @@ message IngressBackend {
// IngressList is a collection of Ingress. // IngressList is a collection of Ingress.
message IngressList { message IngressList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -568,8 +550,6 @@ message IngressTLS { ...@@ -568,8 +550,6 @@ message IngressTLS {
} }
message NetworkPolicy { message NetworkPolicy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -605,8 +585,6 @@ message NetworkPolicyIngressRule { ...@@ -605,8 +585,6 @@ message NetworkPolicyIngressRule {
// Network Policy List is a list of NetworkPolicy objects. // Network Policy List is a list of NetworkPolicy objects.
message NetworkPolicyList { message NetworkPolicyList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -671,8 +649,6 @@ message NetworkPolicySpec { ...@@ -671,8 +649,6 @@ message NetworkPolicySpec {
// Pod Security Policy governs the ability to make requests that affect the Security Context // Pod Security Policy governs the ability to make requests that affect the Security Context
// that will be applied to a pod and container. // that will be applied to a pod and container.
message PodSecurityPolicy { message PodSecurityPolicy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -685,8 +661,6 @@ message PodSecurityPolicy { ...@@ -685,8 +661,6 @@ message PodSecurityPolicy {
// Pod Security Policy List is a list of PodSecurityPolicy objects. // Pod Security Policy List is a list of PodSecurityPolicy objects.
message PodSecurityPolicyList { message PodSecurityPolicyList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -763,8 +737,6 @@ message PodSecurityPolicySpec { ...@@ -763,8 +737,6 @@ message PodSecurityPolicySpec {
// ReplicaSet represents the configuration of a ReplicaSet. // ReplicaSet represents the configuration of a ReplicaSet.
message 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 // If the Labels of a ReplicaSet are empty, they are defaulted to
// be the same as the Pod(s) that the ReplicaSet manages. // 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 // Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
...@@ -808,8 +780,6 @@ message ReplicaSetCondition { ...@@ -808,8 +780,6 @@ message ReplicaSetCondition {
// ReplicaSetList is a collection of ReplicaSets. // ReplicaSetList is a collection of ReplicaSets.
message ReplicaSetList { message ReplicaSetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional // +optional
...@@ -878,7 +848,6 @@ message ReplicaSetStatus { ...@@ -878,7 +848,6 @@ message ReplicaSetStatus {
// Dummy definition // Dummy definition
message ReplicationControllerDummy { message ReplicationControllerDummy {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 1;
} }
message RollbackConfig { message RollbackConfig {
...@@ -940,8 +909,6 @@ message SELinuxStrategyOptions { ...@@ -940,8 +909,6 @@ message SELinuxStrategyOptions {
// represents a scaling request for a resource. // represents a scaling request for a resource.
message Scale { 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. // Standard object metadata; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -1015,8 +982,6 @@ message SupplementalGroupsStrategyOptions { ...@@ -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 // 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. // types to the API. It consists of one or more Versions of the api.
message ThirdPartyResource { message ThirdPartyResource {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object metadata // Standard object metadata
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -1032,8 +997,6 @@ message ThirdPartyResource { ...@@ -1032,8 +997,6 @@ message ThirdPartyResource {
// An internal object, used for versioned storage in etcd. Not exposed to the end user. // An internal object, used for versioned storage in etcd. Not exposed to the end user.
message ThirdPartyResourceData { message ThirdPartyResourceData {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object metadata. // Standard object metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -1045,8 +1008,6 @@ message ThirdPartyResourceData { ...@@ -1045,8 +1008,6 @@ message ThirdPartyResourceData {
// ThirdPartyResrouceDataList is a list of ThirdPartyResourceData. // ThirdPartyResrouceDataList is a list of ThirdPartyResourceData.
message ThirdPartyResourceDataList { message ThirdPartyResourceDataList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -1058,8 +1019,6 @@ message ThirdPartyResourceDataList { ...@@ -1058,8 +1019,6 @@ message ThirdPartyResourceDataList {
// ThirdPartyResourceList is a list of ThirdPartyResources. // ThirdPartyResourceList is a list of ThirdPartyResources.
message ThirdPartyResourceList { message ThirdPartyResourceList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
...@@ -114,14 +114,6 @@ func (m *ImageReview) MarshalTo(data []byte) (int, error) { ...@@ -114,14 +114,6 @@ func (m *ImageReview) MarshalTo(data []byte) (int, error) {
return 0, err return 0, err
} }
i += n3 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 return i, nil
} }
...@@ -264,8 +256,6 @@ func (m *ImageReview) Size() (n int) { ...@@ -264,8 +256,6 @@ func (m *ImageReview) Size() (n int) {
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
l = m.Status.Size() l = m.Status.Size()
n += 1 + l + sovGenerated(uint64(l)) n += 1 + l + sovGenerated(uint64(l))
l = m.TypeMeta.Size()
n += 1 + l + sovGenerated(uint64(l))
return n return n
} }
...@@ -329,7 +319,6 @@ func (this *ImageReview) String() string { ...@@ -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) + `,`, `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) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ImageReviewSpec", "ImageReviewSpec", 1), `&`, ``, 1) + `,`,
`Status:` + strings.Replace(strings.Replace(this.Status.String(), "ImageReviewStatus", "ImageReviewStatus", 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 return s
...@@ -504,36 +493,6 @@ func (m *ImageReview) Unmarshal(data []byte) error { ...@@ -504,36 +493,6 @@ func (m *ImageReview) Unmarshal(data []byte) error {
return err return err
} }
iNdEx = postIndex 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: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipGenerated(data[iNdEx:]) skippy, err := skipGenerated(data[iNdEx:])
...@@ -1060,44 +1019,42 @@ var ( ...@@ -1060,44 +1019,42 @@ var (
) )
var fileDescriptorGenerated = []byte{ var fileDescriptorGenerated = []byte{
// 622 bytes of a gzipped FileDescriptorProto // 588 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x92, 0xbf, 0x6f, 0x13, 0x31,
0x14, 0xc7, 0xe3, 0xa6, 0x3f, 0x92, 0x0b, 0xd0, 0xf6, 0x60, 0xb0, 0x32, 0xb8, 0x55, 0x90, 0x50, 0x14, 0xc7, 0x73, 0x49, 0x7f, 0xc5, 0x01, 0xda, 0x1a, 0x86, 0x28, 0xc3, 0xb5, 0x0a, 0x12, 0x2a,
0x41, 0x70, 0xa7, 0x54, 0x08, 0x55, 0x0c, 0x94, 0x1a, 0x31, 0x74, 0x00, 0xc4, 0xc1, 0x80, 0x10, 0x08, 0x6c, 0xa5, 0x42, 0xa8, 0x62, 0xa0, 0xf4, 0x10, 0x43, 0x07, 0x40, 0x98, 0x05, 0xb1, 0x39,
0xcb, 0xc5, 0x7d, 0x75, 0xdc, 0xd8, 0x77, 0x96, 0xef, 0x9c, 0x2a, 0x03, 0x12, 0x23, 0x03, 0x03, 0xd7, 0xd7, 0x8b, 0x9b, 0x3b, 0xfb, 0x74, 0xf6, 0xa5, 0xca, 0x80, 0xc4, 0xc8, 0xc0, 0xc0, 0x7f,
0x0b, 0xff, 0x53, 0xc7, 0x8e, 0x4c, 0x15, 0x0d, 0xff, 0x08, 0xf2, 0xd9, 0xae, 0x4d, 0xd3, 0x08, 0xc3, 0xbf, 0xd0, 0xb1, 0x23, 0x53, 0x45, 0xc3, 0x3f, 0x82, 0xce, 0x77, 0xe9, 0x1d, 0x4d, 0x23,
0xa1, 0x6e, 0xbe, 0xf7, 0xfc, 0xfd, 0x7c, 0xbf, 0xf7, 0xee, 0xa1, 0xdd, 0xd1, 0x8e, 0x22, 0x81, 0x84, 0xb2, 0xf9, 0xf9, 0xf9, 0x7d, 0xbe, 0x5f, 0xbf, 0xf7, 0xd0, 0xfe, 0x70, 0x4f, 0x13, 0xa1,
0xa4, 0xa3, 0x74, 0x00, 0x89, 0x00, 0x0d, 0x8a, 0xc6, 0x23, 0x9f, 0xf2, 0x38, 0x50, 0x34, 0x88, 0xe8, 0x30, 0xed, 0x43, 0x22, 0xc1, 0x80, 0xa6, 0xf1, 0x30, 0xa0, 0x3c, 0x16, 0x9a, 0x8a, 0x88,
0xb8, 0x0f, 0xb1, 0x0c, 0x03, 0x6f, 0x42, 0xc7, 0x7d, 0x1e, 0xc6, 0x43, 0xde, 0xa7, 0x3e, 0x08, 0x07, 0x10, 0xab, 0x50, 0xf8, 0x63, 0x3a, 0xea, 0xf1, 0x30, 0x1e, 0xf0, 0x1e, 0x0d, 0x40, 0x42,
0x48, 0xb8, 0x86, 0x03, 0x12, 0x27, 0x52, 0x4b, 0x4c, 0x73, 0x00, 0xa9, 0x00, 0x24, 0x1e, 0xf9, 0xc2, 0x0d, 0x1c, 0x91, 0x38, 0x51, 0x46, 0x61, 0x9a, 0x03, 0x48, 0x09, 0x20, 0xf1, 0x30, 0x20,
0x24, 0x03, 0x90, 0x1a, 0x80, 0x94, 0x80, 0xee, 0x23, 0x3f, 0xd0, 0xc3, 0x74, 0x40, 0x3c, 0x19, 0x19, 0x80, 0x54, 0x00, 0x64, 0x0a, 0xe8, 0x3c, 0x09, 0x84, 0x19, 0xa4, 0x7d, 0xe2, 0xab, 0x88,
0x51, 0x5f, 0xfa, 0x92, 0x1a, 0xce, 0x20, 0x3d, 0x34, 0x27, 0x73, 0x30, 0x5f, 0x39, 0xbf, 0xfb, 0x06, 0x2a, 0x50, 0xd4, 0x72, 0xfa, 0xe9, 0xb1, 0x8d, 0x6c, 0x60, 0x4f, 0x39, 0xbf, 0xf3, 0xb4,
0xb8, 0x08, 0xc8, 0xe3, 0x20, 0xe2, 0xde, 0x30, 0x10, 0x90, 0x4c, 0xaa, 0x88, 0x11, 0x68, 0x4e, 0x30, 0xc8, 0x63, 0x11, 0x71, 0x7f, 0x20, 0x24, 0x24, 0xe3, 0xd2, 0x62, 0x04, 0x86, 0xd3, 0xd1,
0xc7, 0x33, 0xa9, 0xba, 0x74, 0x9e, 0x2a, 0x49, 0x85, 0x0e, 0x22, 0x98, 0x11, 0x3c, 0xf9, 0x97, 0x8c, 0xab, 0x0e, 0x9d, 0x57, 0x95, 0xa4, 0xd2, 0x88, 0x08, 0x66, 0x0a, 0x9e, 0xfd, 0xab, 0x40,
0x40, 0x79, 0x43, 0x88, 0xf8, 0x8c, 0x6e, 0x7b, 0xee, 0xfc, 0x68, 0x02, 0x4a, 0xa6, 0x89, 0x37, 0xfb, 0x03, 0x88, 0xf8, 0x4c, 0xdd, 0xee, 0xdc, 0xfe, 0xd1, 0x04, 0xb4, 0x4a, 0x13, 0x7f, 0x56,
0xeb, 0xf5, 0x70, 0xbe, 0xe6, 0x8a, 0xab, 0xf4, 0xaf, 0xfe, 0x3b, 0xd5, 0x41, 0x48, 0x03, 0xa1, 0xeb, 0xf1, 0xfc, 0x9a, 0x1b, 0xbe, 0xd2, 0xbb, 0xf9, 0x75, 0x6a, 0x44, 0x48, 0x85, 0x34, 0xda,
0x95, 0x4e, 0x2e, 0x4b, 0x7a, 0x3f, 0x9a, 0xa8, 0xb3, 0x9f, 0xcd, 0x9e, 0xc1, 0x38, 0x80, 0x63, 0x24, 0xd7, 0x4b, 0xba, 0x3f, 0xea, 0xa8, 0x75, 0x98, 0xf5, 0x9e, 0xc1, 0x48, 0xc0, 0x29, 0xfe,
0xfc, 0x01, 0xb5, 0xb2, 0x41, 0x1d, 0x70, 0xcd, 0x6d, 0x6b, 0xd3, 0xda, 0xea, 0x6c, 0x6f, 0x91, 0x88, 0xd6, 0xb2, 0x46, 0x1d, 0x71, 0xc3, 0xdb, 0xce, 0xb6, 0xb3, 0xd3, 0xda, 0xdd, 0x21, 0x73,
0xb9, 0xcf, 0x46, 0xc6, 0x7d, 0xf2, 0x66, 0x70, 0x04, 0x9e, 0x7e, 0x05, 0x9a, 0xbb, 0xf8, 0xe4, 0xc7, 0x46, 0x46, 0x3d, 0xf2, 0xae, 0x7f, 0x02, 0xbe, 0x79, 0x03, 0x86, 0x7b, 0xf8, 0xec, 0x62,
0x6c, 0xa3, 0x31, 0x3d, 0xdb, 0x40, 0x55, 0x8d, 0x5d, 0xd0, 0xf0, 0x00, 0x2d, 0xaa, 0x18, 0x3c, 0xab, 0x36, 0xb9, 0xd8, 0x42, 0xe5, 0x1d, 0xbb, 0xa2, 0xe1, 0x3e, 0x5a, 0xd2, 0x31, 0xf8, 0xed,
0x7b, 0xc1, 0x50, 0x9f, 0x93, 0xff, 0x5c, 0x06, 0x52, 0x4b, 0xf9, 0x2e, 0x06, 0xcf, 0xbd, 0x51, 0xba, 0xa5, 0xbe, 0x24, 0xff, 0xb9, 0x0c, 0xa4, 0xe2, 0xf2, 0x43, 0x0c, 0xbe, 0x77, 0xab, 0x50,
0xb8, 0x2d, 0x66, 0x27, 0x66, 0xd8, 0xf8, 0x08, 0x2d, 0x2b, 0xcd, 0x75, 0xaa, 0xec, 0xa6, 0x71, 0x5b, 0xca, 0x22, 0x66, 0xd9, 0xf8, 0x04, 0xad, 0x68, 0xc3, 0x4d, 0xaa, 0xdb, 0x0d, 0xab, 0xe2,
0x71, 0xaf, 0xe5, 0x62, 0x48, 0xee, 0xad, 0xc2, 0x67, 0x39, 0x3f, 0xb3, 0xc2, 0x01, 0x7f, 0x42, 0x2d, 0xa4, 0x62, 0x49, 0xde, 0x9d, 0x42, 0x67, 0x25, 0x8f, 0x59, 0xa1, 0xd0, 0xdd, 0x47, 0xed,
0x2d, 0x3d, 0x89, 0x21, 0xbb, 0xa5, 0xbd, 0x68, 0xdc, 0x48, 0xe9, 0x56, 0xdf, 0x8c, 0xca, 0x2f, 0xca, 0xe3, 0x57, 0x4a, 0x1a, 0x9e, 0xad, 0x42, 0xe6, 0x06, 0xdf, 0x47, 0xcb, 0x96, 0x6e, 0x5b,
0x9b, 0x44, 0x36, 0xb1, 0xf7, 0x85, 0xca, 0x5d, 0x2b, 0xc8, 0xad, 0xb2, 0xc2, 0x2e, 0x88, 0xbd, 0xd8, 0xf4, 0x6e, 0x17, 0x88, 0xe5, 0xbc, 0x20, 0xcf, 0x75, 0xbf, 0x35, 0xd0, 0xfa, 0xb5, 0x4f,
0x5d, 0x64, 0xd7, 0xa2, 0xbc, 0x90, 0x42, 0xf3, 0x0c, 0x97, 0xdd, 0x15, 0xdf, 0x45, 0x4b, 0x26, 0xe1, 0xcf, 0x08, 0xf9, 0x53, 0x92, 0x6e, 0x3b, 0xdb, 0x8d, 0x9d, 0xd6, 0xee, 0xe1, 0x22, 0x9f,
0xbb, 0x79, 0xa0, 0xb6, 0x7b, 0xb3, 0xc0, 0x2c, 0xe5, 0x82, 0xbc, 0xd7, 0xfb, 0xd6, 0x44, 0xab, 0xf8, 0xcb, 0x57, 0x39, 0xa1, 0xab, 0x6b, 0xcd, 0x2a, 0x82, 0xf8, 0xab, 0x83, 0x5a, 0x5c, 0x4a,
0x97, 0x46, 0x86, 0x3f, 0x23, 0xe4, 0x95, 0x24, 0x65, 0x5b, 0x9b, 0xcd, 0xad, 0xce, 0xf6, 0xfe, 0x65, 0xb8, 0x11, 0x4a, 0xea, 0x76, 0xdd, 0x1a, 0x78, 0xbf, 0xe8, 0xac, 0xc8, 0x41, 0xc9, 0x7c,
0x75, 0x46, 0xf4, 0x57, 0xae, 0xea, 0xfd, 0x2f, 0xca, 0x8a, 0xd5, 0x0c, 0xf1, 0x57, 0x0b, 0x75, 0x2d, 0x4d, 0x32, 0xf6, 0xee, 0x16, 0x46, 0x5a, 0x95, 0x0c, 0xab, 0x4a, 0x63, 0x8a, 0x9a, 0x92,
0xb8, 0x10, 0x52, 0x73, 0x1d, 0x48, 0xa1, 0xec, 0x05, 0x13, 0xe0, 0xed, 0x75, 0x37, 0x81, 0xec, 0x47, 0xa0, 0x63, 0xee, 0x83, 0x9d, 0x66, 0xd3, 0xdb, 0x2c, 0x8a, 0x9a, 0x6f, 0xa7, 0x09, 0x56,
0x55, 0xcc, 0x97, 0x42, 0x27, 0x13, 0xf7, 0x76, 0x11, 0xa4, 0x53, 0xeb, 0xb0, 0xba, 0x35, 0xa6, 0xbe, 0xe9, 0xbc, 0x40, 0x1b, 0xd7, 0x65, 0xf0, 0x06, 0x6a, 0x0c, 0x61, 0x9c, 0x4f, 0x81, 0x65,
0xa8, 0x2d, 0x78, 0x04, 0x2a, 0xe6, 0x1e, 0x98, 0x5d, 0x69, 0xbb, 0xeb, 0x85, 0xa8, 0xfd, 0xba, 0x47, 0x7c, 0x0f, 0x2d, 0x8f, 0x78, 0x98, 0x82, 0x5d, 0xc3, 0x26, 0xcb, 0x83, 0xe7, 0xf5, 0x3d,
0x6c, 0xb0, 0xea, 0x9f, 0xee, 0x33, 0xb4, 0x76, 0xd9, 0x06, 0xaf, 0xa1, 0xe6, 0x08, 0x26, 0xf9, 0xa7, 0x7b, 0x8c, 0x36, 0x67, 0x86, 0x8f, 0x1f, 0xa2, 0x55, 0x1e, 0x86, 0xea, 0x14, 0x8e, 0x2c,
0x2b, 0xb0, 0xec, 0x13, 0xdf, 0x41, 0x4b, 0x63, 0x1e, 0xa6, 0x60, 0x96, 0xbc, 0xcd, 0xf2, 0xc3, 0x64, 0xcd, 0x5b, 0x2f, 0x3c, 0xac, 0x1e, 0xe4, 0xd7, 0x6c, 0x9a, 0xc7, 0x0f, 0xd0, 0x4a, 0x02,
0xd3, 0x85, 0x1d, 0xab, 0x77, 0x88, 0xd6, 0x67, 0x56, 0x0b, 0xdf, 0x47, 0x2b, 0x3c, 0x0c, 0xe5, 0x5c, 0x2b, 0x99, 0xa3, 0xcb, 0xbd, 0x61, 0xf6, 0x96, 0x15, 0x59, 0xef, 0xd1, 0xd9, 0xa5, 0x5b,
0x31, 0x1c, 0x18, 0x48, 0xcb, 0x5d, 0x2d, 0x32, 0xac, 0xec, 0xe5, 0x65, 0x56, 0xf6, 0xf1, 0x3d, 0x3b, 0xbf, 0x74, 0x6b, 0x3f, 0x2f, 0xdd, 0xda, 0x97, 0x89, 0xeb, 0x9c, 0x4d, 0x5c, 0xe7, 0x7c,
0xb4, 0x9c, 0x00, 0x57, 0x52, 0xe4, 0xe8, 0x6a, 0x2b, 0x99, 0xa9, 0xb2, 0xa2, 0xeb, 0x3e, 0x38, 0xe2, 0x3a, 0xbf, 0x26, 0xae, 0xf3, 0xfd, 0xb7, 0x5b, 0xfb, 0xb4, 0x36, 0xed, 0xe3, 0x9f, 0x00,
0x39, 0x77, 0x1a, 0xa7, 0xe7, 0x4e, 0xe3, 0xe7, 0xb9, 0xd3, 0xf8, 0x32, 0x75, 0xac, 0x93, 0xa9, 0x00, 0x00, 0xff, 0xff, 0x85, 0x95, 0xf8, 0x16, 0x73, 0x05, 0x00, 0x00,
0x63, 0x9d, 0x4e, 0x1d, 0xeb, 0xd7, 0xd4, 0xb1, 0xbe, 0xff, 0x76, 0x1a, 0x1f, 0x5b, 0xe5, 0x1c,
0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x46, 0xf3, 0x4f, 0x24, 0xd1, 0x05, 0x00, 0x00,
} }
...@@ -33,8 +33,6 @@ option go_package = "v1alpha1"; ...@@ -33,8 +33,6 @@ option go_package = "v1alpha1";
// ImageReview checks if the set of images in a pod are allowed. // ImageReview checks if the set of images in a pod are allowed.
message ImageReview { message ImageReview {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
......
...@@ -35,8 +35,6 @@ option go_package = "v1beta1"; ...@@ -35,8 +35,6 @@ option go_package = "v1beta1";
// This is a subresource of Pod. A request to cause such an eviction is // This is a subresource of Pod. A request to cause such an eviction is
// created by POSTing to .../pods/<pod name>/evictions. // created by POSTing to .../pods/<pod name>/evictions.
message Eviction { message Eviction {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// ObjectMeta describes the pod that is being evicted. // ObjectMeta describes the pod that is being evicted.
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -46,8 +44,6 @@ message Eviction { ...@@ -46,8 +44,6 @@ message Eviction {
// PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
message PodDisruptionBudget { message PodDisruptionBudget {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
// Specification of the desired behavior of the PodDisruptionBudget. // Specification of the desired behavior of the PodDisruptionBudget.
...@@ -59,8 +55,6 @@ message PodDisruptionBudget { ...@@ -59,8 +55,6 @@ message PodDisruptionBudget {
// PodDisruptionBudgetList is a collection of PodDisruptionBudgets. // PodDisruptionBudgetList is a collection of PodDisruptionBudgets.
message PodDisruptionBudgetList { message PodDisruptionBudgetList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
repeated PodDisruptionBudget items = 2; repeated PodDisruptionBudget items = 2;
......
...@@ -33,8 +33,6 @@ option go_package = "v1alpha1"; ...@@ -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. // ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.
message ClusterRole { message ClusterRole {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -46,8 +44,6 @@ message ClusterRole { ...@@ -46,8 +44,6 @@ message ClusterRole {
// ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, // ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace,
// and adds who information via Subject. // and adds who information via Subject.
message ClusterRoleBinding { message ClusterRoleBinding {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -70,8 +66,6 @@ message ClusterRoleBindingBuilder { ...@@ -70,8 +66,6 @@ message ClusterRoleBindingBuilder {
// ClusterRoleBindingList is a collection of ClusterRoleBindings // ClusterRoleBindingList is a collection of ClusterRoleBindings
message ClusterRoleBindingList { message ClusterRoleBindingList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -82,8 +76,6 @@ message ClusterRoleBindingList { ...@@ -82,8 +76,6 @@ message ClusterRoleBindingList {
// ClusterRoleList is a collection of ClusterRoles // ClusterRoleList is a collection of ClusterRoles
message ClusterRoleList { message ClusterRoleList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -134,8 +126,6 @@ message PolicyRuleBuilder { ...@@ -134,8 +126,6 @@ message PolicyRuleBuilder {
// Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. // Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
message Role { message Role {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -148,8 +138,6 @@ message Role { ...@@ -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 // 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. // namespace only have effect in that namespace.
message RoleBinding { message RoleBinding {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1; optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
...@@ -164,8 +152,6 @@ message RoleBinding { ...@@ -164,8 +152,6 @@ message RoleBinding {
// RoleBindingList is a collection of RoleBindings // RoleBindingList is a collection of RoleBindings
message RoleBindingList { message RoleBindingList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
...@@ -176,8 +162,6 @@ message RoleBindingList { ...@@ -176,8 +162,6 @@ message RoleBindingList {
// RoleList is a collection of Roles // RoleList is a collection of Roles
message RoleList { message RoleList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard object's metadata. // Standard object's metadata.
// +optional // +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
......
...@@ -37,8 +37,6 @@ option go_package = "v1beta1"; ...@@ -37,8 +37,6 @@ option go_package = "v1beta1";
// StorageClasses are non-namespaced; the name of the storage class // StorageClasses are non-namespaced; the name of the storage class
// according to etcd is in ObjectMeta.Name. // according to etcd is in ObjectMeta.Name.
message StorageClass { message StorageClass {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -55,8 +53,6 @@ message StorageClass { ...@@ -55,8 +53,6 @@ message StorageClass {
// StorageClassList is a collection of storage classes. // StorageClassList is a collection of storage classes.
message StorageClassList { message StorageClassList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata // Standard list metadata
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
......
...@@ -33,8 +33,6 @@ option go_package = "v1beta1"; ...@@ -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. // Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
message Cluster { message Cluster {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 4;
// Standard object's metadata. // Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional // +optional
...@@ -76,8 +74,6 @@ message ClusterCondition { ...@@ -76,8 +74,6 @@ message ClusterCondition {
// A list of all the kubernetes clusters registered to the federation // A list of all the kubernetes clusters registered to the federation
message ClusterList { message ClusterList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.TypeMeta typeMeta = 3;
// Standard list metadata. // Standard list metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds // More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
// +optional // +optional
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"k8s.io/apimachinery/pkg/genericapiserver/openapi/common" "k8s.io/apimachinery/pkg/openapi"
"github.com/go-openapi/spec" "github.com/go-openapi/spec"
"github.com/golang/glog" "github.com/golang/glog"
...@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) { ...@@ -120,8 +120,8 @@ func (intstr IntOrString) MarshalJSON() ([]byte, error) {
} }
} }
func (_ IntOrString) OpenAPIDefinition() common.OpenAPIDefinition { func (_ IntOrString) OpenAPIDefinition() openapi.OpenAPIDefinition {
return common.OpenAPIDefinition{ return openapi.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Type: []string{"string"}, Type: []string{"string"},
......
...@@ -17,14 +17,12 @@ limitations under the License. ...@@ -17,14 +17,12 @@ limitations under the License.
package labels package labels
import ( import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
) )
// Clones the given map and returns a new map with the given key and value added. // Clones the given map and returns a new map with the given key and value added.
// Returns the given map, if labelKey is empty. // 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 == "" { if labelKey == "" {
// Don't need to add a label. // Don't need to add a label.
return labels return labels
...@@ -34,7 +32,7 @@ func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint ...@@ -34,7 +32,7 @@ func CloneAndAddLabel(labels map[string]string, labelKey string, labelValue uint
for key, value := range labels { for key, value := range labels {
newLabels[key] = value newLabels[key] = value
} }
newLabels[labelKey] = fmt.Sprintf("%d", labelValue) newLabels[labelKey] = labelValue
return newLabels return newLabels
} }
...@@ -55,7 +53,7 @@ func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]s ...@@ -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. // 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 == "" { if labelKey == "" {
// Don't need to add a label. // Don't need to add a label.
return labels return labels
...@@ -69,7 +67,7 @@ func AddLabel(labels map[string]string, labelKey string, labelValue string) map[ ...@@ -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. // Clones the given selector and returns a new selector with the given key and value added.
// Returns the given selector, if labelKey is empty. // 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 == "" { if labelKey == "" {
// Don't need to add a label. // Don't need to add a label.
return selector return selector
...@@ -85,7 +83,7 @@ func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, l ...@@ -85,7 +83,7 @@ func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, l
newSelector.MatchLabels[key] = val newSelector.MatchLabels[key] = val
} }
} }
newSelector.MatchLabels[labelKey] = fmt.Sprintf("%d", labelValue) newSelector.MatchLabels[labelKey] = labelValue
if selector.MatchExpressions != nil { if selector.MatchExpressions != nil {
newMExps := make([]metav1.LabelSelectorRequirement, len(selector.MatchExpressions)) newMExps := make([]metav1.LabelSelectorRequirement, len(selector.MatchExpressions))
...@@ -108,7 +106,7 @@ func CloneSelectorAndAddLabel(selector *metav1.LabelSelector, labelKey string, l ...@@ -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. // 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 == "" { if labelKey == "" {
// Don't need to add a label. // Don't need to add a label.
return selector return selector
......
...@@ -70,6 +70,7 @@ type controller struct { ...@@ -70,6 +70,7 @@ type controller struct {
type Controller interface { type Controller interface {
Run(stopCh <-chan struct{}) Run(stopCh <-chan struct{})
HasSynced() bool HasSynced() bool
LastSyncResourceVersion() string
} }
// New makes a new Controller from the given Config. // New makes a new Controller from the given Config.
......
...@@ -211,10 +211,10 @@ func (s *sharedIndexInformer) LastSyncResourceVersion() string { ...@@ -211,10 +211,10 @@ func (s *sharedIndexInformer) LastSyncResourceVersion() string {
s.startedLock.Lock() s.startedLock.Lock()
defer s.startedLock.Unlock() defer s.startedLock.Unlock()
if s.controller == nil || s.controller.reflector == nil { if s.controller == nil {
return "" return ""
} }
return s.controller.reflector.LastSyncResourceVersion() return s.controller.LastSyncResourceVersion()
} }
func (s *sharedIndexInformer) GetStore() Store { func (s *sharedIndexInformer) GetStore() Store {
......
...@@ -9502,7 +9502,7 @@ go_library( ...@@ -9502,7 +9502,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/spf13/pflag", "//vendor:github.com/spf13/pflag",
"//vendor:gopkg.in/inf.v0", "//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( ...@@ -9983,6 +9983,7 @@ go_library(
name = "k8s.io/client-go/pkg/apis/certificates/v1alpha1", name = "k8s.io/client-go/pkg/apis/certificates/v1alpha1",
srcs = [ srcs = [
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/conversion.go", "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/doc.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/generated.pb.go", "k8s.io/client-go/pkg/apis/certificates/v1alpha1/generated.pb.go",
"k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go", "k8s.io/client-go/pkg/apis/certificates/v1alpha1/register.go",
...@@ -10711,7 +10712,7 @@ go_library( ...@@ -10711,7 +10712,7 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/golang/glog", "//vendor:github.com/golang/glog",
"//vendor:github.com/google/gofuzz", "//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( ...@@ -11860,8 +11861,8 @@ go_library(
"//vendor:github.com/gogo/protobuf/sortkeys", "//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/google/gofuzz", "//vendor:github.com/google/gofuzz",
"//vendor:k8s.io/apimachinery/pkg/conversion", "//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/labels",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/selection", "//vendor:k8s.io/apimachinery/pkg/selection",
...@@ -11933,19 +11934,6 @@ go_test( ...@@ -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( go_test(
name = "k8s.io/apimachinery/pkg/labels_test", name = "k8s.io/apimachinery/pkg/labels_test",
srcs = [ srcs = [
...@@ -12764,10 +12752,9 @@ go_library( ...@@ -12764,10 +12752,9 @@ go_library(
"//vendor:github.com/gogo/protobuf/proto", "//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/gogo/protobuf/sortkeys", "//vendor:github.com/gogo/protobuf/sortkeys",
"//vendor:github.com/google/gofuzz", "//vendor:github.com/google/gofuzz",
"//vendor:github.com/ugorji/go/codec",
"//vendor:k8s.io/apimachinery/pkg/conversion", "//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/labels",
"//vendor:k8s.io/apimachinery/pkg/openapi",
"//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/selection", "//vendor:k8s.io/apimachinery/pkg/selection",
...@@ -13341,3 +13328,16 @@ go_library( ...@@ -13341,3 +13328,16 @@ go_library(
"//vendor:k8s.io/apimachinery/pkg/util/validation/field", "//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