Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Update workload commands list/get/update when bogus namespace is passed#84

Merged
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
shashwathi:no-ns
Apr 28, 2022
Merged

Update workload commands list/get/update when bogus namespace is passed#84
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
shashwathi:no-ns

Conversation

@shashwathi
Copy link
Copy Markdown
Contributor

What this PR does / why we need it

New behaviour:

tanzu apps workload update pc -n ns2 
Error: namespace "ns2" not found, it may not exist or user does not have permissions to read it.
Error: exit status 1

✖  exit status 1 
tanzu apps workload list -n ns2                 
Error: namespace "ns2" not found, it may not exist or user does not have permissions to read it.
Error: exit status 1

✖  exit status 1 
tanzu apps workload get pc -n ns2               
Error: namespace "ns2" not found, it may not exist or user does not have permissions to read it.
Error: exit status 1

✖  exit status 1 

Which issue(s) this PR fixes

Fixes #18

Discussion:

For commands create/apply sub-command, when namespace does not exist the above error is not thrown. This is because of NamespaceAutoProvision on https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/. Admission controller can potentially create namespace in a cluster if Workload object includes namespace that does not exist.
cc @heyjcollins @scothis @rashedkvm

…ce is passed.

When user passes --namespace flag with bogus value, command returns "namespace not found..."

Signed-off-by: Shash Reddy <snagarajared@vmware.com>
Comment thread pkg/commands/workload_list.go
Copy link
Copy Markdown
Contributor

@odinnordico odinnordico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread pkg/commands/workload_list.go
@rashedkvm rashedkvm merged commit 6ae1969 into vmware-tanzu:main Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workload list --namespace bogus-namespace returns "no workloads found"

5 participants