Skip to content

Commit

Permalink
Merge pull request #225 from linode/dev
Browse files Browse the repository at this point in the history
Release v1.5.0
  • Loading branch information
ykim-1 committed Apr 24, 2024
2 parents f44199a + 43aa1d6 commit 6034f2c
Show file tree
Hide file tree
Showing 29 changed files with 1,061 additions and 136 deletions.
38 changes: 38 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# PR Labels
- name: new-feature
description: for new features in the changelog.
color: 225fee
- name: improvement
description: for improvements in existing functionality in the changelog.
color: 22ee47
- name: repo-ci-improvement
description: for improvements in the repository or CI workflow in the changelog.
color: c922ee
- name: bugfix
description: for any bug fixes in the changelog.
color: ed8e21
- name: documentation
description: for updates to the documentation in the changelog.
color: d3e1e6
- name: dependencies
description: dependency updates usually from dependabot
color: 5c9dff
- name: testing
description: for updates to the testing suite in the changelog.
color: 933ac9
- name: breaking-change
description: for breaking changes in the changelog.
color: ff0000
- name: ignore-for-release
description: PRs you do not want to render in the changelog
color: 7b8eac
- name: do-not-merge
description: PRs that should not be merged until the commented issue is resolved
color: eb1515
# Issue Labels
- name: enhancement
description: issues that request a enhancement
color: 22ee47
- name: bug
description: issues that report a bug
color: ed8e21
21 changes: 0 additions & 21 deletions .github/release-drafter.yml

This file was deleted.

26 changes: 18 additions & 8 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,30 @@ changelog:
labels:
- ignore-for-release
categories:
- title: Breaking Changes 🛠
- title: ⚠️ Breaking Change
labels:
- breaking-change
- title: Exciting New Features 🎉
- title: 🐛 Bug Fixes
labels:
- enhancement
- title: Bug fixes🧑‍🔧 🐞
- bugfix
- title: 🚀 New Features
labels:
- bug
- title: Doc improvements 📚
- new-feature
- title: 💡 Improvements
labels:
- improvement
- title: 🧪 Testing Improvements
labels:
- testing
- title: ⚙️ Repo/CI Improvements
labels:
- repo-ci-improvement
- title: 📖 Documentation
labels:
- docs
- documentation
- title: 📦 Dependency Updates
labels:
- dependencies
- title: Other Changes
labels:
- "*"

4 changes: 2 additions & 2 deletions .github/workflows/go-test-multiplatform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
go test -race -count 1 ./builder/linode/... -timeout=3m -v
go test -race -count 1 ./... -timeout=3m -v
windows-go-tests:
needs:
Expand All @@ -55,7 +55,7 @@ jobs:
# Running unit tests directly with `go test` due to gofmt/gofumpt issues in Windows
- run: |
echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}"
go test -race -count 1 ./builder/linode/... -timeout=3m -v
go test -race -count 1 ./... -timeout=3m -v
linux-go-tests:
needs:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: labeler

on:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labeler.yml'

jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@de749cf181958193cb7debf1a9c5bb28922f3e1b
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
yaml-file: .github/labels.yml
dry-run: ${{ github.event_name == 'pull_request' }}
exclude: |
help*
*issue
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .web-docs/components/builder/linode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ can also be supplied to override the typical auto-generated key:

