dtk_crd_parser 0.0.65 → 0.0.66
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 14cb8b6840a9bb45fdec7260dba197da1f9f226db3e0cb62a2a530b3ea5afd35
|
4
|
+
data.tar.gz: e6cc5b1e1022a41d861457ec53c2d5ea6b1290e25f8a5a033951962a39e543a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3a504f02fabefbff2cb8481426fe262efdcb3e4ad86097957483067e3c656cfe53b0b261396ae34227893727bcfc0c4461b842ddd4d5cd00f43846f4ba1a48
|
7
|
+
data.tar.gz: db828df65b4f1731655341107d4aa9ce50efe3e2e1266baf096bac69f0155c69dc035ff4eb6ca3984bd40b1ad26fc4aa3d909b8866c665395d5cf4eccdc989cf
|
@@ -1,14 +1,14 @@
|
|
1
1
|
module DTK::CrdParser
|
2
2
|
class ExecutableAction < BaseClass
|
3
3
|
|
4
|
-
attr_reader :entrypoint, :bash_script, :name, :type
|
5
|
-
|
6
4
|
def initialize(params)
|
7
5
|
@name = params[:name]
|
8
6
|
@entrypoint = params[:entrypoint]
|
9
7
|
@type = params[:type]
|
10
8
|
@bash_script = params[:bash_script]
|
11
9
|
end
|
10
|
+
|
11
|
+
attr_reader :entrypoint, :bash_script, :name, :type
|
12
12
|
|
13
13
|
private
|
14
14
|
|
data/lib/crd_parser/component.rb
CHANGED
@@ -13,23 +13,21 @@ module DTK::CrdParser
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.create_from_kube(client, component_instance, component_name)
|
16
|
-
component_name.gsub!('_', '-')
|
17
16
|
component_instance_obj = client.get_component(component_instance[:name], component_instance[:namespace])
|
18
17
|
component_def = ComponentDef.create_from_kube(client, component_instance_obj, component_name)
|
19
18
|
component_attributes = getComponentAttributes(component_name, component_instance_obj[:spec][:components])
|
20
19
|
attributes = []
|
21
|
-
|
22
|
-
|
23
|
-
attributes.push Attribute.create_from_kube(attribute_name, attribute_value)
|
24
|
-
end
|
20
|
+
(component_attributes || []).to_hash.each do |attribute_name, attribute_value|
|
21
|
+
attributes.push Attribute.create_from_kube(attribute_name, attribute_value)
|
25
22
|
end
|
26
|
-
|
23
|
+
Component.new(component_name, component_def, attributes)
|
27
24
|
end
|
28
25
|
|
29
26
|
|
30
27
|
protected
|
31
28
|
|
32
29
|
def self.getComponentAttributes(fullComponentName, components)
|
30
|
+
fullComponentName.gsub!('_', '-')
|
33
31
|
component = components.each do |component|
|
34
32
|
componentObj = component[fullComponentName]
|
35
33
|
if(componentObj && componentObj.is_a?(Kubeclient::Resource))
|
@@ -1,9 +1,6 @@
|
|
1
1
|
module DTK::CrdParser
|
2
2
|
class Component
|
3
3
|
class Attribute < BaseClass
|
4
|
-
|
5
|
-
attr_reader :name, :value
|
6
|
-
|
7
4
|
def initialize(name, value)
|
8
5
|
@name = fail_if_nil(name, 'Attribute.name')
|
9
6
|
@value = fail_if_nil(value, 'Attribute.value')
|
@@ -13,6 +10,10 @@ module DTK::CrdParser
|
|
13
10
|
Attribute.new(attribute_name, attribute_value)
|
14
11
|
end
|
15
12
|
|
13
|
+
protected
|
14
|
+
|
15
|
+
attr_reader :name, :value
|
16
|
+
|
16
17
|
end
|
17
18
|
end
|
18
19
|
end
|
@@ -5,7 +5,6 @@ module DTK::CrdParser
|
|
5
5
|
|
6
6
|
MODE_DEFAULT = :component_instance
|
7
7
|
attr_reader :name, :namespace, :executable_actions, :attribute_type_info
|
8
|
-
|
9
8
|
def initialize(metadata, componentDefActions, componentDefAttributes)
|
10
9
|
@name = fail_if_nil(metadata[:name], 'metadata[:name]')
|
11
10
|
@namespace = fail_if_nil(metadata[:namespace], 'metadata[:namespace]')
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module DTK::CrdParser
|
2
2
|
class ComponentDef
|
3
3
|
class AttributeTypeInfo < BaseClass
|
4
|
-
|
5
|
-
attr_reader :name, :type, :required, :dynamic
|
6
|
-
|
7
4
|
def initialize(params)
|
5
|
+
|
8
6
|
@name = params[:name]
|
9
7
|
@type = params[:type]
|
10
8
|
@required = params[:required] || false
|
@@ -15,6 +13,9 @@ module DTK::CrdParser
|
|
15
13
|
AttributeTypeInfo.new(attribute)
|
16
14
|
end
|
17
15
|
|
16
|
+
protected
|
17
|
+
|
18
|
+
attr_reader :name
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
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.
|
4
|
+
version: 0.0.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DTK
|
@@ -46,8 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
requirements: []
|
49
|
-
|
50
|
-
rubygems_version: 2.4.5.4
|
49
|
+
rubygems_version: 3.0.3
|
51
50
|
signing_key:
|
52
51
|
specification_version: 4
|
53
52
|
summary: Parse kubernetes DTK crd to ruby in memory object!
|