Skip to content

fix: honour -o json/custom across missing and broken commands#586

Merged
giornetta merged 10 commits into
civo:masterfrom
alubbock:fix/k8s-nodepool-instance-delete-json-output
May 27, 2026
Merged

fix: honour -o json/custom across missing and broken commands#586
giornetta merged 10 commits into
civo:masterfrom
alubbock:fix/k8s-nodepool-instance-delete-json-output

Conversation

@alubbock
Copy link
Copy Markdown
Contributor

Several commands ignored the -o json and -o custom flags, always
printing plain text regardless. One command (kubernetes cluster remove)
had a latent bug where -o json also triggered the custom formatter.

Missing output format handling (always printed plain text):

  • kubernetes node-pool instance-delete
  • kubernetes cluster remove (also had WriteCustomOutput inside the
    "json" case, so -o json produced both outputs)
  • apikey remove / apikey set
  • instance public-ip / instance recovery
  • kubernetes update-kubeconfig
  • network show

Also fixed in instance recovery: a fmt.Println("Instance ID is: …") that fired before the API call, unconditionally, on every
invocation.

@giornetta giornetta self-requested a review May 12, 2026 08:38
Comment thread cmd/network/network_show.go Outdated
Comment thread cmd/network/network_show.go Outdated
Comment thread cmd/instance/instance_recovery.go
alubbock and others added 2 commits May 24, 2026 15:03
network show: guard VLAN-specific fields (vlan_id, physical_interface,
allocation_pool_v4_start, allocation_pool_v4_end) behind VlanID \!= 0
so they are omitted from JSON/custom output on non-VLAN networks.
Use strconv.Itoa for VlanID, consistent with network list.
Move gateway_ipv4 outside the VLAN guard -- it is relevant to all networks.

instance recovery: restore instance UUID in human output, shown in
parentheses after the hostname.
Copy link
Copy Markdown
Member

@giornetta giornetta left a comment

Choose a reason for hiding this comment

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

LGTM!

@giornetta giornetta merged commit a258db6 into civo:master May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants