update PC-SDK calls to new function (status still broken)
This commit is contained in:
parent
268824fb91
commit
9fa99118d5
7
main.go
7
main.go
@ -96,14 +96,13 @@ func indexAllInstances(config state.Config) state.Config {
|
|||||||
func createTunnels(config state.Config) {
|
func createTunnels(config state.Config) {
|
||||||
for serviceUUID, service := range config.MTD.Services {
|
for serviceUUID, service := range config.MTD.Services {
|
||||||
if service.AdminEnabled && service.Active {
|
if service.AdminEnabled && service.Active {
|
||||||
s := pcsdk.NewCommandStatus()
|
proxy := pcsdk.BuildProxy(netip.AddrPortFrom(service.EntryIP, config.MTD.ManagementPort))
|
||||||
err := s.Execute(netip.AddrPortFrom(service.EntryIP, config.MTD.ManagementPort))
|
err := proxy.Status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Reconfigure Proxy to new instance
|
// Reconfigure Proxy to new instance
|
||||||
c := pcsdk.NewCommandCreate(service.EntryPort, service.ServicePort, service.ServiceIP, serviceUUID)
|
err = proxy.Create(service.EntryPort, service.ServicePort, service.ServiceIP, serviceUUID)
|
||||||
err = c.Execute(netip.AddrPortFrom(service.EntryIP, config.MTD.ManagementPort))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ func AWSMoveInstance(config state.Config) (state.Config) {
|
|||||||
|
|
||||||
// Test Proxy Connection
|
// Test Proxy Connection
|
||||||
t := time.Now()
|
t := time.Now()
|
||||||
s := pcsdk.NewCommandStatus()
|
proxy := pcsdk.BuildProxy(netip.AddrPortFrom(instance.EntryIP, config.MTD.ManagementPort))
|
||||||
err := s.Execute(netip.AddrPortFrom(instance.EntryIP, config.MTD.ManagementPort))
|
err := proxy.Status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("error executing test command: %s\n", err)
|
fmt.Printf("error executing test command: %s\n", err)
|
||||||
return config
|
return config
|
||||||
@ -93,8 +93,7 @@ func AWSMoveInstance(config state.Config) (state.Config) {
|
|||||||
|
|
||||||
// Reconfigure Proxy to new instance
|
// Reconfigure Proxy to new instance
|
||||||
t = time.Now()
|
t = time.Now()
|
||||||
m := pcsdk.NewCommandModify(config.MTD.Services[serviceUUID].ServicePort, config.MTD.Services[serviceUUID].ServiceIP, serviceUUID)
|
err = proxy.Modify(config.MTD.Services[serviceUUID].ServicePort, config.MTD.Services[serviceUUID].ServiceIP, serviceUUID)
|
||||||
err = m.Execute(netip.AddrPortFrom(config.MTD.Services[serviceUUID].EntryIP, config.MTD.ManagementPort))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("error executing modify command: %s\n", err)
|
fmt.Printf("error executing modify command: %s\n", err)
|
||||||
return config
|
return config
|
||||||
|
Loading…
Reference in New Issue
Block a user