Skip to content

Commit

Permalink
fix(provider/kubernetes): v2 Avoid NPE for unsupported k8s kinds (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjoel authored and lwander committed Mar 28, 2018
1 parent 15e015e commit 12a0b90
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ public OperationResult operate(List _unused) {
}

KubernetesResourceProperties properties = findResourceProperties(manifest);
if (properties == null) {
throw new IllegalArgumentException("Unsupported Kubernetes object kind '" + manifest.getKind().toString() + "', unable to continue.");
}
KubernetesHandler deployer = properties.getHandler();
if (deployer == null) {
throw new IllegalArgumentException("No deployer available for Kubernetes object kind '" + manifest.getKind().toString() + "', unable to continue.");
}

getTask().updateStatus(OP_NAME, "Swapping out artifacts in " + manifest.getFullResourceName() + " from context...");
ReplaceResult replaceResult = deployer.replaceArtifacts(manifest, artifacts);
Expand Down

0 comments on commit 12a0b90

Please sign in to comment.