From 5c1c34ff549157a2cb10b54777c48a350ca4868d Mon Sep 17 00:00:00 2001 From: Devanshu Date: Fri, 20 Dec 2024 00:04:22 +0530 Subject: [PATCH] Add tag cli args for pkgr release Signed-off-by: Devanshu --- cli/pkg/kctrl/cmd/package/repository/release/release.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/pkg/kctrl/cmd/package/repository/release/release.go b/cli/pkg/kctrl/cmd/package/repository/release/release.go index 646e9b16e..ff74460d3 100644 --- a/cli/pkg/kctrl/cmd/package/repository/release/release.go +++ b/cli/pkg/kctrl/cmd/package/repository/release/release.go @@ -27,6 +27,7 @@ type ReleaseOptions struct { chdir string outputLocation string debug bool + tag string } const ( @@ -58,6 +59,7 @@ func NewReleaseCmd(o *ReleaseOptions) *cobra.Command { cmd.Flags().StringVar(&o.chdir, "chdir", "", "Location of the working directory") cmd.Flags().StringVar(&o.outputLocation, "copy-to", "", "Output location for pkgrepo-build.yml") cmd.Flags().BoolVar(&o.debug, "debug", false, "Include debug output") + cmd.Flags().StringVarP(&o.tag, "tag", "t", "", "Tag pushed with imgpkg bundle (default build-)") return cmd } @@ -157,10 +159,15 @@ func (o *ReleaseOptions) Run() error { var bundleURL string + tag := o.pkgRepoVersion + if o.tag != "" { + tag = o.tag + } + switch { case pkgRepoBuild.Spec.Export.ImgpkgBundle != nil: imgpkgRunner := ImgpkgRunner{ - BundlePath: fmt.Sprintf("%s:%s", pkgRepoBuild.Spec.Export.ImgpkgBundle.Image, o.pkgRepoVersion), + BundlePath: fmt.Sprintf("%s:%s", pkgRepoBuild.Spec.Export.ImgpkgBundle.Image, tag), Paths: []string{"packages"}, UseKbldImagesLock: true, ImgLockFilepath: tempImgpkgLockPath,