diff --git a/Tasks/KubernetesV0/src/kubernetes.ts b/Tasks/KubernetesV0/src/kubernetes.ts
index f177d3946517..944e303ccbf4 100644
--- a/Tasks/KubernetesV0/src/kubernetes.ts
+++ b/Tasks/KubernetesV0/src/kubernetes.ts
@@ -56,6 +56,7 @@ async function run(clusterConnection: ClusterConnection, registryAuthenticationT
{
var secretName = tl.getInput("secretName", false);
var configMapName = tl.getInput("configMapName", false);
+ var command = tl.getInput("command", false);
if(secretName) {
await kubectlSecret.run(clusterConnection, registryAuthenticationToken, secretName);
@@ -64,13 +65,14 @@ async function run(clusterConnection: ClusterConnection, registryAuthenticationT
if(configMapName) {
await kubectlConfigMap.run(clusterConnection, configMapName);
}
-
- await executeKubectlCommand(clusterConnection);
+
+ if (command) {
+ await executeKubectlCommand(clusterConnection, command);
+ }
}
// execute kubectl command
-function executeKubectlCommand(clusterConnection: ClusterConnection) : any {
- var command = tl.getInput("command", true);
+function executeKubectlCommand(clusterConnection: ClusterConnection, command: string) : any {
var result = "";
var outputVariableName = tl.getInput("kubectlOutput", false);
var telemetry = {
diff --git a/Tasks/KubernetesV0/task.json b/Tasks/KubernetesV0/task.json
index 42d2854409fd..aa1973c1187a 100644
--- a/Tasks/KubernetesV0/task.json
+++ b/Tasks/KubernetesV0/task.json
@@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
- "Patch": 39
+ "Patch": 40
},
"demands": [],
"preview": "false",
@@ -66,8 +66,8 @@
"name": "command",
"type": "pickList",
"label": "Command",
- "defaultValue": "apply",
- "required": true,
+ "defaultValue": "",
+ "required": false,
"options": {
"apply": "apply",
"create": "create",
diff --git a/Tasks/KubernetesV0/task.loc.json b/Tasks/KubernetesV0/task.loc.json
index ac26006bdd2a..d570eb128a6b 100644
--- a/Tasks/KubernetesV0/task.loc.json
+++ b/Tasks/KubernetesV0/task.loc.json
@@ -13,7 +13,7 @@
"version": {
"Major": 0,
"Minor": 1,
- "Patch": 39
+ "Patch": 40
},
"demands": [],
"preview": "false",
@@ -66,8 +66,8 @@
"name": "command",
"type": "pickList",
"label": "ms-resource:loc.input.label.command",
- "defaultValue": "apply",
- "required": true,
+ "defaultValue": "",
+ "required": false,
"options": {
"apply": "apply",
"create": "create",
diff --git a/Tasks/KubernetesV1/src/kubernetes.ts b/Tasks/KubernetesV1/src/kubernetes.ts
index e6099be54db3..c6c2ea8d16df 100644
--- a/Tasks/KubernetesV1/src/kubernetes.ts
+++ b/Tasks/KubernetesV1/src/kubernetes.ts
@@ -12,7 +12,7 @@ tl.setResourcePath(path.join(__dirname, '..' , 'task.json'));
tl.cd(tl.getInput("cwd"));
var registryType = tl.getInput("containerRegistryType", true);
-var command = tl.getInput("command", true);
+var command = tl.getInput("command", false);
const environmentVariableMaximumSize = 32766;
var kubeconfigfilePath;
@@ -54,8 +54,10 @@ async function run(clusterConnection: ClusterConnection, command: string)
if(configMapName) {
await kubectlConfigMap.run(clusterConnection, configMapName);
}
-
- await executeKubectlCommand(clusterConnection, command);
+
+ if(command) {
+ await executeKubectlCommand(clusterConnection, command);
+ }
}
// execute kubectl command
diff --git a/Tasks/KubernetesV1/task.json b/Tasks/KubernetesV1/task.json
index 122740db49b2..81dc122bb1ad 100644
--- a/Tasks/KubernetesV1/task.json
+++ b/Tasks/KubernetesV1/task.json
@@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 1,
- "Patch": 18
+ "Patch": 19
},
"demands": [],
"releaseNotes": "What's new in Version 1.0:
Added new service connection type input for easy selection of Azure AKS cluster.
Replaced output variable input with output variables section that we had added in all tasks.",
@@ -127,8 +127,8 @@
"name": "command",
"type": "pickList",
"label": "Command",
- "defaultValue": "apply",
- "required": true,
+ "defaultValue": "",
+ "required": false,
"options": {
"apply": "apply",
"create": "create",
diff --git a/Tasks/KubernetesV1/task.loc.json b/Tasks/KubernetesV1/task.loc.json
index 6179ef2f6b34..81e884335d93 100644
--- a/Tasks/KubernetesV1/task.loc.json
+++ b/Tasks/KubernetesV1/task.loc.json
@@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 1,
- "Patch": 18
+ "Patch": 19
},
"demands": [],
"releaseNotes": "ms-resource:loc.releaseNotes",
@@ -127,8 +127,8 @@
"name": "command",
"type": "pickList",
"label": "ms-resource:loc.input.label.command",
- "defaultValue": "apply",
- "required": true,
+ "defaultValue": "",
+ "required": false,
"options": {
"apply": "apply",
"create": "create",