Commit 6eb46fb3 authored by Nick Thomas's avatar Nick Thomas

Fix conflicts in KubernetesService and specs

parent 1ced84fe
...@@ -116,16 +116,10 @@ class KubernetesService < DeploymentService ...@@ -116,16 +116,10 @@ class KubernetesService < DeploymentService
# short time later # short time later
def terminals(environment) def terminals(environment)
with_reactive_cache do |data| with_reactive_cache do |data|
<<<<<<< HEAD
pods = filter_by_label(data[:pods], app: environment.slug)
terminals = pods.flat_map { |pod| terminals_for_pod(api_url, namespace, pod) }
terminals.each { |terminal| add_terminal_auth(terminal, terminal_auth) }
=======
pods = data.fetch(:pods, nil) pods = data.fetch(:pods, nil)
filter_pods(pods, app: environment.slug). filter_pods(pods, app: environment.slug).
flat_map { |pod| terminals_for_pod(api_url, actual_namespace, pod) }. flat_map { |pod| terminals_for_pod(api_url, actual_namespace, pod) }.
each { |terminal| add_terminal_auth(terminal, terminal_auth) } each { |terminal| add_terminal_auth(terminal, terminal_auth) }
>>>>>>> ce-com/master
end end
end end
...@@ -133,16 +127,7 @@ class KubernetesService < DeploymentService ...@@ -133,16 +127,7 @@ class KubernetesService < DeploymentService
with_reactive_cache do |data| with_reactive_cache do |data|
specs = filter_by_label(data[:deployments], app: environment.slug) specs = filter_by_label(data[:deployments], app: environment.slug)
<<<<<<< HEAD
::Gitlab::Kubernetes::RolloutStatus.from_specs(*specs) ::Gitlab::Kubernetes::RolloutStatus.from_specs(*specs)
=======
# Store as hashes, rather than as third-party types
pods = begin
kubeclient.get_pods(namespace: actual_namespace).as_json
rescue KubeException => err
raise err unless err.error_code == 404
[]
>>>>>>> ce-com/master
end end
end end
......
...@@ -7,8 +7,6 @@ describe KubernetesService, models: true, caching: true do ...@@ -7,8 +7,6 @@ describe KubernetesService, models: true, caching: true do
let(:project) { build_stubbed(:kubernetes_project) } let(:project) { build_stubbed(:kubernetes_project) }
let(:service) { project.kubernetes_service } let(:service) { project.kubernetes_service }
<<<<<<< HEAD
=======
# We use Kubeclient to interactive with the Kubernetes API. It will # We use Kubeclient to interactive with the Kubernetes API. It will
# GET /api/v1 for a list of resources the API supports. This must be stubbed # GET /api/v1 for a list of resources the API supports. This must be stubbed
# in addition to any other HTTP requests we expect it to perform. # in addition to any other HTTP requests we expect it to perform.
...@@ -27,7 +25,6 @@ describe KubernetesService, models: true, caching: true do ...@@ -27,7 +25,6 @@ describe KubernetesService, models: true, caching: true do
WebMock.stub_request(:get, pods_url).to_return(pods_response) WebMock.stub_request(:get, pods_url).to_return(pods_response)
end end
>>>>>>> ce-com/master
describe "Associations" do describe "Associations" do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
end 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