-
Notifications
You must be signed in to change notification settings - Fork 6k
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
mgr/dashboard: Auto-create a name for RBD image snapshots #23735
Conversation
5c68eed
to
05085ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is useful as it makes sure that snapshot names are unique by default.
} else { | ||
// Auto-create a name for the snapshot: <image_name>_<timestamp_ISO_8601> | ||
// https://en.wikipedia.org/wiki/ISO_8601 | ||
snapName = `${this.rbdName}-${moment().format('YYYYMMDD[T]HHmmss[Z]')}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Z
indicates you are using the Zulu timezone, you need to convert the date to UTC before doing the format.
- snapName = `${this.rbdName}-${moment().format('YYYYMMDD[T]HHmmss[Z]')}`;
+ snapName = `${this.rbdName}-${moment().utc().format('YYYYMMDD[T]HHmmss[Z]')}`;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx, seems i misunderstood the docu. I thought moment() is just UTC.
05085ef
to
5f3b13c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for the missing tests everything LGTM - Good work :)
...d/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts
Outdated
Show resolved
Hide resolved
67e99b2
to
4503091
Compare
9a7cfa8
to
d9efce2
Compare
retest this please |
d9efce2
to
22429a5
Compare
Signed-off-by: Volker Theile <vtheile@suse.com>
22429a5
to
bc52473
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
If the user creates an snapshot of a RBD image, then a name according to ISO 8601 (<image_name>_<timestamp_ISO_8601>, e.g. test01-20180824T170532Z) will be auto-created. This can still be modified by the user.
Note, the timestamp encoded in the snapshot name is NOT the real creation date (that's because the snapshot is created after you pressed the
Create Snapshot
button and the timestamp is the one when the dialog appears in the UI). To workaround this issue we can drop the HHMMSS part from the snapshot name if necessary.Signed-off-by: Volker Theile vtheile@suse.com