17495: Merge branch 'master' into 17495-document-dedup-report
[arvados.git] / lib / config / deprecated_keepstore.go
index a7d41e985376f4e55119fba360c71c4953c118ec..186ffc3371ea6e80a80be442278fbf6b5cf596b4 100644 (file)
@@ -18,7 +18,7 @@ import (
        "strings"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/arvados"
+       "git.arvados.org/arvados.git/sdk/go/arvados"
        "github.com/sirupsen/logrus"
 )
 
@@ -118,7 +118,7 @@ func (ldr *Loader) loadOldKeepstoreConfig(cfg *arvados.Config) error {
                return err
        }
 
-       myURL := arvados.URL{Scheme: "http"}
+       myURL := arvados.URL{Scheme: "http", Path: "/"}
        if oc.TLSCertificateFile != nil && oc.TLSKeyFile != nil {
                myURL.Scheme = "https"
        }
@@ -137,7 +137,7 @@ func (ldr *Loader) loadOldKeepstoreConfig(cfg *arvados.Config) error {
                cluster.TLS.Key = "file://" + *v
        }
        if v := oc.Listen; v != nil {
-               if _, ok := cluster.Services.Keepstore.InternalURLs[arvados.URL{Scheme: myURL.Scheme, Host: *v}]; ok {
+               if _, ok := cluster.Services.Keepstore.InternalURLs[arvados.URL{Scheme: myURL.Scheme, Host: *v, Path: "/"}]; ok {
                        // already listed
                        myURL.Host = *v
                } else if len(*v) > 1 && (*v)[0] == ':' {
@@ -537,6 +537,7 @@ func keepServiceURL(ks arvados.KeepService) arvados.URL {
        url := arvados.URL{
                Scheme: "http",
                Host:   net.JoinHostPort(ks.ServiceHost, strconv.Itoa(ks.ServicePort)),
+               Path:   "/",
        }
        if ks.ServiceSSLFlag {
                url.Scheme = "https"
@@ -584,7 +585,7 @@ func keepServiceIsMe(ks arvados.KeepService, hostname string, listen string) boo
 // been warned about in loadOldKeepstoreConfig() -- i.e., unmigrated
 // keepstore hosts other than the present host, and obsolete content
 // in the keep_services table.
-func (ldr *Loader) checkPendingKeepstoreMigrations(cluster arvados.Cluster) error {
+func (ldr *Loader) checkPendingKeepstoreMigrations(cluster *arvados.Cluster) error {
        if cluster.Services.Controller.ExternalURL.String() == "" {
                ldr.Logger.Debug("Services.Controller.ExternalURL not configured -- skipping check for pending keepstore config migrations")
                return nil
@@ -593,7 +594,7 @@ func (ldr *Loader) checkPendingKeepstoreMigrations(cluster arvados.Cluster) erro
                ldr.Logger.Debug("(Loader).SkipAPICalls == true -- skipping check for pending keepstore config migrations")
                return nil
        }
-       client, err := arvados.NewClientFromConfig(&cluster)
+       client, err := arvados.NewClientFromConfig(cluster)
        if err != nil {
                return err
        }