Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

govc: add default output formatting for namespace commands #3410

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

dougm
Copy link
Member

@dougm dougm commented Apr 12, 2024

Including a few other minor changes for the new set of namespace commands.

Including a few other minor changes for the new set of namespace commands.
@@ -281,7 +281,6 @@ func (h *Handler) namespaces(w http.ResponseWriter, r *http.Request) {
if len(subpath) > 0 {
if entry, contains := namespacesMap[subpath]; contains {
var spec namespace.NamespacesInstanceUpdateSpec
// If vapi.Decode fails it sets the status to bad request
Copy link
Member Author

Choose a reason for hiding this comment

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

note: removed these comments since it's included in the function doc (and we use vapi.Decode this way all over)

if err != nil {
return err
}

cmd.JSON = !cmd.All()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI - I did the same thing on another PR over a month ago #3368
I'm saying this in case you're working on eliminating the "only-JSON-output-supported" pattern :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I remember, but I've yet to use vLCM (directly at least). I use vSphere Namespaces everyday and am happy to replace stuff like below with the new govc commands, thanks!

# now govc namespace.create
govc session.login -r -X POST /api/vcenter/namespaces/instances \
  <<<'{"cluster": "domain-c9","namespace": "velero"}'

# now govc namespace.ls
govc session.login -r -X GET /api/vcenter/namespaces/instances | jq -r .[].namespace

@dougm dougm merged commit d528fec into vmware:main Apr 12, 2024
11 checks passed
@dougm dougm deleted the govc-namespace branch April 12, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants