persistence-providers 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0c5ae39c7e695356af98828c846e6d001b4978722fa055211359ed2e748e200
4
- data.tar.gz: dfc518c46105bf60247ea68dcea66206900620e400c6f7cfc6c9967619898cfb
3
+ metadata.gz: a953df0805cd56776854b2ecc2536bd65168a09134cac2a9e19370800e2d08bf
4
+ data.tar.gz: cd8693b064bcc866ebdbbe870b258da63c4cf26ead0a844d7c6481b63f64dd37
5
5
  SHA512:
6
- metadata.gz: 1014f0eea5f7b98e6833f664cafad280dc64fb5485c7dbd6848708d4e56dcaae261d68b3ce309048ebeec9c36dba2927802f1931ec9ee5ceeeadb69a31b6cf2d
7
- data.tar.gz: 74f0e73ade33ab4e674865455b4a26645e24435cd3e6cdc846b9da1f169c36e0af84b4b22835eb570307a1b5b9a086a6fb6496e98941ff85c7e6c00bb90c7ed0
6
+ metadata.gz: 6a13cae6f9c26a52e2408e5c7f630ea85a2aab48da505b8ff35a89966a3004103ecf815bd37e618f61532e758f5576359e1a8074fe29be0010ed7e0c0a1a307b
7
+ data.tar.gz: 9059eeec1a431c6460e820afa1be83ee5a365b8df82980c528dd0397ca716d96571b4d92d0d0dd486ba4a39d3d12eda5763546929cd7341e73c5fa10ca0aee9f
@@ -3,6 +3,7 @@ require 'resolv-replace'
3
3
  module DTK::State
4
4
  class Component::Attribute::Influxdb
5
5
  class Client
6
+ INFLUXDB_SECRET_DIR = '/app/influxdb/'
6
7
  def initialize(database)
7
8
  @database = database
8
9
  @connection_parameters = return_connection_parameters
@@ -32,12 +33,16 @@ module DTK::State
32
33
  private
33
34
 
34
35
  def return_connection_parameters
35
- # TODO: change connection parameters and test inside of a pod
36
- # Change current puts methods for output with appropriate container logging
36
+ params = {}
37
+ Dir.children(INFLUXDB_SECRET_DIR).each do |file|
38
+ if (file == 'username' || file == 'password' || file == 'url')
39
+ params[file.to_sym] = File.read("#{INFLUXDB_SECRET_DIR}#{file}")
40
+ end
41
+ end
37
42
  {
38
- url: "http://ec2-54-166-246-220.compute-1.amazonaws.com:31368",
39
- username: 'root',
40
- password: 'root',
43
+ url: params[:url],
44
+ username: params[:username],
45
+ password: params[:password],
41
46
  time_precision: 'ms'
42
47
  }
43
48
  end
@@ -33,7 +33,7 @@ module DTK::State
33
33
  # The encode function we allow us to use different mappings of name, params_hash
34
34
  # to the influxdb actual measurement name and tags.
35
35
  influxdb_encoding = influxdb_encoding(params_hash, timestamp)
36
- timestamp.nil? ? timestamp = Time.now : timestamp = timestamp
36
+ timestamp = timestamp.nil? ? Time.now : timestamp
37
37
 
38
38
  data = {
39
39
  values: { value: value },
@@ -26,7 +26,7 @@ module DTK::State
26
26
  def self.get_attributes_for(namespace, crd_component_name, components, opts = {})
27
27
  output = {}
28
28
 
29
- crd_component = get(namespace, crd_component_name)
29
+ crd_component = get(namespace, crd_component_name, opts)
30
30
  crd_components = crd_component.components
31
31
 
32
32
  if components == 'all'
@@ -42,7 +42,7 @@ module DTK::State
42
42
  check_for_missing_components(crd_components, components)
43
43
  components.each do |component_name|
44
44
  matching_component = crd_components.find{ |cmp| cmp.to_hash.keys.first == component_name }
45
- component = Component.new(component_name, matching_component, crd_component, opts)
45
+ component = Component.new(component_name, matching_component[component_name], crd_component, opts)
46
46
  output.merge!(component_name => component.attributes(opts))
47
47
  end
48
48
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'persistence-providers'
3
- spec.version = '0.0.1'
3
+ spec.version = '0.0.2'
4
4
  spec.author = 'Reactor8'
5
5
  spec.email = 'support@reactor8.com'
6
6
  spec.description = %q{Persistence providers plugin}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persistence-providers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reactor8
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-24 00:00:00.000000000 Z
11
+ date: 2020-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kubeclient