update error message when autoscaling annotation used in service (#1038)

This commit is contained in:
Arghya Sadhu 2020-10-01 14:12:30 +05:30 committed by GitHub
parent e8ae0e1537
commit 2c67eb9d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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
} }

View File

@ -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()
} }