From bcc875c5ac2ecea7b1db23cc1ddaf851d6d83b62 Mon Sep 17 00:00:00 2001 From: Corey Daley Date: Tue, 28 Aug 2018 10:36:03 -0400 Subject: [PATCH] Remove count from new-build/new-app error message Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1622920 --- pkg/oc/lib/newapp/app/errors.go | 2 +- test/cmd/newapp.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/oc/lib/newapp/app/errors.go b/pkg/oc/lib/newapp/app/errors.go index 6432ff3c6cbd..39fb98fa4163 100644 --- a/pkg/oc/lib/newapp/app/errors.go +++ b/pkg/oc/lib/newapp/app/errors.go @@ -89,7 +89,7 @@ type ErrMultipleMatches struct { } func (e ErrMultipleMatches) Error() string { - return fmt.Sprintf("multiple images or templates matched %q: %d", e.Value, len(e.Matches)) + return fmt.Sprintf("multiple images or templates matched %q", e.Value) } // ErrNameRequired is the error returned by new-app when a name cannot be diff --git a/test/cmd/newapp.sh b/test/cmd/newapp.sh index c4b957e1ffa3..312b61896020 100755 --- a/test/cmd/newapp.sh +++ b/test/cmd/newapp.sh @@ -456,7 +456,7 @@ os::cmd::expect_success_and_text 'oc new-build --binary --image=ruby --strategy= os::cmd::expect_success 'oc new-app --image-stream ruby https://github.com/sclorg/rails-ex --dry-run' # when latest does not exist, there are multiple partial matches (2.2, 2.3, 2.4, 2.5) os::cmd::expect_success 'oc delete imagestreamtag ruby:latest' -os::cmd::expect_failure_and_text 'oc new-app --image-stream ruby https://github.com/sclorg/rails-ex --dry-run' 'error: multiple images or templates matched \"ruby\":' +os::cmd::expect_failure_and_text 'oc new-app --image-stream ruby https://github.com/sclorg/rails-ex --dry-run' 'error: multiple images or templates matched \"ruby\"' # when only 2.5 exists, there is a single partial match (2.5) os::cmd::expect_success 'oc delete imagestreamtag ruby:2.2' os::cmd::expect_success 'oc delete imagestreamtag ruby:2.3'