From 330ead55c57dfd6121349b4fa4ca9cdd9ab8a63d Mon Sep 17 00:00:00 2001 From: Zahi Akiva Date: Sun, 16 Jul 2017 16:36:49 +0300 Subject: [PATCH] Add Container Template Spec --- spec/factories/openshift_template.rb | 7 + .../container_template_spec.rb | 61 +++++ spec/vcr_cassettes/container_template.yml | 225 ++++++++++++++++++ 3 files changed, 293 insertions(+) create mode 100644 spec/factories/openshift_template.rb create mode 100644 spec/models/manageiq/providers/openshift/container_manager/container_template_spec.rb create mode 100644 spec/vcr_cassettes/container_template.yml diff --git a/spec/factories/openshift_template.rb b/spec/factories/openshift_template.rb new file mode 100644 index 00000000..7a2fe91c --- /dev/null +++ b/spec/factories/openshift_template.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :openshift_template, + :aliases => ['manageiq/providers/openshift/container_manager/container_template'], + :class => 'ManageIQ::Providers::Openshift::ContainerManager::ContainerTemplate', + :parent => :container_template do + end +end diff --git a/spec/models/manageiq/providers/openshift/container_manager/container_template_spec.rb b/spec/models/manageiq/providers/openshift/container_manager/container_template_spec.rb new file mode 100644 index 00000000..d2ad4be4 --- /dev/null +++ b/spec/models/manageiq/providers/openshift/container_manager/container_template_spec.rb @@ -0,0 +1,61 @@ +describe ContainerTemplate do + let(:ems) do + hostname = 'host.example.com' + token = 'theToken' + FactoryGirl.create( + :ems_openshift, + :name => 'OpenShiftProvider', + :connection_configurations => [{:endpoint => {:role => :default, + :hostname => hostname, + :port => "8443"}, + :authentication => {:role => :bearer, + :auth_key => token, + :userid => "_"}}, + {:endpoint => {:role => :hawkular, + :hostname => hostname, + :port => "443"}, + :authentication => {:role => :hawkular, + :auth_key => token, + :userid => "_"}}] + ) + end + + before(:each) do + allow(MiqServer).to receive(:my_zone).and_return("default") + end + + it "instantiate a template with parameters and object labels" do + param = FactoryGirl.create(:container_template_parameter, + :name => 'VAR', + :value => 'example', + :required => true) + + object = {:apiVersion => "v1", + :kind => "PersistentVolumeClaim", + :metadata => {:name => "pvc-${VAR}"}, + :spec => {:accessModes => ["ReadWriteOnce"], + :resources => {:requests => {:storage => "8Gi"}}}} + + object_labels = {:created_from_template => "true"} + + template = FactoryGirl.create(:openshift_template, + :ems_id => ems.id, + :objects => [object], + :object_labels => object_labels).tap do |temp| + temp.container_template_parameters = [param] + end + + VCR.use_cassette(described_class.name.underscore, + :match_requests_on => [:path, :body], + :allow_unused_http_interactions => false) do # , :record => :new_episodes) do + ems.create_project(:metadata => {:name => "test-project"}) + objects = template.instantiate(template.container_template_parameters, "test-project", template.object_labels) + + pvc = objects.first + expect(pvc[:kind]).to eq("PersistentVolumeClaim") + expect(pvc[:miq_class]).to eq(PersistentVolumeClaim) + expect(pvc[:metadata][:name]).to eq("pvc-example") + expect(pvc[:metadata][:labels]).to eq(:created_from_template => "true") + end + end +end diff --git a/spec/vcr_cassettes/container_template.yml b/spec/vcr_cassettes/container_template.yml new file mode 100644 index 00000000..d86bcf31 --- /dev/null +++ b/spec/vcr_cassettes/container_template.yml @@ -0,0 +1,225 @@ +--- +http_interactions: +- request: + method: get + uri: https://host.example.com:8443/oapi/v1 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Transfer-Encoding: + - chunked + body: + encoding: UTF-8 + string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"appliedclusterresourcequotas","namespaced":true,"kind":"AppliedClusterResourceQuota"},{"name":"buildconfigs","namespaced":true,"kind":"BuildConfig"},{"name":"buildconfigs/instantiate","namespaced":true,"kind":"BuildRequest"},{"name":"buildconfigs/instantiatebinary","namespaced":true,"kind":"BinaryBuildRequestOptions"},{"name":"buildconfigs/webhooks","namespaced":true,"kind":"Status"},{"name":"builds","namespaced":true,"kind":"Build"},{"name":"builds/clone","namespaced":true,"kind":"BuildRequest"},{"name":"builds/details","namespaced":true,"kind":"Build"},{"name":"builds/log","namespaced":true,"kind":"BuildLog"},{"name":"clusternetworks","namespaced":false,"kind":"ClusterNetwork"},{"name":"clusterpolicies","namespaced":false,"kind":"ClusterPolicy"},{"name":"clusterpolicybindings","namespaced":false,"kind":"ClusterPolicyBinding"},{"name":"clusterresourcequotas","namespaced":false,"kind":"ClusterResourceQuota"},{"name":"clusterresourcequotas/status","namespaced":false,"kind":"ClusterResourceQuota"},{"name":"clusterrolebindings","namespaced":false,"kind":"ClusterRoleBinding"},{"name":"clusterroles","namespaced":false,"kind":"ClusterRole"},{"name":"deploymentconfigrollbacks","namespaced":true,"kind":"DeploymentConfigRollback"},{"name":"deploymentconfigs","namespaced":true,"kind":"DeploymentConfig"},{"name":"deploymentconfigs/log","namespaced":true,"kind":"DeploymentLog"},{"name":"deploymentconfigs/rollback","namespaced":true,"kind":"DeploymentConfigRollback"},{"name":"deploymentconfigs/scale","namespaced":true,"kind":"Scale"},{"name":"deploymentconfigs/status","namespaced":true,"kind":"DeploymentConfig"},{"name":"egressnetworkpolicies","namespaced":true,"kind":"EgressNetworkPolicy"},{"name":"generatedeploymentconfigs","namespaced":true,"kind":"DeploymentConfig"},{"name":"groups","namespaced":false,"kind":"Group"},{"name":"hostsubnets","namespaced":false,"kind":"HostSubnet"},{"name":"identities","namespaced":false,"kind":"Identity"},{"name":"images","namespaced":false,"kind":"Image"},{"name":"imagesignatures","namespaced":false,"kind":"ImageSignature"},{"name":"imagestreamimages","namespaced":true,"kind":"ImageStreamImage"},{"name":"imagestreamimports","namespaced":true,"kind":"ImageStreamImport"},{"name":"imagestreammappings","namespaced":true,"kind":"ImageStreamMapping"},{"name":"imagestreams","namespaced":true,"kind":"ImageStream"},{"name":"imagestreams/secrets","namespaced":true,"kind":"SecretList"},{"name":"imagestreams/status","namespaced":true,"kind":"ImageStream"},{"name":"imagestreamtags","namespaced":true,"kind":"ImageStreamTag"},{"name":"localresourceaccessreviews","namespaced":true,"kind":"LocalResourceAccessReview"},{"name":"localsubjectaccessreviews","namespaced":true,"kind":"LocalSubjectAccessReview"},{"name":"netnamespaces","namespaced":false,"kind":"NetNamespace"},{"name":"oauthaccesstokens","namespaced":false,"kind":"OAuthAccessToken"},{"name":"oauthauthorizetokens","namespaced":false,"kind":"OAuthAuthorizeToken"},{"name":"oauthclientauthorizations","namespaced":false,"kind":"OAuthClientAuthorization"},{"name":"oauthclients","namespaced":false,"kind":"OAuthClient"},{"name":"policies","namespaced":true,"kind":"Policy"},{"name":"policybindings","namespaced":true,"kind":"PolicyBinding"},{"name":"processedtemplates","namespaced":true,"kind":"Template"},{"name":"projectrequests","namespaced":false,"kind":"ProjectRequest"},{"name":"projects","namespaced":false,"kind":"Project"},{"name":"resourceaccessreviews","namespaced":true,"kind":"ResourceAccessReview"},{"name":"rolebindings","namespaced":true,"kind":"RoleBinding"},{"name":"roles","namespaced":true,"kind":"Role"},{"name":"routes","namespaced":true,"kind":"Route"},{"name":"routes/status","namespaced":true,"kind":"Route"},{"name":"selfsubjectrulesreviews","namespaced":true,"kind":"SelfSubjectRulesReview"},{"name":"subjectaccessreviews","namespaced":true,"kind":"SubjectAccessReview"},{"name":"templates","namespaced":true,"kind":"Template"},{"name":"useridentitymappings","namespaced":false,"kind":"UserIdentityMapping"},{"name":"users","namespaced":false,"kind":"User"}]} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +- request: + method: post + uri: https://host.example.com:8443/oapi/v1/projectrequests + body: + encoding: UTF-8 + string: '{"metadata":{"name":"test-project"},"kind":"ProjectRequest","apiVersion":"v1"}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Content-Type: + - application/json + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + Content-Length: + - '78' + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Content-Length: + - '637' + body: + encoding: UTF-8 + string: '{"kind":"Project","apiVersion":"v1","metadata":{"name":"test-project","selfLink":"/oapi/v1/projectrequests/test-project","uid":"7a396cc2-6b9d-11e7-8ac6-001a4a162683","resourceVersion":"4138235","creationTimestamp":"2017-07-18T09:42:56Z","annotations":{"openshift.io/description":"","openshift.io/display-name":"","openshift.io/requester":"system:serviceaccount:management-infra:management-admin","openshift.io/sa.scc.mcs":"s0:c25,c20","openshift.io/sa.scc.supplemental-groups":"1000640000/10000","openshift.io/sa.scc.uid-range":"1000640000/10000"}},"spec":{"finalizers":["openshift.io/origin","kubernetes"]},"status":{"phase":"Active"}} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +- request: + method: post + uri: https://host.example.com:8443/oapi/v1/namespaces/test-project/processedtemplates + body: + encoding: UTF-8 + string: '{"metadata":{"name":null,"namespace":"test-project"},"objects":[{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"name":"pvc-${VAR}"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"8Gi"}}}}],"parameters":[{"name":"VAR","value":"example","generate":null,"from":null,"required":true}],"labels":{"created_from_template":"true"}}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Content-Type: + - application/json + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + Content-Length: + - '367' + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Content-Length: + - '432' + body: + encoding: UTF-8 + string: '{"kind":"Template","apiVersion":"v1","metadata":{"namespace":"test-project","creationTimestamp":null},"objects":[{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"labels":{"created_from_template":"true"},"name":"pvc-example"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"8Gi"}}}}],"parameters":[{"name":"VAR","value":"example","required":true}],"labels":{"created_from_template":"true"}} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +- request: + method: get + uri: https://host.example.com:8443/oapi/v1 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Transfer-Encoding: + - chunked + body: + encoding: UTF-8 + string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"appliedclusterresourcequotas","namespaced":true,"kind":"AppliedClusterResourceQuota"},{"name":"buildconfigs","namespaced":true,"kind":"BuildConfig"},{"name":"buildconfigs/instantiate","namespaced":true,"kind":"BuildRequest"},{"name":"buildconfigs/instantiatebinary","namespaced":true,"kind":"BinaryBuildRequestOptions"},{"name":"buildconfigs/webhooks","namespaced":true,"kind":"Status"},{"name":"builds","namespaced":true,"kind":"Build"},{"name":"builds/clone","namespaced":true,"kind":"BuildRequest"},{"name":"builds/details","namespaced":true,"kind":"Build"},{"name":"builds/log","namespaced":true,"kind":"BuildLog"},{"name":"clusternetworks","namespaced":false,"kind":"ClusterNetwork"},{"name":"clusterpolicies","namespaced":false,"kind":"ClusterPolicy"},{"name":"clusterpolicybindings","namespaced":false,"kind":"ClusterPolicyBinding"},{"name":"clusterresourcequotas","namespaced":false,"kind":"ClusterResourceQuota"},{"name":"clusterresourcequotas/status","namespaced":false,"kind":"ClusterResourceQuota"},{"name":"clusterrolebindings","namespaced":false,"kind":"ClusterRoleBinding"},{"name":"clusterroles","namespaced":false,"kind":"ClusterRole"},{"name":"deploymentconfigrollbacks","namespaced":true,"kind":"DeploymentConfigRollback"},{"name":"deploymentconfigs","namespaced":true,"kind":"DeploymentConfig"},{"name":"deploymentconfigs/log","namespaced":true,"kind":"DeploymentLog"},{"name":"deploymentconfigs/rollback","namespaced":true,"kind":"DeploymentConfigRollback"},{"name":"deploymentconfigs/scale","namespaced":true,"kind":"Scale"},{"name":"deploymentconfigs/status","namespaced":true,"kind":"DeploymentConfig"},{"name":"egressnetworkpolicies","namespaced":true,"kind":"EgressNetworkPolicy"},{"name":"generatedeploymentconfigs","namespaced":true,"kind":"DeploymentConfig"},{"name":"groups","namespaced":false,"kind":"Group"},{"name":"hostsubnets","namespaced":false,"kind":"HostSubnet"},{"name":"identities","namespaced":false,"kind":"Identity"},{"name":"images","namespaced":false,"kind":"Image"},{"name":"imagesignatures","namespaced":false,"kind":"ImageSignature"},{"name":"imagestreamimages","namespaced":true,"kind":"ImageStreamImage"},{"name":"imagestreamimports","namespaced":true,"kind":"ImageStreamImport"},{"name":"imagestreammappings","namespaced":true,"kind":"ImageStreamMapping"},{"name":"imagestreams","namespaced":true,"kind":"ImageStream"},{"name":"imagestreams/secrets","namespaced":true,"kind":"SecretList"},{"name":"imagestreams/status","namespaced":true,"kind":"ImageStream"},{"name":"imagestreamtags","namespaced":true,"kind":"ImageStreamTag"},{"name":"localresourceaccessreviews","namespaced":true,"kind":"LocalResourceAccessReview"},{"name":"localsubjectaccessreviews","namespaced":true,"kind":"LocalSubjectAccessReview"},{"name":"netnamespaces","namespaced":false,"kind":"NetNamespace"},{"name":"oauthaccesstokens","namespaced":false,"kind":"OAuthAccessToken"},{"name":"oauthauthorizetokens","namespaced":false,"kind":"OAuthAuthorizeToken"},{"name":"oauthclientauthorizations","namespaced":false,"kind":"OAuthClientAuthorization"},{"name":"oauthclients","namespaced":false,"kind":"OAuthClient"},{"name":"policies","namespaced":true,"kind":"Policy"},{"name":"policybindings","namespaced":true,"kind":"PolicyBinding"},{"name":"processedtemplates","namespaced":true,"kind":"Template"},{"name":"projectrequests","namespaced":false,"kind":"ProjectRequest"},{"name":"projects","namespaced":false,"kind":"Project"},{"name":"resourceaccessreviews","namespaced":true,"kind":"ResourceAccessReview"},{"name":"rolebindings","namespaced":true,"kind":"RoleBinding"},{"name":"roles","namespaced":true,"kind":"Role"},{"name":"routes","namespaced":true,"kind":"Route"},{"name":"routes/status","namespaced":true,"kind":"Route"},{"name":"selfsubjectrulesreviews","namespaced":true,"kind":"SelfSubjectRulesReview"},{"name":"subjectaccessreviews","namespaced":true,"kind":"SubjectAccessReview"},{"name":"templates","namespaced":true,"kind":"Template"},{"name":"useridentitymappings","namespaced":false,"kind":"UserIdentityMapping"},{"name":"users","namespaced":false,"kind":"User"}]} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +- request: + method: get + uri: https://host.example.com:8443/api/v1 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + response: + status: + code: 200 + message: OK + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Transfer-Encoding: + - chunked + body: + encoding: UTF-8 + string: '{"kind":"APIResourceList","groupVersion":"v1","resources":[{"name":"bindings","namespaced":true,"kind":"Binding"},{"name":"componentstatuses","namespaced":false,"kind":"ComponentStatus"},{"name":"configmaps","namespaced":true,"kind":"ConfigMap"},{"name":"endpoints","namespaced":true,"kind":"Endpoints"},{"name":"events","namespaced":true,"kind":"Event"},{"name":"limitranges","namespaced":true,"kind":"LimitRange"},{"name":"namespaces","namespaced":false,"kind":"Namespace"},{"name":"namespaces/finalize","namespaced":false,"kind":"Namespace"},{"name":"namespaces/status","namespaced":false,"kind":"Namespace"},{"name":"nodes","namespaced":false,"kind":"Node"},{"name":"nodes/proxy","namespaced":false,"kind":"Node"},{"name":"nodes/status","namespaced":false,"kind":"Node"},{"name":"persistentvolumeclaims","namespaced":true,"kind":"PersistentVolumeClaim"},{"name":"persistentvolumeclaims/status","namespaced":true,"kind":"PersistentVolumeClaim"},{"name":"persistentvolumes","namespaced":false,"kind":"PersistentVolume"},{"name":"persistentvolumes/status","namespaced":false,"kind":"PersistentVolume"},{"name":"pods","namespaced":true,"kind":"Pod"},{"name":"pods/attach","namespaced":true,"kind":"Pod"},{"name":"pods/binding","namespaced":true,"kind":"Binding"},{"name":"pods/exec","namespaced":true,"kind":"Pod"},{"name":"pods/log","namespaced":true,"kind":"Pod"},{"name":"pods/portforward","namespaced":true,"kind":"Pod"},{"name":"pods/proxy","namespaced":true,"kind":"Pod"},{"name":"pods/status","namespaced":true,"kind":"Pod"},{"name":"podtemplates","namespaced":true,"kind":"PodTemplate"},{"name":"replicationcontrollers","namespaced":true,"kind":"ReplicationController"},{"name":"replicationcontrollers/scale","namespaced":true,"kind":"Scale"},{"name":"replicationcontrollers/status","namespaced":true,"kind":"ReplicationController"},{"name":"resourcequotas","namespaced":true,"kind":"ResourceQuota"},{"name":"resourcequotas/status","namespaced":true,"kind":"ResourceQuota"},{"name":"secrets","namespaced":true,"kind":"Secret"},{"name":"securitycontextconstraints","namespaced":false,"kind":"SecurityContextConstraints"},{"name":"serviceaccounts","namespaced":true,"kind":"ServiceAccount"},{"name":"services","namespaced":true,"kind":"Service"},{"name":"services/proxy","namespaced":true,"kind":"Service"},{"name":"services/status","namespaced":true,"kind":"Service"}]} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +- request: + method: post + uri: https://host.example.com:8443/api/v1/namespaces/test-project/persistentvolumeclaims + body: + encoding: UTF-8 + string: '{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"labels":{"created_from_template":"true"},"name":"pvc-example","namespace":"test-project"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"8Gi"}}}}' + headers: + Accept: + - "*/*" + Accept-Encoding: + - gzip, deflate + User-Agent: + - rest-client/2.0.2 (linux-gnu x86_64) ruby/2.3.3p222 + Content-Type: + - application/json + Authorization: + - Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJtYW5hZ2VtZW50LWluZnJhIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Im1hbmFnZW1lbnQtYWRtaW4tdG9rZW4tOHhlb2siLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoibWFuYWdlbWVudC1hZG1pbiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjI3Zjc0NTNlLWU2ZjgtMTFlNi1hMzQ4LTAwMWE0YTE2MjY4MyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDptYW5hZ2VtZW50LWluZnJhOm1hbmFnZW1lbnQtYWRtaW4ifQ.bPi4TnBvEHQ5URSYZ9pfhebq5KLSJBAgJCeQ3I4UATpxwvy-WkF1uy_E_k2nc_GKRIOTzHjxjxBwvwL4KFyyM-By-RQHSb1Uux4qU077n9c67drbaeeYZ3MJVdoxDANqDu96g00YnVxxODx7DSep36dr9mLzWlP_k2NwAyxBV5NukYULdGunCjvWuv7wEyPHmUMRN4xntbhd5EhZThpN93PD6AhzcYy-OV9ZUB41L7bslnZEPU0kpG9oQbvj9hRoKJR7FyRPnHaUqJD7riOXwYjB57vk7lTCaxzsQs1i21dlQvdetu83drMTdV-02V_XuB5zucYPvaCUx7v-PUUy3A + Content-Length: + - '237' + response: + status: + code: 201 + message: Created + headers: + Cache-Control: + - no-store + Content-Type: + - application/json + Date: + - Tue, 18 Jul 2017 09:42:56 GMT + Content-Length: + - '463' + body: + encoding: UTF-8 + string: '{"kind":"PersistentVolumeClaim","apiVersion":"v1","metadata":{"name":"pvc-example","namespace":"test-project","selfLink":"/api/v1/namespaces/test-project/persistentvolumeclaims/pvc-example","uid":"7a655b7d-6b9d-11e7-8ac6-001a4a162683","resourceVersion":"4138260","creationTimestamp":"2017-07-18T09:42:56Z","labels":{"created_from_template":"true"}},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"8Gi"}}},"status":{"phase":"Pending"}} + +' + http_version: + recorded_at: Tue, 18 Jul 2017 09:45:04 GMT +recorded_with: VCR 3.0.3