Skip to content

Commit 765e8eb

Browse files
authored
Fix terraform feature OpenPGP error on Ubuntu 26.04 (resolute) (#1683)
* Initial plan * Extend GPG workaround to Ubuntu 26.04 (resolute) and add tests * Use devcontainers base:resolute image for terraform resolute tests * Bump terraform feature version to 1.4.4 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 0f54799 commit 765e8eb

5 files changed

Lines changed: 57 additions & 4 deletions

File tree

src/terraform/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "terraform",
3-
"version": "1.4.3",
3+
"version": "1.4.4",
44
"name": "Terraform, tflint, and TFGrunt",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/terraform",
66
"description": "Installs the Terraform CLI and optionally TFLint and Terragrunt. Auto-detects latest version and installs needed dependencies.",

src/terraform/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ INSTALL_SENTINEL=${INSTALLSENTINEL:-false}
1919
INSTALL_TFSEC=${INSTALLTFSEC:-false}
2020
INSTALL_TERRAFORM_DOCS=${INSTALLTERRAFORMDOCS:-false}
2121
CUSTOM_DOWNLOAD_SERVER="${CUSTOMDOWNLOADSERVER:-""}"
22-
# This is because ubuntu noble and debian trixie don't support the old format of GPG keys and validation
23-
NEW_GPG_CODENAMES="trixie noble"
22+
# This is because ubuntu noble, ubuntu resolute and debian trixie don't support the old format of GPG keys and validation
23+
NEW_GPG_CODENAMES="trixie noble resolute"
2424

2525
TERRAFORM_SHA256="${TERRAFORM_SHA256:-"automatic"}"
2626
TFLINT_SHA256="${TFLINT_SHA256:-"automatic"}"
@@ -52,7 +52,7 @@ if [ "$(id -u)" -ne 0 ]; then
5252
exit 1
5353
fi
5454

55-
# Detect Ubuntu Noble or Debian Trixie and use new repo setup, else use legacy GPG logic
55+
# Detect Ubuntu Noble, Ubuntu Resolute or Debian Trixie and use new repo setup, else use legacy GPG logic
5656
IS_GPG_NEW=0
5757
. /etc/os-release
5858
if [[ "${NEW_GPG_CODENAMES}" == *"${VERSION_CODENAME}"* ]]; then
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library
6+
source dev-container-features-test-lib
7+
8+
# Check to make sure the user is vscode
9+
check "user is vscode" whoami | grep vscode
10+
11+
# Check if terraform was installed correctly
12+
check "terraform installed" terraform --version
13+
14+
check "tflint" tflint --version
15+
16+
# Report results
17+
reportResults
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library for `check` command
6+
source dev-container-features-test-lib
7+
8+
# Check to make sure the user is vscode
9+
check "user is vscode" whoami | grep vscode
10+
11+
# Check if terraform was installed correctly
12+
check "terraform installed" terraform --version
13+
14+
check "tflint" tflint --version
15+
16+
# Sentinel specific tests
17+
check "sentinel" sentinel --version
18+
19+
# Report result
20+
reportResults

test/terraform/scenarios.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@
3131
}
3232
}
3333
},
34+
"install_in_ubuntu_resolute": {
35+
"image": "mcr.microsoft.com/devcontainers/base:resolute",
36+
"features": {
37+
"terraform": {
38+
"version": "latest"
39+
}
40+
}
41+
},
42+
"install_in_ubuntu_resolute_sentinel": {
43+
"image": "mcr.microsoft.com/devcontainers/base:resolute",
44+
"features": {
45+
"terraform": {
46+
"installSentinel": true
47+
}
48+
}
49+
},
3450
"install_sentinel": {
3551
"image": "mcr.microsoft.com/devcontainers/base:jammy",
3652
"features": {

0 commit comments

Comments
 (0)