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

Make status.addresses JSON values #157

Closed
andrewrynhard opened this issue Jul 25, 2020 · 3 comments · Fixed by #158
Closed

Make status.addresses JSON values #157

andrewrynhard opened this issue Jul 25, 2020 · 3 comments · Fixed by #158
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@andrewrynhard
Copy link

I would like to use kubectl get machine X -o jsonpath... to parse out addresses assigned to a node. Unfortunately the values in the status.addresses array are formatted golang data structures. Making these JSON would allow me to parse out whatever I needed from the entries.

status:
  addresses:
  ...
  - address: packngo.IPAddressAssignment{IpAddressCommon:packngo.IpAddressCommon{ID:"REDACTED",
      Address:"10.100.2.17", Gateway:"10.100.2.16", Network:"10.100.2.16", AddressFamily:4,
      Netmask:"255.255.255.254", Public:false, CIDR:31, Created:"2020-07-25T14:54:10Z",
      Updated:"", Href:"/ips/REDACTED", Management:true,
      Manageable:true, Project:packngo.Href{Href:"/projects/REDACTED"},
      Tags:[], CustomData:map[]}, AssignedTo:packngo.Href{Href:"/devices/REDACTED"}}
    type: InternalIP
@deitch
Copy link
Contributor

deitch commented Jul 27, 2020

Interesting that it is leaking through the packngo.IPAddressAssignment. Is the above output from a currently set up cluster via CAPP, @andrewrynhard ?

I think it is set here which calls here, but that is setting a corev1.NodeAddress on it.

Do you know why this is @gianarb ?

@andrewrynhard
Copy link
Author

@deitch This is with the latest release of CAPP.

@gianarb
Copy link
Contributor

gianarb commented Jul 27, 2020

In theory it should have a string: 10.100.2.17.
I will have a look at it very soon @andrewrynhard thank you for opening the issue

I think the bug is here:

addr.String() is wrong, it should be something like addr.Address. I will try and cut a release by tomorrow (CET)

@gianarb gianarb added the kind/bug Categorizes issue or PR as related to a bug. label Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants