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
54c70a77
Commit
54c70a77
authored
Nov 28, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static analysys
parent
f6d9dcf8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+1
-0
app/models/project.rb
app/models/project.rb
+1
-1
spec/features/projects/clusters/interchangeability_spec.rb
spec/features/projects/clusters/interchangeability_spec.rb
+3
-3
spec/features/projects/environments/environments_spec.rb
spec/features/projects/environments/environments_spec.rb
+1
-1
No files found.
app/models/clusters/platforms/kubernetes.rb
View file @
54c70a77
...
...
@@ -134,6 +134,7 @@ module Clusters
kubeclient
.
get_pods
(
namespace:
actual_namespace
).
as_json
rescue
KubeException
=>
err
raise
err
unless
err
.
error_code
==
404
[]
end
...
...
app/models/project.rb
View file @
54c70a77
...
...
@@ -905,7 +905,7 @@ class Project < ActiveRecord::Base
# TODO: This will be extended for multiple enviroment clusters
# TODO: Add super nice tests to check this interchangeability
def
deployment_platform
@deployment_platform
||=
clusters
.
where
(
enabled:
true
).
first
&
.
platform_kubernetes
@deployment_platform
||=
clusters
.
find_by
(
enabled:
true
)
&
.
platform_kubernetes
@deployment_platform
||=
services
.
where
(
category: :deployment
).
reorder
(
nil
).
find_by
(
active:
true
)
end
...
...
spec/features/projects/clusters/interchangeability_spec.rb
View file @
54c70a77
require
'spec_helper'
feature
'Interchangeability between KubernetesService and Platform::Kubernetes'
do
EXCEPT_METHODS
=
%i[test title description help fields initialize_properties namespace namespace= api_url api_url=]
EXCEPT_METHODS_GREP_V
=
%w[_touched? _changed? _was]
EXCEPT_METHODS
=
%i[test title description help fields initialize_properties namespace namespace= api_url api_url=]
.
freeze
EXCEPT_METHODS_GREP_V
=
%w[_touched? _changed? _was]
.
freeze
it
'Clusters::Platform::Kubernetes covers core interfaces in KubernetesService'
do
expected_interfaces
=
KubernetesService
.
instance_methods
(
false
)
...
...
@@ -10,7 +10,7 @@ feature 'Interchangeability between KubernetesService and Platform::Kubernetes'
EXCEPT_METHODS_GREP_V
.
each
do
|
g
|
expected_interfaces
=
expected_interfaces
.
grep_v
(
/
#{
Regexp
.
escape
(
g
)
}
\z/
)
end
expect
(
expected_interfaces
-
Clusters
::
Platforms
::
Kubernetes
.
instance_methods
).
to
be_empty
end
end
spec/features/projects/environments/environments_spec.rb
View file @
54c70a77
...
...
@@ -225,7 +225,7 @@ feature 'Environments page', :js do
end
end
end
context
'when user configured kubernetes from Integration > Kubernetes'
do
let
(
:project
)
{
create
(
:kubernetes_project
,
:test_repo
)
}
...
...
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