-
Notifications
You must be signed in to change notification settings - Fork 344
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
(#5654) Added emptyDir support to mount trait #5709
(#5654) Added emptyDir support to mount trait #5709
Conversation
Also I renamed the existing mount trait field |
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 but we need to revert a major API change introduced.
pkg/apis/camel/v1/trait/mount.go
Outdated
@@ -33,7 +33,9 @@ type MountTrait struct { | |||
// Syntax: [configmap|secret]:name[/key][@path], where name represents the resource name, key optionally represents the resource key to be filtered and path represents the destination path | |||
Resources []string `property:"resources" json:"resources,omitempty"` | |||
// A list of Persistent Volume Claims to be mounted. Syntax: [pvcname:/container/path] | |||
Volumes []string `property:"volumes" json:"volumes,omitempty"` | |||
PersistentVolumeClaims []string `property:"persistent-volume-claims" json:"persistentVolumeClaims,omitempty"` |
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 cannot change this without a period of deprecation notice. This change affects the API specification, so, it must be reverted. It was an unfortunate choice when we created it as it really was meant to be PersistentVolumeClaims. We may think to change this when moving to a major API upgrade.
pkg/trait/mount_test.go
Outdated
Configs: []string{"configmap:my-cm"}, | ||
Resources: []string{"secret:my-secret"}, | ||
PersistentVolumeClaims: []string{"my-pvc:/over/the/rainbow"}, | ||
EmptyDirs: []string{"my-empty-dir:/some/path"}, |
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 should create a new test with empty dirs instead. So we test both the default (void) and the presence of the parameter.
a9fde33
to
6ea745c
Compare
@squakez Made the appropriate changes and updated the test as well. Thanks for the feedback! |
Handles: #5654
Currently there is no way to add an emptyDir volume without using a pod template. This is useful but using the pod template will override any volumes mounted when using the mount trait e.g. configmaps, secrets.
This PR adds the trait field
mount.empty-dirs
which uses the same syntax as the existingmount.volumes
trait field. To add an emptyDir volume use:trait=mount.empty-dirs=my-empty-dir:/var/test
📓 Note that the trait field
empty-dirs
will be translated toemptyDirs
in the integration yaml (if using helm or working with yaml directly)The example above will add the following to your integration yaml
Release Note