Skip to content

Commit 6abeef0

Browse files
authored
Update WKO domain resource schema (#770)
* JIRA WDT-488 - Update default API version * JIRA WDT-488 - Allow hyphenated list in YAML output * JIRA WDT-488 - Add spec / configuration, including model / domainType and secrets * JIRA WDT-488 - Read WKO domain resource schema * JIRA WDT-488 - Verify types and structure of WKO domain resource schema; build a complete model * JIRA WDT-488 - Rename unit test * JIRA WDT-488 - Use v8 schema * JIRA WDT-488 - Add metadata and top-level attributes to schema * JIRA WDT-488 - Use flag for hyphenated YAML output instead of type classes * JIRA WDT-488 - Revised validator and extractor to use schema * JIRA WDT-488 - Added blank lines at end of files * JIRA WDT-488 - Updated kubernetes validator to log more issues * JIRA WDT-488 - Add empty property sets for unsupported folders * JIRA WDT-488 - Use WKO schema for modelHelp in kubernetes section * JIRA WDT-488 - Remove kubernetes aliases and references * JIRA WDT-488 - Avoid list attribute check in kubernetes section * JIRA WDT-488 - Improve checks for unsupported folders * JIRA WDT-488 - Refactore type checks in WKO schema * JIRA WDT-488 - Refactor extractor to use type check methods * JIRA WDT-488 - Refactor kubernetes help to use WKO helper methods * JIRA WDT-488 - Corrected spelling
1 parent 136831b commit 6abeef0

File tree

21 files changed

+14502
-427
lines changed

21 files changed

+14502
-427
lines changed

core/src/main/python/compare_model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from wlsdeploy.aliases.alias_constants import ALIAS_LIST_TYPES
3737
from wlsdeploy.aliases.aliases import Aliases
3838
from wlsdeploy.aliases.location_context import LocationContext
39+
from wlsdeploy.aliases.model_constants import KUBERNETES
3940
from wlsdeploy.aliases.wlst_modes import WlstModes
4041
from wlsdeploy.exception import exception_helper
4142
from wlsdeploy.exception.expection_types import ExceptionType
@@ -265,6 +266,9 @@ def _parse_change_path(self, path):
265266
path_tokens = path.split(PATH_TOKEN)
266267
folder_names = self.aliases.get_model_section_top_level_folder_names(path_tokens[0])
267268

269+
if path_tokens[0] == KUBERNETES:
270+
return None, None
271+
268272
for path_token in path_tokens[1:]:
269273
attribute_names = self.aliases.get_model_attribute_names(location)
270274

@@ -713,11 +717,11 @@ def main():
713717
sys.exit(exit_code)
714718
except CompareException, ce:
715719
cla_helper.clean_up_temp_files()
716-
_logger.severe('WLSDPLY-05704', ce.getLocalizedMessage())
720+
_logger.severe('WLSDPLY-05704', ce.getLocalizedMessage(), class_name=_class_name, method_name=_method_name)
717721
System.exit(2)
718722
except PyWLSTException, pe:
719723
cla_helper.clean_up_temp_files()
720-
_logger.severe('WLSDPLY-05704', pe.getLocalizedMessage())
724+
_logger.severe('WLSDPLY-05704', pe.getLocalizedMessage(), class_name=_class_name, method_name=_method_name)
721725
System.exit(2)
722726
except:
723727
exc_type, exc_obj, exc_tb = sys.exc_info()

core/src/main/python/extract_resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
The entry point for the extractDomainResource tool.
66
"""
7-
import os
87
import sys
98

109
from oracle.weblogic.deploy.deploy import DeployException
@@ -66,6 +65,7 @@ def __process_args(args):
6665
cla_helper.validate_variable_file_exists(_program_name, argument_map)
6766
cla_helper.process_encryption_args(argument_map)
6867

68+
argument_map[CommandLineArgUtil.VALIDATION_METHOD] = CommandLineArgUtil.LAX_VALIDATION_METHOD
6969
model_context = model_context_helper.create_context(_program_name, argument_map)
7070
model_context.set_ignore_missing_archive_entries(True)
7171
return model_context

core/src/main/python/wlsdeploy/aliases/alias_entries.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,11 @@
5454
from wlsdeploy.aliases.model_constants import DOMAIN_INFO_ALIAS
5555
from wlsdeploy.aliases.model_constants import JOLT_CONNECTION_POOL
5656
from wlsdeploy.aliases.model_constants import JPA
57-
from wlsdeploy.aliases.model_constants import KUBERNETES
58-
from wlsdeploy.aliases.model_constants import KUBERNETES_ALIAS
5957
from wlsdeploy.aliases.model_constants import ODL_CONFIGURATION
6058
from wlsdeploy.aliases.model_constants import OHS
6159
from wlsdeploy.aliases.model_constants import RCU_DB_INFO
6260
from wlsdeploy.aliases.model_constants import RESOURCE_MANAGER
6361
from wlsdeploy.aliases.model_constants import RESOURCES
64-
from wlsdeploy.aliases.model_constants import SERVER_POD
6562
from wlsdeploy.aliases.model_constants import SYSTEM_COMPONENT
6663
from wlsdeploy.aliases.model_constants import TOPOLOGY
6764
from wlsdeploy.aliases.model_constants import WLS_ROLES
@@ -160,25 +157,16 @@ class AliasEntries(object):
160157
WLS_USER_PASSWORD_CREDENTIAL_MAPPINGS
161158
]
162159

163-
__kubernetes_top_level_folders = [
164-
'metadata',
165-
'spec'
166-
]
167-
168160
__section_top_folders_map = {
169161
DOMAIN_INFO: __domain_info_top_level_folders,
170162
TOPOLOGY: __topology_top_level_folders,
171163
RESOURCES: __resources_top_level_folders,
172-
APP_DEPLOYMENTS: __app_deployments_top_level_folders,
173-
KUBERNETES: __kubernetes_top_level_folders
164+
APP_DEPLOYMENTS: __app_deployments_top_level_folders
174165
}
175166

176167
# in rare cases, the alias file name does not match the folder name
177168
__alternate_alias_file_name_map = {
178-
APPLICATION: 'AppDeployment',
179-
'metadata': 'Metadata',
180-
'spec': 'Spec',
181-
'serverPod': 'ServerPod'
169+
APPLICATION: 'AppDeployment'
182170
}
183171

184172
# all the categories that appear at the top of model sections
@@ -187,19 +175,16 @@ class AliasEntries(object):
187175
__top_model_categories.extend(__resources_top_level_folders)
188176
__top_model_categories.extend(__app_deployments_top_level_folders)
189177
__top_model_categories.extend(__domain_info_top_level_folders)
190-
__top_model_categories.extend(__kubernetes_top_level_folders)
191178

192179
# all the categories, including section-attribute and contained categories
193180
__all_model_categories = []
194181
__all_model_categories.extend(__top_model_categories)
195182

196183
# include contained categories
197184
__all_model_categories.append(RESOURCE_MANAGER)
198-
__all_model_categories.append(SERVER_POD)
199185

200186
# include section attribute categories
201187
__all_model_categories.append(DOMAIN_INFO_ALIAS)
202-
__all_model_categories.append(KUBERNETES_ALIAS)
203188

204189
__domain_name_token = 'DOMAIN'
205190

@@ -309,9 +294,6 @@ def get_model_section_attribute_location(self, section_name):
309294
if section_name == DOMAIN_INFO:
310295
return LocationContext().append_location(DOMAIN_INFO_ALIAS)
311296

312-
if section_name == KUBERNETES:
313-
return LocationContext().append_location(KUBERNETES_ALIAS)
314-
315297
return None
316298

317299
def get_model_subfolder_names_for_location(self, location):

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
JOLT_CONNECTION_POOL = 'JoltConnectionPool'
165165
KEY = 'Key'
166166
KUBERNETES = 'kubernetes'
167-
KUBERNETES_ALIAS = 'Kubernetes'
168167
LDAP_AUTHENTICATOR = 'LDAPAuthenticator'
169168
LDAP_X509_IDENTITY_ASSERTER = 'LDAPX509IdentityAsserter'
170169
LIBRARY = 'Library'
@@ -261,7 +260,6 @@
261260
SERVER = 'Server'
262261
SERVER_FAILURE_TRIGGER = 'ServerFailureTrigger'
263262
SERVER_GROUP_TARGETING_LIMITS = 'ServerGroupTargetingLimits'
264-
SERVER_POD = 'serverPod'
265263
SERVER_NAME_PREFIX = 'ServerNamePrefix'
266264
SERVER_NAME_START_IDX = 'ServerNameStartingIndex'
267265
SERVER_START = 'ServerStart'

0 commit comments

Comments
 (0)