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

📖 Clarify storage class requirement for crypto.encryptionClassName API #747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions api/v1alpha3/virtualmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ type VirtualMachineCryptoSpec struct {
// If the underlying vSphere platform does not have a default key provider,
// then this field is required when specifying an encryption storage class
// and/or a VM Class with a vTPM.
//
// If this field is set, spec.storageClass must use an encryption-enabled
// storage class.
EncryptionClassName string `json:"encryptionClassName,omitempty"`

// +optional
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,9 @@ spec:
If the underlying vSphere platform does not have a default key provider,
then this field is required when specifying an encryption storage class
and/or a VM Class with a vTPM.

If this field is set, spec.storageClass must use an encryption-enabled
storage class.
type: string
useDefaultKeyProvider:
default: true
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/vmoperator.vmware.com_virtualmachines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3818,6 +3818,9 @@ spec:
If the underlying vSphere platform does not have a default key provider,
then this field is required when specifying an encryption storage class
and/or a VM Class with a vTPM.

If this field is set, spec.storageClass must use an encryption-enabled
storage class.
type: string
useDefaultKeyProvider:
default: true
Expand Down
5 changes: 4 additions & 1 deletion docs/ref/api/v1alpha3.md
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,10 @@ minus any virtual disks, will be encrypted.

If the underlying vSphere platform does not have a default key provider,
then this field is required when specifying an encryption storage class
and/or a VM Class with a vTPM. |
and/or a VM Class with a vTPM.

If this field is set, spec.storageClass must use an encryption-enabled
storage class. |
| `useDefaultKeyProvider` _boolean_ | UseDefaultKeyProvider describes the desired behavior for when an explicit
EncryptionClass is not provided.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ func (v validator) validateCrypto(
allErrs = append(allErrs, field.InternalError(encClassNamePath, err))

} else if !ok {
// Return an error on the "vm.Spec.Crypto.EncryptionClassName" path
// instead of "vm.Spec.StorageClass" because the storage class is
// invalid due to the user's choice of encryption class name.
allErrs = append(allErrs, field.Invalid(
encClassNamePath,
vm.Spec.Crypto.EncryptionClassName,
Expand Down
Loading