mirror of
https://github.com/openziti/zrok.git
synced 2024-11-21 23:53:19 +01:00
no need to update targets when reserved backend mode is 'socks' (#558)
This commit is contained in:
parent
2982e43685
commit
d58779c7e2
@ -93,23 +93,25 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
logrus.Infof("sharing target: '%v'", target)
|
||||
if resp.Payload.BackendMode != "socks" {
|
||||
logrus.Infof("sharing target: '%v'", target)
|
||||
|
||||
if resp.Payload.BackendProxyEndpoint != target {
|
||||
upReq := share.NewUpdateShareParams()
|
||||
upReq.Body = &rest_model_zrok.UpdateShareRequest{
|
||||
ShrToken: shrToken,
|
||||
BackendProxyEndpoint: target,
|
||||
}
|
||||
if _, err := zrok.Share.UpdateShare(upReq, auth); err != nil {
|
||||
if !panicInstead {
|
||||
tui.Error("unable to update backend proxy endpoint", err)
|
||||
if resp.Payload.BackendProxyEndpoint != target {
|
||||
upReq := share.NewUpdateShareParams()
|
||||
upReq.Body = &rest_model_zrok.UpdateShareRequest{
|
||||
ShrToken: shrToken,
|
||||
BackendProxyEndpoint: target,
|
||||
}
|
||||
panic(err)
|
||||
if _, err := zrok.Share.UpdateShare(upReq, auth); err != nil {
|
||||
if !panicInstead {
|
||||
tui.Error("unable to update backend proxy endpoint", err)
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
logrus.Infof("updated backend proxy endpoint to: %v", target)
|
||||
} else {
|
||||
logrus.Infof("using existing backend proxy endpoint: %v", target)
|
||||
}
|
||||
logrus.Infof("updated backend proxy endpoint to: %v", target)
|
||||
} else {
|
||||
logrus.Infof("using existing backend proxy endpoint: %v", target)
|
||||
}
|
||||
|
||||
var shareDescription string
|
||||
|
Loading…
Reference in New Issue
Block a user