@@ -84,9 +84,14 @@ func TarFromSource(apiClient *api.ScalewayAPI, source string) (*io.ReadCloser, e
84
84
remoteCommand = append (remoteCommand , base )
85
85
86
86
// Resolve gateway
87
- gateway , err := api .ResolveGateway (apiClient , cpGateway )
88
- if err != nil {
89
- log .Fatalf ("Cannot resolve Gateway '%s': %v" , cpGateway , err )
87
+ var gateway string
88
+ if cpGateway == serverID || cpGateway == serverParts [0 ] {
89
+ gateway = ""
90
+ } else {
91
+ gateway , err = api .ResolveGateway (apiClient , cpGateway )
92
+ if err != nil {
93
+ log .Fatalf ("Cannot resolve Gateway '%s': %v" , cpGateway , err )
94
+ }
90
95
}
91
96
92
97
// execCmd contains the ssh connection + the remoteCommand
@@ -173,9 +178,14 @@ func UntarToDest(apiClient *api.ScalewayAPI, sourceStream *io.ReadCloser, destin
173
178
remoteCommand = append (remoteCommand , "-xf" , "-" )
174
179
175
180
// Resolve gateway
176
- gateway , err := api .ResolveGateway (apiClient , cpGateway )
177
- if err != nil {
178
- log .Fatalf ("Cannot resolve Gateway '%s': %v" , cpGateway , err )
181
+ var gateway string
182
+ if cpGateway == serverID || cpGateway == serverParts [0 ] {
183
+ gateway = ""
184
+ } else {
185
+ gateway , err = api .ResolveGateway (apiClient , cpGateway )
186
+ if err != nil {
187
+ log .Fatalf ("Cannot resolve Gateway '%s': %v" , cpGateway , err )
188
+ }
179
189
}
180
190
181
191
// execCmd contains the ssh connection + the remoteCommand
0 commit comments