diff --git a/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/op/manifest/KubernetesDeleteManifestOperation.java b/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/op/manifest/KubernetesDeleteManifestOperation.java index 2a06ab92cb1..e23c43bd797 100644 --- a/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/op/manifest/KubernetesDeleteManifestOperation.java +++ b/clouddriver-kubernetes/src/main/java/com/netflix/spinnaker/clouddriver/kubernetes/op/manifest/KubernetesDeleteManifestOperation.java @@ -30,8 +30,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class KubernetesDeleteManifestOperation implements AtomicOperation { + private static final Logger log = + LoggerFactory.getLogger(KubernetesDeleteManifestOperation.class); private final KubernetesDeleteManifestDescription description; private final KubernetesCredentials credentials; private static final String OP_NAME = "DELETE_KUBERNETES_MANIFEST"; @@ -68,7 +72,13 @@ public OperationResult operate(List priorOutputs) { } else if (options.containsKey("cascading")) { deleteOptions.setOrphanDependents(options.get("cascading").equalsIgnoreCase("false")); } - + if (options.containsKey("gracePeriodSeconds")) { + try { + deleteOptions.setGracePeriodSeconds(Long.parseLong(options.get("gracePeriodSeconds"))); + } catch (NumberFormatException nfe) { + log.warn("Unable to parse gracePeriodSeconds; {}", nfe.getMessage()); + } + } OperationResult result = new OperationResult(); coordinates.forEach( c -> {