Skip to content

Commit

Permalink
Merge branch 'main' into resource-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau authored Jul 25, 2024
2 parents b62987a + 093b91e commit 4d4c0e5
Show file tree
Hide file tree
Showing 24 changed files with 528 additions and 258 deletions.
3 changes: 3 additions & 0 deletions .changelog/1377.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
Add support for Terraform's experimental deferred actions
```
3 changes: 3 additions & 0 deletions .changelog/1380.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
`helm_release`: add new attributes metadata.last_deployed, metadata.first_deployed, metadata.notes
```
31 changes: 31 additions & 0 deletions .github/workflows/acceptance_test_dfa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deferred Actions

on:
pull_request:
branches:
- main
paths:
- "helm/**/*.go"
- "go.mod"
workflow_dispatch:
inputs:
terraformVersion:
description: Terraform version
default: 1.9.0-alpha20240516

jobs:
acceptance_tests:
runs-on: custom-linux-medium
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: 'go.mod'
- name: Run Tests
env:
TF_ACC: 1
TF_ACC_TERRAFORM_VERSION: ${{ github.event.inputs.terraformVersion || '1.9.0-alpha20240516' }}
run: |
go test -v -run '^TestAccDeferredActions_basic' ./helm/testing
42 changes: 42 additions & 0 deletions .github/workflows/documentation-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Documentation Updates"

on:
pull_request:
paths:
- 'docs/**'
types: [opened, synchronize, labeled]

push:
branches:
- main

jobs:
check-docs:
runs-on: ubuntu-latest

if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-documentation') }}

steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'

- name: Install tfplugindocs command
run: go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest

- name: Run tfplugindocs command
run: tfplugindocs generate

- name: Check for changes
run: |
git diff --exit-code
- name: Undocumented changes
run: |
echo "Documentation is not up to date. Please refer to the `Making Changes` in the Contribution Guide on how to properly update documentation."
exit 1
if: failure()
40 changes: 40 additions & 0 deletions .github/workflows/issue-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,43 @@ jobs:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler-issue-triage.yml
enable-versioned-regex: 0
oncall_review_assigner:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- run: npm install @pagerduty/pdjs
- uses: actions/github-script@e69ef5462fd455e02edcaf4dd7708eda96b9eda0 # v7.0.0
env:
PAGERDUTY_TOKEN: ${{ secrets.PAGERDUTY_TOKEN }}
with:
script: |
const { PAGERDUTY_TOKEN } = process.env
const { api } = require('@pagerduty/pdjs');
const pd = api({token: PAGERDUTY_TOKEN});
const reviewerList = new Map([
["Sheneska Williams", "sheneska"],
["Mauricio Alvarez Leon", "BBBmau"],
["Alex Somesan", "alexsomesan"],
["Alex Pilon", "appilon"],
["John Houston", "jrhouston"],
["Sacha Rybolovlev", "arybolovlev"],
]);
let resp = await pd.get('oncalls?escalation_policy_ids%5B%5D=PH8IF3M')
if (resp.status != 200){
core.setFailed("PagerDuty Error: " + resp.statusText)
}
const reviewer = resp.data.oncalls[0].user.summary
const reviewerGH = reviewerList.get(reviewer)
console.log("Assigning issue to " + reviewerGH);
resp = await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
assignees: reviewerGH,
issue_number: context.issue.number,
})
if (resp.status != 201){
core.setFailed("error assigning reviewer: user doesn't have the appropriate permissions to be assigned an issue.")
}
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
fetch-depth: 0
- name: Generate Release Notes
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt
run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git tag --list 'v*' --sort=-version:refname | head -n 2 | tail -n 1 | tr -d v)/q;p" CHANGELOG.md > release-notes.txt
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: release-notes
Expand Down
4 changes: 3 additions & 1 deletion _about/PULL_REQUESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ expect:
modify the code, and [create a pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork).
You are welcome to submit your pull request for commentary or review before
it is fully completed by creating a [draft pull request](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests).
Please include specific questions or items you'd like feedback on.
Please include specific questions or items you'd like feedback on.

