Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gems/kubeclient/lib/kubeclient/missing_kind_compatibility.rb')
-rw-r--r--vendor/gems/kubeclient/lib/kubeclient/missing_kind_compatibility.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/vendor/gems/kubeclient/lib/kubeclient/missing_kind_compatibility.rb b/vendor/gems/kubeclient/lib/kubeclient/missing_kind_compatibility.rb
new file mode 100644
index 00000000000..ec88960a546
--- /dev/null
+++ b/vendor/gems/kubeclient/lib/kubeclient/missing_kind_compatibility.rb
@@ -0,0 +1,68 @@
+module Kubeclient
+ module Common
+ # Backward compatibility for old versions where kind is missing (e.g. OpenShift Enterprise 3.1)
+ class MissingKindCompatibility
+ MAPPING = {
+ 'bindings' => 'Binding',
+ 'componentstatuses' => 'ComponentStatus',
+ 'endpoints' => 'Endpoints',
+ 'events' => 'Event',
+ 'limitranges' => 'LimitRange',
+ 'namespaces' => 'Namespace',
+ 'nodes' => 'Node',
+ 'persistentvolumeclaims' => 'PersistentVolumeClaim',
+ 'persistentvolumes' => 'PersistentVolume',
+ 'pods' => 'Pod',
+ 'podtemplates' => 'PodTemplate',
+ 'replicationcontrollers' => 'ReplicationController',
+ 'resourcequotas' => 'ResourceQuota',
+ 'secrets' => 'Secret',
+ 'securitycontextconstraints' => 'SecurityContextConstraints',
+ 'serviceaccounts' => 'ServiceAccount',
+ 'services' => 'Service',
+ 'buildconfigs' => 'BuildConfig',
+ 'builds' => 'Build',
+ 'clusternetworks' => 'ClusterNetwork',
+ 'clusterpolicies' => 'ClusterPolicy',
+ 'clusterpolicybindings' => 'ClusterPolicyBinding',
+ 'clusterrolebindings' => 'ClusterRoleBinding',
+ 'clusterroles' => 'ClusterRole',
+ 'deploymentconfigrollbacks' => 'DeploymentConfigRollback',
+ 'deploymentconfigs' => 'DeploymentConfig',
+ 'generatedeploymentconfigs' => 'DeploymentConfig',
+ 'groups' => 'Group',
+ 'hostsubnets' => 'HostSubnet',
+ 'identities' => 'Identity',
+ 'images' => 'Image',
+ 'imagestreamimages' => 'ImageStreamImage',
+ 'imagestreammappings' => 'ImageStreamMapping',
+ 'imagestreams' => 'ImageStream',
+ 'imagestreamtags' => 'ImageStreamTag',
+ 'localresourceaccessreviews' => 'LocalResourceAccessReview',
+ 'localsubjectaccessreviews' => 'LocalSubjectAccessReview',
+ 'netnamespaces' => 'NetNamespace',
+ 'oauthaccesstokens' => 'OAuthAccessToken',
+ 'oauthauthorizetokens' => 'OAuthAuthorizeToken',
+ 'oauthclientauthorizations' => 'OAuthClientAuthorization',
+ 'oauthclients' => 'OAuthClient',
+ 'policies' => 'Policy',
+ 'policybindings' => 'PolicyBinding',
+ 'processedtemplates' => 'Template',
+ 'projectrequests' => 'ProjectRequest',
+ 'projects' => 'Project',
+ 'resourceaccessreviews' => 'ResourceAccessReview',
+ 'rolebindings' => 'RoleBinding',
+ 'roles' => 'Role',
+ 'routes' => 'Route',
+ 'subjectaccessreviews' => 'SubjectAccessReview',
+ 'templates' => 'Template',
+ 'useridentitymappings' => 'UserIdentityMapping',
+ 'users' => 'User'
+ }.freeze
+
+ def self.resource_kind(name)
+ MAPPING[name]
+ end
+ end
+ end
+end