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
Léo-Paul Géneau
gitlab-ce
Commits
982e5436
Commit
982e5436
authored
Mar 29, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add installed scope to cluster applications
parent
a5f9e49f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
0 deletions
+56
-0
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.rb
+2
-0
app/models/clusters/applications/ingress.rb
app/models/clusters/applications/ingress.rb
+2
-0
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+2
-0
app/models/clusters/applications/runner.rb
app/models/clusters/applications/runner.rb
+2
-0
spec/models/clusters/applications/helm_spec.rb
spec/models/clusters/applications/helm_spec.rb
+12
-0
spec/models/clusters/applications/ingress_spec.rb
spec/models/clusters/applications/ingress_spec.rb
+12
-0
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+12
-0
spec/models/clusters/applications/runner_spec.rb
spec/models/clusters/applications/runner_spec.rb
+12
-0
No files found.
app/models/clusters/applications/helm.rb
View file @
982e5436
...
...
@@ -8,6 +8,8 @@ module Clusters
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
return
unless
not_installable?
...
...
app/models/clusters/applications/ingress.rb
View file @
982e5436
...
...
@@ -11,6 +11,8 @@ module Clusters
default_value_for
:ingress_type
,
:nginx
default_value_for
:version
,
:nginx
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Ingress
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
enum
ingress_type:
{
nginx:
1
}
...
...
app/models/clusters/applications/prometheus.rb
View file @
982e5436
...
...
@@ -13,6 +13,8 @@ module Clusters
default_value_for
:version
,
VERSION
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Prometheus
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
state_machine
:status
do
after_transition
any
=>
[
:installed
]
do
|
application
|
application
.
cluster
.
projects
.
each
do
|
project
|
...
...
app/models/clusters/applications/runner.rb
View file @
982e5436
...
...
@@ -14,6 +14,8 @@ module Clusters
default_value_for
:version
,
VERSION
scope
:installed
,
->
{
where
(
status:
::
Clusters
::
Applications
::
Runner
.
state_machines
[
:status
].
states
[
:installed
].
value
)
}
def
chart
"
#{
name
}
/gitlab-runner"
end
...
...
spec/models/clusters/applications/helm_spec.rb
View file @
982e5436
...
...
@@ -3,6 +3,18 @@ require 'rails_helper'
describe
Clusters
::
Applications
::
Helm
do
include_examples
'cluster application core specs'
,
:clusters_applications_helm
describe
'.installed'
do
subject
{
described_class
.
installed
}
let!
(
:cluster
)
{
create
(
:clusters_applications_helm
,
:installed
)
}
before
do
create
(
:clusters_applications_helm
,
:errored
)
end
it
{
is_expected
.
to
contain_exactly
(
cluster
)
}
end
describe
'#install_command'
do
let
(
:helm
)
{
create
(
:clusters_applications_helm
)
}
...
...
spec/models/clusters/applications/ingress_spec.rb
View file @
982e5436
...
...
@@ -11,6 +11,18 @@ describe Clusters::Applications::Ingress do
allow
(
ClusterWaitForIngressIpAddressWorker
).
to
receive
(
:perform_async
)
end
describe
'.installed'
do
subject
{
described_class
.
installed
}
let!
(
:cluster
)
{
create
(
:clusters_applications_ingress
,
:installed
)
}
before
do
create
(
:clusters_applications_ingress
,
:errored
)
end
it
{
is_expected
.
to
contain_exactly
(
cluster
)
}
end
describe
'#make_installed!'
do
before
do
application
.
make_installed!
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
982e5436
...
...
@@ -4,6 +4,18 @@ describe Clusters::Applications::Prometheus do
include_examples
'cluster application core specs'
,
:clusters_applications_prometheus
include_examples
'cluster application status specs'
,
:cluster_application_prometheus
describe
'.installed'
do
subject
{
described_class
.
installed
}
let!
(
:cluster
)
{
create
(
:clusters_applications_prometheus
,
:installed
)
}
before
do
create
(
:clusters_applications_prometheus
,
:errored
)
end
it
{
is_expected
.
to
contain_exactly
(
cluster
)
}
end
describe
'transition to installed'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
])
}
...
...
spec/models/clusters/applications/runner_spec.rb
View file @
982e5436
...
...
@@ -8,6 +8,18 @@ describe Clusters::Applications::Runner do
it
{
is_expected
.
to
belong_to
(
:runner
)
}
describe
'.installed'
do
subject
{
described_class
.
installed
}
let!
(
:cluster
)
{
create
(
:clusters_applications_runner
,
:installed
)
}
before
do
create
(
:clusters_applications_runner
,
:errored
)
end
it
{
is_expected
.
to
contain_exactly
(
cluster
)
}
end
describe
'#install_command'
do
let
(
:kubeclient
)
{
double
(
'kubernetes client'
)
}
let
(
:gitlab_runner
)
{
create
(
:clusters_applications_runner
,
runner:
ci_runner
)
}
...
...
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