Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.25.7 #495

Merged
merged 10 commits into from
Apr 22, 2024
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.

32 changes: 32 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: ⚠️ Breaking Change
labels:
- breaking-change
- title: 🐛 Bug Fixes
labels:
- bugfix
- title: 🚀 New Features
labels:
- new-feature
- title: 💡 Improvements
labels:
- improvement
- title: 🧪 Testing Improvements
labels:
- testing
- title: ⚙️ Repo/CI Improvements
labels:
- repo-ci-improvement
- title: 📖 Documentation
labels:
- documentation
- title: 📦 Dependency Updates
labels:
- dependencies
- title: Other Changes
labels:
- "*"
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.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Modules for retrieving and filtering on multiple Linode resources.

Name | Description |
--- | ------------ |
[linode.cloud.account_availability_list](./docs/modules/account_availability_list.md)|List and filter on Account Availabilitys.|
[linode.cloud.account_availability_list](./docs/modules/account_availability_list.md)|List and filter on Account Availabilities.|
[linode.cloud.database_engine_list](./docs/modules/database_engine_list.md)|List and filter on Managed Database engine types.|
[linode.cloud.database_list](./docs/modules/database_list.md)|List and filter on Linode Managed Databases.|
[linode.cloud.domain_list](./docs/modules/domain_list.md)|List and filter on Domains.|
Expand Down
1 change: 1 addition & 0 deletions docs/modules/account_availability_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Get info about a Linode Account Availability.

{
"region": "us-east",
"available": ["NodeBalancers", "Block Storage", "Kubernetes"],
"unavailable": ["Linode"]
}

Expand Down
14 changes: 8 additions & 6 deletions docs/modules/account_availability_list.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# account_availability_list

List and filter on Account Availabilitys.
List and filter on Account Availabilities.

**:warning: This module makes use of beta endpoints and requires the `api_version` field be explicitly set to `v4beta`.**

Expand All @@ -27,10 +27,10 @@ List and filter on Account Availabilitys.

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list Account Availabilitys in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Account Availabilitys by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Account Availabilitys. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Account Availabilitys to return. If undefined, all results will be returned. |
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list Account Availabilities in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Account Availabilities by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Account Availabilities. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Account Availabilities to return. If undefined, all results will be returned. |

### filters

Expand All @@ -41,17 +41,19 @@ List and filter on Account Availabilitys.

## Return Values

- `account_availabilities` - The returned Account Availabilitys.
- `account_availabilities` - The returned Account Availabilities.

