dtk_crd_parser 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 505ba3ebe0d7ef11e0db8b7de82d4517781ba74bcac3a25f2da0cd2a77a343da
|
4
|
+
data.tar.gz: cab35dcd25589d822fe06c10927b1687366116255e04365cb2783521d6d42e35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec66cb8ea4ebe45a4dd76cecd8c48e7154d2f165522423ecf43a175beb9ebe4e38913967c500bf28e14cf7e20acc6f68296206e3f97fccd40150167aed39e87
|
7
|
+
data.tar.gz: 17637b3fb82aa7d3402d4fb805202449ba52450ea3273a5e0ccc4ba73feb712e8970262fc5a4c0a2f2f2f6eb5592818229a8390e6b7a522d21ee3f3111d51ff3
|
@@ -27,7 +27,6 @@ module DTK::CrdParser
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.destructureActionComponent(actionComponent)
|
30
|
-
puts actionComponent
|
31
30
|
# regex to match component: module::name[attrName].action
|
32
31
|
regex = /(.*)::(.*)\[(.*)\].?(.*)/
|
33
32
|
# if component on node group node, get full name first
|
data/lib/crd_parser/component.rb
CHANGED
@@ -10,13 +10,7 @@ module DTK::CrdParser
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.create_from_kube(client, component_instance, component_name)
|
13
|
-
puts component_instance
|
14
|
-
unless client.discovered
|
15
|
-
client.discover
|
16
|
-
end
|
17
|
-
puts client.methods - Object.methods
|
18
13
|
component_instance_obj = client.get_component(component_instance[:name], component_instance[:namespace])
|
19
|
-
puts component_instance_obj
|
20
14
|
component_def = ComponentDef.create_from_kube(client, component_instance_obj, component_name)
|
21
15
|
component_attributes = getComponentAttributes(component_name, component_instance_obj[:spec][:components])
|
22
16
|
attributes = []
|
@@ -17,7 +17,7 @@ module DTK::CrdParser
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.create_from_kube(client, component_instance, component_def_name)
|
20
|
-
puts '
|
20
|
+
puts 'Component def...'
|
21
21
|
module_name = destructureActionComponent(component_def_name)[:moduleName]
|
22
22
|
module_ref = resolveModuleReference(component_instance.module_refs, component_def_name, module_name)
|
23
23
|
componentDef = client.get_componentdef(component_def_name, module_ref[:namespace])
|
@@ -59,13 +59,17 @@ module DTK::CrdParser
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.destructureActionComponent(actionComponent)
|
62
|
-
puts actionComponent
|
63
62
|
# regex to match component: module::name[attrName].action
|
64
63
|
regex = /(.*)::(.*)\[(.*)\].?(.*)/
|
65
64
|
# if component on node group node, get full name first
|
66
65
|
# i.e ec2::node[ng-1]/(node-utility::ssh-access[ubuntu])
|
66
|
+
puts 'Action component is: '
|
67
|
+
puts actionComponent
|
68
|
+
puts isOnSpecificNode(actionComponent)
|
67
69
|
nodeName, actionComponent = actionComponent.match(/(.*)\/(.*)/).captures if isOnSpecificNode(actionComponent)
|
68
|
-
|
70
|
+
puts 'captures: '
|
71
|
+
puts actionComponent.match(regex)
|
72
|
+
compModule, compName, attributeName, action = actionComponent.match(regex).captures if actionComponent.match(regex)
|
69
73
|
action = !action.empty? ? action.to_sym : :create
|
70
74
|
|
71
75
|
if(compModule.nil? || compName.nil? || attributeName.nil?)
|