Commit 0af64d36 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix inconsistent inflection of API module

We have more instances of API so we change all remaining
Api definitions.
parent 992a7bab
...@@ -50,7 +50,7 @@ module Clusters ...@@ -50,7 +50,7 @@ module Clusters
end end
def helm_api def helm_api
@helm_api ||= Gitlab::Kubernetes::Helm::Api.new(kubeclient) @helm_api ||= Gitlab::Kubernetes::Helm::API.new(kubeclient)
end end
def install_command def install_command
......
...@@ -10,7 +10,7 @@ describe Clusters::Applications::PrometheusUpdateService do ...@@ -10,7 +10,7 @@ describe Clusters::Applications::PrometheusUpdateService do
let(:application) { create(:clusters_applications_prometheus, :installed, cluster: cluster) } let(:application) { create(:clusters_applications_prometheus, :installed, cluster: cluster) }
let(:empty_alerts_values_update_yaml) { "---\nalertmanager:\n enabled: false\nserverFiles:\n alerts: {}\n" } let(:empty_alerts_values_update_yaml) { "---\nalertmanager:\n enabled: false\nserverFiles:\n alerts: {}\n" }
let!(:patch_command) { application.patch_command(empty_alerts_values_update_yaml) } let!(:patch_command) { application.patch_command(empty_alerts_values_update_yaml) }
let(:helm_client) { instance_double(::Gitlab::Kubernetes::Helm::Api) } let(:helm_client) { instance_double(::Gitlab::Kubernetes::Helm::API) }
subject(:service) { described_class.new(application, project) } subject(:service) { described_class.new(application, project) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Kubernetes module Kubernetes
module Helm module Helm
class Api class API
def initialize(kubeclient) def initialize(kubeclient)
@kubeclient = kubeclient @kubeclient = kubeclient
@namespace = Gitlab::Kubernetes::Namespace.new( @namespace = Gitlab::Kubernetes::Namespace.new(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Kubernetes::Helm::Api do describe Gitlab::Kubernetes::Helm::API do
let(:client) { double('kubernetes client') } let(:client) { double('kubernetes client') }
let(:helm) { described_class.new(client) } let(:helm) { described_class.new(client) }
let(:gitlab_namespace) { Gitlab::Kubernetes::Helm::NAMESPACE } let(:gitlab_namespace) { Gitlab::Kubernetes::Helm::NAMESPACE }
......
...@@ -144,7 +144,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do ...@@ -144,7 +144,7 @@ describe Clusters::Applications::CheckInstallationProgressService, '#execute' do
end end
it 'removes the installation POD' do it 'removes the installation POD' do
expect_next_instance_of(Gitlab::Kubernetes::Helm::Api) do |instance| expect_next_instance_of(Gitlab::Kubernetes::Helm::API) do |instance|
expect(instance).to receive(:delete_pod!).with(kind_of(String)).once expect(instance).to receive(:delete_pod!).with(kind_of(String)).once
end end
expect(service).to receive(:remove_installation_pod).and_call_original expect(service).to receive(:remove_installation_pod).and_call_original
......
...@@ -48,7 +48,7 @@ describe Clusters::Applications::CheckUninstallProgressService do ...@@ -48,7 +48,7 @@ describe Clusters::Applications::CheckUninstallProgressService do
let(:phase) { Gitlab::Kubernetes::Pod::SUCCEEDED } let(:phase) { Gitlab::Kubernetes::Pod::SUCCEEDED }
before do before do
expect_next_instance_of(Gitlab::Kubernetes::Helm::Api) do |instance| expect_next_instance_of(Gitlab::Kubernetes::Helm::API) do |instance|
expect(instance).to receive(:delete_pod!).with(kind_of(String)).once expect(instance).to receive(:delete_pod!).with(kind_of(String)).once
end end
expect(service).to receive(:pod_phase).once.and_return(phase) expect(service).to receive(:pod_phase).once.and_return(phase)
......
...@@ -7,7 +7,7 @@ describe Clusters::Applications::InstallService do ...@@ -7,7 +7,7 @@ describe Clusters::Applications::InstallService do
let(:application) { create(:clusters_applications_helm, :scheduled) } let(:application) { create(:clusters_applications_helm, :scheduled) }
let!(:install_command) { application.install_command } let!(:install_command) { application.install_command }
let(:service) { described_class.new(application) } let(:service) { described_class.new(application) }
let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::Api) } let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::API) }
before do before do
allow(service).to receive(:install_command).and_return(install_command) allow(service).to receive(:install_command).and_return(install_command)
......
...@@ -7,7 +7,7 @@ describe Clusters::Applications::PatchService do ...@@ -7,7 +7,7 @@ describe Clusters::Applications::PatchService do
let(:application) { create(:clusters_applications_knative, :scheduled) } let(:application) { create(:clusters_applications_knative, :scheduled) }
let!(:update_command) { application.update_command } let!(:update_command) { application.update_command }
let(:service) { described_class.new(application) } let(:service) { described_class.new(application) }
let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::Api) } let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::API) }
before do before do
allow(service).to receive(:update_command).and_return(update_command) allow(service).to receive(:update_command).and_return(update_command)
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe Clusters::Applications::UninstallService, '#execute' do describe Clusters::Applications::UninstallService, '#execute' do
let(:application) { create(:clusters_applications_prometheus, :scheduled) } let(:application) { create(:clusters_applications_prometheus, :scheduled) }
let(:service) { described_class.new(application) } let(:service) { described_class.new(application) }
let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::Api) } let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::API) }
let(:worker_class) { Clusters::Applications::WaitForUninstallAppWorker } let(:worker_class) { Clusters::Applications::WaitForUninstallAppWorker }
before do before do
......
...@@ -7,7 +7,7 @@ describe Clusters::Applications::UpgradeService do ...@@ -7,7 +7,7 @@ describe Clusters::Applications::UpgradeService do
let(:application) { create(:clusters_applications_helm, :scheduled) } let(:application) { create(:clusters_applications_helm, :scheduled) }
let!(:install_command) { application.install_command } let!(:install_command) { application.install_command }
let(:service) { described_class.new(application) } let(:service) { described_class.new(application) }
let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::Api) } let(:helm_client) { instance_double(Gitlab::Kubernetes::Helm::API) }
before do before do
allow(service).to receive(:install_command).and_return(install_command) allow(service).to receive(:install_command).and_return(install_command)
......
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