-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add defaultMode to additionalConfigMaps #647
Conversation
@@ -1063,6 +1063,7 @@ additionalConfigMaps: [] | |||
# keys: | |||
# - fileName: hello.properties | |||
# mountPath: /opt/atlassian/jira/atlassian-jira/WEB-INF/classes | |||
# defaultMode: |
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.
I find it a bit confusing to put defaultMode
under each key.
mode
in my opinion might be a better addition, so that we'll have spec.template.spec.volumes[n].configMap.items.mode
in the statefulset.
Maybe it makes more sense to put defaultMode
at configmap level? i.e.
- name: extra-configmap
defaultMode:
keys:
- fileName: hello.properties
mountPath: /opt/atlassian/jira/atlassian-jira/WEB-INF/classes
mode:
content: |
foo=bar
hello=world
But I have limited knowledge on how you designed additionalConfigMaps
at the beginning, happy to have a chat about it.
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.
@yzha645 thanks for your comment. I tried to use K8s terms, so, defaultMode is the volume's defaultMode. See: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#configmapvolumesource-v1-core
Also, if we move it one level up, and they have an override in each key, this will make template even more complicated - we'll have to check if defaultMode is set and then if keys[n].mode is defined. I don't see any scenarios where this type of flexibility will help.
Also, setting defaultMode is a rare case. You mostly need it if you want to make the mounted file executable.
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.
yea, thanks for the clarification. I guess in our case, each configmapvolumesource will have one and only one item, so whether set defaultMode
in upper level or mode
in item level probably have the same effect.
We may want to make mounted files executable, so control over defaultMode will help. Other uses cases - security requirements that may enforce certain default modes.
Checklist
e2e
label)