Skip to content

Commit

Permalink
Merge pull request #1526 from linode/dev
Browse files Browse the repository at this point in the history
v2.25.0
  • Loading branch information
jriddle-linode committed Jul 23, 2024
2 parents ccbf858 + 08748be commit 5b71f65
Show file tree
Hide file tree
Showing 27 changed files with 180 additions and 131 deletions.
3 changes: 3 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- name: new-feature
description: for new features in the changelog.
color: 225fee
- name: project
description: for new projects in the changelog.
color: 46BAF0
- name: improvement
description: for improvements in existing functionality in the changelog.
color: 22ee47
Expand Down
7 changes: 5 additions & 2 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ changelog:
labels:
- ignore-for-release
categories:
- title: ⚠️ Breaking Change
- title: 📋 New Project
labels:
- project
- title: ⚠️ Breaking Change
labels:
- breaking-change
- title: 🐛 Bug Fixes
Expand All @@ -18,7 +21,7 @@ changelog:
- title: 🧪 Testing Improvements
labels:
- testing
- title: ⚙️ Repo/CI Improvements
- title: ⚙️ Repo/CI Improvements
labels:
- repo-ci-improvement
- title: 📖 Documentation
Expand Down
41 changes: 41 additions & 0 deletions docs/data-sources/object_storage_bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
page_title: "Linode: linode_object_storage_bucket"
description: |-
Provides details about a Linode Object Storage Bucket.
---

# Data Source: linode_object_storage_bucket

Provides information about a Linode Object Storage Bucket
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-object-storage-bucket).

## Example Usage

The following example shows how one might use this data source to access information about a Linode Object Storage Bucket.

```hcl
data "linode_object_storage_bucket" "my-bucket" {
label = "my-bucket"
region = "us-mia"
}
```

## Argument Reference

* `label` - (Required) The name of this bucket.

* `region` - The ID of the region this bucket is in. Required if `cluster` is not configured.

* `cluster` - (Deprecated) The ID of the Object Storage Cluster this bucket is in. Required if `region` is not configured.

### Attributes Reference

* `created` - When this bucket was created.

* `hostname` - The hostname where this bucket can be accessed.This hostname can be accessed through a browser if the bucket is made public.

* `id` - The id of this bucket.

* `objects` - The number of objects stored in this bucket.

* `size` - The size of the bucket in bytes.
8 changes: 4 additions & 4 deletions docs/data-sources/placement_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ In addition to all arguments above, the following attributes are exported:

* `region` - The region of the Placement Group.

* `affinity_type` - The affinity policy to use when placing Linodes in this group.
* `placement_group_type` - The placement group type to use when placing Linodes in this group.

* `is_strict` - Whether Linodes must be able to become compliant during assignment. (Default `true`)
* `placement_group_policy` - Whether Linodes must be able to become compliant during assignment. (Default `strict`)

* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's affinity policy.
* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's placement group type.

* `members` - A set of Linodes currently assigned to this Placement Group.

Expand All @@ -47,4 +47,4 @@ Represents a single Linode assigned to a Placement Group.

* `linode_id` - The ID of the Linode.

* `is_compliant` - Whether this Linode is currently compliant with the group's affinity policy.
* `is_compliant` - Whether this Linode is currently compliant with the group's placement group type.
12 changes: 6 additions & 6 deletions docs/data-sources/placement_groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ Each Linode Placement Group will be stored in the `placement_groups` attribute a

* `region` - The region of the Placement Group.

* `affinity_type` - The affinity policy to use when placing Linodes in this group.
* `placement_group_type` - The placement group type to use when placing Linodes in this group.

* `is_strict` - Whether Linodes must be able to become compliant during assignment. (Default `true`)
* `placement_group_policy` - Whether Linodes must be able to become compliant during assignment. (Default `strict`)

* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's affinity policy.
* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's type.

* `members` - A set of Linodes currently assigned to this Placement Group.

* `linode_id` - The ID of the Linode.

* `is_compliant` - Whether this Linode is currently compliant with the group's affinity policy.
* `is_compliant` - Whether this Linode is currently compliant with the group's placement group type.

## Filterable Fields

Expand All @@ -76,8 +76,8 @@ Each Linode Placement Group will be stored in the `placement_groups` attribute a

* `region`

* `affinity_type`
* `placement_group_type`

* `is_strict`
* `placement_group_policy`

* `is_compliant`
4 changes: 2 additions & 2 deletions docs/resources/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,9 @@ This Linode Instance resource exports the following attributes:

* `label` - The label of the Placement Group.

