fix(provider/kubernetes): v2 Fix kubectl label selector flag
Currently we set `-l=` when `labelSelectors` is null or is not empty,
causing all commands that pass a null value for `labelSelectors` to
fail.
The `-l=somelabel` flag should be set if `labelSelectors` is not null
and is not empty.
MODIFY
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/job/KubectlJobExecutor.java
clouddriver-kubernetes/src/main/groovy/com/netflix/spinnaker/clouddriver/kubernetes/v2/op/job/KubectlJobExecutor.java
@@ -404,7 +404,7 @@ public class KubectlJobExecutor {
command.add(kind.toString());
}
- if (labelSelectors == null || !labelSelectors.isEmpty()) {
+ if (labelSelectors != null && !labelSelectors.isEmpty()) {
command.add("-l=" + labelSelectors);
}

fix(provider/kubernetes): v2 Fix kubectl label selector flag (#2252)

Currently we set `-l=` when `labelSelectors` is null or is not empty,
causing all commands that pass a null value for `labelSelectors` to
fail.

The `-l=somelabel` flag should be set if `labelSelectors` is not null
and is not empty.