Skip to content

Commit

Permalink
check if file service enabled, add cp version fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpetrovic committed Jan 9, 2025
1 parent 46d0492 commit 41af68d
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 225 deletions.
7 changes: 7 additions & 0 deletions pkg/abstractions/volume/multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ func joinCleanPath(parts ...string) string {
return filepath.Join(parts...)
}

func (s *GlobalVolumeService) GetFileServiceInfo(ctx context.Context, in *pb.GetFileServiceInfoRequest) (*pb.GetFileServiceInfoResponse, error) {
return &pb.GetFileServiceInfoResponse{
Ok: true,
Enabled: s.config.EndpointURL != "" && s.config.BucketName != "",
}, nil
}

func (s *GlobalVolumeService) CreatePresignedURL(ctx context.Context, in *pb.CreatePresignedURLRequest) (*pb.CreatePresignedURLResponse, error) {
authInfo, _ := auth.AuthInfoFromContext(ctx)

Expand Down
9 changes: 9 additions & 0 deletions pkg/abstractions/volume/volume.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ service VolumeService {
rpc StatPath(StatPathRequest) returns (StatPathResponse) {}

// Multipart Upload
rpc GetFileServiceInfo(GetFileServiceInfoRequest) returns (GetFileServiceInfoResponse) {}
rpc CreatePresignedURL(CreatePresignedURLRequest) returns (CreatePresignedURLResponse) {}
rpc CreateMultipartUpload(CreateMultipartUploadRequest) returns (CreateMultipartUploadResponse) {}
rpc CompleteMultipartUpload(CompleteMultipartUploadRequest) returns (CompleteMultipartUploadResponse) {}
Expand Down Expand Up @@ -133,6 +134,14 @@ enum PresignedURLMethod {
UploadPart = 3;
}

message GetFileServiceInfoRequest {}

message GetFileServiceInfoResponse {
bool ok = 1;
string err_msg = 2;
bool enabled = 3;
}

message CreatePresignedURLRequest {
string volume_name = 1;
string volume_path = 2;
Expand Down
Loading

0 comments on commit 41af68d

Please sign in to comment.