diff --git a/pkg/kn/commands/service/configuration_edit_flags.go b/pkg/kn/commands/service/configuration_edit_flags.go index f3241ba38..ebf31c5f0 100644 --- a/pkg/kn/commands/service/configuration_edit_flags.go +++ b/pkg/kn/commands/service/configuration_edit_flags.go @@ -458,7 +458,7 @@ func (p *ConfigurationEditFlags) Apply( for key, value := range annotationServiceFlagMap { 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 } diff --git a/pkg/kn/commands/service/create_mock_test.go b/pkg/kn/commands/service/create_mock_test.go index 6e95ac8db..d62a38a56 100644 --- a/pkg/kn/commands/service/create_mock_test.go +++ b/pkg/kn/commands/service/create_mock_test.go @@ -674,7 +674,7 @@ func TestServiceCreateWithAutoScaleServiceAnnotationsError(t *testing.T) { "--annotation-service", autoscaling.InitialScaleAnnotationKey+"=1", "--no-wait", "--revision-name=") 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() }