Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-02-20 04:42:05 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-02-20 04:47:07 +0300
commitba4114d25f538d198df2f681b9cb08567494207e (patch)
tree876cf5b44ab81b25cdf30acb9ebd642778800615 /app/models/clusters
parentf0b27f9b406579a03e55fa16cbc7095009dc8c2b (diff)
Refactor ingress IP address waiting code (#42643)
Diffstat (limited to 'app/models/clusters')
-rw-r--r--app/models/clusters/applications/ingress.rb15
-rw-r--r--app/models/clusters/concerns/application_core.rb4
2 files changed, 10 insertions, 9 deletions
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb
index 5e9086aecca..418ce7d1504 100644
--- a/app/models/clusters/applications/ingress.rb
+++ b/app/models/clusters/applications/ingress.rb
@@ -5,6 +5,7 @@ module Clusters
include ::Clusters::Concerns::ApplicationCore
include ::Clusters::Concerns::ApplicationStatus
+ include AfterCommitQueue
default_value_for :ingress_type, :nginx
default_value_for :version, :nginx
@@ -15,6 +16,15 @@ module Clusters
IP_ADDRESS_FETCH_RETRIES = 3
+ state_machine :status do
+ before_transition any => [:installed] do |application|
+ application.run_after_commit do
+ ClusterWaitForIngressIpAddressWorker.perform_in(
+ ClusterWaitForIngressIpAddressWorker::INTERVAL, application.name, application.id, IP_ADDRESS_FETCH_RETRIES)
+ end
+ end
+ end
+
def chart
'stable/nginx-ingress'
end
@@ -26,11 +36,6 @@ module Clusters
def install_command
Gitlab::Kubernetes::Helm::InstallCommand.new(name, chart: chart, chart_values_file: chart_values_file)
end
-
- def post_install
- ClusterWaitForIngressIpAddressWorker.perform_in(
- ClusterWaitForIngressIpAddressWorker::INTERVAL, name, id, IP_ADDRESS_FETCH_RETRIES)
- end
end
end
end
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb
index b047fbce214..a98fa85a5ff 100644
--- a/app/models/clusters/concerns/application_core.rb
+++ b/app/models/clusters/concerns/application_core.rb
@@ -23,10 +23,6 @@ module Clusters
def name
self.class.application_name
end
-
- def post_install
- # Override for any extra work that needs to be done after install
- end
end
end
end