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

api/v2: return empty array of peers when disabled #2203

Merged

Conversation

simonpasquier
Copy link
Member

Before this change, the API returns a null value for peers:

$ curl -s localhost:9093/api/v2/status | jq '.cluster'
{           
  "peers": null,           
  "status": "disabled"  
}  

After

{           
  "peers": [],           
  "status": "disabled"  
}

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@brian-brazil
Copy link
Contributor

brian-brazil commented Mar 10, 2020

Why are you touching v2? Noone should be using that, and it's not maintained.

Edit: Ignore me, wrong repo.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

I guess given that the implementation diverges from the specification this is a bug fix and not a breaking change?

@roidelapluie
Copy link
Member

Just to make sure @simonpasquier , did you check that the UI still works as expected with this?

thanks

@simonpasquier
Copy link
Member Author

@mxinden

I guess given that the implementation diverges from the specification this is a bug fix and not a breaking change?

Yes. AFAICT there's no way we can tell the code generated from the OpenAPI spec to return an empty array instead of nil.

did you check that the UI still works as expected with this?

@roidelapluie yes

@simonpasquier simonpasquier merged commit e347c31 into prometheus:master Mar 10, 2020
@simonpasquier simonpasquier deleted the improve-api-v2-status branch March 10, 2020 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants