feat: Label new volumes as managed by uncloud (#79)

This commit is contained in:
Anton Ovchinnikov
2025-06-23 22:05:05 +02:00
committed by GitHub
parent 26f34df3e6
commit 44549c00fd
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -345,6 +345,12 @@ func (s *Server) CreateVolume(ctx context.Context, req *pb.CreateVolumeRequest)
return nil, status.Errorf(codes.InvalidArgument, "unmarshal options: %v", err)
}
// Always add the managed label to the volume to indicate that it is managed by Uncloud.
if opts.Labels == nil {
opts.Labels = make(map[string]string)
}
opts.Labels[api.LabelManaged] = ""
vol, err := s.client.VolumeCreate(ctx, opts)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())