Commit 32ce45ef authored by Shinya Maeda's avatar Shinya Maeda

Fix lib/gitlab/usage_data.rb. spec/lib/gitlab/usage_data_spec.rb....

Fix lib/gitlab/usage_data.rb. spec/lib/gitlab/usage_data_spec.rb. spec/support/kubernetes_helpers.rb.
parent 24eaba35
......@@ -63,16 +63,10 @@ module Gitlab
deploy_keys: DeployKey.count,
deployments: Deployment.count,
environments: ::Environment.count,
<<<<<<< HEAD
gcp_clusters: ::Gcp::Cluster.count,
gcp_clusters_enabled: ::Gcp::Cluster.enabled.count,
gcp_clusters_disabled: ::Gcp::Cluster.disabled.count,
geo_nodes: GeoNode.count,
=======
clusters: ::Clusters::Cluster.count,
clusters_enabled: ::Clusters::Cluster.enabled.count,
clusters_disabled: ::Clusters::Cluster.disabled.count,
>>>>>>> upstream/master
in_review_folder: ::Environment.in_review_folder.count,
groups: Group.count,
issues: Issue.count,
......
......@@ -71,16 +71,10 @@ describe Gitlab::UsageData do
deploy_keys
deployments
environments
<<<<<<< HEAD
gcp_clusters
gcp_clusters_enabled
gcp_clusters_disabled
geo_nodes
=======
clusters
clusters_enabled
clusters_disabled
>>>>>>> upstream/master
in_review_folder
groups
issues
......
......@@ -9,18 +9,13 @@ module KubernetesHelpers
kube_response(kube_pods_body)
end
<<<<<<< HEAD
def kube_deployments_response
kube_response(kube_deployments_body)
end
def stub_kubeclient_discover
WebMock.stub_request(:get, service.api_url + '/api/v1').to_return(kube_response(kube_v1_discovery_body))
WebMock.stub_request(:get, service.api_url + '/apis/extensions/v1beta1').to_return(kube_response(kube_v1beta1_discovery_body))
=======
def stub_kubeclient_discover(api_url)
WebMock.stub_request(:get, api_url + '/api/v1').to_return(kube_response(kube_v1_discovery_body))
>>>>>>> upstream/master
WebMock.stub_request(:get, api_url + '/apis/extensions/v1beta1').to_return(kube_response(kube_v1beta1_discovery_body))
end
def stub_kubeclient_pods(response = nil)
......@@ -30,13 +25,13 @@ module KubernetesHelpers
WebMock.stub_request(:get, pods_url).to_return(response || kube_pods_response)
end
<<<<<<< HEAD
def stub_kubeclient_deployments(response = nil)
stub_kubeclient_discover
deployments_url = service.api_url + "/apis/extensions/v1beta1/namespaces/#{service.actual_namespace}/deployments"
WebMock.stub_request(:get, deployments_url).to_return(response || kube_deployments_response)
=======
end
def stub_kubeclient_get_secrets(api_url, **options)
WebMock.stub_request(:get, api_url + '/api/v1/secrets')
.to_return(kube_response(kube_v1_secrets_body(options)))
......@@ -63,7 +58,6 @@ module KubernetesHelpers
}
]
}
>>>>>>> upstream/master
end
def kube_v1_discovery_body
......@@ -71,8 +65,8 @@ module KubernetesHelpers
"kind" => "APIResourceList",
"resources" => [
{ "name" => "pods", "namespaced" => true, "kind" => "Pod" },
<<<<<<< HEAD
{ "name" => "deployments", "namespaced" => true, "kind" => "Deployment" }
{ "name" => "deployments", "namespaced" => true, "kind" => "Deployment" },
{ "name" => "secrets", "namespaced" => true, "kind" => "Secret" }
]
}
end
......@@ -82,10 +76,8 @@ module KubernetesHelpers
"kind" => "APIResourceList",
"resources" => [
{ "name" => "pods", "namespaced" => true, "kind" => "Pod" },
{ "name" => "deployments", "namespaced" => true, "kind" => "Deployment" }
=======
{ "name" => "deployments", "namespaced" => true, "kind" => "Deployment" },
{ "name" => "secrets", "namespaced" => true, "kind" => "Secret" }
>>>>>>> upstream/master
]
}
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment