Class: Gitlab::QA::Component::GitalyCluster::GitalyClusterConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/qa/component/gitaly_cluster.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ GitalyClusterConfig

rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 17

def initialize(params = {}) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
  @gitlab_name = params[:gitlab_name] || 'gitlab-gitaly-cluster'
  @network = params[:network] || Runtime::Env.docker_network
  @airgapped_network = params[:airgapped_network] || false

  @praefect_node_name = params[:praefect_node_name] || 'praefect'
  @praefect_port = params[:praefect_port] || 2305

  @primary_node_name = params[:primary_node_name] || 'gitaly1'
  @primary_node_port = params[:primary_node_port] || 8075

  @secondary_node_name = params[:secondary_node_name] || 'gitaly2'
  @secondary_node_port = params[:secondary_node_port] || 8075

  @tertiary_node_name = params[:tertiary_node_name] || 'gitaly3'
  @tertiary_node_port = params[:tertiary_node_port] || 8075

  @database_node_name = params[:database_node_name] || 'postgres'
  @database_port = params[:database_port] || 5432

  @praefect_addr = "#{praefect_node_name}.#{network}"
  @primary_node_addr = "#{primary_node_name}.#{network}"
  @secondary_node_addr = "#{secondary_node_name}.#{network}"
  @tertiary_node_addr = "#{tertiary_node_name}.#{network}"
  @database_node_addr = "#{database_node_name}.#{network}"
end

Instance Attribute Details

#airgapped_networkObject

Returns the value of attribute airgapped_network.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def airgapped_network
  @airgapped_network
end

#database_node_addrObject (readonly)

Returns the value of attribute database_node_addr.



15
16
17
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 15

def database_node_addr
  @database_node_addr
end

#database_node_nameObject

Returns the value of attribute database_node_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def database_node_name
  @database_node_name
end

#database_portObject

Returns the value of attribute database_port.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def database_port
  @database_port
end

#gitlab_nameObject

Returns the value of attribute gitlab_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def gitlab_name
  @gitlab_name
end

#networkObject

Returns the value of attribute network.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def network
  @network
end

#praefect_addrObject (readonly)

Returns the value of attribute praefect_addr.



15
16
17
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 15

def praefect_addr
  @praefect_addr
end

#praefect_ipObject

Returns the value of attribute praefect_ip.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def praefect_ip
  @praefect_ip
end

#praefect_node_nameObject

Returns the value of attribute praefect_node_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def praefect_node_name
  @praefect_node_name
end

#praefect_portObject

Returns the value of attribute praefect_port.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def praefect_port
  @praefect_port
end

#primary_node_addrObject (readonly)

Returns the value of attribute primary_node_addr.



15
16
17
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 15

def primary_node_addr
  @primary_node_addr
end

#primary_node_nameObject

Returns the value of attribute primary_node_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def primary_node_name
  @primary_node_name
end

#primary_node_portObject

Returns the value of attribute primary_node_port.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def primary_node_port
  @primary_node_port
end

#secondary_node_addrObject (readonly)

Returns the value of attribute secondary_node_addr.



15
16
17
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 15

def secondary_node_addr
  @secondary_node_addr
end

#secondary_node_nameObject

Returns the value of attribute secondary_node_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def secondary_node_name
  @secondary_node_name
end

#secondary_node_portObject

Returns the value of attribute secondary_node_port.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def secondary_node_port
  @secondary_node_port
end

#tertiary_node_addrObject (readonly)

Returns the value of attribute tertiary_node_addr.



15
16
17
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 15

def tertiary_node_addr
  @tertiary_node_addr
end

#tertiary_node_nameObject

Returns the value of attribute tertiary_node_name.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def tertiary_node_name
  @tertiary_node_name
end

#tertiary_node_portObject

Returns the value of attribute tertiary_node_port.



8
9
10
# File 'lib/gitlab/qa/component/gitaly_cluster.rb', line 8

def tertiary_node_port
  @tertiary_node_port
end