Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/controlplane/internal/service/casredirect.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Copyright 2023 The Chainloop Authors.
// Copyright 2023-2026 The Chainloop Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -110,6 +110,11 @@ func (s *CASRedirectService) GetDownloadURL(ctx context.Context, req *pb.GetDown
return nil, kerrors.NotFound("not found", "CAS backend is inline")
}

// check if the backend is on a valid state, if not return an error
if backend.ValidationStatus != biz.CASBackendValidationOK {
return nil, pb.ErrorCasBackendErrorReasonInvalid("CAS Storage is in an invalid state and can't download artifacts, please fix it before attempting it again")
}

// Create an URL to download the artifact from the CAS backend
downloadBase, err := url.Parse(s.casServerConf.GetDownloadUrl())
if err != nil {
Expand Down
Loading