Skip to content

Advice how to handle Multi with Kubernetes Client #1347

Answered by kjq
kjq asked this question in Q&A
Discussion options

You must be logged in to vote

Here is my latest pass and it seems to work! Is this the right way or is there a simpler way to do this?

I could not get it without injecting Vertx (an i literally clipped it from the Stork/Kubernetes Discovery code).

@GET
@Path("/{client}/instances/{instance}/status")
@Produces(APPLICATION_JSON)
public Uni<List<InstanceInfo>> getStatus(@BeanParam final ClusterParams params) {
    return tenantClient.getClient(params)
        .chain(c -> this.clusterService.getInstances(params.getInstanceId(), c)
            .map(i -> this.clusterMapper.mapInstanceResponse(i)).toUni()
            .chain(r -> getDeployments(r.getTag(), r.getClient()))
            .onItem().transformToMulti(d -> Multi.creat…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kjq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant