mirror of https://git.rancher.io/charts
8dabbb441c
This commit introduces a slight change to the CRD chart templates in order to only run the check for whether CRDs exist in the cluster when a user uses `helm install`. On a `helm template`, no error will ever be thrown and on a `helm install --dry-run`, an error will only be thrown if the CRD is required as part of the chart installation (which is the default behavior of --dry-run either way). The way it accomplishes this is by using the Helm lookup function; based on the [Helm 3 docs](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/), the lookup function never gets called on a `helm install --dry-run` or a `helm template`, so the output of the lookup function will always be nil for those requests (i.e. the number of ClusterRoles returned will always be 0). However, Kubernetes clusters have default ClusterRoles, so this ensures that CRDs are installed if at least one ClusterRole is returned (i.e. the most common setup). |
||
---|---|---|
.. | ||
chart-templates | ||
bootstrap | ||
ci | ||
clean | ||
clean-crds | ||
generate-charts | ||
generate-patch | ||
image-mirror | ||
prepare | ||
prepare-crds | ||
prepare-subcharts | ||
validate | ||
version |