install.go 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Copyright 2017 The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package scheme
  14. import (
  15. admissionv1alpha1 "k8s.io/api/admission/v1beta1"
  16. admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
  17. admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
  18. appsv1 "k8s.io/api/apps/v1"
  19. appsv1beta1 "k8s.io/api/apps/v1beta1"
  20. appsv1beta2 "k8s.io/api/apps/v1beta2"
  21. authenticationv1 "k8s.io/api/authentication/v1"
  22. authenticationv1beta1 "k8s.io/api/authentication/v1beta1"
  23. authorizationv1 "k8s.io/api/authorization/v1"
  24. authorizationv1beta1 "k8s.io/api/authorization/v1beta1"
  25. autoscalingv1 "k8s.io/api/autoscaling/v1"
  26. autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
  27. batchv1 "k8s.io/api/batch/v1"
  28. batchv1beta1 "k8s.io/api/batch/v1beta1"
  29. batchv2alpha1 "k8s.io/api/batch/v2alpha1"
  30. certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
  31. corev1 "k8s.io/api/core/v1"
  32. extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
  33. imagepolicyv1alpha1 "k8s.io/api/imagepolicy/v1alpha1"
  34. networkingv1 "k8s.io/api/networking/v1"
  35. policyv1beta1 "k8s.io/api/policy/v1beta1"
  36. rbacv1 "k8s.io/api/rbac/v1"
  37. rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
  38. rbacv1beta1 "k8s.io/api/rbac/v1beta1"
  39. schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
  40. settingsv1alpha1 "k8s.io/api/settings/v1alpha1"
  41. storagev1 "k8s.io/api/storage/v1"
  42. storagev1beta1 "k8s.io/api/storage/v1beta1"
  43. metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  44. "k8s.io/apimachinery/pkg/runtime/schema"
  45. utilruntime "k8s.io/apimachinery/pkg/util/runtime"
  46. "k8s.io/client-go/kubernetes/scheme"
  47. )
  48. // Register all groups in the kubectl's registry, but no componentconfig group since it's not in k8s.io/api
  49. // The code in this file mostly duplicate the install under k8s.io/kubernetes/pkg/api and k8s.io/kubernetes/pkg/apis,
  50. // but does NOT register the internal types.
  51. func init() {
  52. // Register external types for Scheme
  53. metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
  54. utilruntime.Must(scheme.AddToScheme(Scheme))
  55. utilruntime.Must(Scheme.SetVersionPriority(corev1.SchemeGroupVersion))
  56. utilruntime.Must(Scheme.SetVersionPriority(admissionv1alpha1.SchemeGroupVersion))
  57. utilruntime.Must(Scheme.SetVersionPriority(admissionregistrationv1beta1.SchemeGroupVersion, admissionregistrationv1alpha1.SchemeGroupVersion))
  58. utilruntime.Must(Scheme.SetVersionPriority(appsv1beta1.SchemeGroupVersion, appsv1beta2.SchemeGroupVersion, appsv1.SchemeGroupVersion))
  59. utilruntime.Must(Scheme.SetVersionPriority(authenticationv1.SchemeGroupVersion, authenticationv1beta1.SchemeGroupVersion))
  60. utilruntime.Must(Scheme.SetVersionPriority(authorizationv1.SchemeGroupVersion, authorizationv1beta1.SchemeGroupVersion))
  61. utilruntime.Must(Scheme.SetVersionPriority(autoscalingv1.SchemeGroupVersion, autoscalingv2beta1.SchemeGroupVersion))
  62. utilruntime.Must(Scheme.SetVersionPriority(batchv1.SchemeGroupVersion, batchv1beta1.SchemeGroupVersion, batchv2alpha1.SchemeGroupVersion))
  63. utilruntime.Must(Scheme.SetVersionPriority(certificatesv1beta1.SchemeGroupVersion))
  64. utilruntime.Must(Scheme.SetVersionPriority(extensionsv1beta1.SchemeGroupVersion))
  65. utilruntime.Must(Scheme.SetVersionPriority(imagepolicyv1alpha1.SchemeGroupVersion))
  66. utilruntime.Must(Scheme.SetVersionPriority(networkingv1.SchemeGroupVersion))
  67. utilruntime.Must(Scheme.SetVersionPriority(policyv1beta1.SchemeGroupVersion))
  68. utilruntime.Must(Scheme.SetVersionPriority(rbacv1.SchemeGroupVersion, rbacv1beta1.SchemeGroupVersion, rbacv1alpha1.SchemeGroupVersion))
  69. utilruntime.Must(Scheme.SetVersionPriority(schedulingv1alpha1.SchemeGroupVersion))
  70. utilruntime.Must(Scheme.SetVersionPriority(settingsv1alpha1.SchemeGroupVersion))
  71. utilruntime.Must(Scheme.SetVersionPriority(storagev1.SchemeGroupVersion, storagev1beta1.SchemeGroupVersion))
  72. }