Skip to content

app push: allow custom image tag via --build-tag flag #2907

@kwiatekus

Description

@kwiatekus

Description

The kyma app push command auto-generates a timestamp-based image tag (<name>:2006-01-02_15-04-05) when building from source (--code-path or --dockerfile). There is no way to supply a custom tag.

Add an --build-tag flag that lets users specify the tag used for the built image. When the flag is omitted, the current timestamp fallback is preserved.

Reasons

In CI/CD pipelines (e.g. GitHub Actions) it is common practice to tag images with the Git commit SHA for traceability and reproducibility:

kyma app push --name my-app --code-path . --build-tag ${{ github.sha }}

Without this flag:

  • Every build gets a non-deterministic timestamp tag, making it impossible to correlate a running image with a specific commit.
  • There is no way to implement image promotion or rollback based on a known identifier.
  • Pipelines cannot enforce a consistent tagging strategy.

The flag should:

  • Apply only to source builds (--code-path, --dockerfile); --image already embeds the full tag.
  • Validate the value against Docker tag rules (max 128 chars, [a-zA-Z0-9_][a-zA-Z0-9_.-]*, no spaces or special characters).
  • Return a clear error message on invalid input.

Attachments

Relevant code: internal/cmd/app/push.go#L355-L374buildImage() where the timestamp tag is constructed.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions