[feature]When the data type of spec.replicas is int, cancel the upper limit (#142)
* feature<rollout> When the data type of spec.replicas is int, cancel the upper limit of 100. #141 Signed-off-by: zhousong <zhousong@onething.net> * style<rollout> update error field `CanaryReplicas` ==> `Replicas` #141 Signed-off-by: zhousong <zhousong@onething.net> --------- Signed-off-by: zhousong <zhousong@onething.net> Co-authored-by: zhousong <zhousong@onething.net>
This commit is contained in:
parent
15109e4cea
commit
5626a7fbb8
|
|
@ -240,9 +240,11 @@ func validateRolloutSpecCanarySteps(steps []appsv1alpha1.CanaryStep, fldPath *fi
|
||||||
}
|
}
|
||||||
if s.Replicas != nil {
|
if s.Replicas != nil {
|
||||||
canaryReplicas, err := intstr.GetScaledValueFromIntOrPercent(s.Replicas, 100, true)
|
canaryReplicas, err := intstr.GetScaledValueFromIntOrPercent(s.Replicas, 100, true)
|
||||||
if err != nil || canaryReplicas <= 0 || canaryReplicas > 100 {
|
if err != nil ||
|
||||||
return field.ErrorList{field.Invalid(fldPath.Index(i).Child("CanaryReplicas"),
|
canaryReplicas <= 0 ||
|
||||||
s.Replicas, `canaryReplicas must be positive number with with "0" < canaryReplicas <= "100", or a percentage with "0%" < canaryReplicas <= "100%"`)}
|
(canaryReplicas > 100 && s.Replicas.Type == intstr.String) {
|
||||||
|
return field.ErrorList{field.Invalid(fldPath.Index(i).Child("Replicas"),
|
||||||
|
s.Replicas, `replicas must be positive number, or a percentage with "0%" < canaryReplicas <= "100%"`)}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,12 @@ var (
|
||||||
{
|
{
|
||||||
Weight: utilpointer.Int32Ptr(100),
|
Weight: utilpointer.Int32Ptr(100),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Weight: utilpointer.Int32Ptr(101),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Weight: utilpointer.Int32Ptr(200),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
TrafficRoutings: []*appsv1alpha1.TrafficRouting{
|
TrafficRoutings: []*appsv1alpha1.TrafficRouting{
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue