15467: Replace KeepServices with SbatchEnvironmentVariables
[arvados.git] / lib / config / deprecated.go
index 7ae69708eb53d06334b2e732c944f31fb41a3e2d..3d4c252528046b9e281d272bb5264e7b4d06d0be 100644 (file)
@@ -7,7 +7,6 @@ package config
 import (
        "fmt"
        "io/ioutil"
-       "net/url"
        "os"
        "strings"
 
@@ -198,18 +197,14 @@ func loadOldClientConfig(cluster *arvados.Cluster, client *arvados.Client) {
                cluster.SystemRootToken = client.AuthToken
        }
        cluster.TLS.Insecure = client.Insecure
-       for _, r := range client.KeepServiceURIs {
-               if cluster.Containers.SLURM.KeepServices == nil {
-                       cluster.Containers.SLURM.KeepServices = make(map[string]arvados.Service)
-               }
-               if cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs == nil {
-                       cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"] = arvados.Service{InternalURLs: make(map[arvados.URL]arvados.ServiceInstance)}
-               }
-               p, err := url.Parse(r)
-               if err == nil {
-                       cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs[arvados.URL(*p)] = struct{}{}
+       ks := ""
+       for i, u := range client.KeepServiceURIs {
+               if i > 0 {
+                       ks += " "
                }
+               ks += u
        }
+       disp.cluster.Containers.SLURM.SbatchEnvironmentVariables = map[string]string{"ARVADOS_KEEP_SERVICES": ks}
 }
 
 // update config using values from an crunch-dispatch-slurm config file.