Skip to content

Commit d175b7c

Browse files
authored
Merge pull request #553 from oracle/bread-crumb
Fix bread crumb printing
2 parents 99fec13 + 81f267b commit d175b7c

File tree

7 files changed

+41
-5
lines changed

7 files changed

+41
-5
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,11 @@ public StartNamespacesStep(Collection<String> targetNamespaces) {
240240
this.targetNamespaces = targetNamespaces;
241241
}
242242

243+
@Override
244+
protected String getDetail() {
245+
return String.join(",", targetNamespaces);
246+
}
247+
243248
@Override
244249
public NextAction apply(Packet packet) {
245250
// check for any existing resources and add the watches on them

operator/src/main/java/oracle/kubernetes/operator/calls/AsyncRequestStep.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ public AsyncRequestStep(
7070
next.setPrevious(this);
7171
}
7272

73+
@Override
74+
protected String getDetail() {
75+
return requestParams.call;
76+
}
77+
7378
@Override
7479
public NextAction apply(Packet packet) {
7580
// clear out earlier results

operator/src/main/java/oracle/kubernetes/operator/helpers/RollingHelper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ private RollingStep(Map<String, StepAndPacket> rolling, Step next) {
6363
this.rolling = rolling;
6464
}
6565

66+
@Override
67+
protected String getDetail() {
68+
return String.join(",", rolling.keySet());
69+
}
70+
6671
@Override
6772
public NextAction apply(Packet packet) {
6873
DomainPresenceInfo info = packet.getSPI(DomainPresenceInfo.class);

operator/src/main/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStep.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import java.util.ArrayList;
88
import java.util.Collection;
9+
import java.util.List;
910
import java.util.Map;
1011
import java.util.concurrent.ConcurrentHashMap;
1112
import oracle.kubernetes.operator.ProcessingConstants;
@@ -31,6 +32,15 @@ public ManagedServerUpIteratorStep(Collection<ServerStartupInfo> c, Step next) {
3132
this.c = c;
3233
}
3334

35+
@Override
36+
protected String getDetail() {
37+
List<String> serversToStart = new ArrayList<>();
38+
for (ServerStartupInfo ssi : c) {
39+
serversToStart.add(ssi.serverConfig.getName());
40+
}
41+
return String.join(",", serversToStart);
42+
}
43+
3444
@Override
3545
public NextAction apply(Packet packet) {
3646
Collection<StepAndPacket> startDetails = new ArrayList<>();

operator/src/main/java/oracle/kubernetes/operator/steps/ServerDownIteratorStep.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public List<String> getServersToStop() {
3131
return Collections.unmodifiableList(serverNames);
3232
}
3333

34+
@Override
35+
protected String getDetail() {
36+
return String.join(",", getServersToStop());
37+
}
38+
3439
@Override
3540
public NextAction apply(Packet packet) {
3641
Collection<StepAndPacket> startDetails = new ArrayList<>();

operator/src/main/java/oracle/kubernetes/operator/work/Fiber.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,13 +828,13 @@ private synchronized void writeBreadCrumb(StringBuilder sb) {
828828
BreadCrumb previous = null;
829829
while (it.hasNext()) {
830830
BreadCrumb bc = it.next();
831-
if (previous != null) {
832-
sb.append(previous.isMarker() ? "][" : ",");
833-
}
834-
previous = bc;
835831
if (!bc.isMarker()) {
832+
if (previous != null) {
833+
sb.append(previous.isMarker() ? "][" : ",");
834+
}
836835
bc.writeTo(sb);
837836
}
837+
previous = bc;
838838
}
839839
sb.append(']');
840840
}

operator/src/main/java/oracle/kubernetes/operator/work/Step.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ String getName() {
7171
if (idx >= 0) {
7272
name = name.substring(idx + 1, name.length());
7373
}
74-
return name.endsWith("Step") ? name.substring(0, name.length() - 4) : name;
74+
name = name.endsWith("Step") ? name.substring(0, name.length() - 4) : name;
75+
String detail = getDetail();
76+
return detail != null ? name + "(" + detail + ")" : name;
77+
}
78+
79+
protected String getDetail() {
80+
return null;
7581
}
7682

7783
/**

0 commit comments

Comments
 (0)