From baa37f6cae0c40f6baaebe864577160922569a86 Mon Sep 17 00:00:00 2001 From: Christopher Hunter Date: Fri, 7 Jul 2023 08:52:28 -0700 Subject: [PATCH] fix: error substring assertion for when the slug is not set --- internal/commands/find_stemcell_version.go | 5 ----- internal/commands/find_stemcell_version_test.go | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/commands/find_stemcell_version.go b/internal/commands/find_stemcell_version.go index bfe331cca..6f7ce6619 100644 --- a/internal/commands/find_stemcell_version.go +++ b/internal/commands/find_stemcell_version.go @@ -16,7 +16,6 @@ import ( ) const ( - ErrStemcellOSInfoMustBeValid = "stemcell os information is missing or invalid" ErrStemcellMajorVersionMustBeValid = "stemcell major Version is missing or invalid" TanzuNetRemotePath = "network.pivotal.io" ) @@ -57,10 +56,6 @@ func (cmd FindStemcellVersion) Execute(args []string) error { return err } - if productSlug == "" { - return fmt.Errorf(ErrStemcellOSInfoMustBeValid) - } - if kilnfile.Stemcell.Version == "" { return fmt.Errorf(ErrStemcellMajorVersionMustBeValid) } diff --git a/internal/commands/find_stemcell_version_test.go b/internal/commands/find_stemcell_version_test.go index 8aeffc2b6..e1bbe788b 100644 --- a/internal/commands/find_stemcell_version_test.go +++ b/internal/commands/find_stemcell_version_test.go @@ -112,7 +112,7 @@ release_sources: }) It("returns the stemcell os info missing error message", func() { Expect(executeErr).To(HaveOccurred()) - Expect(executeErr).To(MatchError(ContainSubstring(commands.ErrStemcellOSInfoMustBeValid))) + Expect(executeErr).To(MatchError(ContainSubstring("stemcell slug not set"))) }) })