sslobodr | d046be8 | 2019-01-16 10:02:22 -0500 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2017 The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package v1beta1 |
| 18 | |
| 19 | import ( |
| 20 | "k8s.io/apimachinery/pkg/runtime" |
| 21 | "k8s.io/apimachinery/pkg/runtime/schema" |
| 22 | ) |
| 23 | |
| 24 | // GroupName is the group name for this API. |
| 25 | const GroupName = "meta.k8s.io" |
| 26 | |
| 27 | // SchemeGroupVersion is group version used to register these objects |
| 28 | var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} |
| 29 | |
| 30 | // Kind takes an unqualified kind and returns a Group qualified GroupKind |
| 31 | func 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. |
| 36 | var scheme = runtime.NewScheme() |
| 37 | |
| 38 | // ParameterCodec knows about query parameters used with the meta v1beta1 API spec. |
| 39 | var ParameterCodec = runtime.NewParameterCodec(scheme) |
| 40 | |
| 41 | func 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 | } |