Skip to content

Commit

Permalink
Release v2.3.0 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
skatsaounis authored Jul 3, 2024
1 parent f5a5c2a commit 2078041
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 21 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 2.3.0 (Jul 3, 2024)

:warning: Repository ownership and provider name change

The Terraform Provider for MAAS repository now lives under the [Canonical GitHub organisation](https://github.com/canonical) with a new name `github.com/canonical/terraform-provider-maas`. Check [README.md](./README.md) for more information.

NEW:

* ci: add Canonical CLA check (#182)

IMPROVEMENTS:

* bug: respect given timeouts for create/delete operations (#185)
* fix: manage existing physical interfaces from commissioning (#178)
* fix: properly import physical interfaces (#169)
* Update dependencies

## 2.2.0 (Apr 3, 2024)

NEW:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEST?=$$(go list ./... | grep -v 'vendor')
HOSTNAME=registry.terraform.io
NAMESPACE=maas
NAMESPACE=canonical
NAME=maas
PROVIDER_NAME=terraform-provider-${NAME}
BINARY=terraform-provider-${NAME}
Expand Down
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@

This repository contains the source code for the Terraform MAAS provider.

## :warning: Repository ownership and provider name change

The Terraform Provider for MAAS repository now lives under the [Canonical GitHub organisation](https://github.com/canonical) with a new name `github.com/canonical/terraform-provider-maas`.

Ensure you are pointing at the new provider name inside your Terraform module(s), which is `canonical/maas`:

1. Manually update the list of required providers in your Terraform module(s):

```diff
terraform {
required_providers {
maas = {
- source = "maas/maas"
+ source = "canonical/maas"
version = "~>2.0"
}
}
}
```

1. Upgrade your provider dependencies to add the `canonical/maas` provider info:

```bash
terraform init -upgrade
```

1. Replace the provider reference in your state:

```bash
terraform state replace-provider maas/maas canonical/maas
```

1. Upgrade your provider dependencies to remove the `maas/maas` provider info:

```bash
terraform init -upgrade
```

References:

- <https://developer.hashicorp.com/terraform/language/files/dependency-lock#dependency-on-a-new-provider>
- <https://developer.hashicorp.com/terraform/language/files/dependency-lock#providers-that-are-no-longer-required>
- <https://developer.hashicorp.com/terraform/cli/commands/state/replace-provider>

---

## Requirements

- [Terraform](https://www.terraform.io/downloads.html) >= 1.4.x
Expand Down Expand Up @@ -50,11 +96,18 @@ The [docs](/docs) section contains details about each supported Terraform resour
### Release process

1. Create a new branch from `master` as `release-vX.X.X`

```bash
git branch release-vX.X.X master
git push -u origin release-vX.X.X
```
2. Update the `CHANGELOG.md` with your release version, date and change details and push the changes to the new branch.

2. Update the `CHANGELOG.md` with your release version, date and change details and push the changes to the new branch. New changes between previous release vY.Y.Y and current one vX.X.X can be found with the following command:

```bash
git log --oneline vY.Y.Y..vX.X.X
```

3. Raise a PR on Github, title of the PR should be in the following format
`Release vX.X.X`
4. Merge the PR into master, taking a note of the merge commit which is created
Expand All @@ -71,4 +124,4 @@ The [docs](/docs) section contains details about each supported Terraform resour

### Testing

Unit tests run with every pull request and merge to master. The end to end tests run on a nightly basis against a hosted MAAS deployment, results can be found [here](https://raw.githubusercontent.com/maas/maas-terraform-e2e-tests/main/results.json?token=GHSAT0AAAAAAB3FX6R5C67Q4LH7ADOO5O3IY4ODCNA) and are checked on each PR, with a warning if failed.
Unit tests run with every pull request and merge to master. The end to end tests run on a nightly basis against a hosted MAAS deployment, results can be found [here](https://raw.githubusercontent.com/canonical/maas-terraform-e2e-tests/main/results.json?token=GHSAT0AAAAAAB3FX6R5C67Q4LH7ADOO5O3IY4ODCNA) and are checked on each PR, with a warning if failed.
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
page_title: "MAAS Provider"
description: |-
The Terraform Provider for MAAS.
---
<!-- "MAAS Terraform provider reference" -->
<a href="#heading--what-is-this"><h1 id="heading--what-is-this">The MAAS Terraform provider</h1></a>
Expand All @@ -21,17 +21,17 @@ We will deal with each of these categories in turn. For each data source and re

The schema that provides an API linkage to MAAS from Terraform consists of a standard HCL provider block and a provider API block. As with all Terraform providers, the provider block contains at least two items:

- a source element, which in this case is "maas/maas".
- a version element, which can be sufficiently specified by "~>1.0".
- a source element, which in this case is "canonical/maas".
- a version element, which can be sufficiently specified by "~>2.0".

The provider block would look something like this:

```nohighlight
terraform {
required_providers {
maas = {
source = "maas/maas"
version = "~>1.0"
source = "canonical/maas"
version = "~>2.0"
}
}
}
Expand Down Expand Up @@ -66,7 +66,7 @@ A completed definition would also include some data sources and resources, like
terraform {
required_providers {
maas = {
source = "maas/maas"
source = "canonical/maas"
version = "~>2.0"
}
}
Expand Down Expand Up @@ -203,7 +203,7 @@ The MAAS Terraform provider makes a large number of resources available, current
- A [maas_machine](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/machine.md) provides a resource to manage MAAS machines; note that these are typically physical machines (rather than VMs), so they tend to respond differently at times.
- A [maas_network_interface_physical](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/network_interface_physical.md) provides a resource to manage a physical network interface from an existing MAAS machine. Network interfaces can be created and deleted at will via the MAAS CLI/UI, so there may be more than one of these associate with any given machine.
- A [maas_network_interface_link](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/network_interface_link.md) provides a resource to manage network configuration on a network interface. Note that this does not represent the interface itself, but the parameter set that configure that interface.
- A [maas_fabric](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/fabric.md) provides a resource to manage MAAS network fabrics, which are [described above](#heading--fabric).
- A [maas_fabric](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/fabric.md) provides a resource to manage MAAS network fabrics, which are [described above](#heading--fabric).
- A [maas_vlan](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/vlan.md) provides a resource to manage MAAS network VLANs, also [described above](#heading--vlan).
- A [maas_subnet](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/subnet.md) provides a resource to manage MAAS network subnets, also [described above](#heading--subnet)
- A [maas_subnet_ip_range](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/subnet_ip_range.md) provides a resource to manage MAAS network subnets IP ranges. IP ranges carry particular importance when managing DHCP with multiple DHCP servers, for example.
Expand Down
2 changes: 1 addition & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
maas = {
source = "registry.terraform.io/maas/maas"
source = "registry.terraform.io/canonical/maas"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
maas = {
source = "maas/maas"
source = "canonical/maas"
version = "~>2.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion maas/resource_maas_network_interface_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func getNetworkInterfaceLinkParams(d *schema.ResourceData, subnetID int) *entity
func createNetworkInterfaceLink(client *client.Client, machineSystemID string, networkInterface *entity.NetworkInterface, params *entity.NetworkInterfaceLinkParams) (*entity.NetworkInterfaceLink, error) {
// Clear existing links
// VLAN type interfaces are excluded since this action is not allowed by MAAS itself:
// <https://github.com/maas/maas/blob/master/src/maasserver/models/interface.py#L2001-L2006>
// <https://github.com/canonical/maas/blob/master/src/maasserver/models/interface.py#L2001-L2006>
if networkInterface.Type != "vlan" {
_, err := client.NetworkInterface.Disconnect(machineSystemID, networkInterface.ID)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
opts := &plugin.ServeOpts{ProviderFunc: maas.Provider}

if debugMode {
err := plugin.Debug(context.Background(), "registry.terraform.io/maas/maas", opts)
err := plugin.Debug(context.Background(), "registry.terraform.io/canonical/maas", opts)

if err != nil {
log.Fatal(err.Error())
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-dev-overrides.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cat << EOF > $BIN_DIR/$OVERRIDES_FILENAME
provider_installation {
dev_overrides {
"registry.terraform.io/maas/maas" = "$BIN_DIR"
"registry.terraform.io/canonical/maas" = "$BIN_DIR"
}
direct {}
Expand Down
12 changes: 6 additions & 6 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
page_title: "MAAS Provider"
description: |-
The Terraform Provider for MAAS.

---
<!-- "MAAS Terraform provider reference" -->
<a href="#heading--what-is-this"><h1 id="heading--what-is-this">The MAAS Terraform provider</h1></a>
Expand All @@ -21,17 +21,17 @@ We will deal with each of these categories in turn. For each data source and re

The schema that provides an API linkage to MAAS from Terraform consists of a standard HCL provider block and a provider API block. As with all Terraform providers, the provider block contains at least two items:

- a source element, which in this case is "maas/maas".
- a version element, which can be sufficiently specified by "~>1.0".
- a source element, which in this case is "canonical/maas".
- a version element, which can be sufficiently specified by "~>2.0".

The provider block would look something like this:

```nohighlight
terraform {
required_providers {
maas = {
source = "maas/maas"
version = "~>1.0"
source = "canonical/maas"
version = "~>2.0"
}
}
}
Expand Down Expand Up @@ -143,7 +143,7 @@ The MAAS Terraform provider makes a large number of resources available, current
- A [maas_machine](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/machine.md) provides a resource to manage MAAS machines; note that these are typically physical machines (rather than VMs), so they tend to respond differently at times.
- A [maas_network_interface_physical](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/network_interface_physical.md) provides a resource to manage a physical network interface from an existing MAAS machine. Network interfaces can be created and deleted at will via the MAAS CLI/UI, so there may be more than one of these associate with any given machine.
- A [maas_network_interface_link](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/network_interface_link.md) provides a resource to manage network configuration on a network interface. Note that this does not represent the interface itself, but the parameter set that configure that interface.
- A [maas_fabric](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/fabric.md) provides a resource to manage MAAS network fabrics, which are [described above](#heading--fabric).
- A [maas_fabric](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/fabric.md) provides a resource to manage MAAS network fabrics, which are [described above](#heading--fabric).
- A [maas_vlan](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/vlan.md) provides a resource to manage MAAS network VLANs, also [described above](#heading--vlan).
- A [maas_subnet](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/subnet.md) provides a resource to manage MAAS network subnets, also [described above](#heading--subnet)
- A [maas_subnet_ip_range](https://github.com/maas/terraform-provider-maas/blob/master/docs/resources/subnet_ip_range.md) provides a resource to manage MAAS network subnets IP ranges. IP ranges carry particular importance when managing DHCP with multiple DHCP servers, for example.
Expand Down

0 comments on commit 2078041

Please sign in to comment.