Documentation
¶
Overview ¶
Package publishers contains the logic for publishing Datadog CSI volumes depending on the volume type.
Datadog CSI volume requests should include a `type` property in the `volumeAttributes`.
Supported volume types are:
- APMSocket: mounts the APM UDS socket.
- DSDSocket: mounts the DogStatsD UDS socket.
- APMSocketDirectory: mounts the directory containing the APM socket.
- DSDSocketDirectory: mounts the directory containing the DogStatsD socket.
- DatadogSocketsDirectory: mounts the directory containing both sockets.
Deprecated: The legacy `mode`/`path` schema is still supported but deprecated. Please migrate to using the `type` schema instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher interface {
// Publish publishes the volume
Publish(req *csi.NodePublishVolumeRequest) (*PublisherResponse, error)
// Unpublish unpublishes the volume
Unpublish(req *csi.NodeUnpublishVolumeRequest) (*PublisherResponse, error)
}
Publisher defines logic for publishing and unpublishing volumes. Each method returns:
- (*PublisherResponse, nil) if the operation succeeded
- (*PublisherResponse, error) if the operation failed
- (nil, nil) if the publisher does not support this request
func GetPublishers ¶
func GetPublishers( fs afero.Afero, mounter mount.Interface, apmSocketPath, dsdSocketPath, storageBasePath string, libraryManager *librarymanager.LibraryManager, apmEnabled bool, ) Publisher
GetPublishers returns a chain of publishers for handling CSI volume operations.
The chain includes:
- Library publisher (for DatadogLibrary volumes)
- InjectorPreload publisher (for ld.so.preload injection)
- Socket/Local publishers (for "type" schema: APMSocket, APMSocketDirectory, etc.)
- Legacy publishers (for deprecated "mode/path" schema)
- Fallback unmount handler for all Unpublish requests
type PublisherResponse ¶ added in v1.1.1
type PublisherResponse struct {
VolumeType VolumeType
VolumePath string
}
PublisherResponse contains metadata about a handled request, used for metrics. A nil response means the publisher does not support the request.
type VolumeType ¶ added in v1.1.1
type VolumeType string
VolumeType represents the type of volume to mount.
const ( // APMSocket mounts the APM socket file APMSocket VolumeType = "APMSocket" // APMSocketDirectory mounts the parent directory of the APM socket APMSocketDirectory VolumeType = "APMSocketDirectory" // DSDSocket mounts the DogStatsD socket file DSDSocket VolumeType = "DSDSocket" // DSDSocketDirectory mounts the parent directory of the DogStatsD socket DSDSocketDirectory VolumeType = "DSDSocketDirectory" // DatadogSocketsDirectory is deprecated, use DSDSocketDirectory instead DatadogSocketsDirectory VolumeType = "DatadogSocketsDirectory" // DatadogLibrary mounts a Datadog instrumentation library from an OCI image DatadogLibrary VolumeType = "DatadogLibrary" // DatadogInjectorPreload mounts the ld.so.preload file DatadogInjectorPreload VolumeType = "DatadogInjectorPreload" )