Remove un-used method
We stopped calling the fallback so we can remove this now
This commit is contained in:
parent
a2cd33d1ba
commit
25ba11a2aa
|
@ -85,11 +85,6 @@ class Deployment < ApplicationRecord
|
||||||
Commit.truncate_sha(sha)
|
Commit.truncate_sha(sha)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deprecated - will be replaced by a persisted cluster_id
|
|
||||||
def deployment_platform_cluster
|
|
||||||
environment.deployment_platform&.cluster
|
|
||||||
end
|
|
||||||
|
|
||||||
def execute_hooks
|
def execute_hooks
|
||||||
deployment_data = Gitlab::DataBuilder::Deployment.build(self)
|
deployment_data = Gitlab::DataBuilder::Deployment.build(self)
|
||||||
project.execute_services(deployment_data, :deployment_hooks)
|
project.execute_services(deployment_data, :deployment_hooks)
|
||||||
|
|
|
@ -322,32 +322,4 @@ describe Deployment do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#deployment_platform_cluster' do
|
|
||||||
let(:deployment) { create(:deployment) }
|
|
||||||
let(:project) { deployment.project }
|
|
||||||
let(:environment) { deployment.environment }
|
|
||||||
|
|
||||||
subject { deployment.deployment_platform_cluster }
|
|
||||||
|
|
||||||
before do
|
|
||||||
expect(project).to receive(:deployment_platform)
|
|
||||||
.with(environment: environment.name).and_call_original
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'project has no deployment platform' do
|
|
||||||
before do
|
|
||||||
expect(project.clusters).to be_empty
|
|
||||||
end
|
|
||||||
|
|
||||||
it { is_expected.to be_nil }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'project has a deployment platform' do
|
|
||||||
let!(:cluster) { create(:cluster, projects: [project]) }
|
|
||||||
let!(:platform) { create(:cluster_platform_kubernetes, cluster: cluster) }
|
|
||||||
|
|
||||||
it { is_expected.to eq cluster }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue