cilium-cli icon indicating copy to clipboard operation
cilium-cli copied to clipboard

Add JSON status (fix #956)

Open raphink opened this issue 3 years ago • 1 comments
trafficstars

  • feat: add json output for clustermesh status
  • feat: add json output for status
  • feat: downcase json export fields for status
  • feat: downcase json export fields for clustermesh status

raphink avatar Jul 06 '22 16:07 raphink

@aditighag is it fine like this?

raphink avatar Jul 11 '22 18:07 raphink

Rebased

raphink avatar Nov 14 '22 19:11 raphink

I've squashed a few commits. I don't know if you'd like me to squash more than that.

raphink avatar Nov 14 '22 19:11 raphink

I don't understand why the cross-build is failing 🤔

raphink avatar Nov 17 '22 13:11 raphink

I don't understand why the cross-build is failing thinking

It looks like this is an issue with the newly vendored Cilium version:

2022-11-17T13:14:33.1736986Z # github.com/cilium/cilium/pkg/mtu 2022-11-17T13:14:33.1847236Z ##[error]vendor/github.com/cilium/cilium/pkg/mtu/mtu.go:111:15: undefined: getMTUFromIf 2022-11-17T13:14:33.1860112Z ##[error]vendor/github.com/cilium/cilium/pkg/mtu/mtu.go:113:15: undefined: autoDetect 2022-11-17T13:14:33.2627923Z # github.com/cilium/cilium/pkg/node 2022-11-17T13:14:33.2629974Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:96:14: undefined: firstGlobalV4Addr 2022-11-17T13:14:33.2631853Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:131:27: undefined: firstGlobalV6Addr 2022-11-17T13:14:33.2633262Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:166:23: undefined: firstGlobalV4Addr 2022-11-17T13:14:33.2634706Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:176:16: undefined: firstGlobalV4Addr 2022-11-17T13:14:33.2636663Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:187:23: undefined: firstGlobalV6Addr 2022-11-17T13:14:33.2638502Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:197:16: undefined: firstGlobalV6Addr 2022-11-17T13:14:33.2639815Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:218:15: undefined: firstGlobalV4Addr 2022-11-17T13:14:33.2641201Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:229:15: undefined: firstGlobalV4Addr 2022-11-17T13:14:33.2642740Z ##[error]vendor/github.com/cilium/cilium/pkg/node/address.go:742:9: undefined: getCiliumHostIPsFromNetDev 2022-11-17T13:14:57.0224362Z ##[error]Process completed with exit code 2.

Unfortunately, we currently don't check upstream whether the packages imported by cilium-cli are cross-buildable, also see https://github.com/cilium/cilium/issues/16843

tklauser avatar Nov 17 '22 14:11 tklauser

@tklauser I rebased but cross compile is still failing 😢

raphink avatar Nov 22 '22 11:11 raphink

@tklauser I rebased but cross compile is still failing cry

The fix was not yet backported, we'll need to wait until the respective backport PR (https://github.com/cilium/cilium/pull/22308) is merged and then update the vendored version in this PR to the latest v1.12 branch.

tklauser avatar Nov 22 '22 13:11 tklauser

OK. Sorry for the noise, I thought it was merged already.

raphink avatar Nov 22 '22 15:11 raphink

I think I've addressed everything (I've given up on the enum because it clashed with the option declaration).

raphink avatar Jan 13 '23 16:01 raphink

@raphink I've squashed all the commits, rebased on top of latest master and made two additional changes (https://github.com/cilium/cilium-cli/pull/958#discussion_r1102738168 and https://github.com/cilium/cilium-cli/pull/958#discussion_r1102729947) and force pushed to this PR's branch. Could you please do a quick sanity check on whether this still matches what you had in mind? I think then we're finally good to merge this.

tklauser avatar Feb 10 '23 13:02 tklauser