Always prefer explicit configuration parameters over inferring behavior from indirect sources like image tags, naming conventions, or environment factors. When behavior needs to vary based on environment or version, introduce dedicated configuration parameters that users can explicitly set rather than relying on potentially unreliable metadata.
Always prefer explicit configuration parameters over inferring behavior from indirect sources like image tags, naming conventions, or environment factors. When behavior needs to vary based on environment or version, introduce dedicated configuration parameters that users can explicitly set rather than relying on potentially unreliable metadata.
This practice ensures that:
For example, instead of:
# DON'T: Inferring behavior from image tag
{{- if hasPrefix .Values.images.gitSync.tag "v3" }}
# Use v3 configuration
{{- else }}
# Use v4 configuration
{{- end }}
Use:
# DO: Explicit configuration parameter
gitSync:
version: "v4" # Explicit parameter users can set
{{- if eq .Values.gitSync.version "v3" }}
# Use v3 configuration
{{- else }}
# Use v4 configuration
{{- end }}
When adding configuration parameters that might interact with existing ones, clearly document their relationships and ensure proper handling of all cases. For instance, document when certain parameters might be ignored under specific conditions, and consider providing mechanisms to merge or append user-defined values with defaults.
Enter the URL of a public GitHub repository