From d8aaedcec22bb38a6b6d12099e736bc0d5295eca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:11:38 -0400 Subject: [PATCH 1/9] build(deps): bump golangci/golangci-lint-action from 4 to 5 (#226) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 4 to 5. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v4...v5) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-validate.yml b/.github/workflows/go-validate.yml index e5219752..e43c057e 100644 --- a/.github/workflows/go-validate.yml +++ b/.github/workflows/go-validate.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - - uses: golangci/golangci-lint-action@v4 + - uses: golangci/golangci-lint-action@v5 with: only-new-issues: true check-fmt: From fffb1c5fe5ea0142afcca096133670a3fb698891 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 13:57:59 -0400 Subject: [PATCH 2/9] build(deps): bump golang.org/x/oauth2 from 0.19.0 to 0.20.0 (#228) Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.19.0 to 0.20.0. - [Commits](https://github.com/golang/oauth2/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 5 ++--- go.sum | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 89d3b0c1..de4ae6ee 100644 --- a/go.mod +++ b/go.mod @@ -9,13 +9,12 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/zclconf/go-cty v1.13.3 golang.org/x/crypto v0.22.0 - golang.org/x/oauth2 v0.19.0 + golang.org/x/oauth2 v0.20.0 ) require ( cloud.google.com/go v0.110.2 // indirect - cloud.google.com/go/compute v1.20.1 // indirect - cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect diff --git a/go.sum b/go.sum index 964cb473..ba56bf30 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= @@ -406,8 +404,8 @@ golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg= -golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 742783a3d99a63e97ecc7874f06dbd58bd45cd3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 08:19:06 -0700 Subject: [PATCH 3/9] build(deps): bump golangci/golangci-lint-action from 5 to 6 (#231) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5 to 6. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v5...v6) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/go-validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-validate.yml b/.github/workflows/go-validate.yml index e43c057e..784ab542 100644 --- a/.github/workflows/go-validate.yml +++ b/.github/workflows/go-validate.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: ${{ needs.get-go-version.outputs.go-version }} - - uses: golangci/golangci-lint-action@v5 + - uses: golangci/golangci-lint-action@v6 with: only-new-issues: true check-fmt: From 213730c5adf7a71152f589a3153b25612d509a54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:27:45 -0400 Subject: [PATCH 4/9] build(deps): bump golang.org/x/crypto from 0.22.0 to 0.23.0 (#229) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.22.0 to 0.23.0. - [Commits](https://github.com/golang/crypto/compare/v0.22.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 15 ++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index de4ae6ee..f944adc5 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/linode/linodego v1.33.0 github.com/mitchellh/mapstructure v1.5.0 github.com/zclconf/go-cty v1.13.3 - golang.org/x/crypto v0.22.0 + golang.org/x/crypto v0.23.0 golang.org/x/oauth2 v0.20.0 ) @@ -84,9 +84,9 @@ require ( golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect golang.org/x/mod v0.13.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.14.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/go.sum b/go.sum index ba56bf30..973c13d6 100644 --- a/go.sum +++ b/go.sum @@ -366,8 +366,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= @@ -450,16 +450,16 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -468,8 +468,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 45e3bb4bb125670126740fe89f08938f741cdd52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:34:48 -0400 Subject: [PATCH 5/9] build(deps): bump github.com/linode/linodego from 1.33.0 to 1.33.1 (#230) Bumps [github.com/linode/linodego](https://github.com/linode/linodego) from 1.33.0 to 1.33.1. - [Release notes](https://github.com/linode/linodego/releases) - [Commits](https://github.com/linode/linodego/compare/v1.33.0...v1.33.1) --- updated-dependencies: - dependency-name: github.com/linode/linodego dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f944adc5..488f224e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/hashicorp/hcl/v2 v2.20.1 github.com/hashicorp/packer-plugin-sdk v0.5.3 - github.com/linode/linodego v1.33.0 + github.com/linode/linodego v1.33.1 github.com/mitchellh/mapstructure v1.5.0 github.com/zclconf/go-cty v1.13.3 golang.org/x/crypto v0.23.0 diff --git a/go.sum b/go.sum index 973c13d6..0705205f 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/linode/linodego v1.33.0 h1:cX2FYry7r6CA1ujBMsdqiM4VhvIQtnWsOuVblzfBhCw= -github.com/linode/linodego v1.33.0/go.mod h1:dSJJgIwqZCF5wnpuC6w5cyIbRtcexAm7uVvuJopGB40= +github.com/linode/linodego v1.33.1 h1:GcI7ozlHHzZbfthD8edLNInhHjQ452iCwtphza+FJGc= +github.com/linode/linodego v1.33.1/go.mod h1:rEjoJQACp1gKZn9LfxtCJPwS8ri/+h2B3ScJrgBPPdI= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= From f271cfa9049adaab2225e139ab1e0dc4aedf13b7 Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-1@users.noreply.github.com> Date: Wed, 8 May 2024 11:00:10 -0700 Subject: [PATCH 6/9] CI: Replace test execution handler with conditional (#232) * Add unit test coverage and add workflow to upload test data * e2e framework, update makefile, tod upload logic changed to using git submodule repo * oops forgot LINODE_TOKEN * add submodule in workflow file * misplaced submodule * lint * rename GNUmakefile to Makefile * Add teardown * defer teardown method * place defer block * made image label as global variable for duplicating tests * go fmt and update variable names * replace test execution handler with conditional * update tod_scripts to latest --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> --- .github/workflows/integration-unit-test.yml | 14 ++------------ tod_scripts | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration-unit-test.yml b/.github/workflows/integration-unit-test.yml index 36166e96..4fe20a20 100644 --- a/.github/workflows/integration-unit-test.yml +++ b/.github/workflows/integration-unit-test.yml @@ -34,27 +34,17 @@ jobs: - name: Run integration and unit tests run: | echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}" - if ! make test | go-junit-report -set-exit-code > "$REPORT_FILENAME"; then - echo "EXIT_STATUS=1" >> $GITHUB_ENV - fi - cat "$REPORT_FILENAME" + make test | go-junit-report -set-exit-code -iocopy -out > "$REPORT_FILENAME" env: LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} - name: Upload test report as artifact + if: always() uses: actions/upload-artifact@v4 with: name: test-report-file path: "${{ env.REPORT_FILENAME }}" - - name: Test Execution Status Handler - run: | - if [[ "$EXIT_STATUS" != 0 ]]; then - echo "Test execution contains failure(s), check Run Integration tests step above" - exit $EXIT_STATUS - else - echo "Tests passed!" - fi process-upload-report: runs-on: ubuntu-latest diff --git a/tod_scripts b/tod_scripts index eec4b995..f6da35dc 160000 --- a/tod_scripts +++ b/tod_scripts @@ -1 +1 @@ -Subproject commit eec4b99557cef6f40e8b5b7de00357dc49fb041c +Subproject commit f6da35dcb089fced7bcaf2a3c6ad29929f0d126c From d061dd8b2908711f6980f84c86f61236fdfbb2c1 Mon Sep 17 00:00:00 2001 From: Youjung Kim <126618609+ykim-1@users.noreply.github.com> Date: Wed, 8 May 2024 14:05:45 -0700 Subject: [PATCH 7/9] Update integration-unit-test.yml (#233) Typo --- .github/workflows/integration-unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-unit-test.yml b/.github/workflows/integration-unit-test.yml index 4fe20a20..e359988c 100644 --- a/.github/workflows/integration-unit-test.yml +++ b/.github/workflows/integration-unit-test.yml @@ -34,7 +34,7 @@ jobs: - name: Run integration and unit tests run: | echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}" - make test | go-junit-report -set-exit-code -iocopy -out > "$REPORT_FILENAME" + make test | go-junit-report -set-exit-code -iocopy -out "$REPORT_FILENAME" env: LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} From 7c51c75bbf6fadc97f02bd42e7d86ed8f75f0b3b Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Wed, 8 May 2024 22:05:04 -0400 Subject: [PATCH 8/9] Generate markdown docs from go in-line docs for builder (#227) --- .web-docs/components/builder/linode/README.md | 153 ++++++++++++------ .../components/data-source/image/README.md | 6 +- builder/linode/builder_test.go | 22 +-- builder/linode/config.go | 144 +++++++++++++---- builder/linode/config.hcl2spec.go | 14 +- docs/builders/linode.mdx | 95 ++--------- helper/common.go | 6 +- 7 files changed, 268 insertions(+), 172 deletions(-) diff --git a/.web-docs/components/builder/linode/README.md b/.web-docs/components/builder/linode/README.md index 8fe72fd8..c8915c16 100644 --- a/.web-docs/components/builder/linode/README.md +++ b/.web-docs/components/builder/linode/README.md @@ -36,104 +36,161 @@ can also be supplied to override the typical auto-generated key: ### Required -- `linode_token` (string) - The client TOKEN to use to access your account. - Alternatively, you can set your token as an environment variable named - `LINODE_TOKEN`. Saving the token in the environment or centralized vaults + + +- `linode_token` (string) - The Linode API token required for provision Linode resources. + This can also be specified in `LINODE_TOKEN` environment variable. + Saving the token in the environment or centralized vaults can reduce the risk of the token being leaked from the codebase. + `images:read_write`, `linodes:read_write`, and `events:read_only` + scopes are required for the API token. + + + + + +- `region` (string) - The id of the region to launch the Linode instance in. Images are available in all + regions, but there will be less delay when deploying from the region where the image + was taken. See [regions](https://api.linode.com/v4/regions) for more information on + the available regions. Examples are `us-east`, `us-central`, `us-west`, `ap-south`, + `ca-east`, `ap-northeast`, `eu-central`, and `eu-west`. -- `image` (string) - An Image ID to deploy the Disk from. Official Linode - Images start with `linode/`, while user Images start with `private/`. See - [images](https://api.linode.com/v4/images) for more information on the - Images available for use. Examples are `linode/debian9`, `linode/fedora28`, - `linode/ubuntu18.04`, `linode/arch`, and `private/12345`. +- `instance_type` (string) - The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. See + [instance types](https://api.linode.com/v4/linode/types) for more information on the + available Linode instance types. Examples are `g6-nanode-1`, `g6-standard-2`, + `g6-highmem-16`, and `g6-dedicated-16`. -- `region` (string) - The id of the region to launch the Linode instance in. - Images are available in all regions, but there will be less delay when - deploying from the region where the image was taken. See - [regions](https://api.linode.com/v4/regions) for more information on the - available regions. Examples are `us-east`, `us-central`, `us-west`, - `ap-south`, `ca-east`, `ap-northeast`, `eu-central`, and `eu-west`. +- `image` (string) - An Image ID to deploy the Disk from. Official Linode Images start with `linode/`, + while user Images start with `private/`. See [images](https://api.linode.com/v4/images) + for more information on the Images available for use. Examples are `linode/debian9`, + `linode/fedora28`, `linode/ubuntu18.04`, `linode/arch`, and `private/12345`. + + -- `instance_type` (string) - The Linode type defines the pricing, CPU, disk, - and RAM specs of the instance. See [instance types](https://api.linode.com/v4/linode/types) - for more information on the available Linode instance types. Examples are `g6-nanode-1`, - `g6-standard-2`, `g6-highmem-16`, and `g6-dedicated-16`. ### Optional -- `authorized_keys` (list) - Public SSH keys need to be appended to the Linode instance. + + +- `interface` ([]Interface) - Network Interfaces to add to this Linode’s Configuration Profile. Singular repeatable + block containing a `purpose`, a `label`, and an `ipam_address` field. -- `authorized_users` (list) - Users whose SSH keys need to be appended to the Linode instance. +- `authorized_keys` ([]string) - Public SSH keys need to be appended to the Linode instance. + +- `authorized_users` ([]string) - Users whose SSH keys need to be appended to the Linode instance. - `instance_label` (string) - The name assigned to the Linode Instance. -- `instance_tags` (list) - Tags to apply to the instance when it is created. +- `instance_tags` ([]string) - Tags to apply to the instance when it is created. - `swap_size` (int) - The disk size (MiB) allocated for swap space. -- `interface` ([](Interface)[#interface]) - Network Interfaces - to add to this Linode’s Configuration Profile. Singular repeatable block containing a `purpose`, - a `label`, and an `ipam_address` field. +- `private_ip` (bool) - If true, the created Linode will have private networking enabled and assigned + a private IPv4 address. + +- `root_pass` (string) - The root password of the Linode instance for building the image. Please note that when + you create a new Linode instance with a private image, you will be required to setup a + new root password. - `image_label` (string) - The name of the resulting image that will appear in your account. Defaults to `packer-{{timestamp}}` (see [configuration templates](/packer/docs/templates/legacy_json_templates/engine) for more info). -- `image_description` (string) - The description of the resulting image that - will appear in your account. Defaults to "". +- `image_description` (string) - The description of the resulting image that will appear in your account. Defaults to "". -- `state_timeout` (string) - The time to wait, as a duration string, for the - Linode instance to enter a desired state (such as "running") before timing - out. The default state timeout is "5m". +- `state_timeout` (duration string | ex: "1h5m2s") - The time to wait, as a duration string, for the Linode instance to enter a desired state + (such as "running") before timing out. The default state timeout is "5m". -- `image_create_timeout` (string) - The time to wait, as a duration string, for the - disk image to be created successfully before timing out. - The default image creation timeout is "10m". +- `stackscript_data` (map[string]string) - This attribute is required only if the StackScript being deployed requires input data from + the User for successful completion. See User Defined Fields (UDFs) for more details. + + This attribute is required to be valid JSON. -- `private_ip` (bool) - If true, the created Linode will have private networking - enabled and assigned a private IPv4 address. +- `stackscript_id` (int) - A StackScript ID that will cause the referenced StackScript to be run during deployment + of this Linode. A compatible image is required to use a StackScript. To get a list of + available StackScript and their permitted Images see /stackscripts. This field cannot + be used when deploying from a Backup or a Private Image. -- `root_pass` (string) - The root password of the Linode instance for building the image. - Please note that when you create a new Linode instance with a private image, you will - be required to setup a new root password. +- `image_create_timeout` (duration string | ex: "1h5m2s") - The time to wait, as a duration string, for the disk image to be created successfully + before timing out. The default image creation timeout is "10m". - `cloud_init` (bool) - Whether the newly created image supports cloud-init. +- `metadata` (Metadata) - An object containing user-defined data relevant to the creation of Linodes. + - `firewall_id` (int) - The ID of the Firewall to attach this Linode to upon creation. -- `metadata` ((Metadata)[#metadata]) - An object containing user-defined data relevant - to the creation of Linodes. + + #### Interface This section outlines the fields configurable for a single interface object. +##### Required Interface Common Attributes + + + - `purpose` (string) - The purpose of this interface. (public, vlan, vpc) + + + +##### Optional Interface Common Attributes + + + - `primary` (bool) - Whether this interface is a primary interface. -VLAN-specific fields: + + + +##### VLAN-specific Attributes + + - `label` (string) - The label of the VLAN this interface relates to. - `ipam_address` (string) - This Network Interface’s private IP address in CIDR notation. -VPC-specific fields: + + + +##### VPC-specific Attributes + + + +- `subnet_id` (\*int) - The ID of the VPC Subnet this interface references. + +- `ipv4` (\*InterfaceIPv4) - The IPv4 configuration of this VPC interface. -- `subnet_id` (int) - The ID of the VPC Subnet this interface references. +- `ip_ranges` ([]string) - The IPv4 ranges of this VPC interface. -- `ipv4` (block) - The IPv4 configuration of this VPC interface. + - - `vpc` (string) - The IPv4 address from the VPC subnet to use for this interface. - - `nat_1_1` (string) - The public IPv4 address assigned to this Linode to be 1:1 NATed with the VPC IPv4 address. +###### VPC Interface IPv4 configuration object + + + +- `vpc` (string) - The IPv4 address from the VPC subnet to use for this interface. + +- `nat_1_1` (\*string) - The public IPv4 address assigned to this Linode to be 1:1 NATed with the VPC IPv4 address. + + + #### Metadata This section outlines the fields configurable for a single metadata object. + + - `user_data` (string) - Base64-encoded (cloud-config)[https://www.linode.com/docs/products/compute/compute-instances/guides/metadata-cloud-config/] data. + + + ## Examples ### Basic Example @@ -156,7 +213,7 @@ source "linode" "example" { instance_label = "temporary-linode-${local.timestamp}" instance_type = "g6-nanode-1" linode_token = "YOUR API TOKEN" - region = "us-east" + region = "us-mia" ssh_username = "root" } @@ -175,7 +232,7 @@ build { "example": { "image": "linode/debian11", "linode_token": "YOUR API TOKEN", - "region": "us-east", + "region": "us-mia", "instance_type": "g6-nanode-1", "instance_label": "temporary-linode-{{timestamp}}", "image_label": "private-image-{{timestamp}}", @@ -208,7 +265,7 @@ source "linode" "example" { instance_label = "temporary-linode-${local.timestamp}" instance_type = "g6-nanode-1" linode_token = "YOUR API TOKEN" - region = "us-east" + region = "us-mia" ssh_username = "root" private_ip = true firewall_id = 12345 diff --git a/.web-docs/components/data-source/image/README.md b/.web-docs/components/data-source/image/README.md index 90505b43..f96a3b62 100644 --- a/.web-docs/components/data-source/image/README.md +++ b/.web-docs/components/data-source/image/README.md @@ -63,7 +63,11 @@ data "linode-image" "ubuntu22_lts" { - `linode_token` (string) - The Linode API token required for provision Linode resources. - This can also be specified in LINODE_TOKEN environment variable. + This can also be specified in `LINODE_TOKEN` environment variable. + Saving the token in the environment or centralized vaults + can reduce the risk of the token being leaked from the codebase. + `images:read_write`, `linodes:read_write`, and `events:read_only` + scopes are required for the API token. diff --git a/builder/linode/builder_test.go b/builder/linode/builder_test.go index 7c3a087d..c3621def 100644 --- a/builder/linode/builder_test.go +++ b/builder/linode/builder_test.go @@ -479,18 +479,22 @@ func TestBuilderPrepare_NetworkInterfaces(t *testing.T) { Primary: true, }, { - Purpose: "vlan", - Label: "vlan-1", - IPAMAddress: "10.0.0.1/24", + Purpose: "vlan", + VLANInterfaceAttributes: VLANInterfaceAttributes{ + Label: "vlan-1", + IPAMAddress: "10.0.0.1/24", + }, }, { - Purpose: "vpc", - SubnetID: &subnetID, - IPv4: &InterfaceIPv4{ - VPC: "10.0.0.2", - NAT1To1: &anyStr, + Purpose: "vpc", + VPCInterfaceAttributes: VPCInterfaceAttributes{ + SubnetID: &subnetID, + IPRanges: []string{"10.0.0.3/32"}, + IPv4: &InterfaceIPv4{ + VPC: "10.0.0.2", + NAT1To1: &anyStr, + }, }, - IPRanges: []string{"10.0.0.3/32"}, }, } diff --git a/builder/linode/config.go b/builder/linode/config.go index 39d2c1be..e9abcc31 100644 --- a/builder/linode/config.go +++ b/builder/linode/config.go @@ -1,3 +1,4 @@ +//go:generate packer-sdc struct-markdown //go:generate packer-sdc mapstructure-to-hcl2 -type Config,Interface,InterfaceIPv4,Metadata package linode @@ -20,22 +21,46 @@ import ( ) type InterfaceIPv4 struct { - VPC string `mapstructure:"vpc"` + // The IPv4 address from the VPC subnet to use for this interface. + VPC string `mapstructure:"vpc"` + + // The public IPv4 address assigned to this Linode to be 1:1 NATed with the VPC IPv4 address. NAT1To1 *string `mapstructure:"nat_1_1"` } type Metadata struct { + // Base64-encoded (cloud-config)[https://www.linode.com/docs/products/compute/compute-instances/guides/metadata-cloud-config/] data. UserData string `mapstructure:"user_data"` } +type VPCInterfaceAttributes struct { + // The ID of the VPC Subnet this interface references. + SubnetID *int `mapstructure:"subnet_id"` + + // The IPv4 configuration of this VPC interface. + IPv4 *InterfaceIPv4 `mapstructure:"ipv4"` + + // The IPv4 ranges of this VPC interface. + IPRanges []string `mapstructure:"ip_ranges"` +} + +type VLANInterfaceAttributes struct { + // The label of the VLAN this interface relates to. + Label string `mapstructure:"label"` + + // This Network Interface’s private IP address in CIDR notation. + IPAMAddress string `mapstructure:"ipam_address"` +} + type Interface struct { - Purpose string `mapstructure:"purpose"` - Label string `mapstructure:"label"` - IPAMAddress string `mapstructure:"ipam_address"` - Primary bool `mapstructure:"primary"` - SubnetID *int `mapstructure:"subnet_id"` - IPv4 *InterfaceIPv4 `mapstructure:"ipv4"` - IPRanges []string `mapstructure:"ip_ranges"` + VLANInterfaceAttributes `mapstructure:",squash"` + VPCInterfaceAttributes `mapstructure:",squash"` + + // The purpose of this interface. (public, vlan, vpc) + Purpose string `mapstructure:"purpose" required:"true"` + + // Whether this interface is a primary interface. + Primary bool `mapstructure:"primary"` } type Config struct { @@ -44,26 +69,89 @@ type Config struct { ctx interpolate.Context Comm communicator.Config `mapstructure:",squash"` - Interfaces []Interface `mapstructure:"interface" required:"false"` - Region string `mapstructure:"region"` - AuthorizedKeys []string `mapstructure:"authorized_keys" required:"false"` - AuthorizedUsers []string `mapstructure:"authorized_users" required:"false"` - InstanceType string `mapstructure:"instance_type"` - Label string `mapstructure:"instance_label" required:"false"` - Tags []string `mapstructure:"instance_tags" required:"false"` - Image string `mapstructure:"image"` - SwapSize int `mapstructure:"swap_size" required:"false"` - PrivateIP bool `mapstructure:"private_ip" required:"false"` - RootPass string `mapstructure:"root_pass" required:"false"` - ImageLabel string `mapstructure:"image_label" required:"false"` - Description string `mapstructure:"image_description" required:"false"` - StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"` - StackScriptData map[string]string `mapstructure:"stackscript_data" required:"false"` - StackScriptID int `mapstructure:"stackscript_id" required:"false"` - ImageCreateTimeout time.Duration `mapstructure:"image_create_timeout" required:"false"` - CloudInit bool `mapstructure:"cloud_init" required:"false"` - Metadata Metadata `mapstructure:"metadata" required:"false"` - FirewallID int `mapstructure:"firewall_id" required:"false"` + // Network Interfaces to add to this Linode’s Configuration Profile. Singular repeatable + // block containing a `purpose`, a `label`, and an `ipam_address` field. + Interfaces []Interface `mapstructure:"interface" required:"false"` + + // The id of the region to launch the Linode instance in. Images are available in all + // regions, but there will be less delay when deploying from the region where the image + // was taken. See [regions](https://api.linode.com/v4/regions) for more information on + // the available regions. Examples are `us-east`, `us-central`, `us-west`, `ap-south`, + // `ca-east`, `ap-northeast`, `eu-central`, and `eu-west`. + Region string `mapstructure:"region" required:"true"` + + // Public SSH keys need to be appended to the Linode instance. + AuthorizedKeys []string `mapstructure:"authorized_keys" required:"false"` + + // Users whose SSH keys need to be appended to the Linode instance. + AuthorizedUsers []string `mapstructure:"authorized_users" required:"false"` + + // The Linode type defines the pricing, CPU, disk, and RAM specs of the instance. See + // [instance types](https://api.linode.com/v4/linode/types) for more information on the + // available Linode instance types. Examples are `g6-nanode-1`, `g6-standard-2`, + // `g6-highmem-16`, and `g6-dedicated-16`. + InstanceType string `mapstructure:"instance_type" required:"true"` + + // The name assigned to the Linode Instance. + Label string `mapstructure:"instance_label" required:"false"` + + // Tags to apply to the instance when it is created. + Tags []string `mapstructure:"instance_tags" required:"false"` + + // An Image ID to deploy the Disk from. Official Linode Images start with `linode/`, + // while user Images start with `private/`. See [images](https://api.linode.com/v4/images) + // for more information on the Images available for use. Examples are `linode/debian9`, + // `linode/fedora28`, `linode/ubuntu18.04`, `linode/arch`, and `private/12345`. + Image string `mapstructure:"image" required:"true"` + + // The disk size (MiB) allocated for swap space. + SwapSize int `mapstructure:"swap_size" required:"false"` + + // If true, the created Linode will have private networking enabled and assigned + // a private IPv4 address. + PrivateIP bool `mapstructure:"private_ip" required:"false"` + + // The root password of the Linode instance for building the image. Please note that when + // you create a new Linode instance with a private image, you will be required to setup a + // new root password. + RootPass string `mapstructure:"root_pass" required:"false"` + + // The name of the resulting image that will appear + // in your account. Defaults to `packer-{{timestamp}}` (see [configuration + // templates](/packer/docs/templates/legacy_json_templates/engine) for more info). + ImageLabel string `mapstructure:"image_label" required:"false"` + + // The description of the resulting image that will appear in your account. Defaults to "". + Description string `mapstructure:"image_description" required:"false"` + + // The time to wait, as a duration string, for the Linode instance to enter a desired state + // (such as "running") before timing out. The default state timeout is "5m". + StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"` + + // This attribute is required only if the StackScript being deployed requires input data from + // the User for successful completion. See User Defined Fields (UDFs) for more details. + // + // This attribute is required to be valid JSON. + StackScriptData map[string]string `mapstructure:"stackscript_data" required:"false"` + + // A StackScript ID that will cause the referenced StackScript to be run during deployment + // of this Linode. A compatible image is required to use a StackScript. To get a list of + // available StackScript and their permitted Images see /stackscripts. This field cannot + // be used when deploying from a Backup or a Private Image. + StackScriptID int `mapstructure:"stackscript_id" required:"false"` + + // The time to wait, as a duration string, for the disk image to be created successfully + // before timing out. The default image creation timeout is "10m". + ImageCreateTimeout time.Duration `mapstructure:"image_create_timeout" required:"false"` + + // Whether the newly created image supports cloud-init. + CloudInit bool `mapstructure:"cloud_init" required:"false"` + + // An object containing user-defined data relevant to the creation of Linodes. + Metadata Metadata `mapstructure:"metadata" required:"false"` + + // The ID of the Firewall to attach this Linode to upon creation. + FirewallID int `mapstructure:"firewall_id" required:"false"` } func createRandomRootPassword() (string, error) { diff --git a/builder/linode/config.hcl2spec.go b/builder/linode/config.hcl2spec.go index 20585bc1..63a97488 100644 --- a/builder/linode/config.hcl2spec.go +++ b/builder/linode/config.hcl2spec.go @@ -69,13 +69,13 @@ type FlatConfig struct { WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` Interfaces []FlatInterface `mapstructure:"interface" required:"false" cty:"interface" hcl:"interface"` - Region *string `mapstructure:"region" cty:"region" hcl:"region"` + Region *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"` AuthorizedKeys []string `mapstructure:"authorized_keys" required:"false" cty:"authorized_keys" hcl:"authorized_keys"` AuthorizedUsers []string `mapstructure:"authorized_users" required:"false" cty:"authorized_users" hcl:"authorized_users"` - InstanceType *string `mapstructure:"instance_type" cty:"instance_type" hcl:"instance_type"` + InstanceType *string `mapstructure:"instance_type" required:"true" cty:"instance_type" hcl:"instance_type"` Label *string `mapstructure:"instance_label" required:"false" cty:"instance_label" hcl:"instance_label"` Tags []string `mapstructure:"instance_tags" required:"false" cty:"instance_tags" hcl:"instance_tags"` - Image *string `mapstructure:"image" cty:"image" hcl:"image"` + Image *string `mapstructure:"image" required:"true" cty:"image" hcl:"image"` SwapSize *int `mapstructure:"swap_size" required:"false" cty:"swap_size" hcl:"swap_size"` PrivateIP *bool `mapstructure:"private_ip" required:"false" cty:"private_ip" hcl:"private_ip"` RootPass *string `mapstructure:"root_pass" required:"false" cty:"root_pass" hcl:"root_pass"` @@ -187,13 +187,13 @@ func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { // FlatInterface is an auto-generated flat version of Interface. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatInterface struct { - Purpose *string `mapstructure:"purpose" cty:"purpose" hcl:"purpose"` Label *string `mapstructure:"label" cty:"label" hcl:"label"` IPAMAddress *string `mapstructure:"ipam_address" cty:"ipam_address" hcl:"ipam_address"` - Primary *bool `mapstructure:"primary" cty:"primary" hcl:"primary"` SubnetID *int `mapstructure:"subnet_id" cty:"subnet_id" hcl:"subnet_id"` IPv4 *FlatInterfaceIPv4 `mapstructure:"ipv4" cty:"ipv4" hcl:"ipv4"` IPRanges []string `mapstructure:"ip_ranges" cty:"ip_ranges" hcl:"ip_ranges"` + Purpose *string `mapstructure:"purpose" required:"true" cty:"purpose" hcl:"purpose"` + Primary *bool `mapstructure:"primary" cty:"primary" hcl:"primary"` } // FlatMapstructure returns a new FlatInterface. @@ -208,13 +208,13 @@ func (*Interface) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spe // The decoded values from this spec will then be applied to a FlatInterface. func (*FlatInterface) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ - "purpose": &hcldec.AttrSpec{Name: "purpose", Type: cty.String, Required: false}, "label": &hcldec.AttrSpec{Name: "label", Type: cty.String, Required: false}, "ipam_address": &hcldec.AttrSpec{Name: "ipam_address", Type: cty.String, Required: false}, - "primary": &hcldec.AttrSpec{Name: "primary", Type: cty.Bool, Required: false}, "subnet_id": &hcldec.AttrSpec{Name: "subnet_id", Type: cty.Number, Required: false}, "ipv4": &hcldec.BlockSpec{TypeName: "ipv4", Nested: hcldec.ObjectSpec((*FlatInterfaceIPv4)(nil).HCL2Spec())}, "ip_ranges": &hcldec.AttrSpec{Name: "ip_ranges", Type: cty.List(cty.String), Required: false}, + "purpose": &hcldec.AttrSpec{Name: "purpose", Type: cty.String, Required: false}, + "primary": &hcldec.AttrSpec{Name: "primary", Type: cty.Bool, Required: false}, } return s } diff --git a/docs/builders/linode.mdx b/docs/builders/linode.mdx index 4c2d2a8a..07c00390 100644 --- a/docs/builders/linode.mdx +++ b/docs/builders/linode.mdx @@ -42,103 +42,42 @@ can also be supplied to override the typical auto-generated key: ### Required -- `linode_token` (string) - The client TOKEN to use to access your account. - Alternatively, you can set your token as an environment variable named - `LINODE_TOKEN`. Saving the token in the environment or centralized vaults - can reduce the risk of the token being leaked from the codebase. - -- `image` (string) - An Image ID to deploy the Disk from. Official Linode - Images start with `linode/`, while user Images start with `private/`. See - [images](https://api.linode.com/v4/images) for more information on the - Images available for use. Examples are `linode/debian9`, `linode/fedora28`, - `linode/ubuntu18.04`, `linode/arch`, and `private/12345`. - -- `region` (string) - The id of the region to launch the Linode instance in. - Images are available in all regions, but there will be less delay when - deploying from the region where the image was taken. See - [regions](https://api.linode.com/v4/regions) for more information on the - available regions. Examples are `us-east`, `us-central`, `us-west`, - `ap-south`, `ca-east`, `ap-northeast`, `eu-central`, and `eu-west`. - -- `instance_type` (string) - The Linode type defines the pricing, CPU, disk, - and RAM specs of the instance. See [instance types](https://api.linode.com/v4/linode/types) - for more information on the available Linode instance types. Examples are `g6-nanode-1`, - `g6-standard-2`, `g6-highmem-16`, and `g6-dedicated-16`. +@include 'helper/LinodeCommon-not-required.mdx' +@include 'builder/linode/Config-required.mdx' ### Optional -- `authorized_keys` (list) - Public SSH keys need to be appended to the Linode instance. - -- `authorized_users` (list) - Users whose SSH keys need to be appended to the Linode instance. - -- `instance_label` (string) - The name assigned to the Linode Instance. - -- `instance_tags` (list) - Tags to apply to the instance when it is created. - -- `swap_size` (int) - The disk size (MiB) allocated for swap space. - -- `interface` ([](Interface)[#interface]) - Network Interfaces - to add to this Linode’s Configuration Profile. Singular repeatable block containing a `purpose`, - a `label`, and an `ipam_address` field. - -- `image_label` (string) - The name of the resulting image that will appear - in your account. Defaults to `packer-{{timestamp}}` (see [configuration - templates](/packer/docs/templates/legacy_json_templates/engine) for more info). - -- `image_description` (string) - The description of the resulting image that - will appear in your account. Defaults to "". - -- `state_timeout` (string) - The time to wait, as a duration string, for the - Linode instance to enter a desired state (such as "running") before timing - out. The default state timeout is "5m". - -- `image_create_timeout` (string) - The time to wait, as a duration string, for the - disk image to be created successfully before timing out. - The default image creation timeout is "10m". - -- `private_ip` (bool) - If true, the created Linode will have private networking - enabled and assigned a private IPv4 address. - -- `root_pass` (string) - The root password of the Linode instance for building the image. - Please note that when you create a new Linode instance with a private image, you will - be required to setup a new root password. - -- `cloud_init` (bool) - Whether the newly created image supports cloud-init. - -- `firewall_id` (int) - The ID of the Firewall to attach this Linode to upon creation. - -- `metadata` ((Metadata)[#metadata]) - An object containing user-defined data relevant - to the creation of Linodes. +@include 'builder/linode/Config-not-required.mdx' #### Interface This section outlines the fields configurable for a single interface object. -- `purpose` (string) - The purpose of this interface. (public, vlan, vpc) +##### Required Interface Common Attributes -- `primary` (bool) - Whether this interface is a primary interface. +@include 'builder/linode/Interface-required.mdx' -VLAN-specific fields: +##### Optional Interface Common Attributes -- `label` (string) - The label of the VLAN this interface relates to. +@include 'builder/linode/Interface-not-required.mdx' -- `ipam_address` (string) - This Network Interface’s private IP address in CIDR notation. +##### VLAN-specific Attributes -VPC-specific fields: +@include 'builder/linode/VLANInterfaceAttributes-not-required.mdx' -- `subnet_id` (int) - The ID of the VPC Subnet this interface references. +##### VPC-specific Attributes -- `ipv4` (block) - The IPv4 configuration of this VPC interface. +@include 'builder/linode/VPCInterfaceAttributes-not-required.mdx' - - `vpc` (string) - The IPv4 address from the VPC subnet to use for this interface. +###### VPC Interface IPv4 configuration object - - `nat_1_1` (string) - The public IPv4 address assigned to this Linode to be 1:1 NATed with the VPC IPv4 address. +@include 'builder/linode/InterfaceIPv4-not-required.mdx' #### Metadata This section outlines the fields configurable for a single metadata object. -- `user_data` (string) - Base64-encoded (cloud-config)[https://www.linode.com/docs/products/compute/compute-instances/guides/metadata-cloud-config/] data. +@include 'builder/linode/Metadata-not-required.mdx' ## Examples @@ -162,7 +101,7 @@ source "linode" "example" { instance_label = "temporary-linode-${local.timestamp}" instance_type = "g6-nanode-1" linode_token = "YOUR API TOKEN" - region = "us-east" + region = "us-mia" ssh_username = "root" } @@ -181,7 +120,7 @@ build { "example": { "image": "linode/debian11", "linode_token": "YOUR API TOKEN", - "region": "us-east", + "region": "us-mia", "instance_type": "g6-nanode-1", "instance_label": "temporary-linode-{{timestamp}}", "image_label": "private-image-{{timestamp}}", @@ -214,7 +153,7 @@ source "linode" "example" { instance_label = "temporary-linode-${local.timestamp}" instance_type = "g6-nanode-1" linode_token = "YOUR API TOKEN" - region = "us-east" + region = "us-mia" ssh_username = "root" private_ip = true firewall_id = 12345 diff --git a/helper/common.go b/helper/common.go index bbc13db0..13dfa3e6 100644 --- a/helper/common.go +++ b/helper/common.go @@ -4,6 +4,10 @@ package helper // The common configuration options related to Linode services type LinodeCommon struct { // The Linode API token required for provision Linode resources. - // This can also be specified in LINODE_TOKEN environment variable. + // This can also be specified in `LINODE_TOKEN` environment variable. + // Saving the token in the environment or centralized vaults + // can reduce the risk of the token being leaked from the codebase. + // `images:read_write`, `linodes:read_write`, and `events:read_only` + // scopes are required for the API token. PersonalAccessToken string `mapstructure:"linode_token"` } From 051378d1f1d3d2a18f0280e3bea84a06bef970a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 09:00:41 -0700 Subject: [PATCH 9/9] build(deps): bump goreleaser/goreleaser-action from 5.0.0 to 5.1.0 (#234) Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.0.0 to 5.1.0. - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](https://github.com/goreleaser/goreleaser-action/compare/7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8...5742e2a039330cbb23ebf35f046f814d4c6ff811) --- updated-dependencies: - dependency-name: goreleaser/goreleaser-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd363881..90490561 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 with: version: latest args: release --rm-dist