Skip to content

Commit

Permalink
revert admin changes
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Nov 27, 2024
1 parent 3316c94 commit 1f9dca3
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions flyteadmin/dataproxy/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,17 @@ func (s Service) CreateDownloadLink(ctx context.Context, req *service.CreateDown
return nil, errors.NewFlyteAdminErrorf(codes.Internal, "no deckUrl found for request [%+v]", req)
}

// Check if the native url exists
metadata, err := s.dataStore.Head(ctx, storage.DataReference(nativeURL))
ref := storage.DataReference(nativeURL)
meta, err := s.dataStore.Head(ctx, ref)
if err != nil {
return nil, errors.NewFlyteAdminErrorf(codes.Internal, "Failed to check the existence of the URL [%s]. Error: %v", nativeURL, err)
return nil, errors.NewFlyteAdminErrorf(codes.Internal, "failed to head object before signing url. Error: %v", err)
}
if !metadata.Exists() {
return nil, errors.NewFlyteAdminErrorf(
codes.NotFound,
"URL [%s] does not exist yet. Please try again later. If you are using the real-time deck, this could be because the 'persist' function has not been called yet.",
nativeURL)

if !meta.Exists() {
return nil, errors.NewFlyteAdminErrorf(codes.NotFound, "object not found")
}

signedURLResp, err := s.dataStore.CreateSignedURL(ctx, storage.DataReference(nativeURL), storage.SignedURLProperties{
signedURLResp, err := s.dataStore.CreateSignedURL(ctx, ref, storage.SignedURLProperties{
Scope: stow.ClientMethodGet,
ExpiresIn: req.GetExpiresIn().AsDuration(),
})
Expand Down

0 comments on commit 1f9dca3

Please sign in to comment.