Skip to content

Add Linode machine_config_v2 support for interface networking and user data#2121

Draft
lots0logs wants to merge 4 commits into
rancher:mainfrom
lots0logs:linode-config-updates
Draft

Add Linode machine_config_v2 support for interface networking and user data#2121
lots0logs wants to merge 4 commits into
rancher:mainfrom
lots0logs:linode-config-updates

Conversation

@lots0logs
Copy link
Copy Markdown
Contributor

@lots0logs lots0logs commented Mar 31, 2026

Fixes #2120

Description

Adds support for the new Linode machine config fields in rancher2_machine_config_v2 so Terraform can configure the Linode machine driver updates for:

  • interface/VPC networking
  • metadata user_data / cloud-init

This change updates the Linode machine config schema, expand/flatten handling, validation, docs, and tests.

New linode_config fields:

  • use_interfaces
  • vpc_subnet_id
  • vpc_private_ip
  • public_interface_firewall_id
  • vpc_interface_firewall_id
  • user_data

Compatibility notes:

  • Existing legacy create_private_ip support is preserved.
  • Validation prevents mixing legacy private IP mode with interface/VPC mode.
  • Validation also enforces vpc_subnet_id when use_interfaces is enabled.

This PR depends on the corresponding Linode machine driver support landing first:

Until those changes are merged and available in the driver consumed by Rancher, these provider fields will not be usable end-to-end.

Testing

Updated unit tests cover Linode machine config expand/flatten behavior for the new fields.

I did not run the full provider test suite as part of opening this PR.

Not a breaking change.

Copilot AI review requested due to automatic review settings March 31, 2026 19:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new Linode machine driver options to rancher2_machine_config_v2 so Terraform can configure Linode interface/VPC networking and metadata user data (cloud-init) for downstream provisioning.

Changes:

  • Extend the Linode machine config v2 schema with interface/VPC networking fields and user_data.
  • Update Linode expand/flatten logic to map the new fields between Terraform state and the Rancher machine config object.
  • Add unit tests for Linode machine config v2 expand/flatten behavior, and document the new fields.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rancher2/structure_machine_config_v2_linode.go Adds Linode config fields and maps them in expand/flatten.
rancher2/structure_machine_config_v2_linode_test.go New tests covering expand/flatten for the added Linode fields.
rancher2/schema_machine_config_v2_linode.go Adds schema entries for user_data and interface/VPC networking fields (plus conflicts/required-with wiring).
rancher2/resource_rancher2_machine_config_v2.go Adds plan-time validation (CustomizeDiff) for interface/VPC field combinations.
docs/resources/machine_config_v2.md Documents the new linode_config fields.

Comment thread rancher2/resource_rancher2_machine_config_v2.go Outdated
Comment thread rancher2/schema_machine_config_v2_linode.go Outdated
Copilot AI review requested due to automatic review settings March 31, 2026 19:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread rancher2/schema_machine_config_v2_linode.go
@matttrach matttrach added area/rancher-machine This issue involves Rancher machine and removed area/rancher-machine This issue involves Rancher machine labels Apr 1, 2026
@matttrach matttrach requested a review from a team April 1, 2026 16:39
@lots0logs lots0logs force-pushed the linode-config-updates branch from 9e4ec06 to 2a2e7a0 Compare April 1, 2026 16:45
@matttrach
Copy link
Copy Markdown
Collaborator

@lots0logs please sign your commits with verified signatures, if you look on the commits tab you will see the commits you have made. They should have the "verified" badge when signed properly.
https://docs.github.com/en/authentication/managing-commit-signature-verification

@matttrach matttrach added the release/v14 Targets release v14.x correlating to Rancher's v2.14.x label Apr 1, 2026
Codex AI and others added 3 commits April 1, 2026 13:07
* feat: add linode vpc and user data fields

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* chore: user data plain string handling

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* fix: send linode user data plain text

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: validate linode interfaces subnet requirement

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* test: align linode fixture with schema constraints

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* Harden linode config validation

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

* Enforce vpc subnet interface validation

Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>

---------

Co-authored-by: openai-code-agent[bot] <242516109+Codex@users.noreply.github.com>
Co-authored-by: lots0logs <4675662+lots0logs@users.noreply.github.com>
Co-authored-by: Dustin Falgout <dustin@falgout.us>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lots0logs lots0logs force-pushed the linode-config-updates branch from 2a2e7a0 to ab1a565 Compare April 1, 2026 18:07
@lots0logs
Copy link
Copy Markdown
Contributor Author

@lots0logs please sign your commits with verified signatures, if you look on the commits tab you will see the commits you have made. They should have the "verified" badge when signed properly. https://docs.github.com/en/authentication/managing-commit-signature-verification

Done ✔️

Copy link
Copy Markdown
Member

@jiaqiluo jiaqiluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Since the PR depends on the machine driver, it makes sense not to merge it until the machine driver is updated in rancher/rancher.

@matttrach
Copy link
Copy Markdown
Collaborator

@jiaqiluo is there an issue or PR in rancher/rancher for this already?

@jiaqiluo
Copy link
Copy Markdown
Member

jiaqiluo commented Apr 2, 2026

@matttrach, I don't find any issue for it in rancher/rancher.

The docker-machine-driver-linode is maintained by Linode. rancher/rancher#49533 tracks the last time we bumped the docker-machine-driver-linode. The actual PR was also raised by Linode.

I know there is a communication channel between the Linode engineering team and us at the manager level, but I am not involved. I think the GH issue will be made by Sergey after the Linode team notifies us that they are ready for bumping the driver in Rancher.

@snasovich
Copy link
Copy Markdown
Collaborator

@jiaqiluo, thank you for reviewing this. Logged rancher/rancher#54573 to track Linode driver version bump that is a prerequisite to merging this PR (we can create backports as necessary).
@matttrach , should we convert this PR to draft meanwhile or is there some other mechanism you prefer to use to indicate merging of this PR is blocked by some other issue.

@matttrach matttrach marked this pull request as draft April 13, 2026 17:05
@matttrach
Copy link
Copy Markdown
Collaborator

converting to draft makes sense to me

@lots0logs
Copy link
Copy Markdown
Contributor Author

@matttrach I've been informed by Linode Support that their Dev team said they are no longer accepting updates to their machine driver plugin code. They consider it to be legacy and EOL. I couldn't get any response directly from their Dev team on my PRs so not sure if this is a case of someone not knowing what they are talking about or if its legit. Maybe your team can reach out directly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/rancher-machine This issue involves Rancher machine release/v14 Targets release v14.x correlating to Rancher's v2.14.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add Linode machine_config_v2 support for interface/VPC networking and user data

6 participants