50
50
DEFAULT_IMAGE_PULL_SECRETS = PASSWORD_TOKEN
51
51
DEFAULT_SOURCE_TYPE = 'Image'
52
52
53
- MULTI_KEYS = {
54
- 'spec/adminServer/adminService/channels' : 'channelName' ,
55
- 'spec/clusters' : 'clusterName'
56
- }
57
-
58
53
_secret_pattern = re .compile ("@@SECRET:([\\ w.-]+):[\\ w.-]+@@" )
59
54
60
55
@@ -107,10 +102,10 @@ def _create_domain_resource_dictionary(self):
107
102
108
103
schema = wko_schema_helper .get_domain_resource_schema (ExceptionType .DEPLOY )
109
104
110
- self ._process_folder (kubernetes_map , schema , resource_dict , None )
105
+ self ._process_object (kubernetes_map , schema , resource_dict , None )
111
106
return resource_dict
112
107
113
- def _process_folder (self , model_dict , schema_folder , target_dict , schema_path ):
108
+ def _process_object (self , model_dict , schema_folder , target_dict , schema_path ):
114
109
"""
115
110
Transfer folders and attributes from the model dictionary to the target domain resource dictionary.
116
111
:param model_dict: the source model dictionary
@@ -128,14 +123,14 @@ def _process_folder(self, model_dict, schema_folder, target_dict, schema_path):
128
123
if not wko_schema_helper .is_unsupported_folder (next_schema_path ):
129
124
next_target_dict = PyOrderedDict ()
130
125
target_dict [key ] = next_target_dict
131
- self ._process_folder (model_value , properties , next_target_dict , next_schema_path )
126
+ self ._process_object (model_value , properties , next_target_dict , next_schema_path )
132
127
133
128
elif wko_schema_helper .is_object_array (properties ):
134
129
next_schema_path = wko_schema_helper .append_path (schema_path , key )
135
130
if not wko_schema_helper .is_unsupported_folder (next_schema_path ):
136
131
item_info = wko_schema_helper .get_array_item_info (properties )
137
132
target_dict [key ] = \
138
- self ._process_multiple_folder (model_value , item_info , next_schema_path )
133
+ self ._process_object_array (model_value , item_info , next_schema_path )
139
134
140
135
elif wko_schema_helper .is_simple_map (properties ):
141
136
# map of key / value pairs
@@ -146,18 +141,17 @@ def _process_folder(self, model_dict, schema_folder, target_dict, schema_path):
146
141
property_type = wko_schema_helper .get_type (properties )
147
142
target_dict [key ] = _get_target_value (model_value , property_type )
148
143
149
- def _process_multiple_folder (self , model_value , item_info , schema_path ):
144
+ def _process_object_array (self , model_value , item_info , schema_path ):
150
145
"""
151
- Process a multiple-element model section.
152
- There should be a list of objects, each representing a sub-folder.
146
+ Process an array of objects.
153
147
:param model_value: the model contents for a folder
154
148
:param item_info: describes the contents of the sub-folder for each element
155
149
:param schema_path: the path of schema elements (no multi-element names), used for supported check
156
150
"""
157
151
child_list = list ()
158
- for name_map in model_value :
152
+ for object_map in model_value :
159
153
next_target_dict = PyOrderedDict ()
160
- self ._process_folder ( name_map , item_info , next_target_dict , schema_path )
154
+ self ._process_object ( object_map , item_info , next_target_dict , schema_path )
161
155
child_list .append (next_target_dict )
162
156
return child_list
163
157
0 commit comments