Skip to content

Simplify project structure#255

Open
dabradley wants to merge 5 commits intokubernetes-sigs:developmentfrom
dabradley:simplify-structure
Open

Simplify project structure#255
dabradley wants to merge 5 commits intokubernetes-sigs:developmentfrom
dabradley:simplify-structure

Conversation

@dabradley
Copy link
Collaborator

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
The newer versions of the CSI libraries have base classes that will automatically respond to unimplemented API calls appropriately. The csi-common directory only contained files that specifically returned these values, and in some cases contained redundant implementations of API functionality that were shadowed by the real driver files. This PR removes all of this redundant code to help improve maintainability and remove unnecessary and potentially confusing complexity. The existing tests were moved into the appropriate driver files, those these already didn't necessarily exhaustively test the unimplemented responses.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jan 15, 2026
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 15, 2026
@dabradley dabradley requested review from Copilot and removed request for andyzhangx January 15, 2026 17:46
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 simplifies the project structure by removing the pkg/csi-common directory containing redundant default implementations of CSI interfaces. The newer CSI libraries provide base classes (csi.UnimplementedControllerServer, csi.UnimplementedNodeServer, csi.UnimplementedIdentityServer) that automatically handle unimplemented methods, making the custom default implementations unnecessary.

Changes:

  • Removed the entire pkg/csi-common directory containing redundant default server implementations and tests
  • Moved the CSIDriver struct and capability management methods directly into the Driver struct in the azurelustre package
  • Embedded CSI unimplemented server structs directly in the Driver type
  • Improved error messages for unimplemented methods to be more descriptive

Reviewed changes

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

Show a summary per file
File Description
pkg/csi-common/nodeserver-default.go Deleted redundant default node server implementation
pkg/csi-common/nodeserver-default_test.go Deleted corresponding tests
pkg/csi-common/identityserver-default.go Deleted redundant default identity server implementation
pkg/csi-common/identityserver-default_test.go Deleted corresponding tests
pkg/csi-common/driver.go Deleted redundant CSIDriver struct and methods
pkg/csi-common/driver_test.go Deleted corresponding tests
pkg/csi-common/controllerserver-default.go Deleted redundant default controller server implementation
pkg/csi-common/controllerserver-default_test.go Deleted corresponding tests
pkg/azurelustre/utils.go Changed package from csicommon to azurelustre, removed factory functions for default servers
pkg/azurelustre/utils_test.go Changed package from csicommon to azurelustre
pkg/azurelustre/server.go Changed package from csicommon to azurelustre
pkg/azurelustre/server_test.go Changed package from csicommon to azurelustre
pkg/azurelustre/azurelustre.go Added CSIDriver struct and capability methods, embedded unimplemented server structs
pkg/azurelustre/azurelustre_test.go Added tests for capability management methods
pkg/azurelustre/nodeserver.go Improved error messages for unimplemented methods
pkg/azurelustre/nodeserver_test.go Added tests for unimplemented node methods
pkg/azurelustre/controllerserver_test.go Added tests for unimplemented controller methods

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coveralls
Copy link

coveralls commented Jan 15, 2026

Pull Request Test Coverage Report for Build 21041124610

Details

  • 24 of 25 (96.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 88.031%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/azurelustre/azurelustre.go 22 23 95.65%
Totals Coverage Status
Change from base Build 20998306893: 0.4%
Covered Lines: 1802
Relevant Lines: 2047

💛 - Coveralls

Copy link
Contributor

@jeffbearer jeffbearer left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dabradley, jeffbearer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants