Skip to content

Commit

Permalink
fix(deleteOp): Set received GracePeriod value to the operation itself (
Browse files Browse the repository at this point in the history
…#5624)

* fix(deleteOp): Set received GracePeriod value to the operation itself

* chore(deleteOp): Handle GracePeriod parse

* fix(deleteOp): Import log dependencies

Co-authored-by: Digital On Us <[email protected]>
  • Loading branch information
AdanUrbanReyesArmory and Digital On Us committed Feb 8, 2022
1 parent cb31a6f commit f3b3934
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<OperationResult> {
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";
Expand Down Expand Up @@ -68,7 +72,13 @@ public OperationResult operate(List<OperationResult> 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 -> {
Expand Down

0 comments on commit f3b3934

Please sign in to comment.