Skip to content

Commit 31fb620

Browse files
Merge pull request #1038 from oracle/three-target-filters
Add separate target filters for k8s and vz
2 parents daf5367 + 6a130bf commit 31fb620

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

core/src/main/python/wlsdeploy/tool/util/filter_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
TARGET_CONFIG_TOKEN = '@@TARGET_CONFIG_DIR@@'
1919

2020
__id_filter_map = {
21+
'k8s_filter': wko_filter.filter_model,
22+
'vz_filter': wko_filter.filter_model,
2123
'wko_filter': wko_filter.filter_model
2224
}
2325

core/src/main/python/wlsdeploy/tool/util/filters/model_traverse.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
from wlsdeploy.aliases.aliases import Aliases
@@ -7,6 +7,7 @@
77
from wlsdeploy.aliases.model_constants import DOMAIN_INFO
88
from wlsdeploy.aliases.model_constants import RESOURCES
99
from wlsdeploy.aliases.model_constants import TOPOLOGY
10+
from wlsdeploy.aliases.validation_codes import ValidationCodes
1011
from wlsdeploy.logging.platform_logger import PlatformLogger
1112

1213
_class_name = 'ModelTraverse'
@@ -71,6 +72,9 @@ def traverse_folder(self, model_node, model_location):
7172
self.traverse_node(model_node, model_location)
7273

7374
def traverse_node(self, model_node, model_location):
75+
result, message = self._aliases.is_version_valid_location(model_location)
76+
if result == ValidationCodes.VERSION_INVALID:
77+
return
7478
valid_folder_names = self._aliases.get_model_subfolder_names(model_location)
7579
valid_attribute_names = self._aliases.get_model_attribute_names(model_location)
7680
self.traverse_node_elements(model_node, model_location, valid_folder_names, valid_attribute_names)

core/src/main/targetconfigs/k8s/k8s_operator_filter.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, Oracle Corporation and/or its affiliates.
1+
# Copyright (c) 2020, 2022, Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# ------------
@@ -56,15 +56,3 @@ def __cleanup_topology(model):
5656
for delthis in ['ServerStart']:
5757
if server_templates[server_template].has_key(delthis):
5858
del server_templates[server_template][delthis]
59-
else:
60-
topology['ServerTemplate'] = {}
61-
server_templates = topology['ServerTemplate']
62-
if topology.has_key('Cluster'):
63-
clusters = topology['Cluster']
64-
for cluster in clusters:
65-
server_templates[cluster] = {}
66-
server_template = server_templates[cluster]
67-
server_template['Cluster'] = cluster
68-
server_template['AutoMigrationEnabled'] = False
69-
70-

core/src/main/targetconfigs/k8s/target.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"model_filters" : {
33
"discover": [
44
{ "name": "k8s_prep", "path": "@@TARGET_CONFIG_DIR@@/k8s_operator_filter.py" },
5-
{ "id": "wko_filter" }
5+
{ "id": "k8s_filter" }
66
]
77
},
88
"variable_injectors" : {"PORT": {},"HOST": {},"URL": {}},

core/src/main/targetconfigs/vz/target.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"model_filters" : {
33
"discover": [
44
{ "name": "vz_prep", "path": "@@TARGET_CONFIG_DIR@@/vz_filter.py" },
5-
{ "id": "wko_filter" }
5+
{ "id": "vz_filter" }
66
]
77
},
88
"variable_injectors" : {"PORT": {},"HOST": {},"URL": {}},

0 commit comments

Comments
 (0)