Skip to content

--dry-run fails with workload create for pre-existing workload and returns full workload object with status rather than just example of what would be created/applied. #426

@heyjcollins

Description

@heyjcollins

WIP

to do:

  1. create separate issue for the enhancement, leave create --dry-run error issue as bug
  2. spec supported flag values/default
  3. update help
  4. default = server (start deprecation)
  5. deprecation warning
  6. consider time-bomb (once deprecation window is up, automatic switch of default , hide warning message, update default in helpoutput)

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

2 issues:

  1. running tanzu apps workload create/apply appname -f workload.yaml --dry-run for an existing workload should return output the workload object that would be created/applied if the command were to actually run - but currently, the entire object including status is returned -- that's not expected.
  2. running tanzu apps workload create appname -f workload.yaml --dry-run for an existing workload throws an error -- but in the case of --dry-run, the intention is to see what changes would be made - but the changes aren't applied
    ** the validation which errors because you can't create something that's already been created is happening here, but when --dry-run is included, that should short-circuit the validation

Expected behavior

issue 1: return output the workload object that would be created/applied
issue 2: return output the workload object that would be created/applied

Steps to Reproduce

issue 1:

  1. create a workload named foo
  2. run tanzu apps workload create foo --env foo=bar --dry-run
  3. returned the full workload object including status rather than just the workload object that would be submitted

issue 2:

  1. create a workload named foo
  2. run tanzu apps workload create foo --env foo=bar --dry-run
  3. error

Screenshots

If applicable, add screenshots to help explain your problem.

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

apps v0.9.0, but this issue likely goes all the way back to v0.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions