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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
afbe48aa
Commit
afbe48aa
authored
Dec 11, 2021
by
Siddharth Asthana
Committed by
Kerri Miller
Dec 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Gitlab/DelegatePredicateMethods offenses
parent
70a1dc76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
.rubocop_todo/gitlab/delegate_predicate_methods.yml
.rubocop_todo/gitlab/delegate_predicate_methods.yml
+0
-1
app/models/clusters/platforms/kubernetes.rb
app/models/clusters/platforms/kubernetes.rb
+13
-6
No files found.
.rubocop_todo/gitlab/delegate_predicate_methods.yml
View file @
afbe48aa
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
Gitlab/DelegatePredicateMethods
:
Gitlab/DelegatePredicateMethods
:
Exclude
:
Exclude
:
-
app/models/clusters/cluster.rb
-
app/models/clusters/cluster.rb
-
app/models/clusters/platforms/kubernetes.rb
-
app/models/concerns/ci/metadatable.rb
-
app/models/concerns/ci/metadatable.rb
-
app/models/concerns/diff_positionable_note.rb
-
app/models/concerns/diff_positionable_note.rb
-
app/models/concerns/integrations/base_data_fields.rb
-
app/models/concerns/integrations/base_data_fields.rb
...
...
app/models/clusters/platforms/kubernetes.rb
View file @
afbe48aa
...
@@ -50,12 +50,6 @@ module Clusters
...
@@ -50,12 +50,6 @@ module Clusters
alias_attribute
:ca_pem
,
:ca_cert
alias_attribute
:ca_pem
,
:ca_cert
delegate
:enabled?
,
to: :cluster
,
allow_nil:
true
delegate
:provided_by_user?
,
to: :cluster
,
allow_nil:
true
delegate
:allow_user_defined_namespace?
,
to: :cluster
,
allow_nil:
true
alias_method
:active?
,
:enabled?
enum_with_nil
authorization_type:
{
enum_with_nil
authorization_type:
{
unknown_authorization:
nil
,
unknown_authorization:
nil
,
rbac:
1
,
rbac:
1
,
...
@@ -66,6 +60,19 @@ module Clusters
...
@@ -66,6 +60,19 @@ module Clusters
nullify_if_blank
:namespace
nullify_if_blank
:namespace
def
enabled?
!!
cluster
&
.
enabled?
end
alias_method
:active?
,
:enabled?
def
provided_by_user?
!!
cluster
&
.
provided_by_user?
end
def
allow_user_defined_namespace?
!!
cluster
&
.
allow_user_defined_namespace?
end
def
predefined_variables
(
project
:,
environment_name
:,
kubernetes_namespace:
nil
)
def
predefined_variables
(
project
:,
environment_name
:,
kubernetes_namespace:
nil
)
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
Gitlab
::
Ci
::
Variables
::
Collection
.
new
.
tap
do
|
variables
|
variables
.
append
(
key:
'KUBE_URL'
,
value:
api_url
)
variables
.
append
(
key:
'KUBE_URL'
,
value:
api_url
)
...
...
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