Skip to content

Commit

Permalink
Fixes to allow topology to still work
Browse files Browse the repository at this point in the history
Made writebackhost be advertised within `AdvertiseOSDF`
  • Loading branch information
joereuss12 committed Dec 19, 2023
1 parent fb6369b commit 8b3bc64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,14 @@ func DoStashCPSingle(sourceFile string, destination string, methods []string, re
OSDFDirectorUrl := param.Federation_DirectorUrl.GetString()
useOSDFDirector := viper.IsSet("Federation.DirectorURL")

var ns namespaces.Namespace

if destScheme == "stash" || destScheme == "osdf" || destScheme == "pelican" {
log.Debugln("Detected writeback")
if !strings.HasPrefix(destination, "/") {
destination = strings.TrimPrefix(destination, destScheme+"://")
}
var ns namespaces.Namespace
// If we have a director set, go through that for namespace info, otherwise use topology
if useOSDFDirector {
destination = strings.TrimPrefix(destination, destScheme+"://")
dirResp, err := QueryDirector(destination, OSDFDirectorUrl)
if err != nil {
log.Errorln("Error while querying the Director:", err)
Expand Down Expand Up @@ -542,6 +543,8 @@ func DoStashCPSingle(sourceFile string, destination string, methods []string, re
if string(sourceFile[0]) != "/" {
sourceFile = "/" + sourceFile
}

var ns namespaces.Namespace
// If we have a director set, go through that for namespace info, otherwise use topology
if useOSDFDirector {
dirResp, err := QueryDirector(sourceFile, OSDFDirectorUrl)
Expand Down
1 change: 1 addition & 0 deletions director/advertise.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func AdvertiseOSDF() error {
nsAd.RequireToken = ns.UseTokenOnRead
nsAd.Path = ns.Path
nsAd.DirlistHost = ns.DirlistHost
nsAd.WritebackHost = ns.WritebackHost
issuerURL, err := url.Parse(ns.CredentialGeneration.Issuer)
if err != nil {
log.Warningf("Invalid URL %v when parsing topology response: %v\n", ns.CredentialGeneration.Issuer, err)
Expand Down

0 comments on commit 8b3bc64

Please sign in to comment.