dtk_crd_parser 0.0.106 → 0.0.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89533172658ed158134bf0f487d912820a1df6fe9d9bb96a022a43309792b73a
4
- data.tar.gz: f7c30d80fa0e0f497d9894f738d38e1b19ec8553aea8db91712acca6a3dc3e8b
3
+ metadata.gz: 1a233391303f4495f2e22959a124be17cafa736dd9c4d9e2708855c56b226322
4
+ data.tar.gz: dadf79a5a916f2438554dbb3eb64af010b41f70c78f9811b00504c36f6cc1fb5
5
5
  SHA512:
6
- metadata.gz: 06a2c428191042be4d60192d4ed40458c36da6f97776db1213329cd806a6b1d51128b8288bc2591e75b7c8d083607beee5f24ac5c88bb37518441ae2f3ec0cd0
7
- data.tar.gz: e5b0e47a6079bba33c7b8f4f812c32511814e8b2a7c2181442a87c0332ea89c53c822576d73e392672cfaa366d1bc68782b22d1d16ee1eb3ccc52fa6585aa6d4
6
+ metadata.gz: 03cf8dba3a5d4d89b9299f68662846cbe7f3873518bbd86f47a698d7e54e91587a84a67654c4f98041f11d33edebdf755f59858b35a02f5c16a7f61ac860e717
7
+ data.tar.gz: b44886601604297c7e3f6e47ffdb2a12cda625a1efc2a27f24d47e98ceb60923aabc012a0e8398d85b5fb466133ca16360ab071fd9442f88cf847445adf9d993
@@ -16,14 +16,16 @@ module DTK::CrdParser
16
16
  component_obj = Component.create_from_kube(client, component_instance, component_name)
17
17
  actions = component_obj.component_def.executable_actions
18
18
  executable_actions = Hash.new
19
- actions.to_hash.each do |name, action|
20
- params = {
21
- name: name.to_s,
22
- entrypoint: action[:entrypoint] || "",
23
- type: action[:type] || "",
24
- bash_script: action[:bash_script] || ""
25
- }
26
- executable_actions[name.to_sym] = ExecutableAction.new(params)
19
+ if actions
20
+ actions.to_hash.each do |name, action|
21
+ params = {
22
+ name: name.to_s,
23
+ entrypoint: action[:entrypoint] || "",
24
+ type: action[:type] || "",
25
+ bash_script: action[:bash_script] || ""
26
+ }
27
+ executable_actions[name.to_sym] = ExecutableAction.new(params)
28
+ end
27
29
  end
28
30
  executable_actions
29
31
  end
@@ -28,6 +28,8 @@ module DTK::CrdParser
28
28
  end
29
29
 
30
30
  def decrypt_if_encrypted(data_to_decrypt, encrypted)
31
+ Logger.new('/proc/1/fd/1').info "Encrypted is: #{encrypted}"
32
+ Logger.new('/proc/1/fd/1').info "Data to decrypt is is: #{data_to_decrypt}"
31
33
  return nil unless data_to_decrypt
32
34
  return data_to_decrypt unless encrypted
33
35
  #get secret to get the key
@@ -21,7 +21,7 @@ module DTK::CrdParser
21
21
  component_attributes = getComponentAttributes(component_name, component_instance_obj[:spec][:components])
22
22
  attributes = []
23
23
  if component_attributes
24
- component_attributes.to_hash.each do |attribute_name, attribute_value|
24
+ (component_attributes.to_hash || []).each do |attribute_name, attribute_value|
25
25
  attribute_type_info = (component_def.attribute_type_info
26
26
  .select {|attribute| attribute.name == attribute_name.to_s} || []).first
27
27
  encrypted = attribute_type_info.encrypted if attribute_type_info
@@ -35,7 +35,7 @@ module DTK::CrdParser
35
35
  protected
36
36
 
37
37
  def self.getComponentAttributes(fullComponentName, components)
38
- component = components.each do |component|
38
+ component = (components || []).each do |component|
39
39
  componentObj = component[fullComponentName]
40
40
  if(componentObj && componentObj.is_a?(Kubeclient::Resource))
41
41
  return componentObj[:attributes]
@@ -28,6 +28,8 @@ module DTK::CrdParser
28
28
  resourceVersion = componentMetadata[:resourceVersion]
29
29
 
30
30
  componentDefSpec = componentDef[:spec] || {}
31
+ Logger.new('/proc/1/fd/1').info "Component def spec is: : #{componentDefSpec}"
32
+
31
33
  if destructured_component[:action] && componentDefSpec[:actions]
32
34
  componentDefAction = componentDefSpec[:actions][destructured_component[:action].to_sym]
33
35
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtk_crd_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.106
4
+ version: 0.0.107
5
5
  platform: ruby
6
6
  authors:
7
7
  - DTK