Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f6fa8429
Commit
f6fa8429
authored
Mar 29, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract installed cluster application scope to concern
parent
e36b203f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
8 deletions
+2
-8
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.rb
+0
-2
app/models/clusters/applications/ingress.rb
app/models/clusters/applications/ingress.rb
+0
-2
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+0
-2
app/models/clusters/applications/runner.rb
app/models/clusters/applications/runner.rb
+0
-2
app/models/clusters/concerns/application_status.rb
app/models/clusters/concerns/application_status.rb
+2
-0
No files found.
app/models/clusters/applications/helm.rb
View file @
f6fa8429
...
@@ -8,8 +8,6 @@ module Clusters
...
@@ -8,8 +8,6 @@ module Clusters
default_value_for
:version
,
Gitlab
::
Kubernetes
::
Helm
::
HELM_VERSION
default_value_for
:version
,
Gitlab
::
Kubernetes
::
Helm
::
HELM_VERSION
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Helm
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
def
set_initial_status
def
set_initial_status
return
unless
not_installable?
return
unless
not_installable?
...
...
app/models/clusters/applications/ingress.rb
View file @
f6fa8429
...
@@ -11,8 +11,6 @@ module Clusters
...
@@ -11,8 +11,6 @@ module Clusters
default_value_for
:ingress_type
,
:nginx
default_value_for
:ingress_type
,
:nginx
default_value_for
:version
,
:nginx
default_value_for
:version
,
:nginx
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Ingress
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
enum
ingress_type:
{
enum
ingress_type:
{
nginx:
1
nginx:
1
}
}
...
...
app/models/clusters/applications/prometheus.rb
View file @
f6fa8429
...
@@ -13,8 +13,6 @@ module Clusters
...
@@ -13,8 +13,6 @@ module Clusters
default_value_for
:version
,
VERSION
default_value_for
:version
,
VERSION
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Prometheus
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
state_machine
:status
do
state_machine
:status
do
after_transition
any
=>
[
:installed
]
do
|
application
|
after_transition
any
=>
[
:installed
]
do
|
application
|
application
.
cluster
.
projects
.
each
do
|
project
|
application
.
cluster
.
projects
.
each
do
|
project
|
...
...
app/models/clusters/applications/runner.rb
View file @
f6fa8429
...
@@ -14,8 +14,6 @@ module Clusters
...
@@ -14,8 +14,6 @@ module Clusters
default_value_for
:version
,
VERSION
default_value_for
:version
,
VERSION
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Runner
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
def
chart
def
chart
"
#{
name
}
/gitlab-runner"
"
#{
name
}
/gitlab-runner"
end
end
...
...
app/models/clusters/concerns/application_status.rb
View file @
f6fa8429
...
@@ -4,6 +4,8 @@ module Clusters
...
@@ -4,6 +4,8 @@ module Clusters
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
included
do
included
do
scope
:installed
,
->
{
where
(
status:
self
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
state_machine
:status
,
initial: :not_installable
do
state_machine
:status
,
initial: :not_installable
do
state
:not_installable
,
value:
-
2
state
:not_installable
,
value:
-
2
state
:errored
,
value:
-
1
state
:errored
,
value:
-
1
...
...
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