Skip to content

Commit ae1357b

Browse files
committed
sync to the latest
2 parents 1110f73 + dac044c commit ae1357b

File tree

18 files changed

+198
-53
lines changed

18 files changed

+198
-53
lines changed

documentation/4.0/content/samples/azure-kubernetes-service/includes/prerequisites-01.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This sample assumes the following prerequisite environment.
44

5+
* If you don't have an [Azure subscription](https://learn.microsoft.com/en-us/azure/guides/developer/azure-developer-guide#understanding-accounts-subscriptions-and-billing), create a [free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio) before you begin.
6+
* It's recommended that the Azure identity you use to sign in and complete this article has either the [Owner](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#owner) role in the current subscription or the [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) roles in the current subscription.
7+
* If your identity has very limited role assignments, ensure you have the following role assignments in the AKS resource group and AKS node resource group.
8+
* [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) role in the resource group that runs AKS cluster. This requires asking a privileged user to assign the roles before creating resource in the resource group.
9+
* [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role in the AKS node resource group whose name starts with "MC_". This requires asking a privileged user to assign the role after the AKS instance is created.
510
* Operating System: GNU/Linux, macOS or [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
611
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
712
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.48.1.

documentation/4.0/content/samples/azure-kubernetes-service/includes/prerequisites-02.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
This sample assumes the following prerequisite environment.
44

5+
* If you don't have an [Azure subscription](https://learn.microsoft.com/en-us/azure/guides/developer/azure-developer-guide#understanding-accounts-subscriptions-and-billing), create a [free account](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio) before you begin.
6+
* It's recommended that the Azure identity you use to sign in and complete this article has either the [Owner](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#owner) role in the current subscription or the [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) roles in the current subscription.
7+
* If your identity has very limited role assignments, ensure you have [Contributor](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#contributor) role and [User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator) role in the resource group that runs the AKS cluster. This requires asking a privileged user to assign the roles before creating resources in the resource group.
58
* Operating System: GNU/Linux, macOS or [WSL2 for Windows 10](https://docs.microsoft.com/windows/wsl/install-win10).
69
* [Git](https://git-scm.com/downloads); use `git --version` to test if `git` works. This document was tested with version 2.25.1.
7-
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.39.0.
10+
* [Azure CLI](https://docs.microsoft.com/cli/azure); use `az --version` to test if `az` works. This document was tested with version 2.48.1.
811
* [Docker for Desktop](https://www.docker.com/products/docker-desktop). This document was tested with `Docker version 20.10.7`
912
* [kubectl](https://kubernetes-io-vnext-staging.netlify.com/docs/tasks/tools/install-kubectl/); use `kubectl version` to test if `kubectl` works. This document was tested with version v1.21.2.
1013
* [Helm](https://helm.sh/docs/intro/install/), version 3.1 and later; use `helm version` to check the `helm` version. This document was tested with version v3.6.2.

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItFmwDomainInPvUserCreateRcu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ void testFmwDomainOnPvUserCreatesRCUMultiImages() {
379379

380380
}
381381

382+
382383
/**
383384
* User creates RCU, Operate creates PV/PVC and FMW domain with additional WDT config map.
384385
* Verify Pod is ready and service exists for both admin server and managed servers.
@@ -492,7 +493,6 @@ private DomainCreationImage createImage(String fmwModelFile, File fmwModelPropF
492493

493494
}
494495

495-
496496
private File createWdtPropertyFile(String domainUid, String rcuSchemaPrefix) {
497497

498498
Properties p = new Properties();

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/LoggingExporter.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ public static Map<String, String> verifyLoggingExporterReady(String opNamespace,
278278
execLoggingExpStatusCheck(opNamespace, esNamespace, labelSelector, "*" + index + "*");
279279
assertNotNull(statusLine);
280280

281-
logger.info("=== statusLine return by execLoggingExpStatusCheck: {0}!", statusLine);
282-
283281
String [] parseString = statusLine.split("\\s+");
284282
assertTrue(parseString.length >= 3, index + " does not exist!");
285283
String healthStatus = parseString[0];
@@ -471,33 +469,28 @@ private static V1Service createKibanaServiceCr(LoggingExporterParams params) {
471469
private static String execLoggingExpStatusCheck(String opNamespace, String esNamespace,
472470
String labelSelector, String indexRegex) {
473471
String elasticSearchHost = "elasticsearch." + esNamespace + ".svc.cluster.local";
474-
logger.info("=== elasticSearchHost in execLoggingExpStatusCheck: {0}", elasticSearchHost);
475472
StringBuffer k8sExecCmdPrefixBuff = new StringBuffer("curl http://");
476473
String cmd = k8sExecCmdPrefixBuff
477474
.append(elasticSearchHost)
478475
.append(":")
479476
.append(ELASTICSEARCH_HTTP_PORT)
480477
.append("/_cat/indices/")
481478
.append(indexRegex).toString();
482-
logger.info("=== Command to get logging exporter status line {0}", cmd);
479+
logger.info("Command to get logging exporter status line {0}", cmd);
483480

484481
// get Operator pod name
485482
String operatorPodName = assertDoesNotThrow(() -> getOperatorPodName(OPERATOR_RELEASE_NAME, opNamespace));
486483
assertTrue(operatorPodName != null && !operatorPodName.isEmpty(), "Failed to get Operator pad name");
487-
logger.info("=== operatorPodName in execLoggingExpStatusCheck: {0}", operatorPodName);
488484

489485
int i = 0;
490486
ExecResult statusLine = null;
491487
while (i < maxIterationsPod) {
492-
logger.info("=== cmd to exec execLoggingExpStatusCheck: opNamespace: {0}, operatorPodName: {1}, cmd {2} {3}",
488+
logger.info("Command to exec execLoggingExpStatusCheck: opNamespace: {0}, operatorPodName: {1}, cmd {2} {3}",
493489
opNamespace, operatorPodName, "/bin/sh -c ", cmd);
494490
statusLine = assertDoesNotThrow(() -> execCommand(opNamespace, operatorPodName, null, true,
495491
"/bin/sh", "-c", cmd));
496492
assertNotNull(statusLine, "curl command returns null");
497493

498-
logger.info("Status.stdout(): ###{0}### for index ***{1}***", statusLine.stdout(), indexRegex);
499-
logger.info("Status.stderr(): ###{0}### for index ***{1}***", statusLine.stderr(), indexRegex);
500-
logger.info("Status.toString(): ###{0}### for index ***{1}***", statusLine.toString(), indexRegex);
501494
if (null != statusLine.stdout() && !statusLine.stdout().isEmpty()) {
502495
break;
503496
}

operator/src/main/java/oracle/kubernetes/operator/DomainProcessorImpl.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,12 @@ private boolean shouldContinue(MakeRightDomainOperation operation, DomainPresenc
385385
final DomainPresenceInfo cachedInfo = getExistingDomainPresenceInfo(liveInfo);
386386
if (isNewDomain(cachedInfo)) {
387387
return true;
388-
} else if (liveInfo.isFromOutOfDateEvent(operation, cachedInfo)
389-
|| liveInfo.isDomainProcessingHalted(cachedInfo)) {
388+
} else if (liveInfo.isFromOutOfDateEvent(operation, cachedInfo)) {
389+
return false;
390+
} else if (isDeleting(operation)) {
391+
return true;
392+
} else if (liveInfo.isDomainProcessingHalted(cachedInfo)
393+
|| hasRetriableFailureNonRetryingOperation(operation, liveInfo)) {
390394
return false;
391395
} else if (operation.isExplicitRecheck() || liveInfo.isDomainGenerationChanged(cachedInfo)) {
392396
return true;
@@ -398,7 +402,7 @@ private boolean shouldContinue(MakeRightDomainOperation operation, DomainPresenc
398402

399403
private boolean shouldContinue(MakeRightClusterOperation operation, ClusterPresenceInfo liveInfo) {
400404
final ClusterPresenceInfo cachedInfo = getExistingClusterPresenceInfo(liveInfo);
401-
if (hasDeletedClusterEventData(operation)) {
405+
if (isDeleting(operation)) {
402406
return findClusterPresenceInfo(liveInfo.getNamespace(), liveInfo.getResourceName());
403407
} else if (isNewCluster(cachedInfo)) {
404408
return true;
@@ -412,6 +416,10 @@ private boolean shouldContinue(MakeRightClusterOperation operation, ClusterPrese
412416
}
413417
}
414418

419+
private boolean hasRetriableFailureNonRetryingOperation(MakeRightDomainOperation operation, DomainPresenceInfo info) {
420+
return info.hasRetriableFailure() && !operation.isRetryOnFailure();
421+
}
422+
415423
private boolean isNewDomain(DomainPresenceInfo cachedInfo) {
416424
return Optional.ofNullable(cachedInfo).map(DomainPresenceInfo::getDomain).orElse(null) == null;
417425
}
@@ -424,11 +432,15 @@ private boolean findClusterPresenceInfo(String namespace, String clusterName) {
424432
return Optional.ofNullable(clusters.get(namespace)).orElse(Collections.emptyMap()).get(clusterName) != null;
425433
}
426434

427-
private boolean hasDeletedClusterEventData(MakeRightClusterOperation operation) {
435+
private boolean isDeleting(MakeRightClusterOperation operation) {
428436
return EventItem.CLUSTER_DELETED == getEventItem(operation);
429437
}
430438

431-
private EventItem getEventItem(MakeRightClusterOperation operation) {
439+
private boolean isDeleting(MakeRightDomainOperation operation) {
440+
return operation.isDeleting() || EventItem.DOMAIN_DELETED == getEventItem(operation);
441+
}
442+
443+
private EventItem getEventItem(MakeRightOperation operation) {
432444
return Optional.ofNullable(operation.getEventData()).map(EventData::getItem).orElse(null);
433445
}
434446

@@ -644,7 +656,7 @@ public void updateDomainStatus(@Nonnull V1PersistentVolumeClaim pvc, DomainPrese
644656
}
645657

646658
private String getPhase(@Nonnull V1PersistentVolumeClaim pvc) {
647-
return Optional.ofNullable(pvc).map(V1PersistentVolumeClaim::getStatus)
659+
return Optional.of(pvc).map(V1PersistentVolumeClaim::getStatus)
648660
.map(V1PersistentVolumeClaimStatus::getPhase).orElse(null);
649661
}
650662

operator/src/main/java/oracle/kubernetes/operator/DomainResourcesValidation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ private boolean isStranded(DomainPresenceInfo dpi) {
272272
private static void removeStrandedDomainPresenceInfo(DomainProcessor dp, DomainPresenceInfo info) {
273273
info.setDeleting(true);
274274
info.setPopulated(true);
275-
dp.createMakeRightOperation(info).withExplicitRecheck().forDeletion().withEventData(new EventData(
276-
EventItem.DOMAIN_DELETED)).execute();
275+
dp.createMakeRightOperation(info).withExplicitRecheck().forDeletion().execute();
277276
}
278277

279278
private Stream<DomainPresenceInfo> getActiveDomainPresenceInfos() {
@@ -289,9 +288,10 @@ private void activateDomain(DomainProcessor dp, DomainPresenceInfo info) {
289288
EventItem eventItem = getEventItem(info);
290289
MakeRightDomainOperation makeRight = dp.createMakeRightOperation(info).withExplicitRecheck();
291290
if (eventItem != null) {
292-
makeRight.withEventData(new EventData(eventItem)).interrupt();
291+
makeRight.withEventData(new EventData(eventItem)).interrupt().execute();
292+
} else if (!info.hasRetriableFailure()) {
293+
makeRight.execute();
293294
}
294-
makeRight.execute();
295295
}
296296

297297
private EventItem getEventItem(DomainPresenceInfo info) {

operator/src/main/java/oracle/kubernetes/operator/DomainStatusUpdater.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private boolean wasNotRolling() {
201201
/**
202202
* Creates an asynchronous step to initialize the domain status, if needed, to indicate that the operator has
203203
* seen the domain and is now working on it.
204-
* @param hasEventData tue if the make right operation is associated with an event data
204+
* @param hasEventData true if the make right operation is associated with an event.
205205
*/
206206
public static Step createStatusInitializationStep(boolean hasEventData) {
207207
return new StatusInitializationStep(hasEventData);
@@ -603,7 +603,7 @@ void addDomainEvent(DomainCondition condition) {
603603
}
604604

605605
public static class StatusInitializationStep extends DomainStatusUpdaterStep {
606-
private boolean hasEventData;
606+
private final boolean hasEventData;
607607

608608
StatusInitializationStep(boolean hasEventData) {
609609
super();

operator/src/main/java/oracle/kubernetes/operator/MakeRightClusterOperation.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Defines the operation to log a ClusterCreated/Changed/Deleted event.
1111
*/
1212
public interface MakeRightClusterOperation extends MakeRightOperation<ClusterPresenceInfo> {
13+
1314
/**
1415
* Set the event data that is associated with this operation.
1516
*
@@ -26,11 +27,4 @@ public interface MakeRightClusterOperation extends MakeRightOperation<ClusterPre
2627
MakeRightClusterOperation interrupt();
2728

2829
MakeRightClusterOperation withExplicitRecheck();
29-
30-
/**
31-
* Get the event data associated with this make-right operation.
32-
*
33-
* @return the event data.
34-
*/
35-
EventHelper.EventData getEventData();
3630
}

operator/src/main/java/oracle/kubernetes/operator/MakeRightDomainOperation.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,17 @@ public interface MakeRightDomainOperation extends MakeRightOperation<DomainPrese
4444
*/
4545
MakeRightDomainOperation interrupt();
4646

47+
/**
48+
* Modifies the factory to indicate that this is a retry operation on a retriable failure.
49+
+
50+
+ @return the updated factory
51+
*/
52+
MakeRightDomainOperation retryOnFailure();
53+
4754
boolean isDeleting();
4855

56+
boolean isRetryOnFailure();
57+
4958
void setInspectionRun();
5059

5160
void setLiveInfo(@Nonnull DomainPresenceInfo info);
@@ -99,5 +108,4 @@ static Step createStepsToRerunWithIntrospection(Packet packet) {
99108
static Optional<MakeRightDomainOperation> fromPacket(Packet packet) {
100109
return Optional.ofNullable(packet.getValue(MAKE_RIGHT_DOMAIN_OPERATION));
101110
}
102-
103111
}

operator/src/main/java/oracle/kubernetes/operator/MakeRightOperation.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import javax.annotation.Nonnull;
77

8+
import oracle.kubernetes.operator.helpers.EventHelper;
89
import oracle.kubernetes.operator.helpers.ResourcePresenceInfo;
910
import oracle.kubernetes.operator.work.Packet;
1011
import oracle.kubernetes.operator.work.PacketComponent;
@@ -15,6 +16,7 @@
1516
* or to log a ClusterCreated/Changed/Deleted event.
1617
*/
1718
public interface MakeRightOperation<T extends ResourcePresenceInfo> extends PacketComponent {
19+
1820
void execute();
1921

2022
@Nonnull
@@ -28,5 +30,12 @@ public interface MakeRightOperation<T extends ResourcePresenceInfo> extends Pack
2830

2931
boolean hasEventData();
3032

33+
/**
34+
* Get the event data associated with this make-right operation.
35+
*
36+
* @return the event data.
37+
*/
38+
EventHelper.EventData getEventData();
39+
3140
boolean isExplicitRecheck();
3241
}

0 commit comments

Comments
 (0)