summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 06:07:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 06:07:51 +0000
commit4411353300cf8219d2b899785bc5103c549ba8cf (patch)
tree07088034176e9cf9fbbed39bf33001cf56319381
parentc3bcd285f88d6444a043c0c4f653e3749ec60d75 (diff)
downloadgitlab-ce-4411353300cf8219d2b899785bc5103c549ba8cf.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/models/clusters/concerns/application_core.rb2
-rw-r--r--spec/support/shared_examples/models/cluster_application_initial_status.rb24
-rw-r--r--spec/support/shared_examples/models/cluster_application_status_shared_examples.rb10
3 files changed, 24 insertions, 12 deletions
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb
index f6431f5bac3..b94f2b15846 100644
--- a/app/models/clusters/concerns/application_core.rb
+++ b/app/models/clusters/concerns/application_core.rb
@@ -15,7 +15,7 @@ module Clusters
def set_initial_status
return unless not_installable?
- self.status = status_states[:installable] if cluster&.application_helm_available?
+ self.status = status_states[:installable] if cluster&.application_helm_available? || Feature.enabled?(:managed_apps_local_tiller)
end
def can_uninstall?
diff --git a/spec/support/shared_examples/models/cluster_application_initial_status.rb b/spec/support/shared_examples/models/cluster_application_initial_status.rb
index 9775d87953c..030974c9aa0 100644
--- a/spec/support/shared_examples/models/cluster_application_initial_status.rb
+++ b/spec/support/shared_examples/models/cluster_application_initial_status.rb
@@ -6,8 +6,30 @@ shared_examples 'cluster application initial status specs' do
subject { described_class.new(cluster: cluster) }
+ context 'local tiller feature flag is disabled' do
+ before do
+ stub_feature_flags(managed_apps_local_tiller: false)
+ end
+
+ it 'sets a default status' do
+ expect(subject.status_name).to be(:not_installable)
+ end
+ end
+
+ context 'local tiller feature flag is enabled' do
+ before do
+ stub_feature_flags(managed_apps_local_tiller: true)
+ end
+
+ it 'sets a default status' do
+ expect(subject.status_name).to be(:installable)
+ end
+ end
+
context 'when application helm is scheduled' do
before do
+ stub_feature_flags(managed_apps_local_tiller: false)
+
create(:clusters_applications_helm, :scheduled, cluster: cluster)
end
@@ -16,7 +38,7 @@ shared_examples 'cluster application initial status specs' do
end
end
- context 'when application is scheduled' do
+ context 'when application helm is installed' do
before do
create(:clusters_applications_helm, :installed, cluster: cluster)
end
diff --git a/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb b/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
index a6653f89377..4bca37a4cd0 100644
--- a/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
+++ b/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb
@@ -1,16 +1,6 @@
# frozen_string_literal: true
shared_examples 'cluster application status specs' do |application_name|
- describe '#status' do
- let(:cluster) { create(:cluster, :provided_by_gcp) }
-
- subject { described_class.new(cluster: cluster) }
-
- it 'sets a default status' do
- expect(subject.status_name).to be(:not_installable)
- end
- end
-
describe '#status_states' do
let(:cluster) { create(:cluster, :provided_by_gcp) }