Make ingress to use install_command
This commit is contained in:
parent
c42786021c
commit
1625adf5ba
|
@ -35,6 +35,10 @@ module Clusters
|
|||
def chart
|
||||
'stable/nginx-ingress'
|
||||
end
|
||||
|
||||
def install_command
|
||||
Gitlab::Kubernetes::Helm::InstallCommand.new(name, false, chart)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,9 +23,19 @@ describe Clusters::Applications::Ingress do
|
|||
expect(subject.status_name).to be(:not_installable)
|
||||
end
|
||||
|
||||
context 'when application helm is defined' do
|
||||
context 'when application helm is scheduled' do
|
||||
before do
|
||||
create(:cluster_applications_ingress, cluster: cluster)
|
||||
create(:cluster_applications_helm, :scheduled, cluster: cluster)
|
||||
end
|
||||
|
||||
it 'defaults to :not_installable' do
|
||||
expect(subject.status_name).to be(:not_installable)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when application helm is installed' do
|
||||
before do
|
||||
create(:cluster_applications_helm, :installed, cluster: cluster)
|
||||
end
|
||||
|
||||
it 'defaults to :installable' do
|
||||
|
@ -34,6 +44,12 @@ describe Clusters::Applications::Ingress do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#install_command' do
|
||||
it 'has all the needed information' do
|
||||
expect(subject.install_command).to have_attributes(name: subject.name, install_helm: false, chart: subject.chart)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'status state machine' do
|
||||
describe '#make_installing' do
|
||||
subject { create(:cluster_applications_ingress, :scheduled) }
|
||||
|
|
Loading…
Reference in New Issue