| ... | @@ -48,6 +48,11 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
... | @@ -48,6 +48,11 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
|
|
expect(subject).to be_installed
|
|
expect(subject).to be_installed
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
context 'managed_apps_local_tiller feature flag disabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(managed_apps_local_tiller: false)
|
|
|
|
end
|
|
|
|
|
|
|
it 'updates helm version' do
|
|
it 'updates helm version' do
|
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
|
|
|
|
| ... | @@ -57,6 +62,31 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
... | @@ -57,6 +62,31 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
|
|
|
|
|
|
|
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
|
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'managed_apps_local_tiller feature flag enabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(managed_apps_local_tiller: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not update the helm version' do
|
|
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
|
|
|
|
|
|
expect do
|
|
|
|
subject.make_installed!
|
|
|
|
|
|
|
|
subject.cluster.application_helm.reload
|
|
|
|
end.not_to change { subject.cluster.application_helm.version }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'the cluster has no helm installed' do
|
|
|
|
subject { create(application_name, :installing, :no_helm_installed) }
|
|
|
|
|
|
|
|
it 'runs without errors' do
|
|
|
|
expect { subject.make_installed! }.not_to raise_error
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'sets the correct version of the application' do
|
|
it 'sets the correct version of the application' do
|
|
|
subject.update!(version: '0.0.0')
|
|
subject.update!(version: '0.0.0')
|
| ... | @@ -77,6 +107,11 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
... | @@ -77,6 +107,11 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
|
|
expect(subject).to be_updated
|
|
expect(subject).to be_updated
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
context 'managed_apps_local_tiller feature flag disabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(managed_apps_local_tiller: false)
|
|
|
|
end
|
|
|
|
|
|
|
it 'updates helm version' do
|
|
it 'updates helm version' do
|
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
|
|
|
|
| ... | @@ -86,6 +121,31 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
... | @@ -86,6 +121,31 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| |
|
|
|
|
|
|
|
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
|
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'managed_apps_local_tiller feature flag enabled' do
|
|
|
|
before do
|
|
|
|
stub_feature_flags(managed_apps_local_tiller: true)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not update the helm version' do
|
|
|
|
subject.cluster.application_helm.update!(version: '1.2.3')
|
|
|
|
|
|
|
|
expect do
|
|
|
|
subject.make_installed!
|
|
|
|
|
|
|
|
subject.cluster.application_helm.reload
|
|
|
|
end.not_to change { subject.cluster.application_helm.version }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'the cluster has no helm installed' do
|
|
|
|
subject { create(application_name, :updating, :no_helm_installed) }
|
|
|
|
|
|
|
|
it 'runs without errors' do
|
|
|
|
expect { subject.make_installed! }.not_to raise_error
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'updates the version of the application' do
|
|
it 'updates the version of the application' do
|
|
|
subject.update!(version: '0.0.0')
|
|
subject.update!(version: '0.0.0')
|
| ... | |
... | |
| ... | | ... | |