]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: RBD snapshot name suggestion with local time suffix 27613/head
authorStephan Müller <smueller@suse.com>
Tue, 16 Apr 2019 15:22:41 +0000 (17:22 +0200)
committerStephan Müller <smueller@suse.com>
Mon, 29 Apr 2019 14:49:28 +0000 (16:49 +0200)
The new suffix is still a time that follows the ISO standard as it can
be converted into any other time zone through the time zone prefix of
itself.

Fixes: https://tracker.ceph.com/issues/23858
Signed-off-by: Stephan Müller <smueller@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts

index 522c60f8737242ecb5acc298688816fccbf52231..e6d0031b6d5e76a8c14c4c1fb3df92d7201ac0d4 100644 (file)
@@ -206,7 +206,7 @@ describe('RbdSnapshotListComponent', () => {
     it('should display suggested snapshot name', () => {
       component.openCreateSnapshotModal();
       expect(component.modalRef.content.snapName).toMatch(
-        RegExp(`^${component.rbdName}-\\d+T\\d+Z\$`)
+        RegExp(`^${component.rbdName}_[\\d-]+T[\\d.:]+\\+[\\d:]+\$`)
       );
     });
   });
index cc40bea3032a4a57ee0a5fa69a0d58950370251e..101525bf30b552f24922479251ff06dc2bb3e1b3 100644 (file)
@@ -167,9 +167,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
     } else {
       // Auto-create a name for the snapshot: <image_name>_<timestamp_ISO_8601>
       // https://en.wikipedia.org/wiki/ISO_8601
-      snapName = `${this.rbdName}-${moment()
-        .utc()
-        .format('YYYYMMDD[T]HHmmss[Z]')}`;
+      snapName = `${this.rbdName}_${moment().toISOString(true)}`;
     }
     this.modalRef.content.setSnapName(snapName);
     this.modalRef.content.onSubmit.subscribe((snapshotName: string) => {