Commit b8cf41bc authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'security-gcp-token-exposed-by-kubernetes' into 'master'

[master] - Do not persist errors from Kubernetes calls

See merge request gitlab/gitlabhq!2506
parents a04c4ae3 6f0b7a39
...@@ -14,8 +14,8 @@ module Clusters ...@@ -14,8 +14,8 @@ module Clusters
else else
check_timeout check_timeout
end end
rescue Kubeclient::HttpError => ke rescue Kubeclient::HttpError
app.make_errored!("Kubernetes error: #{ke.message}") unless app.errored? app.make_errored!("Kubernetes error") unless app.errored?
end end
private private
...@@ -27,7 +27,7 @@ module Clusters ...@@ -27,7 +27,7 @@ module Clusters
end end
def on_failed def on_failed
app.make_errored!(installation_errors || 'Installation silently failed') app.make_errored!('Installation failed')
ensure ensure
remove_installation_pod remove_installation_pod
end end
......
...@@ -12,10 +12,10 @@ module Clusters ...@@ -12,10 +12,10 @@ module Clusters
ClusterWaitForAppInstallationWorker.perform_in( ClusterWaitForAppInstallationWorker.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => ke rescue Kubeclient::HttpError
app.make_errored!("Kubernetes error: #{ke.message}") app.make_errored!("Kubernetes error.")
rescue StandardError => e rescue StandardError
app.make_errored!("Can't start installation process. #{e.message}") app.make_errored!("Can't start installation process.")
end end
end end
end end
......
...@@ -82,7 +82,7 @@ describe Clusters::Applications::CheckInstallationProgressService do ...@@ -82,7 +82,7 @@ describe Clusters::Applications::CheckInstallationProgressService do
service.execute service.execute
expect(application).to be_errored expect(application).to be_errored
expect(application.status_reason).to eq(errors) expect(application.status_reason).to eq("Installation failed")
end end
end end
......
...@@ -42,7 +42,7 @@ describe Clusters::Applications::InstallService do ...@@ -42,7 +42,7 @@ describe Clusters::Applications::InstallService do
service.execute service.execute
expect(application).to be_errored expect(application).to be_errored
expect(application.status_reason).to match(/kubernetes error:/i) expect(application.status_reason).to match('Kubernetes error.')
end end
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