Class: Clusters::KubernetesNamespace

Inherits:
ApplicationRecord show all
Includes:
Gitlab::Kubernetes
Defined in:
app/models/clusters/kubernetes_namespace.rb

Constant Summary

Constants included from Gitlab::Kubernetes

Gitlab::Kubernetes::EXEC_COMMAND

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from ResetOnUnionError

ResetOnUnionError::MAX_RESET_PERIOD

Instance Method Summary collapse

Methods included from Gitlab::Kubernetes

#add_terminal_auth, build_header_hash, #container_exec_url, #filter_by_annotation, #filter_by_label, #filter_by_legacy_label, #filter_by_project_environment, #terminals_for_pod, #to_kubeconfig

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

Instance Method Details

#predefined_variablesObject



36
37
38
39
40
41
42
43
44
# File 'app/models/clusters/kubernetes_namespace.rb', line 36

def predefined_variables
  Gitlab::Ci::Variables::Collection.new.tap do |variables|
    variables
      .append(key: 'KUBE_SERVICE_ACCOUNT', value: .to_s)
      .append(key: 'KUBE_NAMESPACE', value: namespace.to_s)
      .append(key: 'KUBE_TOKEN', value: .to_s, public: false, masked: true)
      .append(key: 'KUBECONFIG', value: kubeconfig, public: false, file: true)
  end
end

#token_nameObject



32
33
34
# File 'app/models/clusters/kubernetes_namespace.rb', line 32

def token_name
  "#{namespace}-token"
end