Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: test/e2e/storage: replace mock driver with hostpath driver #101672

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/e2e/storage/drivers/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,10 @@ func (m *mockCSIDriver) PrepareTest(f *framework.Framework) (*storageframework.P
} else {
// When using the mock driver inside the cluster it has to be reconfigured
// via command line parameters.
containerArgs = append(containerArgs, "--name=csi-mock-"+f.UniqueName)
containerArgs = append(containerArgs, "--drivername=csi-mock-"+f.UniqueName)

if !m.attachable {
containerArgs = append(containerArgs, "--disable-attach")
if m.attachable {
containerArgs = append(containerArgs, "--enable-attach")
}

if m.enableTopology {
Expand Down
19 changes: 16 additions & 3 deletions test/e2e/testing-manifests/storage-csi/mock/csi-mock-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,17 @@ spec:
- mountPath: /registration
name: registration-dir
- name: mock
image: k8s.gcr.io/sig-storage/mock-driver:v4.1.0
# FIXME: Move to release image once the hostpath-plugin release
# having below chagnes;
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/269
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/260 #
image: gcr.io/k8s-staging-sig-storage/hostpathplugin:canary
args:
- "--name=mock.storage.k8s.io"
- "-v=3" # enabled the gRPC call logging
- "--drivername=mock.storage.k8s.io"
- "--nodeid=$(KUBE_NODE_NAME)"
- "--endpoint=/csi/csi.sock"
- "--statedir=/tmp/csi-hotpath-data"
- "-v=5" # enabled the gRPC call logging
env:
- name: CSI_ENDPOINT
value: /csi/csi.sock
Expand All @@ -74,6 +81,8 @@ spec:
name: kubelet-pods-dir
- mountPath: /var/lib/kubelet/plugins/kubernetes.io/csi
name: kubelet-csi-dir
- mountPath: /dev
name: dev-dir
volumes:
- hostPath:
path: /var/lib/kubelet/plugins/csi-mock
Expand All @@ -93,3 +102,7 @@ spec:
path: /var/lib/kubelet/plugins_registry
type: Directory
name: registration-dir
- hostPath:
path: /dev
type: Directory
name: dev-dir
18 changes: 13 additions & 5 deletions test/e2e/testing-manifests/storage-csi/mock/csi-mock-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,24 @@ spec:
- mountPath: /registration
name: registration-dir
- name: mock
image: k8s.gcr.io/sig-storage/mock-driver:v4.1.0
# FIXME: Move to release image once the hostpath-plugin release
# having below chagnes;
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/269
# - https://github.com/kubernetes-csi/csi-driver-host-path/pull/260 #
image: gcr.io/k8s-staging-sig-storage/hostpathplugin:canary
args:
# -v3 shows when connections get established. Higher log levels print information about
# transferred bytes, but cannot print message content (no gRPC parsing), so this is usually
# not interesting.
- -v=3
- -v=5
- -nodeid=$(KUBE_NODE_NAME)
- -endpoint=/csi/csi.sock
- -proxy-endpoint=tcp://:9000
env:
- name: CSI_ENDPOINT
value: /csi/csi.sock
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
ports:
- containerPort: 9000
name: socat
Expand Down
77 changes: 41 additions & 36 deletions test/utils/image/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,19 @@ import (

// RegistryList holds public and private image registries
type RegistryList struct {
GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry"`
E2eRegistry string `yaml:"e2eRegistry"`
PromoterE2eRegistry string `yaml:"promoterE2eRegistry"`
BuildImageRegistry string `yaml:"buildImageRegistry"`
InvalidRegistry string `yaml:"invalidRegistry"`
GcEtcdRegistry string `yaml:"gcEtcdRegistry"`
GcRegistry string `yaml:"gcRegistry"`
SigStorageRegistry string `yaml:"sigStorageRegistry"`
GcrReleaseRegistry string `yaml:"gcrReleaseRegistry"`
PrivateRegistry string `yaml:"privateRegistry"`
SampleRegistry string `yaml:"sampleRegistry"`
MicrosoftRegistry string `yaml:"microsoftRegistry"`
GcAuthenticatedRegistry string `yaml:"gcAuthenticatedRegistry"`
E2eRegistry string `yaml:"e2eRegistry"`
PromoterE2eRegistry string `yaml:"promoterE2eRegistry"`
BuildImageRegistry string `yaml:"buildImageRegistry"`
InvalidRegistry string `yaml:"invalidRegistry"`
GcEtcdRegistry string `yaml:"gcEtcdRegistry"`
GcRegistry string `yaml:"gcRegistry"`
SigStorageRegistry string `yaml:"sigStorageRegistry"`
SigStorageCanaryRegistry string `yaml:"sigStorageCanaryRegistry"`
GcrReleaseRegistry string `yaml:"gcrReleaseRegistry"`
PrivateRegistry string `yaml:"privateRegistry"`
SampleRegistry string `yaml:"sampleRegistry"`
MicrosoftRegistry string `yaml:"microsoftRegistry"`
}

// Config holds an images registry, name, and version
Expand All @@ -68,18 +69,19 @@ func (i *Config) SetVersion(version string) {

func initReg() RegistryList {
registry := RegistryList{
GcAuthenticatedRegistry: "gcr.io/authenticated-image-pulling",
E2eRegistry: "gcr.io/kubernetes-e2e-test-images",
PromoterE2eRegistry: "k8s.gcr.io/e2e-test-images",
BuildImageRegistry: "k8s.gcr.io/build-image",
InvalidRegistry: "invalid.com/invalid",
GcEtcdRegistry: "k8s.gcr.io",
GcRegistry: "k8s.gcr.io",
SigStorageRegistry: "k8s.gcr.io/sig-storage",
PrivateRegistry: "gcr.io/k8s-authenticated-test",
SampleRegistry: "gcr.io/google-samples",
GcrReleaseRegistry: "gcr.io/gke-release",
MicrosoftRegistry: "mcr.microsoft.com",
GcAuthenticatedRegistry: "gcr.io/authenticated-image-pulling",
E2eRegistry: "gcr.io/kubernetes-e2e-test-images",
PromoterE2eRegistry: "k8s.gcr.io/e2e-test-images",
BuildImageRegistry: "k8s.gcr.io/build-image",
InvalidRegistry: "invalid.com/invalid",
GcEtcdRegistry: "k8s.gcr.io",
GcRegistry: "k8s.gcr.io",
SigStorageRegistry: "k8s.gcr.io/sig-storage",
SigStorageCanaryRegistry: "gcr.io/k8s-staging-sig-storage",
PrivateRegistry: "gcr.io/k8s-authenticated-test",
SampleRegistry: "gcr.io/google-samples",
GcrReleaseRegistry: "gcr.io/gke-release",
MicrosoftRegistry: "mcr.microsoft.com",
}
repoList := os.Getenv("KUBE_TEST_REPO_LIST")
if repoList == "" {
Expand All @@ -105,18 +107,19 @@ var (
PrivateRegistry = registry.PrivateRegistry

// Preconfigured image configs
dockerLibraryRegistry = "docker.io/library"
e2eRegistry = registry.E2eRegistry
promoterE2eRegistry = registry.PromoterE2eRegistry
buildImageRegistry = registry.BuildImageRegistry
gcAuthenticatedRegistry = registry.GcAuthenticatedRegistry
gcEtcdRegistry = registry.GcEtcdRegistry
gcRegistry = registry.GcRegistry
sigStorageRegistry = registry.SigStorageRegistry
gcrReleaseRegistry = registry.GcrReleaseRegistry
invalidRegistry = registry.InvalidRegistry
sampleRegistry = registry.SampleRegistry
microsoftRegistry = registry.MicrosoftRegistry
dockerLibraryRegistry = "docker.io/library"
e2eRegistry = registry.E2eRegistry
promoterE2eRegistry = registry.PromoterE2eRegistry
buildImageRegistry = registry.BuildImageRegistry
gcAuthenticatedRegistry = registry.GcAuthenticatedRegistry
gcEtcdRegistry = registry.GcEtcdRegistry
gcRegistry = registry.GcRegistry
sigStorageRegistry = registry.SigStorageRegistry
sigStorageCanaryRegistry = registry.SigStorageCanaryRegistry
gcrReleaseRegistry = registry.GcrReleaseRegistry
invalidRegistry = registry.InvalidRegistry
sampleRegistry = registry.SampleRegistry
microsoftRegistry = registry.MicrosoftRegistry

imageConfigs, originalImageConfigs = initImageConfigs()
)
Expand Down Expand Up @@ -393,6 +396,8 @@ func ReplaceRegistryInImageURL(imageURL string) (string, error) {
registryAndUser = gcRegistry
case "k8s.gcr.io/sig-storage":
registryAndUser = sigStorageRegistry
case "gcr.io/k8s-staging-sig-storage":
registryAndUser = sigStorageCanaryRegistry
case "gcr.io/k8s-authenticated-test":
registryAndUser = PrivateRegistry
case "gcr.io/google-samples":
Expand Down