dtk_crd_parser 0.0.152 → 0.0.153
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 +4 -4
- data/lib/crd_parser/component.rb +1 -8
- data/lib/crd_parser.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7c48f2f27852ec1566c0c6124586ead52b7d7429655719e7594ef86e6603e39
|
4
|
+
data.tar.gz: 616fd38faa2f4c877c3ad141cfcf6f46cf292a895122b0e5422aa5e0179f7969
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3289649d08031a3880f8bad4c870eb8c4a1419f51d3a61a60257d9c246fbb61bc2dd37a3759dc80d0e86642f2583ccf5843e492942ef0e93dfdaf503a95cce49
|
7
|
+
data.tar.gz: b0aec48351a68831cf1b8ac8132d4e9278a8620ac63fc57e2c02b9d1799e9243e465d15f11fbe0a9f76192cc753b82d3b35bb47c4cdb16b3b2a1ed7d14467161
|
data/lib/crd_parser/component.rb
CHANGED
@@ -12,22 +12,16 @@ module DTK::CrdParser
|
|
12
12
|
@name = fail_if_nil(name, 'name')
|
13
13
|
@component_def = fail_if_nil(component_def, 'component_def') # this wil point to the corresponding component def
|
14
14
|
@attributes = attributes || [] # array that has an Attribute object for each attribute; these are name-value pairs
|
15
|
+
Logger.new('/proc/1/fd/1').info "INITIALIZED COMPONENT"
|
15
16
|
end
|
16
17
|
|
17
18
|
def self.create_from_kube(client, component_instance, component_name)
|
18
19
|
component_instance_obj = client.get_component(component_instance[:name], component_instance[:namespace])
|
19
20
|
component_def = ComponentDef.create_from_kube(client, component_instance_obj, component_name)
|
20
|
-
Logger.new('/proc/1/fd/1').info "Component def (IN PARSER): #{component_def}"
|
21
|
-
|
22
21
|
component_attributes = getComponentAttributes(component_name, component_instance_obj[:spec][:components])
|
23
|
-
Logger.new('/proc/1/fd/1').info "Component attrs (IN PARSER): #{component_attributes}"
|
24
|
-
|
25
22
|
attribute_name_value = BaseClass::Helper::ClassAndInstanceMixin.destructureActionComponent(component_name)[:attributeName]
|
26
|
-
Logger.new('/proc/1/fd/1').info "destructured attr.. #{attribute_name_value}"
|
27
|
-
|
28
23
|
attributes = []
|
29
24
|
attributes.push(Attribute.create_from_kube("name", attribute_name_value, {}))
|
30
|
-
Logger.new('/proc/1/fd/1').info "if component attributes... #{component_attributes}"
|
31
25
|
if component_attributes
|
32
26
|
(component_attributes.to_hash || []).each do |attribute_name, attribute_value|
|
33
27
|
attribute_type_info = (component_def.attribute_type_info
|
@@ -36,7 +30,6 @@ module DTK::CrdParser
|
|
36
30
|
attributes.push Attribute.create_from_kube(attribute_name, attribute_value, {encrypted: encrypted || false})
|
37
31
|
end
|
38
32
|
end
|
39
|
-
Logger.new('/proc/1/fd/1').info "FINISHED!!!"
|
40
33
|
Component.new(component_name, component_def, attributes)
|
41
34
|
end
|
42
35
|
|
data/lib/crd_parser.rb
CHANGED
@@ -11,11 +11,17 @@ module DTK
|
|
11
11
|
#component instance has a name and a namespace {name: xxx, namespace: yyy}
|
12
12
|
#client is kube client
|
13
13
|
#component name is, for example, network-aws::vpc[vpc1]
|
14
|
-
Component.create_from_kube(client, component_instance, component_name)
|
14
|
+
component = Component.create_from_kube(client, component_instance, component_name)
|
15
|
+
Logger.new('/proc/1/fd/1').error "IN PARSER #{component}"
|
16
|
+
component
|
15
17
|
end
|
16
18
|
|
17
19
|
def self.parse_crd_to_actions(client, component_instance, component_name)
|
18
|
-
|
20
|
+
Logger.new('/proc/1/fd/1').error "actions IN PARSER "
|
21
|
+
|
22
|
+
action = Action.ndxExecutableActions(client, component_instance, component_name)
|
23
|
+
Logger.new('/proc/1/fd/1').error "action is IN PARSER #{action}"
|
24
|
+
action
|
19
25
|
end
|
20
26
|
|
21
27
|
private
|