mirror of https://github.com/knative/client.git
update error message when autoscaling annotation used in service (#1038)
This commit is contained in:
parent
e8ae0e1537
commit
2c67eb9d7c
|
|
@ -458,7 +458,7 @@ func (p *ConfigurationEditFlags) Apply(
|
||||||
|
|
||||||
for key, value := range annotationServiceFlagMap {
|
for key, value := range annotationServiceFlagMap {
|
||||||
if strings.HasPrefix(key, autoscaling.GroupName) {
|
if strings.HasPrefix(key, autoscaling.GroupName) {
|
||||||
return fmt.Errorf("Service cannot have annotation: %s", key)
|
return fmt.Errorf("service can not have auto-scaling related annotation: %s , please update using '--annotation-revision'", key)
|
||||||
}
|
}
|
||||||
serviceAnnotations[key] = value
|
serviceAnnotations[key] = value
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -674,7 +674,7 @@ func TestServiceCreateWithAutoScaleServiceAnnotationsError(t *testing.T) {
|
||||||
"--annotation-service", autoscaling.InitialScaleAnnotationKey+"=1",
|
"--annotation-service", autoscaling.InitialScaleAnnotationKey+"=1",
|
||||||
"--no-wait", "--revision-name=")
|
"--no-wait", "--revision-name=")
|
||||||
assert.Assert(t, err != nil)
|
assert.Assert(t, err != nil)
|
||||||
assert.Assert(t, util.ContainsAll(output, "Service cannot have annotation: autoscaling.knative.dev/initialScale"))
|
assert.Assert(t, util.ContainsAll(output, "service can not have auto-scaling related annotation", "autoscaling.knative.dev/initialScale"))
|
||||||
|
|
||||||
r.Validate()
|
r.Validate()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue