rancher-charts/scripts
Arvind Iyengar 8dabbb441c Validate that CRDs exist only on a helm install
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).
2020-09-16 10:32:12 -07:00
..
chart-templates Validate that CRDs exist only on a helm install 2020-09-16 10:32:12 -07:00
bootstrap Initial commit 2020-07-29 15:59:02 -07:00
ci Initial commit 2020-07-29 15:59:02 -07:00
clean Fix url check when package.yaml does not exist 2020-09-09 12:27:17 -07:00
clean-crds Add generateCRDChart.assumeOwnershipOfCRDs flag 2020-09-09 15:25:13 -07:00
generate-charts Revert "Generate asset on different branch" 2020-09-10 15:12:51 -07:00
generate-patch Fix url check when package.yaml does not exist 2020-09-09 12:27:17 -07:00
image-mirror Initial commit 2020-07-29 15:59:02 -07:00
prepare Fix url check when package.yaml does not exist 2020-09-09 12:27:17 -07:00
prepare-crds Add generateCRDChart.assumeOwnershipOfCRDs flag 2020-09-09 15:25:13 -07:00
prepare-subcharts Allow patches on remote deps with fixed versions 2020-09-03 12:05:44 -07:00
validate Add clean to end of validate script 2020-09-09 15:05:46 -07:00
version Initial commit 2020-07-29 15:59:02 -07:00