diff --git a/hips/hip-9999.md b/hips/hip-9999.md new file mode 100644 index 00000000..797ab810 --- /dev/null +++ b/hips/hip-9999.md @@ -0,0 +1,65 @@ +--- +hip: "9999" +title: "Support for Conditionals in helm dependency update" +authors: [ "Yonah Dissen " ] +created: "2023-04-13" +type: "feature" +status: "draft" +--- + +## Abstract: + +Currently, when using Helm charts with dependencies that have conditions specified in their Chart.yaml file e.g. +``` +dependencies: +- name: nginx + version: "1.3.1" + condition: is.enabled +``` +the conditionals are only evaluated during the installation process, +but not during the helm dependency update command. This can be confusing and can require workarounds to manage different versions of dependencies in different environments. +This proposal suggests enhancing the helm dependency update command to also evaluate the conditionals in the dependencies during the update process. + +## Motivation: + +Helm allows defining dependencies in a chart's Chart.yaml file which can have conditions specified using the condition field. This allows installing different versions of a dependency based on environment-specific requirements. +However, the current behavior of helm dependency update command, which updates all dependencies regardless of their conditions, +can cause confusion and inconvenience when managing different versions of dependencies in different environments. +In addition this would save unneccessary storage space consumed by the unwanted dependencies. + +## Proposal: + +The proposal suggests enhancing the helm dependency update command to evaluate the conditions specified in the dependencies' Chart.yaml file. +Currently, during the update process, helm dependency update fetches the latest versions of all dependencies and updates the requirements.lock file. +The proposal suggests modifying the update process to also consider the conditions specified in the dependencies, and only update the dependencies that satisfy their conditions. +This can be achieved by reusing the existing code used during the installation process that evaluates the conditions, and applying it during the helm dependency update command as well. + +This enhancement would make managing different versions of dependencies in different environments more straightforward, without requiring workarounds such as using alias charts or conditional logic in the chart templates. +It would align with the behavior of dependencies during the installation process and provide a more intuitive and consistent experience for Helm users. + +## Implementation Details: + +The implementation of this proposal would require modifying the helm dependency update command to evaluate the conditions specified in the dependencies' Chart.yaml file during the update process. +This can be achieved by reusing the existing code used during the installation process that evaluates the conditions and updating the dependencies' versions only if their conditions are satisfied. +The updated dependencies' versions would then be reflected in the requirements.lock file. + +## Backward Compatibility: + +This proposal enhances the behavior of helm dependency update to evaluate the conditions specified in the dependencies' Chart.yaml file. +Existing charts with dependencies that do not have conditions specified would continue to work as before, and charts with conditions would benefit from the updated behavior during the helm dependency update command. + +However, to maintain backward compatibility and provide flexibility, a new flag, such as --ignore-conditions, could be introduced to allow users to opt-out of condition evaluation during helm dependency update if they prefer to update all dependencies regardless of their conditions. +This flag would provide users with the option to choose whether to consider conditions during the update process or not, depending on their requirements. + +## Conclusion: + +The proposed enhancement to support conditionals in the helm dependency update command, along with the introduction of a flag to ignore conditions, would improve the consistency and usability of Helm charts with dependencies that have conditions specified. +It would provide a more intuitive way to manage different versions of dependencies in different environments, align with the behavior of dependencies during the installation process, and also provide flexibility for users who may need to update all dependencies regardless of conditions. +This proposal aims to simplify the management of Helm charts with dependencies and improve the overall user experience with Helm. + + + + + + +