From c2fa44860fdaff63e9f3ff663c5deb65852bb83f Mon Sep 17 00:00:00 2001 From: catsby Date: Mon, 9 Sep 2024 10:56:51 -0500 Subject: [PATCH] format and enforce bundle names on creation --- src/pkg/bundle/create.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pkg/bundle/create.go b/src/pkg/bundle/create.go index 51cf89be..984c5d56 100644 --- a/src/pkg/bundle/create.go +++ b/src/pkg/bundle/create.go @@ -41,6 +41,13 @@ func (b *Bundle) Create() error { return err } + // validate bundle name to avoid bad characters + name, err := utils.FormatBundleName(b.bundle.Metadata.Name) + if err != nil { + return err + } + b.bundle.Metadata.Name = name + // confirm creation if ok := b.confirmBundleCreation(); !ok { return fmt.Errorf("bundle creation cancelled")