dtk_crd_parser 0.0.16 → 0.0.17
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/attribute.rb +2 -0
- data/lib/crd_parser/component.rb +6 -8
- data/lib/crd_parser.rb +1 -4
- 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: d8ac9bb2c72b3650f6b468368aa2fc440bf5cc11b38ed52ceab866092c9452f3
|
4
|
+
data.tar.gz: 59702f0be958039a5cf6d7de0693adbc4b682c431868cc1cec4a8f8684789788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7db87a04555da9c090f4621c01f7fe6da9a140e2b926412f43cf1b9450f392829fbffb1aef2e5fd70f55ef3cad7b5ee1a313155160dade9200091c3748f58ab2
|
7
|
+
data.tar.gz: 1a4b871a9a8d3010cb026c37068b641df6a584428750b60c5e82012908957080e9ef26179c88211fb774ce2e94ae6851d75ac076b7ae43577ba51caafd70caa0
|
data/lib/crd_parser/component.rb
CHANGED
@@ -10,30 +10,28 @@ module DTK::CrdParser
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.create_from_kube(client, component_instance, component_name)
|
13
|
-
puts 'Component instance object :'
|
14
13
|
component_instance_obj = client.get_component(component_instance[:name], component_instance[:namespace])
|
15
|
-
puts component_instance_obj
|
16
14
|
component_def = ComponentDef.create_from_kube(client, component_instance_obj, component_name)
|
17
|
-
puts '
|
18
|
-
puts component_def
|
15
|
+
puts 'GET..'
|
19
16
|
component_attributes = getComponentAttributes(component_name, component_instance_obj[:spec][:components])
|
20
|
-
|
17
|
+
|
21
18
|
attributes = []
|
22
19
|
component_attributes.each do |attr|
|
23
20
|
attributes.push Attribute.create_from_kube(attr)
|
24
21
|
end
|
25
|
-
puts 'Attributes are:'
|
26
|
-
puts attributes
|
27
22
|
Component.new(component_name, component_def, attributes)
|
28
23
|
end
|
29
24
|
|
30
25
|
protected
|
31
26
|
|
32
27
|
def self.getComponentAttributes(fullComponentName, components)
|
33
|
-
puts '
|
28
|
+
puts 'COMPONENT ATTRIBUTES'
|
34
29
|
fullComponentName.gsub!('_', '-')
|
30
|
+
puts 'COMPONENTS'
|
35
31
|
component = components.each do |component|
|
32
|
+
puts component
|
36
33
|
componentObj = component[fullComponentName]
|
34
|
+
puts componentObj
|
37
35
|
if(componentObj && componentObj.is_a?(Kubeclient::Resource))
|
38
36
|
return componentObj[:attributes]
|
39
37
|
end
|
data/lib/crd_parser.rb
CHANGED
@@ -9,10 +9,7 @@ module DTK
|
|
9
9
|
#component instance has a name and a namespace
|
10
10
|
#client is kube client
|
11
11
|
#component name is, for example, network-aws::vpc[vpc1]
|
12
|
-
|
13
|
-
comp = Component.create_from_kube(client, component_instance, component_name)
|
14
|
-
puts comp
|
15
|
-
comp
|
12
|
+
Component.create_from_kube(client, component_instance, component_name)
|
16
13
|
end
|
17
14
|
end
|
18
15
|
end
|