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