Refactor `EncryptionConfig` for AWSManagedControlPlane
#2,540 opened on Jun 24, 2021
Repository metrics
- Stars
- (723 stars)
- PR merge metrics
- (PR metrics pending)
Description
/area provider/eks /kind api-change /kind refactor /milestone v0.7.0 /help /priority important-soon
Describe the solution you'd like You can optionally enable encryption for EKS by supplying details in AWSManagedControlPlane.Spec.EncryptionConfig. As its optional, it is a pointer and marked as optional and omitempty.
If you want to enable encryption, then you must supply the provider and resources. Currently, these are pointers and not marked as required. We should mark these as required using kubebuilder validation and remove the pointers/omitempty.
This was noticed whilst making a change for #2505
Anything else you would like to add: So perhaps something like this:
// EncryptionConfig specifies the encryption configuration for the EKS clsuter.
type EncryptionConfig struct {
// Provider specifies the ARN or alias of the CMK (in AWS KMS)
// +kubebuilder:validation:Required
Provider string `json:"provider"`
// Resources specifies the resources to be encrypted
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinItems=1
Resources []string `json:"resources"`
}
This will cause problems with the generated deepcopy and conversion functions which will need to be fixed.
Environment:
- Cluster-api-provider-aws version: 0.6.6