File tree Expand file tree Collapse file tree 3 files changed +56
-2
lines changed Expand file tree Collapse file tree 3 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # Copyright (c) 2017, 2021 , Oracle and/or its affiliates.
2
+ # Copyright (c) 2017, 2022 , Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4
4
5
5
# script parameters
@@ -135,6 +135,13 @@ for i in json.load(sys.stdin)["groups"]:
135
135
INPUT
136
136
domain_api_version=` echo ${APIS} | python cmds-$$ .py 2>> ${log_file_name} `
137
137
fi
138
+
139
+ # This script only supports up to version v8 of Domain resource
140
+ version=$( echo " ${domain_api_version} " | grep -Eo ' [0-9]+$' )
141
+ if [ -n " ${version} " ] && [ " $version " -gt 8 ]; then
142
+ trace " Setting domain_api_version from $domain_api_version to v8"
143
+ domain_api_version=" v8"
144
+ fi
138
145
echo " $domain_api_version "
139
146
}
140
147
Original file line number Diff line number Diff line change
1
+ {
2
+ "kind" : " APIGroupList" ,
3
+ "apiVersion" : " v1" ,
4
+ "groups" : [
5
+ {
6
+ "name" : " weblogic.oracle" ,
7
+ "versions" : [
8
+ {
9
+ "groupVersion" : " weblogic.oracle/v9" ,
10
+ "version" : " v9"
11
+ },
12
+ {
13
+ "groupVersion" : " weblogic.oracle/v8" ,
14
+ "version" : " v8"
15
+ },
16
+ {
17
+ "groupVersion" : " weblogic.oracle/v1" ,
18
+ "version" : " v1"
19
+ }
20
+ ],
21
+ "preferredVersion" : {
22
+ "groupVersion" : " weblogic.oracle/v9" ,
23
+ "version" : " v9"
24
+ }
25
+ }
26
+ ]
27
+ }
28
+
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # Copyright (c) 2021, Oracle and/or its affiliates.
2
+ # Copyright (c) 2021, 2022 Oracle and/or its affiliates.
3
3
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
4
4
5
5
TEST_OPERATOR_ROOT=/tmp/test/weblogic-operator
@@ -44,6 +44,25 @@ test_get_domain_api_version_jq() {
44
44
assertEquals " Did not return expected api version" ' v8' " ${result} "
45
45
}
46
46
47
+ test_get_domain_api_version_set_to_v8 () {
48
+ CURL_FILE=" apis3.json"
49
+
50
+ result=$( get_domain_api_version)
51
+
52
+ assertEquals " Did not return expected api version" ' v8' " ${result} "
53
+ }
54
+
55
+ test_get_domain_api_version_set_to_v8_jq () {
56
+ skip_if_jq_not_installed
57
+
58
+ CURL_FILE=" apis3.json"
59
+
60
+ result=$( get_domain_api_version)
61
+
62
+ assertEquals " Did not return expected api version" ' v8' " ${result} "
63
+ }
64
+
65
+
47
66
test_get_domain_api_version_without_weblogic_group () {
48
67
CURL_FILE=" apis2.json"
49
68
You can’t perform that action at this time.
0 commit comments