blob: d13254b41dd0ce240c763cd83f41fe46ba0a8c88 [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
2Copyright 2017 The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17package v1beta1
18
19import (
20 "k8s.io/apimachinery/pkg/runtime"
21 "k8s.io/apimachinery/pkg/runtime/schema"
22)
23
24// GroupName is the group name for this API.
25const GroupName = "meta.k8s.io"
26
27// SchemeGroupVersion is group version used to register these objects
28var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
29
30// Kind takes an unqualified kind and returns a Group qualified GroupKind
31func Kind(kind string) schema.GroupKind {
32 return SchemeGroupVersion.WithKind(kind).GroupKind()
33}
34
35// scheme is the registry for the common types that adhere to the meta v1beta1 API spec.
36var scheme = runtime.NewScheme()
37
38// ParameterCodec knows about query parameters used with the meta v1beta1 API spec.
39var ParameterCodec = runtime.NewParameterCodec(scheme)
40
41func init() {
42 scheme.AddKnownTypes(SchemeGroupVersion,
43 &Table{},
44 &TableOptions{},
45 &PartialObjectMetadata{},
46 &PartialObjectMetadataList{},
47 )
48
49 if err := scheme.AddConversionFuncs(
50 Convert_Slice_string_To_v1beta1_IncludeObjectPolicy,
51 ); err != nil {
52 panic(err)
53 }
54
55 // register manually. This usually goes through the SchemeBuilder, which we cannot use here.
56 //scheme.AddGeneratedDeepCopyFuncs(GetGeneratedDeepCopyFuncs()...)
57}