25
25
import oracle .weblogic .kubernetes .actions .impl .Domain ;
26
26
import oracle .weblogic .kubernetes .actions .impl .Exec ;
27
27
import oracle .weblogic .kubernetes .actions .impl .Namespace ;
28
+ import oracle .weblogic .kubernetes .actions .impl .Nginx ;
29
+ import oracle .weblogic .kubernetes .actions .impl .NginxParams ;
28
30
import oracle .weblogic .kubernetes .actions .impl .Operator ;
29
31
import oracle .weblogic .kubernetes .actions .impl .OperatorParams ;
30
32
import oracle .weblogic .kubernetes .actions .impl .PersistentVolume ;
31
33
import oracle .weblogic .kubernetes .actions .impl .PersistentVolumeClaim ;
32
34
import oracle .weblogic .kubernetes .actions .impl .Secret ;
33
35
import oracle .weblogic .kubernetes .actions .impl .Service ;
34
36
import oracle .weblogic .kubernetes .actions .impl .ServiceAccount ;
35
- import oracle .weblogic .kubernetes .actions .impl .Traefik ;
36
- import oracle .weblogic .kubernetes .actions .impl .TraefikParams ;
37
37
import oracle .weblogic .kubernetes .actions .impl .primitive .Docker ;
38
38
import oracle .weblogic .kubernetes .actions .impl .primitive .Helm ;
39
39
import oracle .weblogic .kubernetes .actions .impl .primitive .HelmParams ;
45
45
// detail impl classes - tests would only ever call methods in here, never
46
46
// directly call the methods in the impl classes
47
47
public class TestActions {
48
-
49
48
// ---------------------- operator ---------------------------------
50
49
51
50
/**
52
51
* Install WebLogic Kubernetes Operator.
53
52
*
54
- * @param params operator parameters for helm values
53
+ * @param params operator parameters for Helm values
55
54
* @return true if the operator is successfully installed, false otherwise.
56
55
*/
57
56
public static boolean installOperator (OperatorParams params ) {
@@ -61,7 +60,7 @@ public static boolean installOperator(OperatorParams params) {
61
60
/**
62
61
* Upgrade existing Operator release.
63
62
*
64
- * @param params operator parameters for helm values
63
+ * @param params operator parameters for Helm values
65
64
* @return true if the operator is successfully upgraded, false otherwise.
66
65
*/
67
66
public static boolean upgradeOperator (OperatorParams params ) {
@@ -83,7 +82,7 @@ public static boolean scaleDomain(String domainUid, String clusterName, int numO
83
82
/**
84
83
* Uninstall the Operator release.
85
84
*
86
- * @param params the parameters to helm uninstall command, release name and namespace
85
+ * @param params the parameters to Helm uninstall command, release name and namespace
87
86
* @return true on success, false otherwise
88
87
*/
89
88
@@ -192,26 +191,52 @@ public static boolean patchDomainCustomResource(String domainUid, String namespa
192
191
return Domain .patchDomainCustomResource (domainUid , namespace , patch , patchFormat );
193
192
}
194
193
195
- // ------------------------ ingress controller ----------------------
194
+ // ------------------------ Ingress Controller ----------------------
196
195
197
196
/**
198
- * Install Traefik Operator .
197
+ * Install NGINX ingress controller .
199
198
*
200
- * @param params parameters for helm values
199
+ * @param params the parameters to Helm install command, such as release name, namespace, repo url,
200
+ * repo name and chart name
201
201
* @return true on success, false otherwise
202
202
*/
203
- public static boolean installTraefik ( TraefikParams params ) {
204
- return Traefik .install (params );
203
+ public static boolean installNginx ( NginxParams params ) {
204
+ return Nginx .install (params );
205
205
}
206
206
207
207
/**
208
- * Create Treafik Ingress .
208
+ * Create an ingress for the WebLogic domain with domainUid in the specified domain namespace .
209
209
*
210
- * @param valuesYaml values yaml file to be used
210
+ * @param domainNamespace the WebLogic domain namespace in which to create the ingress
211
+ * @param domainUid WebLogic domainUid which is backend to the ingress
212
+ * @param clusterName the name of the WebLogic domain cluster
213
+ * @param managedServerPort the port number of the WebLogic domain managed servers
211
214
* @return true on success, false otherwise
215
+ * @throws ApiException if Kubernetes client API call fails
212
216
*/
213
- public static boolean createIngress (String valuesYaml ) {
214
- return Traefik .createIngress (valuesYaml );
217
+ public static boolean createIngress (String domainNamespace , String domainUid , String clusterName ,
218
+ int managedServerPort ) throws ApiException {
219
+ return Nginx .createIngress (domainNamespace , domainUid , clusterName , managedServerPort );
220
+ }
221
+
222
+ /**
223
+ * Upgrade NGINX release.
224
+ *
225
+ * @param params the parameters to Helm upgrade command, such as release name and http/https nodeport
226
+ * @return true on success, false otherwise
227
+ */
228
+ public static boolean upgradeNginx (NginxParams params ) {
229
+ return Nginx .upgrade (params );
230
+ }
231
+
232
+ /**
233
+ * Uninstall the NGINX release.
234
+ *
235
+ * @param params the parameters to Helm uninstall command, such as release name and namespace
236
+ * @return true on success, false otherwise
237
+ */
238
+ public static boolean uninstallNginx (HelmParams params ) {
239
+ return Nginx .uninstall (params );
215
240
}
216
241
217
242
// ------------------------- namespaces -------------------------------
@@ -454,7 +479,7 @@ public static boolean deleteClusterRoleBinding(String name) {
454
479
return ClusterRoleBinding .delete (name );
455
480
}
456
481
457
- // ----------------------- helm -----------------------------------
482
+ // ----------------------- Helm -----------------------------------
458
483
459
484
/**
460
485
* List releases.
@@ -535,6 +560,19 @@ public static JsonObject createDockerConfigJson(String username, String password
535
560
return Docker .createDockerConfigJson (username , password , email , registry );
536
561
}
537
562
563
+ // ------------------------ Ingress -------------------------------------
564
+
565
+ /**
566
+ * Get a list of ingress names in the specified namespace.
567
+ *
568
+ * @param namespace in which to list all the ingresses
569
+ * @return list of ingress names in the specified namespace
570
+ * @throws ApiException if Kubernetes client API call fails
571
+ */
572
+ public static List <String > getIngressList (String namespace ) throws ApiException {
573
+ return Nginx .getIngressList (namespace );
574
+ }
575
+
538
576
// ----------------------- Execute a Command ---------------------------
539
577
540
578
/**
0 commit comments