rebase: remove protobuf dependency locking

this commit remove the protobuf dependency locking in the module
description.

Also, ptypes.TimestampProto is deprecated and this commit
make use of the timestamppb.New() for the construction.

ParseTime() function has been removed and callers adjusted to the
same.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2022-11-11 16:10:24 +05:30
committed by mergify[bot]
parent d772fc098c
commit 71c4ae542c
14 changed files with 84 additions and 67 deletions

View File

@ -16,16 +16,6 @@ limitations under the License.
package util
import (
"context"
"time"
"github.com/ceph/ceph-csi/internal/util/log"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/timestamp"
)
// VolumeID string representation.
type VolumeID string
@ -36,14 +26,3 @@ const (
// RadosNamespace to store CSI specific objects and keys.
RadosNamespace = "csi"
)
func ParseTime(ctx context.Context, createTime time.Time) (*timestamp.Timestamp, error) {
tm, err := ptypes.TimestampProto(createTime)
if err != nil {
log.ErrorLog(ctx, "failed to convert time %s %v", createTime, err)
return tm, err
}
return tm, nil
}