File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
operator/src/main/java/oracle/kubernetes/operator Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,11 @@ public void receivedResponse(Watch.Response<V1Job> item) {
83
83
case "ADDED" :
84
84
case "MODIFIED" :
85
85
V1Job job = item .object ;
86
- Boolean isComplete = isComplete (job ) || isFailed (job );
86
+ Boolean isComplete = isComplete (job );
87
+ Boolean isFailed = isFailed (job );
87
88
String jobName = job .getMetadata ().getName ();
88
- if (isComplete ) {
89
- Complete complete = completeCallbackRegistrations .remove (jobName );
89
+ if (isComplete || isFailed ) {
90
+ Complete complete = completeCallbackRegistrations .get (jobName );
90
91
if (complete != null ) {
91
92
complete .isComplete (job );
92
93
}
@@ -150,6 +151,11 @@ private WaitForJobReadyStep(V1Job job, Step next) {
150
151
this .job = job ;
151
152
}
152
153
154
+ boolean shouldProcessJob (V1Job job ) {
155
+ return (this .job .getMetadata ().getCreationTimestamp ().getMillis ()
156
+ == job .getMetadata ().getCreationTimestamp ().getMillis ());
157
+ }
158
+
153
159
@ Override
154
160
public NextAction apply (Packet packet ) {
155
161
if (isComplete (job )) {
@@ -165,6 +171,10 @@ public NextAction apply(Packet packet) {
165
171
(fiber ) -> {
166
172
Complete complete =
167
173
(V1Job job ) -> {
174
+ if (!shouldProcessJob (job )) {
175
+ return ;
176
+ }
177
+ completeCallbackRegistrations .remove (job .getMetadata ().getName ());
168
178
if (didResume .compareAndSet (false , true )) {
169
179
LOGGER .fine ("Job status: " + job .getStatus ());
170
180
packet .put (ProcessingConstants .DOMAIN_INTROSPECTOR_JOB , job );
You can’t perform that action at this time.
0 commit comments