Skip to content

Commit 4a7d654

Browse files
nixpanicceph-csi-bot
authored andcommitted
nfs: rename Server to nfsIdentityServer
Rename the NFS identity Server struct to nfsIdentityServer to follow Go naming conventions for unexported types and to make it clear this is the NFS-specific implementation. Update the method receiver, add compile-time interface assertion to ensure the type implements the required CSI IdentityServer interface, and update NewIdentityServer to return the csi.IdentityServer interface. Assisted-by: AskBob <askbob@ibm.com> Signed-off-by: Niels de Vos <ndevos@ibm.com>
1 parent 97fd945 commit 4a7d654

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

internal/nfs/identity/identityserver.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,23 @@ import (
2424
csicommon "github.com/ceph/ceph-csi/internal/csi-common"
2525
)
2626

27-
// Server struct of ceph CSI driver with supported methods of CSI identity
28-
// server spec.
29-
type Server struct {
27+
// nfsIdentityServer implements the CSI identity server for the NFS driver.
28+
type nfsIdentityServer struct {
3029
*csicommon.DefaultIdentityServer
3130
}
3231

32+
// Assert required implementation of CSI interfaces.
33+
var _ csi.IdentityServer = &nfsIdentityServer{}
34+
3335
// NewIdentityServer initialize a identity server for ceph CSI driver.
34-
func NewIdentityServer(d *csicommon.CSIDriver) *Server {
35-
return &Server{
36+
func NewIdentityServer(d *csicommon.CSIDriver) csi.IdentityServer {
37+
return &nfsIdentityServer{
3638
DefaultIdentityServer: csicommon.NewDefaultIdentityServer(d),
3739
}
3840
}
3941

4042
// GetPluginCapabilities returns available capabilities of the ceph driver.
41-
func (is *Server) GetPluginCapabilities(
43+
func (is *nfsIdentityServer) GetPluginCapabilities(
4244
ctx context.Context,
4345
req *csi.GetPluginCapabilitiesRequest,
4446
) (*csi.GetPluginCapabilitiesResponse, error) {

0 commit comments

Comments
 (0)