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

--override-endpoint Fixes #348

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

FIX: Improved TUI word-wrapping (https://github.com/openziti/zrok/issues/180)
Expand Down
1 change: 1 addition & 0 deletions cmd/zrok/shareReserved.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
}
panic(err)
}
target = cmd.overrideEndpoint
if target == "" {
target = resp.Payload.BackendProxyEndpoint
}
Expand Down
2 changes: 1 addition & 1 deletion controller/updateShare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions ui/src/console/visualizer/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 {
Expand Down