- Sample Response:
```json
[
{
"region": "ap-west",
"available": ["NodeBalancers", "Block Storage", "Kubernetes"],
"unavailable": ["Linode"]
},
{
"region": "ca-central",
"available": ["NodeBalancers", "Kubernetes"],
"unavailable": ["Linode", "Block Storage"]
}
]
Expand Down
1 change: 1 addition & 0 deletions docs/modules/nodebalancer.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Manage a Linode NodeBalancer.
| `client_conn_throttle` | <center>`int`</center> | <center>Optional</center> | Throttle connections per second. Set to 0 (zero) to disable throttling. **(Updatable)** |
| `region` | <center>`str`</center> | <center>Optional</center> | The ID of the Region to create this NodeBalancer in. |
| `firewall_id` | <center>`int`</center> | <center>Optional</center> | The ID of the Firewall to assign this NodeBalancer to. |
| `tags` | <center>`list`</center> | <center>Optional</center> | Tags to assign to this NodeBalancer. **(Updatable)** |
| [`configs` (sub-options)](#configs) | <center>`list`</center> | <center>Optional</center> | A list of configs to apply to the NodeBalancer. **(Updatable)** |

### configs
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/vpc_subnet_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ List and filter on VPC Subnets.

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `vpc_id` | <center>`int`</center> | <center>**Required**</center> | The parent VPC for this VPC Subnet. |
| `vpc_id` | <center>`int`</center> | <center>**Required**</center> | The parent VPC for the VPC Subnets. |
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list VPC Subnets in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order VPC Subnets by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting VPC Subnets. |
Expand Down
9 changes: 6 additions & 3 deletions plugins/inventory/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
from linode_api4.objects import Instance

DOCUMENTATION = r"""
DOCUMENTATION = """
name: instance
author:
- Luke Murphy (@decentral1se)
Expand Down Expand Up @@ -59,7 +59,7 @@
type: list
"""

EXAMPLES = r"""
EXAMPLES = """
# Minimal example. `LINODE_API_TOKEN` is exposed in environment.
plugin: linode.cloud.instance

Expand Down Expand Up @@ -209,7 +209,10 @@ def _add_instances_to_groups(self) -> None:
def _add_hostvars_for_instances(self) -> None:
"""Add hostvars for instances in the dynamic inventory."""
for instance in self.instances:
hostvars = instance._raw_json
hostvars = {}
hostvars.update(instance._raw_json)
hostvars["networking_info"] = instance.ips.dict

for hostvar_key in hostvars:
self.inventory.set_variable(
instance.label, hostvar_key, hostvars[hostvar_key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
result_account_availability_samples = ['''
{
"region": "us-east",
"available": ["NodeBalancers", "Block Storage", "Kubernetes"],
"unavailable": ["Linode"]
}
''']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
result_account_availabilities_samples = ['''[
{
"region": "ap-west",
"available": ["NodeBalancers", "Block Storage", "Kubernetes"],
"unavailable": ["Linode"]
},
{
"region": "ca-central",
"available": ["NodeBalancers", "Kubernetes"],
"unavailable": ["Linode", "Block Storage"]
}
]''']
14 changes: 7 additions & 7 deletions plugins/module_utils/linode_common_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,29 @@ def spec(self):
"order": SpecField(
type=FieldType.string,
description=[
f"The order to list {self.result_display_name}s in."
f"The order to list {self.result_display_name} in."
],
default="asc",
choices=["desc", "asc"],
),
"order_by": SpecField(
type=FieldType.string,
description=[
f"The attribute to order {self.result_display_name}s by."
f"The attribute to order {self.result_display_name} by."
],
),
"filters": SpecField(
type=FieldType.list,
element_type=FieldType.dict,
suboptions=spec_filter,
description=[
f"A list of filters to apply to the resulting {self.result_display_name}s."
f"A list of filters to apply to the resulting {self.result_display_name}."
],
),
"count": SpecField(
type=FieldType.integer,
description=[
f"The number of {self.result_display_name}s to return.",
f"The number of {self.result_display_name} to return.",
"If undefined, all results will be returned.",
],
),
Expand All @@ -151,12 +151,12 @@ def spec(self):
options[param.name] = SpecField(
type=param.type,
description=[
f"The parent {param.display_name} for this {self.result_display_name}."
f"The parent {param.display_name} for the {self.result_display_name}."
],
required=True,
)

description = [f"List and filter on {self.result_display_name}s."]
description = [f"List and filter on {self.result_display_name}."]

if self.requires_beta:
description.append(BETA_DISCLAIMER)
Expand All @@ -169,7 +169,7 @@ def spec(self):
examples=self.examples,
return_values={
self.result_field_name: SpecReturnValue(
description=f"The returned {self.result_display_name}s.",
description=f"The returned {self.result_display_name}.",
docs_url=self.result_docs_url,
type=FieldType.list,
elements=FieldType.dict,
Expand Down
17 changes: 16 additions & 1 deletion plugins/module_utils/linode_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def handle_updates(

obj._api_get()

# We need the type to access property metadata
property_metadata = type(obj).properties

# Update mutable values
params = filter_null_values(params)

Expand All @@ -128,7 +131,19 @@ def handle_updates(

old_value = parse_linode_types(getattr(obj, key))

if new_value != old_value:
has_diff = new_value != old_value

# We should convert properties to sets
# if they are annotated as unordered in the
# Python SDK.
if (
property_metadata is not None
and property_metadata.get(key) is not None
and property_metadata.get(key).unordered
):
has_diff = set(old_value) != set(new_value)

if has_diff:
if key in mutable_fields:
put_request[key] = new_value
result.add(key)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/account_availability_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)

module = ListModule(
result_display_name="Account Availability",
result_display_name="Account Availabilities",
result_field_name="account_availabilities",
endpoint_template="/account/availability",
result_docs_url="TBD",
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/image_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)

module = ListModule(
result_display_name="Image",
result_display_name="Images",
result_field_name="images",
endpoint_template="/images",
result_docs_url="https://www.linode.com/docs/api/images/#images-list__responses",
Expand Down
Loading
Loading