Skip to content

Conversation

@tchinmai7
Copy link
Contributor

@tchinmai7 tchinmai7 commented Jul 24, 2025

What this PR does / why we need it:

  • Make the FirewallID mutable on the LinodeMachineTemplate
  • Propagate the change from LinodeMachineTemplate -> LinodeMachine
  • Update the firewalls attached to a linode when the spec changes

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@codecov
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 74.07407% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.42%. Comparing base (6e6db1b) to head (a796d7b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...nal/controller/linodemachinetemplate_controller.go 36.36% 11 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #813      +/-   ##
==========================================
+ Coverage   63.20%   63.42%   +0.22%     
==========================================
  Files          71       71              
  Lines        7359     7410      +51     
==========================================
+ Hits         4651     4700      +49     
  Misses       2435     2435              
- Partials      273      275       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

// update the firewallID if needed.
if !slices.Contains(attachedFirewalls, machineScope.LinodeMachine.Spec.FirewallID) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're replacing an array with an individual ID - is this OK?

@tchinmai7 tchinmai7 marked this pull request as ready for review July 28, 2025 21:27
@tchinmai7 tchinmai7 changed the title feat: make firewallID mutable, propagate it from lmt->lm [feat] make firewallID mutable, propagate it from lmt->lm Jul 28, 2025
@tchinmai7 tchinmai7 requested a review from Copilot July 28, 2025 23:40
Copy link

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

This PR adds support for mutable FirewallID configurations in LinodeMachineTemplate and propagates firewall changes from LinodeMachineTemplate to LinodeMachine resources. It enables dynamic firewall management for Linode instances.

  • Removes immutability constraints on FirewallID fields in both LinodeMachine and LinodeMachineTemplate
  • Adds reconciliation logic to propagate firewall changes from templates to machines and update Linode instances
  • Introduces new client methods for listing and updating instance firewalls with corresponding mock implementations

Reviewed Changes

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

Show a summary per file
File Description
api/v1alpha2/linodemachine_types.go Removes immutability validation for FirewallID field and adds documentation
api/v1alpha2/linodemachinetemplate_types.go Adds FirewallID field to LinodeMachineTemplateStatus
config/crd/bases/*.yaml Updates CRD definitions to reflect API changes and remove immutability constraints
clients/clients.go Adds new interface methods for firewall operations
internal/controller/linodemachine_controller.go Implements firewall reconciliation logic for LinodeMachine
internal/controller/linodemachinetemplate_controller.go Adds firewall propagation from template to machines
mock/client.go Adds mock implementations for new firewall client methods
observability/wrappers/linodeclient/linodeclient.gen.go Adds tracing wrappers for new firewall methods
go.mod Updates dependencies
docs/src/reference/out.md Updates documentation with new field descriptions
Test files Adds comprehensive test coverage for firewall functionality
Comments suppressed due to low confidence (1)

internal/controller/linodemachinetemplate_controller.go:190

  • Missing log statement in reconcileFirewallID function. Consider adding a log message similar to the reconcileTags function to track successful firewall ID updates.
	return nil

@tchinmai7 tchinmai7 merged commit 4e6e873 into main Aug 12, 2025
19 of 20 checks passed
@AshleyDumaine AshleyDumaine deleted the mutable-firwall branch August 12, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants