BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3cb46142
Commit
3cb46142
authored
7 years ago
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix initial status again
parent
f96b5eae
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
helm.rb
app/models/clusters/applications/helm.rb
+4
-6
ingress.rb
app/models/clusters/applications/ingress.rb
+4
-6
application_status.rb
app/models/clusters/concerns/application_status.rb
+1
-1
No files found.
app/models/clusters/applications/helm.rb
View file @
3cb46142
...
...
@@ -11,16 +11,14 @@ module Clusters
validates
:cluster
,
presence:
true
after_initialize
:set_initial_status
def
self
.
application_name
self
.
to_s
.
demodulize
.
underscore
end
def
initial_status
if
cluster
&
.
platform_kubernetes_active?
:installable
else
:not_installable
end
def
set_initial_status
self
.
status
=
'installable'
if
cluster
&
.
platform_kubernetes_active?
end
def
name
...
...
This diff is collapsed.
Click to expand it.
app/models/clusters/applications/ingress.rb
View file @
3cb46142
...
...
@@ -12,6 +12,8 @@ module Clusters
default_value_for
:ingress_type
,
:nginx
default_value_for
:version
,
:nginx
after_initialize
:set_initial_status
enum
ingress_type:
{
nginx:
1
}
...
...
@@ -20,12 +22,8 @@ module Clusters
self
.
to_s
.
demodulize
.
underscore
end
def
initial_status
if
cluster
&
.
application_helm_installed?
:installable
else
:not_installable
end
def
set_initial_status
self
.
status
=
'installable'
if
cluster
&
.
application_helm_installed?
end
def
name
...
...
This diff is collapsed.
Click to expand it.
app/models/clusters/concerns/application_status.rb
View file @
3cb46142
...
...
@@ -4,7 +4,7 @@ module Clusters
extend
ActiveSupport
::
Concern
included
do
state_machine
:status
,
initial:
->
(
application
)
{
application
.
initial_status
}
do
state_machine
:status
,
initial:
:not_installable
do
state
:not_installable
,
value:
-
2
state
:errored
,
value:
-
1
state
:installable
,
value:
0
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment