2525import oracle .weblogic .kubernetes .actions .impl .Domain ;
2626import oracle .weblogic .kubernetes .actions .impl .Exec ;
2727import oracle .weblogic .kubernetes .actions .impl .Namespace ;
28+ import oracle .weblogic .kubernetes .actions .impl .Nginx ;
29+ import oracle .weblogic .kubernetes .actions .impl .NginxParams ;
2830import oracle .weblogic .kubernetes .actions .impl .Operator ;
2931import oracle .weblogic .kubernetes .actions .impl .OperatorParams ;
3032import oracle .weblogic .kubernetes .actions .impl .PersistentVolume ;
3133import oracle .weblogic .kubernetes .actions .impl .PersistentVolumeClaim ;
3234import oracle .weblogic .kubernetes .actions .impl .Secret ;
3335import oracle .weblogic .kubernetes .actions .impl .Service ;
3436import oracle .weblogic .kubernetes .actions .impl .ServiceAccount ;
35- import oracle .weblogic .kubernetes .actions .impl .Traefik ;
36- import oracle .weblogic .kubernetes .actions .impl .TraefikParams ;
3737import oracle .weblogic .kubernetes .actions .impl .primitive .Docker ;
3838import oracle .weblogic .kubernetes .actions .impl .primitive .Helm ;
3939import oracle .weblogic .kubernetes .actions .impl .primitive .HelmParams ;
4545// detail impl classes - tests would only ever call methods in here, never
4646// directly call the methods in the impl classes
4747public class TestActions {
48-
4948 // ---------------------- operator ---------------------------------
5049
5150 /**
5251 * Install WebLogic Kubernetes Operator.
5352 *
54- * @param params operator parameters for helm values
53+ * @param params operator parameters for Helm values
5554 * @return true if the operator is successfully installed, false otherwise.
5655 */
5756 public static boolean installOperator (OperatorParams params ) {
@@ -61,7 +60,7 @@ public static boolean installOperator(OperatorParams params) {
6160 /**
6261 * Upgrade existing Operator release.
6362 *
64- * @param params operator parameters for helm values
63+ * @param params operator parameters for Helm values
6564 * @return true if the operator is successfully upgraded, false otherwise.
6665 */
6766 public static boolean upgradeOperator (OperatorParams params ) {
@@ -83,7 +82,7 @@ public static boolean scaleDomain(String domainUid, String clusterName, int numO
8382 /**
8483 * Uninstall the Operator release.
8584 *
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
8786 * @return true on success, false otherwise
8887 */
8988
@@ -192,26 +191,52 @@ public static boolean patchDomainCustomResource(String domainUid, String namespa
192191 return Domain .patchDomainCustomResource (domainUid , namespace , patch , patchFormat );
193192 }
194193
195- // ------------------------ ingress controller ----------------------
194+ // ------------------------ Ingress Controller ----------------------
196195
197196 /**
198- * Install Traefik Operator .
197+ * Install NGINX ingress controller .
199198 *
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
201201 * @return true on success, false otherwise
202202 */
203- public static boolean installTraefik ( TraefikParams params ) {
204- return Traefik .install (params );
203+ public static boolean installNginx ( NginxParams params ) {
204+ return Nginx .install (params );
205205 }
206206
207207 /**
208- * Create Treafik Ingress .
208+ * Create an ingress for the WebLogic domain with domainUid in the specified domain namespace .
209209 *
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
211214 * @return true on success, false otherwise
215+ * @throws ApiException if Kubernetes client API call fails
212216 */
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 );
215240 }
216241
217242 // ------------------------- namespaces -------------------------------
@@ -454,7 +479,7 @@ public static boolean deleteClusterRoleBinding(String name) {
454479 return ClusterRoleBinding .delete (name );
455480 }
456481
457- // ----------------------- helm -----------------------------------
482+ // ----------------------- Helm -----------------------------------
458483
459484 /**
460485 * List releases.
@@ -535,6 +560,19 @@ public static JsonObject createDockerConfigJson(String username, String password
535560 return Docker .createDockerConfigJson (username , password , email , registry );
536561 }
537562
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+
538576 // ----------------------- Execute a Command ---------------------------
539577
540578 /**
0 commit comments