specs

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TesterContainerName   = "volume-tester"
	K8sServiceAccountName = "gcsfuse-csi-sa"
	//nolint:gosec
	K8sSecretName                                              = "gcsfuse-csi-test-secret"
	FakeVolumePrefix                                           = "gcsfuse-csi-fake-volume"
	InvalidVolumePrefix                                        = "gcsfuse-csi-invalid-volume"
	NonRootVolumePrefix                                        = "gcsfuse-csi-non-root-volume"
	InvalidMountOptionsVolumePrefix                            = "gcsfuse-csi-invalid-mount-options-volume"
	ImplicitDirsVolumePrefix                                   = "gcsfuse-csi-implicit-dirs-volume"
	ForceNewBucketPrefix                                       = "gcsfuse-csi-force-new-bucket"
	SubfolderInBucketPrefix                                    = "gcsfuse-csi-subfolder-in-bucket"
	MultipleBucketsPrefix                                      = "gcsfuse-csi-multiple-buckets"
	EnableFileCacheForceNewBucketPrefix                        = "gcsfuse-csi-enable-file-cache-force-new-bucket"
	EnableFileCacheForceNewBucketAndMetricsPrefix              = "gcsfuse-csi-enable-file-cache-force-new-bucket-and-metrics"
	EnableFileCachePrefix                                      = "gcsfuse-csi-enable-file-cache"
	EnableFileCacheAndMetricsPrefix                            = "gcsfuse-csi-enable-file-cache-and-metrics"
	EnableFileCacheWithLargeCapacityPrefix                     = "gcsfuse-csi-enable-file-cache-large-capacity"
	EnableMetadataPrefetchPrefix                               = "gcsfuse-csi-enable-metadata-prefetch"
	EnableMetadataPrefetchAndFakeVolumePrefix                  = "gcsfuse-csi-enable-metadata-prefetch-and-fake-volume"
	EnableMetadataPrefetchPrefixForceNewBucketPrefix           = "gcsfuse-csi-enable-metadata-prefetch-and-force-new-bucket"
	EnableMetadataPrefetchAndInvalidMountOptionsVolumePrefix   = "gcsfuse-csi-enable-metadata-prefetch-and-invalid-mount-options-volume"
	ImplicitDirsPath                                           = "implicit-dir"
	InvalidVolume                                              = "<invalid-name>"
	SkipCSIBucketAccessCheckPrefix                             = "gcsfuse-csi-skip-bucket-access-check"
	SkipCSIBucketAccessCheckAndFakeVolumePrefix                = "gcsfuse-csi-skip-bucket-access-check-fake-volume"
	SkipCSIBucketAccessCheckAndInvalidVolumePrefix             = "gcsfuse-csi-skip-bucket-access-check-invalid-volume"
	SkipCSIBucketAccessCheckAndInvalidMountOptionsVolumePrefix = "gcsfuse-csi-skip-bucket-access-check-invalid-mount-options-volume"
	SkipCSIBucketAccessCheckAndNonRootVolumePrefix             = "gcsfuse-csi-skip-bucket-access-check-non-root-volume"
	SkipCSIBucketAccessCheckAndImplicitDirsVolumePrefix        = "gcsfuse-csi-skip-bucket-access-check-implicit-dirs-volume"

	GoogleCloudCliImage = "gcr.io/google.com/cloudsdktool/google-cloud-cli:slim"
	GolangImage         = "golang:1.22.7"
	UbuntuImage         = "ubuntu:20.04"

	LastPublishedSidecarContainerImage = "" /* 126-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CreateImplicitDirInBucket added in v0.1.5

func CreateImplicitDirInBucket(dirPath, bucketName string)

func CreateTestFileInBucket added in v1.1.0

func CreateTestFileInBucket(fileName, bucketName string)

func CreateTestFileWithSizeInBucket added in v1.2.0

func CreateTestFileWithSizeInBucket(fileName, bucketName string, fileSize int)

func DeployIstioServiceEntry added in v1.6.0

func DeployIstioServiceEntry(namespace string)

func DeployIstioSidecar added in v1.6.0

func DeployIstioSidecar(namespace string)

func GetGCSFuseVersion added in v1.5.0

func GetGCSFuseVersion(ctx context.Context, client clientset.Interface) string

func InitGCSFuseCSITestDriver added in v1.5.0

func InitGCSFuseCSITestDriver(c clientset.Interface, m metadata.Service, bl string, skipGcpSaTest, enableHierarchicalNamespace bool) storageframework.TestDriver

InitGCSFuseCSITestDriver returns GCSFuseCSITestDriver that implements TestDriver interface.

func WaitForWorkloadReady added in v0.1.7

func WaitForWorkloadReady(ctx context.Context, c clientset.Interface, namespace string, selector *metav1.LabelSelector, replica int32, expectedPodStatus corev1.PodPhase, timeout time.Duration)

WaitForWorkloadReady waits for the pods in the workload to reach the expected status.

Types

type GCSFuseCSITestDriver added in v1.5.0

type GCSFuseCSITestDriver struct {
	EnableHierarchicalNamespace bool
	// contains filtered or unexported fields
}

func (*GCSFuseCSITestDriver) CreateVolume added in v1.5.0

func (*GCSFuseCSITestDriver) GetCSIDriverName added in v1.5.0

func (*GCSFuseCSITestDriver) GetDriverInfo added in v1.5.0

func (n *GCSFuseCSITestDriver) GetDriverInfo() *storageframework.DriverInfo

func (*GCSFuseCSITestDriver) GetDynamicProvisionStorageClass added in v1.5.0

func (n *GCSFuseCSITestDriver) GetDynamicProvisionStorageClass(ctx context.Context, config *storageframework.PerTestConfig, _ string) *storagev1.StorageClass

func (*GCSFuseCSITestDriver) GetPersistentVolumeSource added in v1.5.0

func (n *GCSFuseCSITestDriver) GetPersistentVolumeSource(readOnly bool, _ string, volume storageframework.TestVolume) (*corev1.PersistentVolumeSource, *corev1.VolumeNodeAffinity)

func (*GCSFuseCSITestDriver) GetVolume added in v1.5.0

func (n *GCSFuseCSITestDriver) GetVolume(config *storageframework.PerTestConfig, _ int) (map[string]string, bool, bool)

func (*GCSFuseCSITestDriver) PrepareTest added in v1.5.0

func (*GCSFuseCSITestDriver) RemoveIAMPolicy added in v1.5.0

func (n *GCSFuseCSITestDriver) RemoveIAMPolicy(ctx context.Context, bucket *storage.ServiceBucket, serviceAccountNamespace, serviceAccountName string)

RemoveIAMPolicy removes IAM policy from the GCS bucket.

func (*GCSFuseCSITestDriver) SetIAMPolicy added in v1.5.0

func (n *GCSFuseCSITestDriver) SetIAMPolicy(ctx context.Context, bucket *storage.ServiceBucket, serviceAccountNamespace, serviceAccountName string)

SetIAMPolicy sets IAM policy for the GCS bucket.

func (*GCSFuseCSITestDriver) SkipUnsupportedTest added in v1.5.0

func (n *GCSFuseCSITestDriver) SkipUnsupportedTest(pattern storageframework.TestPattern)

type TestDeployment added in v0.1.1

type TestDeployment struct {
	// contains filtered or unexported fields
}

func NewTestDeployment added in v0.1.1

func NewTestDeployment(c clientset.Interface, ns *corev1.Namespace, tPod *TestPod) *TestDeployment

func (*TestDeployment) Cleanup added in v0.1.1

func (t *TestDeployment) Cleanup(ctx context.Context)

func (*TestDeployment) Create added in v0.1.1

func (t *TestDeployment) Create(ctx context.Context)

func (*TestDeployment) Scale added in v0.1.14

func (t *TestDeployment) Scale(ctx context.Context, replica int)

func (*TestDeployment) SetReplicas added in v0.1.14

func (t *TestDeployment) SetReplicas(replica int)

func (*TestDeployment) WaitForRunningAndReady added in v0.1.7

func (t *TestDeployment) WaitForRunningAndReady(ctx context.Context)

func (*TestDeployment) WaitForRunningAndReadyWithTimeout added in v0.1.14

func (t *TestDeployment) WaitForRunningAndReadyWithTimeout(ctx context.Context)

type TestGCPProjectIAMPolicyBinding

type TestGCPProjectIAMPolicyBinding struct {
	// contains filtered or unexported fields
}

func NewTestGCPProjectIAMPolicyBinding

func NewTestGCPProjectIAMPolicyBinding(projectID, member, role, condition string) *TestGCPProjectIAMPolicyBinding

func (*TestGCPProjectIAMPolicyBinding) Cleanup

func (*TestGCPProjectIAMPolicyBinding) Create

type TestGCPServiceAccount

type TestGCPServiceAccount struct {
	// contains filtered or unexported fields
}

func NewTestGCPServiceAccount

func NewTestGCPServiceAccount(name, projectID string) *TestGCPServiceAccount

func (*TestGCPServiceAccount) AddIAMPolicyBinding added in v0.1.4

func (t *TestGCPServiceAccount) AddIAMPolicyBinding(ctx context.Context, ns *corev1.Namespace)

func (*TestGCPServiceAccount) Cleanup

func (t *TestGCPServiceAccount) Cleanup(ctx context.Context)

func (*TestGCPServiceAccount) Create

func (t *TestGCPServiceAccount) Create(ctx context.Context)

func (*TestGCPServiceAccount) GetEmail added in v0.1.4

func (t *TestGCPServiceAccount) GetEmail() string

type TestJob added in v0.1.1

type TestJob struct {
	// contains filtered or unexported fields
}

func NewTestJob added in v0.1.1

func NewTestJob(c clientset.Interface, ns *corev1.Namespace, tPod *TestPod) *TestJob

func (*TestJob) Cleanup added in v0.1.1

func (t *TestJob) Cleanup(ctx context.Context)

func (*TestJob) Create added in v0.1.1

func (t *TestJob) Create(ctx context.Context)

func (*TestJob) WaitForAllJobPodsGone added in v1.0.0

func (t *TestJob) WaitForAllJobPodsGone(ctx context.Context)

func (*TestJob) WaitForJobFailed added in v0.1.14

func (t *TestJob) WaitForJobFailed()

func (*TestJob) WaitForJobPodsSucceeded added in v0.1.1

func (t *TestJob) WaitForJobPodsSucceeded(ctx context.Context)

type TestKubernetesServiceAccount

type TestKubernetesServiceAccount struct {
	// contains filtered or unexported fields
}

func NewTestKubernetesServiceAccount

func NewTestKubernetesServiceAccount(c clientset.Interface, ns *corev1.Namespace, name, gcpSAEmail string) *TestKubernetesServiceAccount

func (*TestKubernetesServiceAccount) Cleanup

func (*TestKubernetesServiceAccount) Create

type TestPVC added in v0.1.13

type TestPVC struct {
	PVC *corev1.PersistentVolumeClaim
	// contains filtered or unexported fields
}

func NewTestPVC added in v0.1.13

func NewTestPVC(c clientset.Interface, ns *corev1.Namespace, pvcName, storageClassName, capacity string, accessMode corev1.PersistentVolumeAccessMode) *TestPVC

func (*TestPVC) Cleanup added in v0.1.13

func (t *TestPVC) Cleanup(ctx context.Context)

func (*TestPVC) Create added in v0.1.13

func (t *TestPVC) Create(ctx context.Context)

type TestPod

type TestPod struct {
	// contains filtered or unexported fields
}

func NewTestPod

func NewTestPod(c clientset.Interface, ns *corev1.Namespace) *TestPod

func (*TestPod) CheckSidecarNeverTerminatedAfterAWhile added in v1.3.0

func (t *TestPod) CheckSidecarNeverTerminatedAfterAWhile(ctx context.Context, isNativeSidecar bool)

func (*TestPod) Cleanup

func (t *TestPod) Cleanup(ctx context.Context)

func (*TestPod) Create

func (t *TestPod) Create(ctx context.Context)

func (*TestPod) GetCSIDriverNodePodIP added in v1.6.0

func (t *TestPod) GetCSIDriverNodePodIP(ctx context.Context) string

func (*TestPod) GetNode added in v0.1.1

func (t *TestPod) GetNode() string

func (*TestPod) GetPodName added in v1.6.0

func (t *TestPod) GetPodName() string

func (*TestPod) SetAnnotations

func (t *TestPod) SetAnnotations(annotations map[string]string)

func (*TestPod) SetCommand

func (t *TestPod) SetCommand(cmd string)

func (*TestPod) SetCustomSidecarContainerImage added in v0.1.9

func (t *TestPod) SetCustomSidecarContainerImage()

func (*TestPod) SetGracePeriod added in v0.1.14

func (t *TestPod) SetGracePeriod(s int)

func (*TestPod) SetImage added in v0.1.4

func (t *TestPod) SetImage(image string)

func (*TestPod) SetInitContainerWithCommand added in v1.2.0

func (t *TestPod) SetInitContainerWithCommand(cmd string)

func (*TestPod) SetLabels added in v1.6.0

func (t *TestPod) SetLabels(labels map[string]string)

func (*TestPod) SetName

func (t *TestPod) SetName(name string)

func (*TestPod) SetNodeAffinity added in v0.1.4

func (t *TestPod) SetNodeAffinity(nodeName string, sameNode bool)

func (*TestPod) SetNodeSelector

func (t *TestPod) SetNodeSelector(nodeSelector map[string]string)

func (*TestPod) SetNonRootSecurityContext

func (t *TestPod) SetNonRootSecurityContext(uid, gid, fsgroup int)

func (*TestPod) SetPod added in v0.1.1

func (t *TestPod) SetPod(pod *corev1.Pod)

func (*TestPod) SetResource added in v0.1.4

func (t *TestPod) SetResource(cpuLimit, memoryLimit, storageLimit string)

func (*TestPod) SetRestartPolicy added in v0.1.3

func (t *TestPod) SetRestartPolicy(rp corev1.RestartPolicy)

func (*TestPod) SetServiceAccount

func (t *TestPod) SetServiceAccount(sa string)

func (*TestPod) SetupCacheVolumeMount added in v1.1.0

func (t *TestPod) SetupCacheVolumeMount(mountPath string, subPath ...string)

func (*TestPod) SetupTmpVolumeMount added in v1.2.0

func (t *TestPod) SetupTmpVolumeMount(mountPath string)

func (*TestPod) SetupVolume

func (t *TestPod) SetupVolume(volumeResource *storageframework.VolumeResource, name, mountPath string, readOnly bool, mountOptions ...string)

func (*TestPod) SetupVolumeForHNS added in v1.7.0

func (t *TestPod) SetupVolumeForHNS(name string)

func (*TestPod) SetupVolumeForInitContainer added in v1.2.0

func (t *TestPod) SetupVolumeForInitContainer(name, mountPath string, readOnly bool, subPath string)

func (*TestPod) SetupVolumeWithSubPath added in v0.1.5

func (t *TestPod) SetupVolumeWithSubPath(volumeResource *storageframework.VolumeResource, name, mountPath string, readOnly bool, subPath string, reuseMount bool, mountOptions ...string)

func (*TestPod) VerifyCustomSidecarContainerImage added in v0.1.9

func (t *TestPod) VerifyCustomSidecarContainerImage(isNativeSidecar, hasMetadataPrefetch bool)

func (*TestPod) VerifyExecInPodFail

func (t *TestPod) VerifyExecInPodFail(f *framework.Framework, containerName, shExec string, exitCode int)

VerifyExecInPodFail verifies shell cmd in target pod fail with certain exit code.

func (*TestPod) VerifyExecInPodSucceed

func (t *TestPod) VerifyExecInPodSucceed(f *framework.Framework, containerName, shExec string)

VerifyExecInPodSucceed verifies shell cmd in target pod succeed.

func (*TestPod) VerifyExecInPodSucceedWithFullOutput added in v0.1.4

func (t *TestPod) VerifyExecInPodSucceedWithFullOutput(f *framework.Framework, containerName, shExec string)

VerifyExecInPodSucceedWithFullOutput verifies shell cmd in target pod succeed with full output.

func (*TestPod) VerifyMetadataPrefetchNotPresent added in v1.8.0

func (t *TestPod) VerifyMetadataPrefetchNotPresent()

func (*TestPod) VerifyMetadataPrefetchPresence added in v1.8.0

func (t *TestPod) VerifyMetadataPrefetchPresence()

func (*TestPod) WaitForFail added in v1.0.0

func (t *TestPod) WaitForFail(ctx context.Context)

func (*TestPod) WaitForFailedContainerError added in v1.6.0

func (t *TestPod) WaitForFailedContainerError(ctx context.Context, msg string)

func (*TestPod) WaitForFailedMountError

func (t *TestPod) WaitForFailedMountError(ctx context.Context, msg string)

func (*TestPod) WaitForLog added in v1.2.0

func (t *TestPod) WaitForLog(ctx context.Context, container string, expectedString string)

func (*TestPod) WaitForPodNotFoundInNamespace added in v0.1.14

func (t *TestPod) WaitForPodNotFoundInNamespace(ctx context.Context)

func (*TestPod) WaitForRunning

func (t *TestPod) WaitForRunning(ctx context.Context)

func (*TestPod) WaitForSuccess

func (t *TestPod) WaitForSuccess(ctx context.Context)

func (*TestPod) WaitForUnschedulable added in v0.1.1

func (t *TestPod) WaitForUnschedulable(ctx context.Context)

type TestSecret

type TestSecret struct {
	// contains filtered or unexported fields
}

func NewTestSecret

func NewTestSecret(c clientset.Interface, ns *corev1.Namespace, name string, data map[string]string) *TestSecret

func (*TestSecret) Cleanup

func (t *TestSecret) Cleanup(ctx context.Context)

func (*TestSecret) Create

func (t *TestSecret) Create(ctx context.Context)

type TestStatefulSet added in v0.1.7

type TestStatefulSet struct {
	// contains filtered or unexported fields
}

func NewTestStatefulSet added in v0.1.7

func NewTestStatefulSet(c clientset.Interface, ns *corev1.Namespace, tPod *TestPod) *TestStatefulSet

func (*TestStatefulSet) Cleanup added in v0.1.7

func (t *TestStatefulSet) Cleanup(ctx context.Context)

func (*TestStatefulSet) Create added in v0.1.7

func (t *TestStatefulSet) Create(ctx context.Context)

func (*TestStatefulSet) WaitForRunningAndReady added in v0.1.7

func (t *TestStatefulSet) WaitForRunningAndReady(ctx context.Context)

Jump to

Keyboard shortcuts

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