15467: Adding KeepServices WIP
[arvados.git] / lib / config / deprecated.go
index cfd77ced23bd4e7a228f57a712c99d269ad964fa..ce9b2e4d01d3654c73faf8855acc99c53832cc74 100644 (file)
@@ -7,6 +7,7 @@ package config
 import (
        "fmt"
        "io/ioutil"
+       "net/url"
        "os"
        "strings"
 
@@ -197,6 +198,16 @@ 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"].InternalURLs = map[arvados.URL]arvados.ServiceInstance{}
+               }
+               p, err := url.Parse(r)
+               cluster.Containers.SLURM.KeepServices["00000-bi6l4-000000000000000"].InternalURLs[arvados.URL(p)] = struct{}{}
+       }
 }
 
 // update config using values from an crunch-dispatch-slurm config file.