-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: encrypt option can only choose encrypted storage class when creating VM image #93
base: main
Are you sure you want to change the base?
Conversation
… creating image Signed-off-by: andy.lee <[email protected]>
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find((s) => s.isDefault); | ||
|
||
// if default sc is encrypted, use longhorn as default | ||
return defaultStorage.isEncrypted ? LONGHORN : defaultStorage?.metadata?.name; |
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.
Is there any chance that longhorn
could be deleted, or is it not deletable?
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.
Longhorn sc can be deleted from UI. But backend won't actually delete it.
cc @Vicente-Cheng
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.
That was actually deleted but soon was recreated by someone...
|
||
defaultStorageClassName() { | ||
const inStore = this.$store.getters['currentProduct'].inStore; | ||
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find((s) => s.isDefault); |
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.
fallback to longhorn
is there is no defaultStorage
?
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.
Good idea. If there is no default SC, we can fallback to longhorn.
if (this.value.spec?.securityParameters?.cryptoOperation === ENCRYPT) { | ||
this.storageClassName = this.encryptedStorageClasses[0]?.name || LONGHORN; | ||
} else { // URL / FILE / DECRYPT should use default storage class | ||
this.storageClassName = this.defaultStorageClassName(); |
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.
We use this.value.metadata.annotations[HCI_ANNOTATIONS.STORAGE_CLASS]
to retrieve the storageClassName
on line 177.
Is this value always be the same of this.$store.getters[${ inStore }/all](STORAGE_CLASS).find((s) => s.isDefault)
?
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.
updated in 6e9350e
Signed-off-by: andy.lee <[email protected]>
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
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
Summary
PR Checklists
Related Issue
harvester/harvester#6792
Test screenshot/video
feature_img.mov