* `affinity_type` - The affinity policy enforced by the Placement Group.
* `placement_group_type` - The placement group type enforced by the Placement Group.

* `is_strict` - Whether the Placement Group enforces strict compliance.
* `placement_group_policy` - Whether the Placement Group enforces strict compliance.

## Import

Expand Down
10 changes: 5 additions & 5 deletions docs/resources/placement_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Create a Placement Group with the local anti-affinity policy:
resource "linode_placement_group" "test" {
label = "my-placement-group"
region = "us-mia"
affinity_type = "anti_affinity:local"
placement_group_type = "anti_affinity:local"
}
```

Expand All @@ -31,17 +31,17 @@ The following arguments are supported:

* `region` - (Required) The region of the Placement Group.

* `affinity_type` - (Required) The affinity policy to use when placing Linodes in this group.
* `placement_group_type` - (Required) The placement group type to use when placing Linodes in this group.

* `is_strict` - (Optional) Whether Linodes must be able to become compliant during assignment. (Default `true`)
* `placement_group_policy` - (Optional) Whether Linodes must be able to become compliant during assignment. (Default `strict`)

## Attributes Reference

In addition to all the arguments above, the following attributes are exported.

* `id` - The ID of the Placement Group.

* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's affinity policy.
* `is_compliant` - Whether all Linodes in this group are currently compliant with the group's placement group type.

* [`members`](#members) - A set of Linodes currently assigned to this Placement Group.

Expand All @@ -51,7 +51,7 @@ Represents a single Linode assigned to a Placement Group.

* `linode_id` - The ID of the Linode.

* `is_compliant` - Whether this Linode is currently compliant with the group's affinity policy.
* `is_compliant` - Whether this Linode is currently compliant with the group's placement group type.

## Import

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/placement_group_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "linode_placement_group_assignment" "my-assignment" {
resource "linode_placement_group" "my-pg" {
label = "my-pg"
region = "us-east"
affinity_type = "anti_affinity:local"
placement_group_type = "anti_affinity:local"
}
resource "linode_instance" "my-inst" {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
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.9.0
github.com/linode/linodego v1.37.0
github.com/linode/linodego v1.38.0
github.com/linode/linodego/k8s v1.25.2
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.25.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,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.37.0 h1:B/2Spzv9jYXzKA+p+GD8fVCNJ7Wuw6P91ZDD9eCkkso=
github.com/linode/linodego v1.37.0/go.mod h1:L7GXKFD3PoN2xSEtFc04wIXP5WK65O10jYQx0PQISWQ=
github.com/linode/linodego v1.38.0 h1:wP3oW9OhGc6vhze8NPf2knbwH4TzSbrjzuCd9okjbTY=
github.com/linode/linodego v1.38.0/go.mod h1:L7GXKFD3PoN2xSEtFc04wIXP5WK65O10jYQx0PQISWQ=
github.com/linode/linodego/k8s v1.25.2 h1:PY6S0sAD3xANVvM9WY38bz9GqMTjIbytC8IJJ9Cv23o=
github.com/linode/linodego/k8s v1.25.2/go.mod h1:DC1XCSRZRGsmaa/ggpDPSDUmOM6aK1bhSIP6+f9Cwhc=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
Expand Down
8 changes: 4 additions & 4 deletions linode/instance/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ func flattenInstancePlacementGroup(d *schema.ResourceData, pg *linodego.Instance
}

result := map[string]any{
"id": pg.ID,
"label": pg.Label,
"affinity_type": string(pg.AffinityType),
"is_strict": pg.IsStrict,
"id": pg.ID,
"label": pg.Label,
"placement_group_type": string(pg.PlacementGroupType),
"placement_group_policy": pg.PlacementGroupPolicy,
}

// Inherit compliant_only if it already exists in state
Expand Down
12 changes: 6 additions & 6 deletions linode/instance/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2406,8 +2406,8 @@ func TestAccResourceInstance_withPG(t *testing.T) {
resource.TestCheckResourceAttr(resName, "placement_group.#", "1"),
resource.TestCheckResourceAttrSet(resName, "placement_group.0.id"),
resource.TestCheckResourceAttr(resName, "placement_group.0.label", testLabel+"-g1"),
resource.TestCheckResourceAttr(resName, "placement_group.0.affinity_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.is_strict", "false"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_policy", "flexible"),
),
},
{
Expand Down Expand Up @@ -2467,8 +2467,8 @@ func TestAccResourceInstance_pgAssignment(t *testing.T) {
resource.TestCheckResourceAttr(resName, "placement_group.#", "1"),
resource.TestCheckResourceAttrSet(resName, "placement_group.0.id"),
resource.TestCheckResourceAttr(resName, "placement_group.0.label", testLabel+"-g1"),
resource.TestCheckResourceAttr(resName, "placement_group.0.affinity_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.is_strict", "false"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_policy", "flexible"),
),
},

Expand All @@ -2484,8 +2484,8 @@ func TestAccResourceInstance_pgAssignment(t *testing.T) {
resource.TestCheckResourceAttr(resName, "placement_group.#", "1"),
resource.TestCheckResourceAttrSet(resName, "placement_group.0.id"),
resource.TestCheckResourceAttr(resName, "placement_group.0.label", testLabel+"-g2"),
resource.TestCheckResourceAttr(resName, "placement_group.0.affinity_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.is_strict", "false"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_type", "anti_affinity:local"),
resource.TestCheckResourceAttr(resName, "placement_group.0.placement_group_policy", "flexible"),
),
},

Expand Down
14 changes: 8 additions & 6 deletions linode/instance/schema_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ func resourcePlacementGroup() *schema.Resource {
Computed: true,
Description: "The label of this Placement Group.",
},
"affinity_type": {
"placement_group_type": {
Type: schema.TypeString,
Computed: true,
Description: "The affinity policy for this Placement Group.",
Description: "The placement group type for this Placement Group.",
},
"is_strict": {
Type: schema.TypeBool,
Computed: true,
Description: "Whether compliance is strictly enforced by this Placement Group.",
"placement_group_policy": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"strict", "flexible"}, true),
Computed: true,
Description: "Whether compliance is strictly enforced by this Placement Group.",
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions linode/instance/tmpl/templates/with_pg.gotf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
resource "linode_placement_group" "{{ $group_id }}" {
label = "{{ $.Label }}-{{ $group_id }}"
region = "{{ $.Region }}"
affinity_type = "anti_affinity:local"
is_strict = false
placement_group_type = "anti_affinity:local"
placement_group_policy = "flexible"
}

{{ end }}
Expand Down
8 changes: 4 additions & 4 deletions linode/placementgroup/datasource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ func TestAccDataSourcePlacementGroup_basic(t *testing.T) {
resourceName := "data.linode_placement_group.test"

label := acctest.RandomWithPrefix("tf-test")
affinityType := string(linodego.AffinityTypeAntiAffinityLocal)
placementGroupType := string(linodego.PlacementGroupTypeAntiAffinityLocal)

resource.Test(t, resource.TestCase{
PreCheck: func() { acceptance.PreCheck(t) },
ProtoV5ProviderFactories: acceptance.ProtoV5ProviderFactories,
Steps: []resource.TestStep{
{
Config: tmpl.DataBasic(t, label, testRegion, affinityType, false),
Config: tmpl.DataBasic(t, label, testRegion, placementGroupType, "flexible"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet(resourceName, "id"),
resource.TestCheckResourceAttrSet(resourceName, "label"),
resource.TestCheckResourceAttrSet(resourceName, "region"),
resource.TestCheckResourceAttrSet(resourceName, "affinity_type"),
resource.TestCheckResourceAttrSet(resourceName, "placement_group_type"),
resource.TestCheckResourceAttrSet(resourceName, "is_compliant"),
resource.TestCheckResourceAttrSet(resourceName, "is_strict"),
resource.TestCheckResourceAttrSet(resourceName, "placement_group_policy"),
),
},
},
Expand Down
10 changes: 5 additions & 5 deletions linode/placementgroup/framework_datasource_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ var DataSourceSchema = schema.Schema{
Description: "The region that the placement group is in.",
Computed: true,
},
"affinity_type": schema.StringAttribute{
Description: "The affinity policy for Linodes in a placement group",
"placement_group_type": schema.StringAttribute{
Description: "The placement group type for Linodes in a placement group",
Computed: true,
},
"is_compliant": schema.BoolAttribute{
Description: "Whether all Linodes in this group are currently compliant with the group's affinity policy.",
Description: "Whether all Linodes in this group are currently compliant with the group's placement group type.",
Computed: true,
},
"is_strict": schema.BoolAttribute{
"placement_group_policy": schema.StringAttribute{
Description: "Whether Linodes must be able to become compliant during assignment.",
Computed: true,
},
Expand All @@ -41,7 +41,7 @@ var DataSourceSchema = schema.Schema{
Computed: true,
},
"is_compliant": schema.BoolAttribute{
Description: "Whether this Linode is currently compliant with the group's affinity policy.",
Description: "Whether this Linode is currently compliant with the group's placement group type.",
Computed: true,
},
},
Expand Down
Loading

0 comments on commit 5b71f65

Please sign in to comment.