Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snapshot creation, deletion and restore from snapshot, Clone from PVC support for CephFS volumes. #394

Merged
merged 27 commits into from
Aug 8, 2020
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fe74c03
deploy: add csi-cephfsplugin provisioner deployment and role
humblec Aug 3, 2020
2d86457
helm: add deployment charts for cephfs csi snapshotter and roles
humblec Aug 3, 2020
6259a4b
e2e: add/modify deployment files for cephfs snapshot/clone tests
humblec Aug 3, 2020
340a15d
deploy: update external provisioner version to v1.6.0 from v1.4.0
humblec Aug 3, 2020
038071e
e2e: introduce writeDataInPod() to write data to an attached PVC
humblec Aug 3, 2020
e0def3c
e2e: introduce createCephFSSnapshotClass creation
humblec Aug 3, 2020
d243e97
e2e: add test cases for cephfs snapshot creation,deletion and restore
humblec Aug 3, 2020
b3d1d90
cephfs: make use of expand operation lock in ControllerExpandVolume
humblec Aug 3, 2020
e1ea1ac
cephfs: add snapshotlock and operationlock to controllerserver
humblec Aug 3, 2020
3460375
cephfs: change createBackingVolume to accomodate clone operations
humblec Aug 3, 2020
bf03614
cephfs: add checkContentSource() to validate the data source
humblec Aug 3, 2020
0268a8c
cephfs: add various error strings for command validation
humblec Aug 3, 2020
62fa5ef
cephfs: retrieve NewCSISnapshotJournal with namespace set
humblec Aug 3, 2020
ab71114
cephfs: introduce newSnapshotOptionsFromID to generate volOpt and sid
humblec Aug 3, 2020
b8fe1b0
cephfs: add snapshot create/delete capabilities in controllerserver
humblec Aug 4, 2020
7e84873
cephfs: use delete operation lock in delete volume
humblec Aug 4, 2020
7d59196
cephfs: change createvolume for snapshot/clone workflow
humblec Aug 4, 2020
13885cb
cephfs: add snapshot and clone helper functions
humblec Aug 7, 2020
9daa0ea
cephfs: Change checkVolExist for snapshot and clone workflow
humblec Aug 7, 2020
3bb069a
cephfs: validate create volume request
humblec Aug 4, 2020
c820f3a
cephfs: add snap reserve/unreserve and snap exist functionalities
humblec Aug 4, 2020
211ca6f
cephfs: remove inValidCommmand and errNotFoundString
humblec Aug 4, 2020
09b9db8
cephfs: add subvolume struct and getSubvolumeInfo calls
humblec Aug 4, 2020
cc2c616
cephfs: getVolumeRootPathCeph and purgeVolume use new error strings
humblec Aug 4, 2020
1fa7308
cephfs: add snapshot create and delete functionalilies
humblec Aug 4, 2020
9f65173
cephfs: introduce parsetime() to parse createdAt field in snap return
humblec Aug 7, 2020
36babba
e2e: remove volume populate test case and also change writeDataInPod()
humblec Aug 4, 2020
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
Prev Previous commit
Next Next commit
cephfs: introduce parsetime() to parse createdAt field in snap return
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
  • Loading branch information
humblec authored and mergify-bot committed Aug 7, 2020
commit 9f6517359c6869e97f653eabe756a424823a3f7e
21 changes: 21 additions & 0 deletions internal/cephfs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ import (
"encoding/json"
"errors"
"fmt"
"time"

"github.com/ceph/ceph-csi/internal/util"

humblec marked this conversation as resolved.
Show resolved Hide resolved
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/timestamp"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
klog "k8s.io/klog/v2"
Expand Down Expand Up @@ -158,3 +161,21 @@ func getMonsAndClusterID(ctx context.Context, options map[string]string) (monito

return
}

func parseTime(ctx context.Context, createTime string) (*timestamp.Timestamp, error) {
tm := &timestamp.Timestamp{}
layout := "2006-01-02 15:04:05.000000"
// TODO currently parsing of timestamp to time.ANSIC generate from ceph fs is failng
var t time.Time
t, err := time.Parse(layout, createTime)
if err != nil {
klog.Errorf(util.Log(ctx, "failed to parse time %s %v"), createTime, err)
return tm, err
}
tm, err = ptypes.TimestampProto(t)
if err != nil {
klog.Errorf(util.Log(ctx, "failed to convert time %s %v"), createTime, err)
return tm, err
}
return tm, nil
}