fixes for --override-endpoint (#347)

This commit is contained in:
Michael Quigley 2023-06-14 13:18:44 -04:00
parent 6f91bf7f9f
commit d3ea780a1b
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
3 changed files with 5 additions and 4 deletions

View File

@ -73,6 +73,7 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
}
panic(err)
}
target = cmd.overrideEndpoint
if target == "" {
target = resp.Payload.BackendProxyEndpoint
}

View File

@ -38,7 +38,7 @@ func (h *updateShareHandler) Handle(params share.UpdateShareParams, principal *r
envFound := false
for _, senv := range senvs {
if senv.Id == sshr.Id {
if senv.Id == sshr.EnvironmentId {
envFound = true
break
}

View File

@ -12,7 +12,7 @@ const sortNodes = (nodes) => {
const nodesEqual = (a, b) => {
if(a.length !== b.length) return false;
return a.every((e, i) => e.id === b[i].id && e.limited === b[i].limited);
return a.every((e, i) => e.id === b[i].id && e.limited === b[i].limited && e.label === b[i].label);
}
export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
@ -116,11 +116,11 @@ export const mergeGraph = (oldGraph, user, accountLimited, newOverview) => {
// we're going to need to recompute a new graph... but we want to maintain the instances that already exist...
// we want to preserve nodes that exist in the new graph, and remove those that don't.
let outputNodes = oldGraph.nodes.filter(oldNode => newGraph.nodes.find(newNode => newNode.id === oldNode.id && newNode.limited === oldNode.limited));
let outputNodes = oldGraph.nodes.filter(oldNode => newGraph.nodes.find(newNode => newNode.id === oldNode.id && newNode.limited === oldNode.limited && newNode.label === oldNode.label));
let outputLinks = oldGraph.nodes.filter(oldLink => newGraph.links.find(newLink => newLink.target === oldLink.target && newLink.source === oldLink.source));
// and then do the opposite; add any nodes that are in newGraph that are missing from oldGraph.
outputNodes.push(...newGraph.nodes.filter(newNode => !outputNodes.find(oldNode => oldNode.id === newNode.id && oldNode.limited === newNode.limited)));
outputNodes.push(...newGraph.nodes.filter(newNode => !outputNodes.find(oldNode => oldNode.id === newNode.id && oldNode.limited === newNode.limited && oldNode.label === newNode.label)));
outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
return {