Documentation ¶
Overview ¶
Package csi is CSI driver interface for OSD Copyright 2017 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package csi is CSI driver interface for OSD Copyright 2017 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package csi is CSI driver interface for OSD Copyright 2017 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package csi is CSI driver interface for OSD Copyright 2017 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func NewOsdCsiServer(config *OsdCsiServerConfig) (grpcserver.Server, error)
- type OsdCsiServer
- func (s *OsdCsiServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (s *OsdCsiServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (s *OsdCsiServer) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (s *OsdCsiServer) ControllerPublishVolume(context.Context, *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (s *OsdCsiServer) ControllerUnpublishVolume(context.Context, *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (s *OsdCsiServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (s *OsdCsiServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (s *OsdCsiServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (s *OsdCsiServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (s *OsdCsiServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (s *OsdCsiServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (s *OsdCsiServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (s *OsdCsiServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (s *OsdCsiServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (s *OsdCsiServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (s *OsdCsiServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (s *OsdCsiServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (s *OsdCsiServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (s *OsdCsiServer) Start() error
- func (s *OsdCsiServer) Stop()
- func (s *OsdCsiServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type OsdCsiServerConfig
- type TimedSDKConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOsdCsiServer ¶
func NewOsdCsiServer(config *OsdCsiServerConfig) (grpcserver.Server, error)
NewOsdCsiServer creates a gRPC CSI complient server on the specified port and transport.
Types ¶
type OsdCsiServer ¶
type OsdCsiServer struct { csi.ControllerServer csi.NodeServer csi.IdentityServer *grpcserver.GrpcServer // contains filtered or unexported fields }
OsdCsiServer is a OSD CSI compliant server which proxies CSI requests for a single specific driver
func (*OsdCsiServer) ControllerExpandVolume ¶
func (s *OsdCsiServer) ControllerExpandVolume( ctx context.Context, req *csi.ControllerExpandVolumeRequest, ) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume is a CSI API which resizes a volume
func (*OsdCsiServer) ControllerGetCapabilities ¶
func (s *OsdCsiServer) ControllerGetCapabilities( ctx context.Context, req *csi.ControllerGetCapabilitiesRequest, ) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities is a CSI API functions which returns to the caller the capabilities of the OSD CSI driver.
func (*OsdCsiServer) ControllerGetVolume ¶
func (s *OsdCsiServer) ControllerGetVolume( ctx context.Context, req *csi.ControllerGetVolumeRequest, ) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume is a CSI API which implements getting a single volume. This function skips auth and directly hits the driver as it is read-only and only exposed via the CSI unix domain socket. If a secrets field is added in csi.ControllerGetVolumeRequest, we can update this to hit the SDK and use auth.
func (*OsdCsiServer) ControllerPublishVolume ¶
func (s *OsdCsiServer) ControllerPublishVolume( context.Context, *csi.ControllerPublishVolumeRequest, ) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume is a CSI API implements the attachment of a volume on to a node.
func (*OsdCsiServer) ControllerUnpublishVolume ¶
func (s *OsdCsiServer) ControllerUnpublishVolume( context.Context, *csi.ControllerUnpublishVolumeRequest, ) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume is a CSI API which implements the detaching of a volume onto a node.
func (*OsdCsiServer) CreateSnapshot ¶
func (s *OsdCsiServer) CreateSnapshot( ctx context.Context, req *csi.CreateSnapshotRequest, ) (*csi.CreateSnapshotResponse, error)
CreateSnapshot is a CSI implementation to create a snapshot from the volume
func (*OsdCsiServer) CreateVolume ¶
func (s *OsdCsiServer) CreateVolume( ctx context.Context, req *csi.CreateVolumeRequest, ) (*csi.CreateVolumeResponse, error)
CreateVolume is a CSI API which creates a volume on OSD This function supports snapshots if the parent volume id is supplied in the parameters.
func (*OsdCsiServer) DeleteSnapshot ¶
func (s *OsdCsiServer) DeleteSnapshot( ctx context.Context, req *csi.DeleteSnapshotRequest, ) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot is a CSI implementation to delete a snapshot
func (*OsdCsiServer) DeleteVolume ¶
func (s *OsdCsiServer) DeleteVolume( ctx context.Context, req *csi.DeleteVolumeRequest, ) (*csi.DeleteVolumeResponse, error)
DeleteVolume is a CSI API which deletes a volume
func (*OsdCsiServer) GetPluginCapabilities ¶
func (s *OsdCsiServer) GetPluginCapabilities( ctx context.Context, req *csi.GetPluginCapabilitiesRequest, ) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities is a CSI API
func (*OsdCsiServer) GetPluginInfo ¶
func (s *OsdCsiServer) GetPluginInfo( ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo is a CSI API which returns the information about the plugin. This includes name, version, and any other OSD specific information
func (*OsdCsiServer) ListSnapshots ¶
func (s *OsdCsiServer) ListSnapshots( ctx context.Context, req *csi.ListSnapshotsRequest, ) (*csi.ListSnapshotsResponse, error)
ListSnapshots lists all snapshots in a cluster. This is mainly implemented for Nomad, as Kubernetes will not call list snapshots for drivers which have synchronous snapshot creation. This is because ReadyToUse is set to true immediately upon on our snapshot creation.
func (*OsdCsiServer) NodeGetCapabilities ¶
func (s *OsdCsiServer) NodeGetCapabilities( ctx context.Context, req *csi.NodeGetCapabilitiesRequest, ) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities is a CSI API function which seems to be setup for future patches
func (*OsdCsiServer) NodeGetInfo ¶
func (s *OsdCsiServer) NodeGetInfo( ctx context.Context, req *csi.NodeGetInfoRequest, ) (*csi.NodeGetInfoResponse, error)
func (*OsdCsiServer) NodeGetVolumeStats ¶
func (s *OsdCsiServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats get volume stats for a given node. This function skips auth and directly hits the driver as it is read-only and only exposed via the CSI unix domain socket. If a secrets field is added in csi.NodeGetVolumeStatsRequest, we can update this to hit the SDK and use auth.
func (*OsdCsiServer) NodePublishVolume ¶
func (s *OsdCsiServer) NodePublishVolume( ctx context.Context, req *csi.NodePublishVolumeRequest, ) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume is a CSI API call which mounts the volume on the specified target path on the node.
TODO: Support READ ONLY Mounts
func (*OsdCsiServer) NodeUnpublishVolume ¶
func (s *OsdCsiServer) NodeUnpublishVolume( ctx context.Context, req *csi.NodeUnpublishVolumeRequest, ) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume is a CSI API call which unmounts the volume.
func (*OsdCsiServer) Probe ¶
func (s *OsdCsiServer) Probe( ctx context.Context, req *csi.ProbeRequest, ) (*csi.ProbeResponse, error)
Probe is a CSI API
func (*OsdCsiServer) Start ¶
func (s *OsdCsiServer) Start() error
Start is used to start the server. It will return an error if the server is already running.
func (*OsdCsiServer) ValidateVolumeCapabilities ¶
func (s *OsdCsiServer) ValidateVolumeCapabilities( ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest, ) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities is a CSI API used by container orchestration systems to make sure a volume specification is validiated by the CSI driver.
type OsdCsiServerConfig ¶
type OsdCsiServerConfig struct { Net string Address string DriverName string Cluster cluster.Cluster SdkUds string SdkPort string // Name to be reported back to the CO. If not provided, // the name will be in the format of <driver>.openstorage.org CsiDriverName string // EnableInlineVolumes decides whether or not we will allow // creation of inline volumes. EnableInlineVolumes bool }
OsdCsiServerConfig provides the configuration to the the gRPC CSI server created by NewOsdCsiServer()
type TimedSDKConn ¶
type TimedSDKConn struct { Conn *grpc.ClientConn LastUsage time.Time }
TimedSDKConn represents a gRPC connection and the last time it was used