Skip to content

Conversation

@adamginna-akamai
Copy link
Contributor

@adamginna-akamai adamginna-akamai commented Jul 16, 2025

This PR introduces a flag that allows you to replace the "ccm-" prefix with any string of up to 20 characters.

This change allows you to set a cluster name as a prefix and trace Node Balancers more easily.

General:

  1. Have you removed all sensitive information, including but not limited to access keys and passwords?
  2. Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@github-actions github-actions bot added the new-feature for new features in the changelog. label Jul 16, 2025
@Michkov Michkov requested a review from eljohnson92 July 16, 2025 12:12
@rahulait rahulait requested a review from Copilot July 17, 2025 02:33

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.48%. Comparing base (5a59a82) to head (e65c24c).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #414      +/-   ##
==========================================
+ Coverage   75.39%   75.48%   +0.09%     
==========================================
  Files          16       16              
  Lines        2983     2994      +11     
==========================================
+ Hits         2249     2260      +11     
  Misses        545      545              
  Partials      189      189              

☔ 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.

@rahulait rahulait requested a review from Copilot July 17, 2025 15:39
Copy link
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

This PR adds a customizable prefix for Linode NodeBalancers, replacing the hardcoded “ccm-” prefix.

  • Introduces a --nodebalancer-prefix flag and enforces a maximum length.
  • Updates the load balancer name generator to use the new prefix.
  • Propagates the flag into documentation, Helm chart values, DaemonSet template, and adds tests for length validation.

Reviewed Changes

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

Show a summary per file
File Description
main.go Add --nodebalancer-prefix flag and default/help text
docs/configuration/environment.md Document the --nodebalancer-prefix flag
deploy/chart/values.yaml Add Helm nodeBalancerPrefix value comment
deploy/chart/templates/daemonset.yaml Inject --nodebalancer-prefix into DaemonSet args
cloud/linode/loadbalancers.go Use Options.NodeBalancerPrefix in name formatting
cloud/linode/cloud_test.go Test prefix length validation
cloud/linode/cloud.go Validate NodeBalancerPrefix length in newCloud
Comments suppressed due to low confidence (2)

deploy/chart/templates/daemonset.yaml:159

  • The condition for rendering --nodebalancer-prefix is checking nodeBalancerBackendIPv4Subnet instead of nodeBalancerPrefix, so the custom prefix flag may never be included. Change the if to if .Values.nodeBalancerPrefix.
            {{- if .Values.nodeBalancerBackendIPv4Subnet }}

cloud/linode/loadbalancers.go:230

  • [nitpick] It would be helpful to add a unit test for GetLoadBalancerName that verifies the custom prefix is applied correctly, including edge cases like an empty string or a very long prefix.
	return fmt.Sprintf("%s-%s", Options.NodeBalancerPrefix, unixNano[len(unixNano)-12:])

Copy link
Contributor

@rahulait rahulait left a comment

Choose a reason for hiding this comment

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

LGTM

@rahulait rahulait merged commit 77d65e1 into linode:main Jul 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants