Skip to content

Conversation

@jescarri
Copy link

@jescarri jescarri commented Apr 21, 2025

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • 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

This PR removes the dependency on the Linode API from the NodeServer component of the CSI driver.
Disk enumeration logic previously relying on the Linode API has been refactored to use local system information instead.

CSI Sanity tests are now executed independently for the Controller and NodeServer roles to reflect their distinct responsibilities.

A new DRIVER_ROLE environment variable has been introduced to explicitly define the driver's operational mode.
When DRIVER_ROLE=nodeserver, Linode API credentials are no longer required, enabling the NodeServer to run in environments where cloud API access is restricted or unnecessary.

@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.01%. Comparing base (34f29e7) to head (d36f902).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
main.go 0.00% 5 Missing ⚠️
pkg/hwinfo/hwinfo.go 33.33% 4 Missing ⚠️
internal/driver/limits.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #415      +/-   ##
==========================================
+ Coverage   73.65%   74.01%   +0.35%     
==========================================
  Files          23       24       +1     
  Lines        2775     2763      -12     
==========================================
+ Hits         2044     2045       +1     
+ Misses        594      586       -8     
+ Partials      137      132       -5     

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

@jescarri
Copy link
Author

Related To: #417

@jescarri jescarri force-pushed the remove_linode_api_ds branch from 0f9e85c to 7361046 Compare April 29, 2025 22:12
@jescarri jescarri changed the title [WIP] Remove linode api token requirement from node-server Refactor NodeServer to eliminate Linode API dependency and support isolated driver roles Apr 29, 2025
Copy link
Contributor

@komer3 komer3 left a comment

Choose a reason for hiding this comment

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

Just one small thing. Apart from that everything looks good to me!

This change decouples the NodeServer from the Linode API by replacing disk enumeration logic with local system inspection.
A DRIVER_ROLE environment variable is introduced to distinguish Controller and NodeServer modes. When set to 'nodeserver',
cloud API credentials are no longer required.

Sanity tests for Controller and NodeServer are now executed independently to reflect this separation.

update helm chart node-server daemonset and remove the need of
LINODE_TOKEN to be set.

remove LINODE_TOKEN from node-server kustomize manifests

add lsblk as a dependency in the Dockerfile

exclude non block devices from lsblk output

remove linode api testing from node_server test TestNodeGetInfo

added methods to detect the number of attached disks

add hardwareinfo package and update attachedVolumeCount

upodate mocks

remove linode client dependency from node-server

add driver role either controller or nodeserver

this controls if the LINODE_TOKEN is required or not.

skip some csi-sanity checks that requre linodeapi access

fix golangci-lint remove unused functions

fix golanci-lint errors

fix TestNodeGetInfo so that it uses mockhw.

fix: logic to detect attached disks.

Move from counting disks with valid partitions to disk bus type.

update deployment documentation

Added section about driver_role env variables
Jesus Carrillo added 2 commits May 2, 2025 13:44
In order for the node-server sanity checks to pass we have to:

1. Add Linode token and api to the nodeserver daemonset

There's a need for the nodeserver to have linode api access because
sanity checks require CreateVolume and ListVolume.

By patching the node-server Daemonset and injecting the LINODE_TOKEN
The Controller Code Path is able to be initialized with a proper client.
This is not needed for normal nodeserver operation, however the
sanity-checks expect the ability for the nodeserver to also perform
controller functions.

E2E tests pass without the need of LINODE_TOKEN in the nodeserver
- Specify that `DRIVER_ROLE=controller` requires `LINODE_TOKEN` and initializes the CSI Controller with Linode API access.
- Specify that `DRIVER_ROLE=nodeserver` does not require `LINODE_TOKEN` and only launches the NodeServer, operating without any Linode API calls.
Copy link
Contributor

@komer3 komer3 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jescarri jescarri merged commit 1f66948 into main May 2, 2025
10 of 11 checks passed
@komer3 komer3 added the improvement for improvements in existing functionality in the changelog. label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants