Skip to content

Commit 892082c

Browse files
authored
Porting replica count validation changes to release (#12289)
1 parent 363c603 commit 892082c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Tasks/KubernetesManifestV0/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"loc.messages.UnableToCreateTrafficSplitManifestFile": "Unable to create TrafficSplit manifest file. %s",
8989
"loc.messages.StableSpecSelectorNotExist": "Resource %s not deployed using SMI canary deployment.",
9090
"loc.messages.InvalidPercentage": "Invalid value for percentage.",
91-
"loc.messages.InvalidBaselineAndCanaryReplicas": "Invalid value for replica count. Enter a value greater than 0.",
91+
"loc.messages.InvalidBaselineAndCanaryReplicas": "Invalid value for replica count.",
9292
"loc.messages.InvalidTimeoutValue": "Invalid value for timeout. Enter a valid number.",
9393
"loc.messages.RolloutStatusTimedout": "Rollout status check failed.",
9494
"loc.messages.EnvironmentLink": "For more information, go to %s"

Tasks/KubernetesManifestV0/src/models/TaskInputParameters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function validateCanaryPercentage() {
4343
}
4444

4545
export function validateReplicaCount() {
46-
if (deploymentStrategy.toUpperCase() === canaryDeploymentHelper.CANARY_DEPLOYMENT_STRATEGY && trafficSplitMethod.toUpperCase() === canaryDeploymentHelper.TRAFFIC_SPLIT_STRATEGY && !validateRegex("^[1-9]\\d*$", baselineAndCanaryReplicas)) {
46+
if (deploymentStrategy.toUpperCase() === canaryDeploymentHelper.CANARY_DEPLOYMENT_STRATEGY && trafficSplitMethod.toUpperCase() === canaryDeploymentHelper.TRAFFIC_SPLIT_STRATEGY && !validateRegex("(^([0-9]|([1-9]\\d*))$)", baselineAndCanaryReplicas)) {
4747
throw new Error(tl.loc('InvalidBaselineAndCanaryReplicas'));
4848
}
4949
}

Tasks/KubernetesManifestV0/task.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 0,
1616
"Minor": 164,
17-
"Patch": 2
17+
"Patch": 3
1818
},
1919
"demands": [],
2020
"groups": [],
@@ -100,8 +100,8 @@
100100
"defaultValue": 1,
101101
"visibleRule": "strategy = Canary && action = deploy && trafficSplitMethod = SMI",
102102
"validation": {
103-
"expression": "isMatch(value, '(^[1-9]\\d*$)','Multiline')",
104-
"message": "Enter valid value greater than 0."
103+
"expression": "isMatch(value, '(^([0-9]|([1-9]\\d*))$)','Multiline')",
104+
"message": "Enter valid value for baseline and canary replica count."
105105
}
106106
},
107107
{
@@ -376,7 +376,7 @@
376376
"UnableToCreateTrafficSplitManifestFile": "Unable to create TrafficSplit manifest file. %s",
377377
"StableSpecSelectorNotExist": "Resource %s not deployed using SMI canary deployment.",
378378
"InvalidPercentage": "Invalid value for percentage.",
379-
"InvalidBaselineAndCanaryReplicas": "Invalid value for replica count. Enter a value greater than 0.",
379+
"InvalidBaselineAndCanaryReplicas": "Invalid value for replica count.",
380380
"InvalidTimeoutValue": "Invalid value for timeout. Enter a valid number.",
381381
"RolloutStatusTimedout": "Rollout status check failed.",
382382
"EnvironmentLink": "For more information, go to %s"

Tasks/KubernetesManifestV0/task.loc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": 0,
1616
"Minor": 164,
17-
"Patch": 2
17+
"Patch": 3
1818
},
1919
"demands": [],
2020
"groups": [],
@@ -101,8 +101,8 @@
101101
"defaultValue": 1,
102102
"visibleRule": "strategy = Canary && action = deploy && trafficSplitMethod = SMI",
103103
"validation": {
104-
"expression": "isMatch(value, '(^[1-9]\\d*$)','Multiline')",
105-
"message": "Enter valid value greater than 0."
104+
"expression": "isMatch(value, '(^([0-9]|([1-9]\\d*))$)','Multiline')",
105+
"message": "Enter valid value for baseline and canary replica count."
106106
}
107107
},
108108
{

0 commit comments

Comments
 (0)