diff --git a/dataproxy/service.go b/dataproxy/service.go index a62d37b43..05b364daf 100644 --- a/dataproxy/service.go +++ b/dataproxy/service.go @@ -77,10 +77,16 @@ func (s Service) CreateUploadLocation(ctx context.Context, req *service.CreateUp } md5 := base64.StdEncoding.EncodeToString(req.ContentMd5) - urlSafeMd5 := base32.StdEncoding.EncodeToString(req.ContentMd5) + var prefix string + if len(req.FilenameRoot) > 0 { + prefix = req.FilenameRoot + } else { + // url safe base32 encoding + prefix = base32.StdEncoding.EncodeToString(req.ContentMd5) + } storagePath, err := createStorageLocation(ctx, s.dataStore, s.cfg.Upload, - req.Project, req.Domain, urlSafeMd5, req.Filename) + req.Project, req.Domain, prefix, req.Filename) if err != nil { return nil, errors.NewFlyteAdminErrorf(codes.Internal, "failed to create shardedStorageLocation, Error: %v", err) } diff --git a/go.mod b/go.mod index 46ef4b0de..388c650f3 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/cloudevents/sdk-go/v2 v2.8.0 github.com/coreos/go-oidc v2.2.1+incompatible github.com/evanphx/json-patch v4.12.0+incompatible - github.com/flyteorg/flyteidl v1.5.7 + github.com/flyteorg/flyteidl v1.5.11 github.com/flyteorg/flyteplugins v1.0.56 github.com/flyteorg/flytepropeller v1.1.87 github.com/flyteorg/flytestdlib v1.0.15 diff --git a/go.sum b/go.sum index 255fa8893..dedb61115 100644 --- a/go.sum +++ b/go.sum @@ -314,6 +314,10 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flyteorg/flyteidl v1.5.7 h1:voAxMMFsKOseNFSlCyRGlpegqtQXtJjyxgsQzZg4tts= github.com/flyteorg/flyteidl v1.5.7/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og= +github.com/flyteorg/flyteidl v1.5.11-0.20230615182642-01c711f0a4d7 h1:lDqtfcevqPPwcCwHxoUpFs0JiQ7U1nEMMrMNy8p8Iko= +github.com/flyteorg/flyteidl v1.5.11-0.20230615182642-01c711f0a4d7/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og= +github.com/flyteorg/flyteidl v1.5.11 h1:Xcb17YqNstl+dHQsK+o0Ac+1l1U154wXivg28O3C5l0= +github.com/flyteorg/flyteidl v1.5.11/go.mod h1:EtE/muM2lHHgBabjYcxqe9TWeJSL0kXwbI0RgVwI4Og= github.com/flyteorg/flyteplugins v1.0.56 h1:kBTDgTpdSi7wcptk4cMwz5vfh1MU82VaUMMboe1InXw= github.com/flyteorg/flyteplugins v1.0.56/go.mod h1:aFCKSn8TPzxSAILIiogHtUnHlUCN9+y6Vf+r9R4KZDU= github.com/flyteorg/flytepropeller v1.1.87 h1:Px7ASDjrWyeVrUb15qXmhw9QK7xPcFjL5Yetr2P6iGM=