Commit 4a573ca6 authored by Kerri Miller's avatar Kerri Miller

Merge branch 'issue_324629_kubernetes' into 'master'

Fix Gitlab/DelegatePredicateMethods offenses

See merge request gitlab-org/gitlab!76000
parents ee93f13c afbe48aa
......@@ -2,7 +2,6 @@
Gitlab/DelegatePredicateMethods:
Exclude:
- app/models/clusters/cluster.rb
- app/models/clusters/platforms/kubernetes.rb
- app/models/concerns/ci/metadatable.rb
- app/models/concerns/integrations/base_data_fields.rb
- app/models/concerns/resolvable_discussion.rb
......
......@@ -50,12 +50,6 @@ module Clusters
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: {
unknown_authorization: nil,
rbac: 1,
......@@ -66,6 +60,19 @@ module Clusters
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)
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'KUBE_URL', value: api_url)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment