Skip to content

Commit

Permalink
Merge pull request #1630 from linode/dev
Browse files Browse the repository at this point in the history
Release v2.30.0
  • Loading branch information
ezilber-akamai authored Oct 22, 2024
2 parents 97ca025 + 343d70d commit 0b39a7c
Show file tree
Hide file tree
Showing 89 changed files with 2,346 additions and 172 deletions.
74 changes: 70 additions & 4 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
run: |
case "${{ matrix.user }}" in
"USER_1")
echo "TEST_TAGS=acceptance,backup,domain,domainrecord,domains,domainzonefile,helper,instance" >> $GITHUB_ENV
echo "TEST_TAGS=acceptance,backup,domain,domainrecord,domains,domainzonefile,helper,instance,provider" >> $GITHUB_ENV
echo "LINODE_TOKEN=${{ secrets.LINODE_TOKEN_USER_1 }}" >> $GITHUB_ENV
;;
"USER_2")
echo "TEST_TAGS=firewall,firewalldevice,firewalls,image,images,instancenetworking,instancesharedips,instancetype,instancetypes,ipv6range,ipv6ranges,kernel,kernels,nb,nbconfig,nbconfigs,nbnode,nbs,sshkey,sshkeys,vlan,volume,volumes,vpc,vpcs" >> $GITHUB_ENV
echo "TEST_TAGS=firewall,firewalldevice,firewalls,image,images,instancenetworking,instancesharedips,instancetype,instancetypes,ipv6range,ipv6ranges,kernel,kernels,nb,nbconfig,nbconfigs,nbnode,nbs,sshkey,sshkeys,vlan,volume,volumes,vpc,vpcs,vpcsubnets" >> $GITHUB_ENV
echo "LINODE_TOKEN=${{ secrets.LINODE_TOKEN_USER_2 }}" >> $GITHUB_ENV
;;
"USER_3")
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
process-upload-report:
runs-on: ubuntu-latest
needs: [integration_tests]
if: always() # Run even if previous job fails
if: always() && github.repository == 'linode/terraform-provider-linode' # Run even if integration tests fail and only on main repository

steps:
- name: Checkout code
Expand Down Expand Up @@ -145,4 +145,70 @@ jobs:
run: |
cd e2e_scripts/cloud_security_scripts/lke_calico_rules/ && ./lke_calico_rules_e2e.sh
env:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN_USER_4 }}
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN_USER_4 }}

notify-slack:
runs-on: ubuntu-latest
needs: [integration_tests]
if: always() && github.repository == 'linode/terraform-provider-linode' # Run even if integration tests fail and only on main repository

steps:
- name: Notify Slack
uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ needs.integration_tests.result == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
84 changes: 79 additions & 5 deletions .github/workflows/nightly_smoke_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,99 @@ on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
sha:
description: 'Commit SHA to test'
required: false
default: ''
type: string

jobs:
smoke_tests:
if: github.repository == 'linode/terraform-provider-linode' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
submodules: 'recursive'
ref: ${{ github.event.inputs.sha || github.ref }}

- name: Set up go
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
go-version: '1.x'

- run: go version
- name: Install Dependencies
run: |
make deps
- name: Run smoke tests
run: make smoke-test
id: smoke_tests
run: |
make smoke-test
env:
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}

- name: Notify Slack
if: always()
uses: slackapi/slack-github-action@v1.27.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":rocket: *${{ github.workflow }} Completed in: ${{ github.repository }}* :white_check_mark:"
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Build Result:*\n${{ steps.smoke_tests.outcome == 'success' && ':large_green_circle: Build Passed' || ':red_circle: Build Failed' }}"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n`${{ github.ref_name }}`"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Commit Hash:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Run URL:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "Triggered by: :bust_in_silhouette: `${{ github.actor }}`"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,34 @@ include-env: $(IP_ENV_FILE)

generate-ip-env-fw-e2e: $(IP_ENV_FILE)

SUBMODULE_DIR := e2e_scripts

$(IP_ENV_FILE):
# Generate env file for E2E cloud firewall
. ./e2e_scripts/cloud_security_scripts/cloud_e2e_firewall/terraform-provider-linode/generate_ip_env_fw_e2e.sh || touch $(IP_ENV_FILE)
@if [ ! -d $(SUBMODULE_DIR) ]; then \
echo "Submodule directory $(SUBMODULE_DIR) does not exist. Updating submodules..."; \
git submodule update --init --recursive; \
else \
echo "Submodule directory $(SUBMODULE_DIR) already exists. Skipping update."; \
fi
. ./e2e_scripts/cloud_security_scripts/cloud_e2e_firewall/terraform-provider-linode/generate_ip_env_fw_e2e.sh

.PHONY: smoke-test
smoke-test: fmt-check
smoke-test: fmt-check generate-ip-env-fw-e2e include-env
TF_ACC=1 \
LINODE_API_VERSION="v4beta" \
RUN_LONG_TESTS=$(RUN_LONG_TESTS) \
go test -v -run smoke ./linode/... -count $(COUNT) -timeout $(TIMEOUT) -parallel=$(PARALLEL) -ldflags="-X=github.com/linode/terraform-provider-linode/v2/version.ProviderVersion=acc"
TF_VAR_ipv4_addr=${PUBLIC_IPV4} \
TF_VAR_ipv6_addr=${PUBLIC_IPV6} \
bash -c 'set -o pipefail && go test -v ./linode/... -run TestSmokeTests -tags=integration \
-count $(COUNT) \
-timeout $(TIMEOUT) \
-parallel=$(PARALLEL) \
-ldflags="-X=github.com/linode/terraform-provider-linode/v2/version.ProviderVersion=acc" \
| sed -e "/testing: warning: no tests to run/,+1d" -e "/\[no test files\]/d" -e "/\[no tests to run\]/d"; \
exit_status=$$?; \
exit $$exit_status'


.PHONY: docs-check
docs-check:
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ Each Linode instance will be stored in the `instances` attribute and will export

* `tags` - A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.

* `capabilities` - A list of capabilities of this Linode instance.

* `private_ip` - If true, the Linode has private networking enabled, allowing use of the 192.168.128.0/17 network within the Linode's region.

* `alerts.0.cpu` - The percentage of CPU usage required to trigger an alert. If the average CPU usage over two hours exceeds this value, we'll send you an alert. If this is set to 0, the alert is disabled.
Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ The Linode Volume resource exports the following attributes:
- `linode_id` - If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.

- `filesystem_path` - The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.

- `encryption` - Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ This section outlines commonly used provider configuration options.

The Linode API version can also be specified using the `LINODE_API_VERSION` environment variable.

* `api_ca_path` (Optional) The path to a CA file to trust when making API requests.

The Linode API CA file path can also be specified using the `LINODE_CA` environment variable.

* `obj_access_key` - (Optional) The access key to be used in [linode_object_storage_bucket](/docs/resources/object_storage_bucket.md) and [linode_object_storage_object](/docs/resources/object_storage_object.md).

The Object Access Key can also be specified using the `LINODE_OBJ_ACCESS_KEY` shell environment variable.
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ The following arguments are supported:

* `tags` - (Optional) A list of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.

* `encryption` - (Optional) Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.

### Timeouts

The `timeouts` block allows you to specify [timeouts](https://developer.hashicorp.com/terraform/language/resources/syntax#operation-timeouts) for certain actions:
Expand Down
36 changes: 18 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.22.0
toolchain go1.22.5

require (
github.com/aws/aws-sdk-go-v2 v1.30.5
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.23
github.com/aws/aws-sdk-go-v2/credentials v1.17.23
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.4
github.com/aws/aws-sdk-go-v2/service/s3 v1.62.0
github.com/aws/smithy-go v1.21.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.0
github.com/aws/smithy-go v1.22.0
github.com/go-resty/resty/v2 v2.14.0
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
Expand All @@ -20,34 +20,34 @@ require (
github.com/hashicorp/terraform-plugin-framework-nettypes v0.2.0
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-framework-validators v0.14.0
github.com/hashicorp/terraform-plugin-go v0.24.0
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-mux v0.16.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0
github.com/hashicorp/terraform-plugin-testing v1.10.0
github.com/linode/linodego v1.41.0
github.com/linode/linodego v1.42.0
github.com/linode/linodego/k8s v1.25.2
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.27.0
golang.org/x/net v0.29.0
golang.org/x/crypto v0.28.0
golang.org/x/net v0.30.0
golang.org/x/sync v0.8.0
)

require (
github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.17 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.19 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.1 // indirect
Expand Down Expand Up @@ -102,9 +102,9 @@ require (
github.com/zclconf/go-cty v1.15.0 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.24.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand Down
Loading

0 comments on commit 0b39a7c

Please sign in to comment.