From 6f6fa6586d6ae10df4bd00d01a978017ef106817 Mon Sep 17 00:00:00 2001 From: Yonah Dissen <47282577+yonahd@users.noreply.github.com> Date: Thu, 13 Apr 2023 07:52:18 +0300 Subject: [PATCH 1/2] Create hip-9999.md Signed-off-by: Yonah Dissen <47282577+yonahd@users.noreply.github.com> --- hips/hip-9999.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 hips/hip-9999.md diff --git a/hips/hip-9999.md b/hips/hip-9999.md new file mode 100644 index 00000000..6e60ba0e --- /dev/null +++ b/hips/hip-9999.md @@ -0,0 +1,58 @@ +--- +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, the conditionals are only respected 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 respect the conditionals in the dependencies during the update process. + +## Motivation: + +Helm is a widely used package manager for Kubernetes, and it allows defining dependencies in a chart's Chart.yaml file. +These dependencies can have conditions specified using the condition field, which 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. + +## Proposal: + +The proposal suggests enhancing the helm dependency update command to respect 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 does not introduce any backward incompatibility, as it enhances the behavior of helm dependency update to respect 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. + + + + + + + From 275f00d4c85bb69e8adc2212af72af41d7ac012c Mon Sep 17 00:00:00 2001 From: Yonah Dissen <47282577+yonahd@users.noreply.github.com> Date: Sun, 16 Apr 2023 21:14:05 +0300 Subject: [PATCH 2/2] Update hip-9999.md Signed-off-by: Yonah Dissen <47282577+yonahd@users.noreply.github.com> --- hips/hip-9999.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/hips/hip-9999.md b/hips/hip-9999.md index 6e60ba0e..797ab810 100644 --- a/hips/hip-9999.md +++ b/hips/hip-9999.md @@ -9,20 +9,27 @@ status: "draft" ## Abstract: -Currently, when using Helm charts with dependencies that have conditions specified in their Chart.yaml file, the conditionals are only respected during the installation process, +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 respect the conditionals in the dependencies during the update process. +This proposal suggests enhancing the helm dependency update command to also evaluate the conditionals in the dependencies during the update process. ## Motivation: -Helm is a widely used package manager for Kubernetes, and it allows defining dependencies in a chart's Chart.yaml file. -These dependencies can have conditions specified using the condition field, which allows installing different versions of a dependency based on environment-specific requirements. +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. +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 respect the conditions specified in the dependencies' Chart.yaml file. +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. @@ -38,7 +45,7 @@ The updated dependencies' versions would then be reflected in the requirements.l ## Backward Compatibility: -This proposal does not introduce any backward incompatibility, as it enhances the behavior of helm dependency update to respect the conditions specified in the dependencies' Chart.yaml file. +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.