From 86fe37593f075b0fdcb3a303b6327994373b476e Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 11:52:38 -0700 Subject: [PATCH] fix tests Signed-off-by: Ludvig Liljenberg --- pkg/porter/lifecycle.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/porter/lifecycle.go b/pkg/porter/lifecycle.go index 7d2f256c61..25d54cb3ef 100644 --- a/pkg/porter/lifecycle.go +++ b/pkg/porter/lifecycle.go @@ -311,6 +311,14 @@ func (p *Porter) BuildActionArgs(ctx context.Context, installation storage.Insta // https://github.com/getporter/porter/blob/17bd7816ef6bde856793f6122e32274aa9d01d1b/pkg/storage/installation.go#L350 func ensureVPrefix(opts *BundleReferenceOptions) error { if opts._ref == nil { + idx := strings.LastIndex(opts.Reference, ":") + if idx == -1 { + return fmt.Errorf("invalid bundle reference: %s", opts.Reference) + } + if strings.HasPrefix(opts.Reference[idx+1:], "v") { + return nil + } + opts.Reference = opts.Reference[:idx] + ":v" + opts.Reference[idx+1:] return nil } if strings.HasPrefix(opts._ref.Tag(), "v") {