diff --git a/extended/src/main/java/io/kubernetes/client/extended/controller/builder/DefaultControllerBuilder.java b/extended/src/main/java/io/kubernetes/client/extended/controller/builder/DefaultControllerBuilder.java index 04e35cb2b7..a07fbbe568 100644 --- a/extended/src/main/java/io/kubernetes/client/extended/controller/builder/DefaultControllerBuilder.java +++ b/extended/src/main/java/io/kubernetes/client/extended/controller/builder/DefaultControllerBuilder.java @@ -104,6 +104,9 @@ public DefaultControllerBuilder withName(String controllerName) { * @return the controller builder */ public DefaultControllerBuilder withWorkQueue(RateLimitingQueue workQueue) { + if (this.workQueue != null && !this.workQueue.isShuttingDown()){ + this.workQueue.shutDown(); + } this.workQueue = workQueue; return this; }