Skip to content

Weird behaviour in flag interaction when creating workload from git source #179

@warango4

Description

@warango4

Please fill out the issue checklist below and provide ALL the requested information.

  • I reviewed open and closed Github issues that may be related to my problem.
  • I am reporting a bug that others will be able to reproduce.

Describe the bug

A clear and concise description of what the bug is.

When creating a workload from git source, it is allowed to set git tag, git branch and git commit. When not setting at least one of those there is a message saying

[--git-branch, --git-tag]: Required value: expected exactly one, got neither

This can be misleading for user and wouldn't know what's actually the way a workload should be created.

Also, when updating commit field, tag field is deleted. Same if updating tag, then commit would be deleted

WHEN UPDATING COMMIT
image

image

WHEN UPDATING TAG
image

image

Steps to Reproduce

Steps to reproduce the behavior:

  • Create a workload
tanzu apps workload create pet-clinic --git-repo https://github.com/sample-accelerators/spring-petclinic --type web --app spring-petclinic --git-commit 123 --git-branch main
  • Update the workload
tanzu apps workload update pet-clinic  --git-tag tap-1.2
  • Delete the workload
tanzu apps workload delete pet-clinic -y
  • Create the workload without --git-tag, --git-commit and --git-branch
    See the error
Error: [--git-branch, --git-tag]: Required value: expected exactly one, got neither
Error: exit status 1

Screenshots

If applicable, add screenshots to help explain your problem.

Version (Apps plugin version, Version of K8s running on cluster)

Put the output of the following commad

tanzu version && tanzu apps version

version: v0.11.1
buildDate: 2022-02-14
sha: 4d578570
v0.0.0-dev

Environment where the bug was observed (cloud, OS, etc)

Additional context & Relevant Debug Output (Logs, etc)

Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

acceptedbugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions