sidecarmounter

package
v1.23.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCSFuseAppName = "gke-gcs-fuse-csi"
	TempDir        = "/temp-dir"

	TokenFileName              = "token.sock" // #nosec G101
	KernelParamsFileConfigFlag = "file-system:kernel-params-file"
)

Variables

View Source
var DisallowedFlags = map[string]string{

	"log-file":   "logging:file-path",
	"log-format": "logging:format",
	"o":          "o",
	"cache-dir":  "cache-dir",

	"temp-dir":                 "temp-dir",
	"config-file":              "config-file",
	"foreground":               "foreground",
	"key-file":                 "gcs-auth:key-file",
	"token-url":                "gcs-auth:token-url",
	"reuse-token-from-url":     "gcs-auth:reuse-token-from-url",
	"prometheus-port":          "prometheus-port",
	"kernel-params-file":       "file-system:kernel-params-file",
	KernelParamsFileConfigFlag: KernelParamsFileConfigFlag,
}

DisallowedFlags is a map of flags that are disallowed to be passed to sidecar mounter directly. They are mapped to their config file style representation so that they can be passed in config file format as a workaround to bypass the disallowed flags validation. Note: If you add a new disallowed flag here that is needed for integration testing, you should also update the ParseConfigFlags() logic in test/e2e/utils/utils.go to handle it.

Functions

func NewErrorWriter

func NewErrorWriter(errorFile string) stderrWriterInterface

func StartTokenServer added in v1.11.0

func StartTokenServer(ctx context.Context, tokenURLBasePath, tokenSocketName string, identityProvider string)

Types

type MountConfig

type MountConfig struct {
	FileDescriptor                 int                   `json:"-"`
	VolumeName                     string                `json:"volumeName,omitempty"`
	BucketName                     string                `json:"bucketName,omitempty"`
	BufferDir                      string                `json:"-"`
	CacheDir                       string                `json:"-"`
	TempDir                        string                `json:"-"`
	ConfigFile                     string                `json:"-"`
	Options                        []string              `json:"options,omitempty"`
	ErrWriter                      stderrWriterInterface `json:"-"`
	FlagMap                        map[string]string     `json:"-"`
	ConfigFileFlagMap              map[string]string     `json:"-"`
	TokenServerIdentityProvider    string                `json:"-"`
	HostNetworkKSAOptIn            bool                  `json:"-"`
	EnableGCSFuseKernelParams      bool                  `json:"-"`
	EnableCloudProfilerForSidecar  bool                  `json:"-"`
	PodNamespace                   string                `json:"-"`
	ServiceAccountName             string                `json:"-"`
	PodName                        string                `json:"-"`
	PodUID                         string                `json:"-"`
	EnableSidecarBucketAccessCheck bool                  `json:"-"`
	TokenServerIdentityPool        string                `json:"-"`
	SidecarRetryConfig             sidecarRetryConfig    `json:"-"`
	FileCacheMedium                string                `json:"-"`
	GcsFuseNumaNode                int                   `json:"-"`
	CustomEndpoint                 string                `json:"-"`
	EnableAutoGoMemLimit           bool                  `json:"-"`
	AutoGoMemLimitRatio            float64               `json:"-"`
	StorageEndpoint                string                `json:"-"`
}

MountConfig contains the information gcsfuse needs.

func NewMountConfig added in v0.1.14

func NewMountConfig(sp string, flagMapFromDriver map[string]string) *MountConfig

Fetch the following information from a given socket path: 1. Pod volume name 2. The file descriptor 3. GCS bucket name 4. Mount options passing to gcsfuse (passed by the csi mounter).

func (*MountConfig) EnsureErrWriter added in v1.23.19

func (mc *MountConfig) EnsureErrWriter()

EnsureErrWriter safely initializes ErrWriter to the correct writer if it is nil.

type Mounter

type Mounter struct {
	WaitGroup             sync.WaitGroup
	TokenManager          auth.TokenManager
	StorageServiceManager storage.ServiceManager
	// contains filtered or unexported fields
}

Mounter will be used in the sidecar container to invoke gcsfuse.

func New

func New(mounterPath string) *Mounter

New returns a Mounter for the current system. It provides an option to specify the path to gcsfuse binary.

func (*Mounter) Mount

func (m *Mounter) Mount(ctx context.Context, mc *MountConfig) error

func (*Mounter) SetupTokenAndStorageManager added in v1.19.0

func (m *Mounter) SetupTokenAndStorageManager(ctx context.Context, clientset clientset.Interface, mc *MountConfig) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL