Merge pull request #348 from openziti/v0.4.0_override_endpoint

--override-endpoint Fixes (#347)
This commit is contained in:
Michael Quigley 2023-06-14 14:07:24 -04:00 committed by GitHub
commit 1d09d32866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -18,6 +18,8 @@ CHANGE: The underlying database store now utilizes a `deleted` flag on all table
CHANGE: Updated to latest `github.com/openziti/sdk-golang` (https://github.com/openziti/zrok/issues/335) CHANGE: Updated to latest `github.com/openziti/sdk-golang` (https://github.com/openziti/zrok/issues/335)
FIX: `zrok share reserved --override-endpoint` now works correctly; `--override-endpoint` was being incorrectly ignore previously (https://github.com/openziti/zrok/pull/348)
# v0.3.7 # v0.3.7
FIX: Improved TUI word-wrapping (https://github.com/openziti/zrok/issues/180) FIX: Improved TUI word-wrapping (https://github.com/openziti/zrok/issues/180)

View File

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

View File

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

View File

@ -12,7 +12,7 @@ const sortNodes = (nodes) => {
const nodesEqual = (a, b) => { const nodesEqual = (a, b) => {
if(a.length !== b.length) return false; 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) => { 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'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. // 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)); 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. // 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))); outputLinks.push(...newGraph.links.filter(newLink => !outputLinks.find(oldLink => oldLink.target === newLink.target && oldLink.source === newLink.source)));
return { return {