Skip to content

[vtadmin-api] Add cluster field to vtadmin-api's /api/gates response#7425

Merged
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-api-gate-clusters
Feb 1, 2021
Merged

[vtadmin-api] Add cluster field to vtadmin-api's /api/gates response#7425
rohit-nayak-ps merged 1 commit intovitessio:masterfrom
tinyspeck:sarabee-vtadmin-api-gate-clusters

Conversation

@doeg
Copy link
Contributor

@doeg doeg commented Feb 1, 2021

Signed-off-by: Sara Bee 855595+doeg@users.noreply.github.com

Description

Updates vtadmin-api's /api/gates endpoint to return cluster information.

Previously:

{"result":{"gates":[{"hostname":"127.0.0.1:15991"}]},"ok":true}

Currently:

{"result":{"gates":[{"hostname":"127.0.0.1:15991","cluster":{"id":"id1","name":"cluster1"}}]},"ok":true}

Related Issue(s)

N/A

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

N/A

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
@doeg doeg requested a review from ajm188 as a code owner February 1, 2021 16:25

fakedisco1.AddTaggedGates(nil, cluster1Gates...)

expectedCluster1Gates := []*vtadminpb.VTGate{
Copy link
Contributor Author

@doeg doeg Feb 1, 2021

Choose a reason for hiding this comment

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

I defined these expectedCluster*Gates slices rather than adding the Cluster field to the existing cluster*Gates slice. Prior, when I added the Cluster to a cluster*Gates slice, fakedisco added them as-is, meaning the test passed without exercising the new codepath.

@rohit-nayak-ps rohit-nayak-ps merged commit 4c9a50b into vitessio:master Feb 1, 2021
@askdba askdba added the Component: VTAdmin VTadmin interface label Feb 8, 2021
@askdba askdba added this to the v10.0 milestone Feb 8, 2021
@doeg doeg changed the title Add cluster field to vtadmin-api's /api/gates response [vtadmin-api] Add cluster field to vtadmin-api's /api/gates response Mar 16, 2021
@doeg doeg deleted the sarabee-vtadmin-api-gate-clusters branch November 1, 2021 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: VTAdmin VTadmin interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants