Skip to content

Commit abe619e

Browse files
committed
Removed "all" value that would remove all domain related resources in a cluster; Moved the sh script to kubernetes/samples/scripts/.
1 parent d175b7c commit abe619e

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ public static void createRBACPoliciesForWLDFScaling() throws Exception {
728728
public static void deleteWeblogicDomainResources(String domainUid) throws Exception {
729729
StringBuilder cmd =
730730
new StringBuilder(BaseTest.getProjectRoot())
731-
.append("/kubernetes/delete-weblogic-domain-resources.sh ")
731+
.append("/kubernetes/samples/scripts/delete-weblogic-domain-resources.sh ")
732732
.append("-d ")
733733
.append(domainUid);
734734
logger.info("Running " + cmd);

kubernetes/delete-weblogic-domain-resources.sh renamed to kubernetes/samples/scripts/delete-weblogic-domain-resources.sh

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ cat << EOF
2929
or all resources were deleted (default $default_maxwaitsecs seconds).
3030
3131
The domains can be specified as a comma-separated list of
32-
domain-uids (no spaces), or the keyword 'all'. The domains can be
33-
located in any kubernetes namespace.
32+
domain-uids (no spaces). The domains can be located in any
33+
kubernetes namespace.
3434
3535
Specify '-t' to run the script in a test mode which will
3636
show kubernetes commands but not actually perform them.
@@ -73,18 +73,14 @@ EOF
7373
#
7474
function getDomainResources {
7575
local domain_regex=''
76-
if [ "$1" = "all" ]; then
77-
LABEL_SELECTOR="weblogic.domainUID"
78-
else
79-
LABEL_SELECTOR="weblogic.domainUID in ($1)"
80-
IFS=',' read -ra UIDS <<< "$1"
81-
for i in "${!UIDS[@]}"; do
82-
if [ $i -gt 0 ]; then
83-
domain_regex="$domain_regex|"
84-
fi
85-
domain_regex="$domain_regex^Domain ${UIDS[$i]} "
86-
done
87-
fi
76+
LABEL_SELECTOR="weblogic.domainUID in ($1)"
77+
IFS=',' read -ra UIDS <<< "$1"
78+
for i in "${!UIDS[@]}"; do
79+
if [ $i -gt 0 ]; then
80+
domain_regex="$domain_regex|"
81+
fi
82+
domain_regex="$domain_regex^Domain ${UIDS[$i]} "
83+
done
8884

8985
# clean the output file
9086
if [ -e $2 ]; then
@@ -122,7 +118,6 @@ function getDomainResources {
122118
#
123119
# Usage:
124120
# deleteDomains domainA,domainB,... maxwaitsecs
125-
# deleteDomains all maxwaitsecs
126121
#
127122
# Internal helper function
128123
# This function first sets the serverStartPolicy of each Domain to NEVER
@@ -131,9 +126,7 @@ function getDomainResources {
131126
# any remaining k8s resources for domain $1 (including any remaining pods)
132127
# and retries these direct deletes up to $2 seconds.
133128
#
134-
# If $1 has special value "all", it deletes all domains in all namespaces.
135-
#
136-
# If global $test_mode is true, it shows candidate actions but doesn't
129+
# If global $test_mode is true, it shows candidate actions but doesn't
137130
# actually perform them
138131
#
139132
function deleteDomains {

0 commit comments

Comments
 (0)