- `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.

#### Interface

This section outlines the fields configurable for a single interface object.
Expand All @@ -123,6 +128,12 @@ VPC-specific fields:

- `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
Expand Down Expand Up @@ -200,7 +211,9 @@ source "linode" "example" {
region = "us-east"
ssh_username = "root"
private_ip = true
firewall_id = 12345
instance_tags = ["abc", "foo=bar"]
authorized_users = ["your_authorized_username"]
authorized_keys = ["ssh-rsa AAAA_valid_public_ssh_key_123456785== user@their-computer"]
stackscript_id = 1177256
Expand All @@ -220,6 +233,20 @@ source "linode" "example" {
nat_1_1 = "any"
}
}
metadata {
user_data = base64encode(<<EOF
#cloud-config
write_files:
- path: /root/helloworld.txt
content: |
Hello, world!
owner: 'root:root'
permissions: '0644'
EOF
)
}
}
build {
Expand Down
109 changes: 109 additions & 0 deletions .web-docs/components/data-source/image/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Type: `linode-image`

The Linode Image data source matches or filters the ID or label of both public images on
Linode and private images in your account using regular expression (regex) or an exact
match.

You can get the latest list of available public images on Linode via the
[Linode Image List API](https://www.linode.com/docs/api/images/#images-list).

## Examples

```hcl
data "linode-image" "latest_ubuntu" {
id_regex = "linode/ubuntu.*"
latest = true
}
source "linode" "example" {
image = data.linode-image.latest_ubuntu.id
image_description = "My Private Image"
image_label = "my-packaer-private-linode-image-test"
instance_label = "temporary-linode-image"
instance_type = "g6-nanode-1"
region = "us-mia"
ssh_username = "root"
}
build {
sources = ["source.linode.example"]
}
```

```hcl
data "linode-image" "latest_ubuntu_lts" {
label_regex = "Ubuntu [0-9]+\\.[0-9]+ LTS"
latest = true
}
```

```hcl
data "linode-image" "ubuntu22_lts" {
id = "linode/ubuntu22.04"
latest = true
}
```

## Configuration Reference:

<!-- Code generated from the comments of the Config struct in datasource/image/data.go; DO NOT EDIT MANUALLY -->

- `label` (string) - Matching the label of an image by exact label

- `label_regex` (string) - Matching the label of an image by a regular expression

- `id` (string) - Matching the ID of an image by exact ID

- `id_regex` (string) - Matching the ID of an image by a regular expression

- `latest` (bool) - Whether to use the latest created image when there are multiple matches

<!-- End of code generated from the comments of the Config struct in datasource/image/data.go; -->

<!-- Code generated from the comments of the LinodeCommon struct in helper/common.go; DO NOT EDIT MANUALLY -->

- `linode_token` (string) - The Linode API token required for provision Linode resources.
This can also be specified in LINODE_TOKEN environment variable.

<!-- End of code generated from the comments of the LinodeCommon struct in helper/common.go; -->


## Output:

<!-- Code generated from the comments of the DatasourceOutput struct in datasource/image/data.go; DO NOT EDIT MANUALLY -->

- `id` (string) - The unique ID of this Image.

- `capabilities` ([]string) - A list containing the following possible capabilities of this Image:
- cloud-init: This Image supports cloud-init with Metadata. Only applies to public Images.

- `created` (string) - When this Image was created.

- `created_by` (string) - The name of the User who created this Image, or “linode” for public Images.

- `deprecated` (bool) - Whether or not this Image is deprecated. Will only be true for deprecated public Images.

- `description` (string) - A detailed description of this Image.

- `eol` (string) - The date of the public Image’s planned end of life. `null` for private Images.

- `expiry` (string) - Expiry date of the image.
Only Images created automatically from a deleted Linode (type=automatic) will expire.

- `is_public` (bool) - True if the Image is a public distribution image.
False if Image is private Account-specific Image.

- `label` (string) - A short description of the Image.

- `size` (int) - The minimum size this Image needs to deploy. Size is in MB.

- `type` (string) - Enum: `manual` `automatic`
How the Image was created.
"Manual" Images can be created at any time.
"Automatic" Images are created automatically from a deleted Linode.

- `updated` (string) - When this Image was last updated.

- `vendor` (string) - The upstream distribution vendor. `null` for private Images.

<!-- End of code generated from the comments of the DatasourceOutput struct in datasource/image/data.go; -->
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NAME=linode
BINARY=packer-plugin-${NAME}
PLUGIN_FQN="$(shell grep -E '^module' <go.mod | sed -E 's/module *//')"
COUNT?=1
UNIT_TEST_TARGET?=$(shell go list ./builder/...)
TEST?=$(shell go list ./...)
HASHICORP_PACKER_PLUGIN_SDK_VERSION?=$(shell go list -m github.com/hashicorp/packer-plugin-sdk | cut -d " " -f2)
PACKER_SDC_REPO ?= github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc
.DEFAULT_GOAL = dev
Expand All @@ -21,7 +21,7 @@ build: fmtcheck
@go build -o ${BINARY}

.PHONY: test
test: fmtcheck unit-test int-test
test: fmtcheck acctest

.PHONY: install-packer-sdc
install-packer-sdc: ## Install packer sofware development command
Expand All @@ -33,15 +33,15 @@ plugin-check: install-packer-sdc build

.PHONY: unit-test
unit-test: dev
@go test -count $(COUNT) -v $(UNIT_TEST_TARGET) -timeout=10m
@go test -race -count $(COUNT) -v $(TEST) -timeout=10m

# int-test is an alias of acctest
.PHONY: int-test
int-test: acctest

.PHONY: acctest
acctest: dev
@PACKER_ACC=1 go test -count $(COUNT) ./... -v -timeout=100m
@PACKER_ACC=1 go test -race -count $(COUNT) -v $(TEST) -timeout=100m

.PHONY: generate
generate: install-packer-sdc
Expand Down
Loading

0 comments on commit 6034f2c

Please sign in to comment.