Class: Clusters::Integrations::ElasticStack

Inherits:
ApplicationRecord show all
Includes:
Concerns::ElasticsearchClient, Concerns::KubernetesLogger
Defined in:
app/models/clusters/integrations/elastic_stack.rb

Constant Summary

Constants included from Concerns::ElasticsearchClient

Concerns::ElasticsearchClient::ELASTICSEARCH_NAMESPACE, Concerns::ElasticsearchClient::ELASTICSEARCH_PORT

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Instance Method Summary collapse

Methods included from Concerns::KubernetesLogger

#log_exception, #logger

Methods included from Concerns::ElasticsearchClient

#elasticsearch_client

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

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

#available?Boolean

Returns:

  • (Boolean)

19
20
21
# File 'app/models/clusters/integrations/elastic_stack.rb', line 19

def available?
  enabled
end

#chart_above_v2?Boolean

Returns:

  • (Boolean)

27
28
29
30
31
# File 'app/models/clusters/integrations/elastic_stack.rb', line 27

def chart_above_v2?
  return true if chart_version.nil?

  Gem::Version.new(chart_version) >= Gem::Version.new('2.0.0')
end

#chart_above_v3?Boolean

Returns:

  • (Boolean)

33
34
35
36
37
# File 'app/models/clusters/integrations/elastic_stack.rb', line 33

def chart_above_v3?
  return true if chart_version.nil?

  Gem::Version.new(chart_version) >= Gem::Version.new('3.0.0')
end

#service_nameObject


23
24
25
# File 'app/models/clusters/integrations/elastic_stack.rb', line 23

def service_name
  chart_above_v3? ? 'elastic-stack-elasticsearch-master' : 'elastic-stack-elasticsearch-client'
end