19166: Return better error message to incompatible arvados-client.
authorTom Clegg <tom@curii.com>
Thu, 7 Jul 2022 03:08:21 +0000 (23:08 -0400)
committerTom Clegg <tom@curii.com>
Thu, 7 Jul 2022 03:08:21 +0000 (23:08 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/controller/router/router.go

index a87dbca92664254df43b12b73a2fd15917f137fe..80d5e929850cd18df389daeddb18eb4b12387a38 100644 (file)
@@ -244,6 +244,17 @@ func (rtr *router) addRoutes() {
                                return rtr.backend.ContainerSSH(ctx, *opts.(*arvados.ContainerSSHOptions))
                        },
                },
+               {
+                       // arvados-client built before commit
+                       // bdc29d3129f6d75aa9ce0a24ffb849a272b06f08
+                       // used GET with params in headers instead of
+                       // POST form
+                       arvados.APIEndpoint{"GET", "arvados/v1/connect/{uuid}/ssh", ""},
+                       func() interface{} { return &arvados.ContainerSSHOptions{} },
+                       func(ctx context.Context, opts interface{}) (interface{}, error) {
+                               return nil, httpError(http.StatusGone, fmt.Errorf("API endpoint is obsolete -- please upgrade your arvados-client program"))
+                       },
+               },
                {
                        arvados.EndpointContainerGatewayTunnel,
                        func() interface{} { return &arvados.ContainerGatewayTunnelOptions{} },