Skip to content

Commit

Permalink
Add tag cli args for pkgr release
Browse files Browse the repository at this point in the history
Signed-off-by: Devanshu <[email protected]>
  • Loading branch information
devanshuVmware committed Dec 19, 2024
1 parent cfe66c0 commit 5c1c34f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/pkg/kctrl/cmd/package/repository/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type ReleaseOptions struct {
chdir string
outputLocation string
debug bool
tag string
}

const (
Expand Down Expand Up @@ -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-<TIMESTAMP>)")

return cmd
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5c1c34f

Please sign in to comment.