---
# System prepended metadata

title: kctrl - pkg release command should have a flag to let users provide tag for imgpkg bundle
tags: [kctrl]

---

# kctrl - pkg release command should have a flag to let users provide tag for imgpkg bundle

###### tags: `kctrl`

## Problem Statement

If a user wants to overwrite the imgpkg bundle tag, there is no provision for that today.

## Observation and findings

`imgpkg` bundle doesn't support providing multiple tags while running   `imgpkg push`.

## Possible Approach

1. Instead of creating the tag with `bundle-<TIMESTAMP>>`, create it with user provided value.
2. Enhance imgpkg bundle to support multiple tags while doing `imgpkg push` [#355](https://github.com/vmware-tanzu/carvel-imgpkg/issues/355). Since it is a good first issue, I will check with `Joao` and see if we can pick and implement it real quick.
3. Run imgpkg push twice on the same bundle, once with `user-provided` tag and other time with `bundle-<TIMESTAMP>` tag.

## Adding a flag

There are two possibilities:
1. There is already a version tag provided which can be used. A flag can be used to enable/disable the use of this `version` as tag.

    e.g. `kctrl pkg release -v 1.0.0 --use-version-as-tag=true/false`

    **Cons**:

    As version flag is optional, how will be the behavior if it is not provided.

    `kctrl pkg release --use-version-as-tag=true`

    In this, version is set to `0.0.0+build.1664733377`.
    
2. Add another flag: `--additional-imgpkg-tag` 

    e.g. `kctrl pkg release -v 1.0.0 --additional-imgpkg-tag=v1.0.0`

    **Pros**
    Decoupled from package version.

    **Cons**
    1. Two tags are introduced, one for package version and another for imgpkg tag.
    2. Export section only supports imgpkg bundle only today. Do we see some other mechanism? If yes, should we make it more generic e.g. `--additional-tag` ?

## Discussion and finalized approach

Since the user wants to override the tag, we will add a new flag `tag` which when specified will override the default `bundle-<TIMESTAMP>` format.