1. Our documentation utilizes the [`tfplugindocs`](https://github.com/hashicorp/terraform-plugin-docs) tool. When making updates to documentation, please only edit the `.md.tmpl` files and execute the `tfplugindocs generate` command to ensure the changes are reflected in the `.md` files.

1. Once you believe your pull request is ready to be reviewed, ensure the
pull request is not a draft pull request by [marking it ready for review](https://help.github.com/en/articles/changing-the-stage-of-a-pull-request) and a
Expand Down
34 changes: 17 additions & 17 deletions docs/data-sources/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,47 @@ For further details on the `helm template` command, refer to the [Helm documenta
### Optional

- `api_versions` (List of String) Kubernetes api versions used for Capabilities.APIVersions
- `atomic` (Boolean) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used
- `atomic` (Boolean) If set, installation process purges chart on fail. The wait flag will be set automatically if atomic is used. Defaults to `false`.
- `crds` (List of String) List of rendered CRDs from the chart.
- `create_namespace` (Boolean) Create the namespace if it does not exist
- `dependency_update` (Boolean) Run helm dependency update before installing the chart
- `create_namespace` (Boolean) Create the namespace if it does not exist. Defaults to `false`.
- `dependency_update` (Boolean) Run helm dependency update before installing the chart. Defaults to `false`.
- `description` (String) Add a custom description
- `devel` (Boolean) Use chart development versions, too. Equivalent to version '>0.0.0-0'. If `version` is set, this is ignored
- `disable_openapi_validation` (Boolean) If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema
- `disable_webhooks` (Boolean) Prevent hooks from running.
- `disable_openapi_validation` (Boolean) If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema.Defaults to `false`.
- `disable_webhooks` (Boolean) Prevent hooks from running.Defaults to `300` seconds.
- `include_crds` (Boolean) Include CRDs in the templated output
- `is_upgrade` (Boolean) Set .Release.IsUpgrade instead of .Release.IsInstall
- `keyring` (String) Location of public keys used for verification. Used only if `verify` is true
- `keyring` (String) Location of public keys used for verification. Used only if `verify` is true. Defaults to `/.gnupg/pubring.gpg` in the location set by `home`.
- `kube_version` (String) Kubernetes version used for Capabilities.KubeVersion
- `manifest` (String) Concatenated rendered chart templates. This corresponds to the output of the `helm template` command.
- `manifests` (Map of String) Map of rendered chart templates indexed by the template name.
- `namespace` (String) Namespace to install the release into.
- `namespace` (String) Namespace to install the release into. Defaults to `default`.
- `notes` (String) Rendered notes if the chart contains a `NOTES.txt`.
- `pass_credentials` (Boolean) Pass credentials to all domains
- `pass_credentials` (Boolean) Pass credentials to all domains. Defaults to `false`.
- `postrender` (Block List, Max: 1) Postrender command configuration. (see [below for nested schema](#nestedblock--postrender))
- `render_subchart_notes` (Boolean) If set, render subchart notes along with the parent
- `replace` (Boolean) Re-use the given name, even if that name is already used. This is unsafe in production
- `render_subchart_notes` (Boolean) If set, render subchart notes along with the parent. Defaults to `true`.
- `replace` (Boolean) Re-use the given name, even if that name is already used. This is unsafe in production. Defaults to `false`.
- `repository` (String) Repository where to locate the requested chart. If is a URL the chart is installed without installing the repository.
- `repository_ca_file` (String) The Repositories CA File
- `repository_cert_file` (String) The repositories cert file
- `repository_key_file` (String) The repositories cert key file
- `repository_password` (String, Sensitive) Password for HTTP basic authentication
- `repository_username` (String) Username for HTTP basic authentication
- `reset_values` (Boolean) When upgrading, reset the values to the ones built into the chart
- `reuse_values` (Boolean) When upgrading, reuse the last release's values and merge in any overrides. If 'reset_values' is specified, this is ignored
- `reset_values` (Boolean) When upgrading, reset the values to the ones built into the chart.Defaults to `false`.
- `reuse_values` (Boolean) When upgrading, reuse the last release's values and merge in any overrides. If 'reset_values' is specified, this is ignored. Defaults to `false`.
- `set` (Block Set) Custom values to be merged with the values. (see [below for nested schema](#nestedblock--set))
- `set_list` (Block List) Custom sensitive values to be merged with the values. (see [below for nested schema](#nestedblock--set_list))
- `set_sensitive` (Block Set) Custom sensitive values to be merged with the values. (see [below for nested schema](#nestedblock--set_sensitive))
- `set_string` (Block Set, Deprecated) Custom string values to be merged with the values. (see [below for nested schema](#nestedblock--set_string))
- `show_only` (List of String) Only show manifests rendered from the given templates
- `skip_crds` (Boolean) If set, no CRDs will be installed. By default, CRDs are installed if not already present
- `skip_tests` (Boolean) If set, tests will not be rendered. By default, tests are rendered
- `timeout` (Number) Time in seconds to wait for any individual kubernetes operation.
- `skip_crds` (Boolean) If set, no CRDs will be installed. By default, CRDs are installed if not already present. Defaults to `false`.
- `skip_tests` (Boolean) If set, tests will not be rendered. By default, tests are rendered. Defaults to `false`.
- `timeout` (Number) Time in seconds to wait for any individual kubernetes operation. Defaults to `300` seconds.
- `validate` (Boolean) Validate your manifests against the Kubernetes cluster you are currently pointing at. This is the same validation performed on an install
- `values` (List of String) List of values in raw yaml format to pass to helm.
- `verify` (Boolean) Verify the package before installing it.
- `verify` (Boolean) Verify the package before installing it.Defaults to `false`.
- `version` (String) Specify the exact chart version to install. If this is not specified, the latest version is installed.
- `wait` (Boolean) Will wait until all resources are in a ready state before marking the release as successful.
- `wait` (Boolean) Will wait until all resources are in a ready state before marking the release as successful.Defaults to `true`.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/v2-upgrade-guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout : "helm"
layout: "helm"
page_title: "Helm: Upgrade Guide for Helm Provider v2.0.0"
description: |-
This guide covers the changes introduced in v2.0.0 of the Helm provider and what you may need to do to upgrade your configuration.
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Try the [hands-on tutorial](https://learn.hashicorp.com/tutorials/terraform/helm

## Data Sources

* [Data Source: helm_template](d/template.md)
* [Data Source: helm_template](d/template.html)

## Example Usage

Expand Down Expand Up @@ -186,10 +186,10 @@ The `kubernetes` block supports:
* `config_context` - (Optional) Context to choose from the config file. Can be sourced from `KUBE_CTX`.
* `proxy_url` - (Optional) URL to the proxy to be used for all API requests. URLs with "http", "https", and "socks5" schemes are supported. Can be sourced from `KUBE_PROXY_URL`.
* `exec` - (Optional) Configuration block to use an [exec-based credential plugin](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), e.g. call an external command to receive user credentials.
* `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`.
* `command` - (Required) Command to execute.
* `args` - (Optional) List of arguments to pass when executing the plugin.
* `env` - (Optional) Map of environment variables to set when executing the plugin.
* `api_version` - (Required) API version to use when decoding the ExecCredentials resource, e.g. `client.authentication.k8s.io/v1beta1`.
* `command` - (Required) Command to execute.
* `args` - (Optional) List of arguments to pass when executing the plugin.
* `env` - (Optional) Map of environment variables to set when executing the plugin.

The `registry` block has options:

Expand Down
Loading

0 comments on commit 4d4c0e5

Please sign in to comment.