{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/charts/issues/3943","repository_url":"https://api.github.com/repos/kubernetes/charts","labels_url":"https://api.github.com/repos/kubernetes/charts/issues/3943/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/charts/issues/3943/comments","events_url":"https://api.github.com/repos/kubernetes/charts/issues/3943/events","html_url":"https://github.com/kubernetes/charts/issues/3943","id":301498793,"number":3943,"title":"Proposal: Enable testing and linting charts with test values.","user":{"login":"unguiculus","id":925412,"avatar_url":"https://avatars1.githubusercontent.com/u/925412?v=4","gravatar_id":"","url":"https://api.github.com/users/unguiculus","html_url":"https://github.com/unguiculus","followers_url":"https://api.github.com/users/unguiculus/followers","following_url":"https://api.github.com/users/unguiculus/following{/other_user}","gists_url":"https://api.github.com/users/unguiculus/gists{/gist_id}","starred_url":"https://api.github.com/users/unguiculus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unguiculus/subscriptions","organizations_url":"https://api.github.com/users/unguiculus/orgs","repos_url":"https://api.github.com/users/unguiculus/repos","events_url":"https://api.github.com/users/unguiculus/events{/privacy}","received_events_url":"https://api.github.com/users/unguiculus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-01T17:48:54Z","updated_at":"2018-03-06T17:21:01Z","closed_at":null,"author_association":"MEMBER","body":"Currently, we can only test charts with their default values. There are certain cases when this is not ideal:\r\n\r\n* Charts cannot use the `required` function without providing a default value.\r\n* Some charts need key files (e. g. #3220). Adding keys to the chart is a security risk, even if we document that the user is supposed to provide their own keys. In such a case we could create keys for the tests only. for a real installation the user would be required to specify their own.\r\n\r\nI propose that a chart can have a `ci` folder. Any file in this folder that ends with `-values.yaml` is considered a values file for testing. Linting and tests are run with each of these files. If no test values are found, the chart is installed with defaults.\r\n\r\nHere's some bash code that illustrates this.\r\n\r\n```bash\r\n#!/usr/bin/env bash\r\n\r\nshopt -s nullglob\r\nhas_test_values=\r\n\r\nfor values_file in ./ci/*-values.yaml; do\r\n    echo \"Testing chart with values file: $values_file...\"\r\n\r\n    helm lint stable/mychart --values \"$values_file\"\r\n    helm install stable/mychart --values \"$values_file\"\r\n    has_test_values=true\r\ndone\r\n\r\nif [[ -z \"$has_test_values\" ]]; then\r\n    echo \"Chart does not provide test values. Testing installation with defaults...\"\r\n\r\n    helm lint stable/mychart\r\n    helm install stable/mychart\r\nfi\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/charts/issues/comments/370858646","html_url":"https://github.com/kubernetes/charts/issues/3943#issuecomment-370858646","issue_url":"https://api.github.com/repos/kubernetes/charts/issues/3943","id":370858646,"user":{"login":"prydonius","id":1544861,"avatar_url":"https://avatars3.githubusercontent.com/u/1544861?v=4","gravatar_id":"","url":"https://api.github.com/users/prydonius","html_url":"https://github.com/prydonius","followers_url":"https://api.github.com/users/prydonius/followers","following_url":"https://api.github.com/users/prydonius/following{/other_user}","gists_url":"https://api.github.com/users/prydonius/gists{/gist_id}","starred_url":"https://api.github.com/users/prydonius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prydonius/subscriptions","organizations_url":"https://api.github.com/users/prydonius/orgs","repos_url":"https://api.github.com/users/prydonius/repos","events_url":"https://api.github.com/users/prydonius/events{/privacy}","received_events_url":"https://api.github.com/users/prydonius/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T17:21:01Z","updated_at":"2018-03-06T17:21:01Z","author_association":"MEMBER","body":"+1 from me"}}
{"actor":{"display_login":"prydonius"}}