mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-09 15:30:20 +08:00
fix smi weight bug
This commit is contained in:
parent
33608d18f7
commit
a3cef0e4cd
@ -186,33 +186,31 @@ function getTrafficSplitObject(kubectl: Kubectl, name: string, stableWeight: num
|
|||||||
if (!trafficSplitAPIVersion) {
|
if (!trafficSplitAPIVersion) {
|
||||||
trafficSplitAPIVersion = kubectlUtils.getTrafficSplitAPIVersion(kubectl);
|
trafficSplitAPIVersion = kubectlUtils.getTrafficSplitAPIVersion(kubectl);
|
||||||
}
|
}
|
||||||
const trafficSplitObjectJson = `{
|
|
||||||
|
return `{
|
||||||
"apiVersion": "${trafficSplitAPIVersion}",
|
"apiVersion": "${trafficSplitAPIVersion}",
|
||||||
"kind": "TrafficSplit",
|
"kind": "TrafficSplit",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "%s"
|
"name": "${getTrafficSplitResourceName(name)}"
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"backends": [
|
"backends": [
|
||||||
{
|
{
|
||||||
"service": "%s",
|
"service": "${canaryDeploymentHelper.getStableResourceName(name)}",
|
||||||
"weight": "%sm"
|
"weight": "${stableWeight}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"service": "%s",
|
"service": "${canaryDeploymentHelper.getBaselineResourceName(name)}",
|
||||||
"weight": "%sm"
|
"weight": "${baselineWeight}"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"service": "%s",
|
"service": "${canaryDeploymentHelper.getCanaryResourceName(name)}",
|
||||||
"weight": "%sm"
|
"weight": "${canaryWeight}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"service": "%s"
|
"service": "%s"
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
const trafficSplitObject = util.format(trafficSplitObjectJson, getTrafficSplitResourceName(name), canaryDeploymentHelper.getStableResourceName(name), stableWeight, canaryDeploymentHelper.getBaselineResourceName(name), baselineWeight, canaryDeploymentHelper.getCanaryResourceName(name), canaryWeight, name);
|
|
||||||
return trafficSplitObject;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTrafficSplitResourceName(name: string) {
|
function getTrafficSplitResourceName(name: string) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user