|
12 | 12 | import java.nio.file.StandardOpenOption;
|
13 | 13 | import java.util.ArrayList;
|
14 | 14 | import java.util.Arrays;
|
| 15 | +import java.util.Collection; |
15 | 16 | import java.util.Collections;
|
16 | 17 | import java.util.HashMap;
|
17 | 18 | import java.util.List;
|
|
44 | 45 | import oracle.weblogic.kubernetes.assertions.impl.Cluster;
|
45 | 46 | import oracle.weblogic.kubernetes.logging.LoggingFacade;
|
46 | 47 | import oracle.weblogic.kubernetes.utils.ExecResult;
|
| 48 | +import org.awaitility.core.ConditionFactory; |
47 | 49 | import org.junit.jupiter.api.BeforeAll;
|
48 | 50 | import org.junit.jupiter.api.DisplayName;
|
49 | 51 | import org.junit.jupiter.api.Tag;
|
50 | 52 | import org.junit.jupiter.api.Test;
|
51 | 53 | import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;
|
52 | 54 |
|
53 | 55 | import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
|
| 56 | +import static java.util.concurrent.TimeUnit.MINUTES; |
| 57 | +import static java.util.concurrent.TimeUnit.SECONDS; |
54 | 58 | import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
|
55 | 59 | import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
|
56 |
| -import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_PREFIX; |
| 60 | +import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_REPO; |
57 | 61 | import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_REPO_SECRET_NAME;
|
| 62 | +import static oracle.weblogic.kubernetes.TestConstants.BASE_IMAGES_TENANCY; |
58 | 63 | import static oracle.weblogic.kubernetes.TestConstants.CLUSTER_VERSION;
|
59 | 64 | import static oracle.weblogic.kubernetes.TestConstants.DB_IMAGE_TO_USE_IN_SPEC;
|
60 | 65 | import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_API_VERSION;
|
61 | 66 | import static oracle.weblogic.kubernetes.TestConstants.DOMAIN_IMAGES_PREFIX;
|
62 | 67 | import static oracle.weblogic.kubernetes.TestConstants.ELASTICSEARCH_HOST;
|
63 | 68 | import static oracle.weblogic.kubernetes.TestConstants.FAILURE_RETRY_INTERVAL_SECONDS;
|
64 | 69 | import static oracle.weblogic.kubernetes.TestConstants.FAILURE_RETRY_LIMIT_MINUTES;
|
65 |
| -import static oracle.weblogic.kubernetes.TestConstants.FMWINFRA_IMAGE_NAME_DEFAULT; |
66 |
| -import static oracle.weblogic.kubernetes.TestConstants.FMWINFRA_IMAGE_TO_USE_IN_SPEC; |
| 70 | +import static oracle.weblogic.kubernetes.TestConstants.FMWINFRA_IMAGE_NAME; |
67 | 71 | import static oracle.weblogic.kubernetes.TestConstants.IMAGE_PULL_POLICY;
|
| 72 | +import static oracle.weblogic.kubernetes.TestConstants.KIND_REPO; |
68 | 73 | import static oracle.weblogic.kubernetes.TestConstants.OKD;
|
69 | 74 | import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
|
70 | 75 | import static oracle.weblogic.kubernetes.TestConstants.OPERATOR_CHART_DIR;
|
|
76 | 81 | import static oracle.weblogic.kubernetes.actions.TestActions.execCommand;
|
77 | 82 | import static oracle.weblogic.kubernetes.actions.TestActions.getDomainCustomResource;
|
78 | 83 | import static oracle.weblogic.kubernetes.actions.TestActions.imagePull;
|
| 84 | +import static oracle.weblogic.kubernetes.actions.TestActions.imagePush; |
79 | 85 | import static oracle.weblogic.kubernetes.actions.TestActions.imageTag;
|
80 | 86 | import static oracle.weblogic.kubernetes.actions.impl.Domain.shutdown;
|
81 | 87 | import static oracle.weblogic.kubernetes.assertions.TestAssertions.podDoesNotExist;
|
|
103 | 109 | import static oracle.weblogic.kubernetes.utils.SecretUtils.createOpsswalletpasswordSecret;
|
104 | 110 | import static oracle.weblogic.kubernetes.utils.SecretUtils.createSecretWithUsernamePassword;
|
105 | 111 | import static oracle.weblogic.kubernetes.utils.ThreadSafeLogger.getLogger;
|
| 112 | +import static org.awaitility.Awaitility.with; |
106 | 113 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
107 | 114 | import static org.junit.jupiter.api.Assertions.assertNotNull;
|
108 | 115 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
@@ -133,8 +140,15 @@ class ItFmwDomainOnPVUpgrade {
|
133 | 140 |
|
134 | 141 | private final String fmwModelFilePrefix = "model-fmwdomain-upgrade";
|
135 | 142 |
|
136 |
| - private final String imageTag1412 = "14.1.2.0.0-jdk17"; |
137 |
| - private final String image1412 = BASE_IMAGES_PREFIX + FMWINFRA_IMAGE_NAME_DEFAULT + ":" + imageTag1412; |
| 143 | + private static final String imageTag12214 = "12.2.1.4"; |
| 144 | + private static final String image12214 = FMWINFRA_IMAGE_NAME + ":" + imageTag12214; |
| 145 | + private static final String imageTag1412 = "14.1.2.0-jdk17-ol8"; |
| 146 | + private static final String image1412 = FMWINFRA_IMAGE_NAME + ":" + imageTag1412; |
| 147 | + |
| 148 | + private static ConditionFactory withVeryLongRetryPolicy |
| 149 | + = with().pollDelay(0, SECONDS) |
| 150 | + .and().with().pollInterval(10, SECONDS) |
| 151 | + .atMost(30, MINUTES).await(); |
138 | 152 |
|
139 | 153 | /**
|
140 | 154 | * Assigns unique namespaces for DB, operator and domain.
|
@@ -189,6 +203,21 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
|
189 | 203 | // create pull secrets for domainNamespace when running in non Kind Kubernetes cluster
|
190 | 204 | // this secret is used only for non-kind cluster
|
191 | 205 | createBaseRepoSecret(domainNamespace);
|
| 206 | + |
| 207 | + if (KIND_REPO != null) { |
| 208 | + Collection<String> images = new ArrayList<>(); |
| 209 | + images.add(image12214); |
| 210 | + images.add(image1412); |
| 211 | + |
| 212 | + for (String image : images) { |
| 213 | + testUntil( |
| 214 | + withVeryLongRetryPolicy, |
| 215 | + pullImageFromBaseRepoAndPushToKind(image), |
| 216 | + logger, |
| 217 | + "pullImageFromBaseRepoAndPushToKind for image {0} to be successful", |
| 218 | + image); |
| 219 | + } |
| 220 | + } |
192 | 221 | }
|
193 | 222 |
|
194 | 223 | /**
|
@@ -342,7 +371,7 @@ private void createDomain(String domainName, String startMode, String rcuSchemap
|
342 | 371 | DOMAINHOMEPREFIX,
|
343 | 372 | replicaCount,
|
344 | 373 | configuration,
|
345 |
| - FMWINFRA_IMAGE_TO_USE_IN_SPEC); |
| 374 | + image12214); |
346 | 375 |
|
347 | 376 | // Set the inter-pod anti-affinity for the domain custom resource
|
348 | 377 | setPodAntiAffinity(domain);
|
@@ -587,4 +616,11 @@ private static DomainResource createDomainResourceOnPv(String domainUid,
|
587 | 616 | return domain;
|
588 | 617 | }
|
589 | 618 |
|
| 619 | + private static Callable<Boolean> pullImageFromBaseRepoAndPushToKind(String image) { |
| 620 | + return (() -> { |
| 621 | + String kindRepoImage = KIND_REPO + image.substring(BASE_IMAGES_REPO.length() + BASE_IMAGES_TENANCY.length() + 2); |
| 622 | + return imagePull(image) && imageTag(image, kindRepoImage) && imagePush(kindRepoImage); |
| 623 | + }); |
| 624 | + } |
| 625 | + |
590 | 626 | }
|
0 commit comments