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

e2e: Improve storage class names and supported storage checks #1635

Open
nirs opened this issue Oct 31, 2024 · 0 comments
Open

e2e: Improve storage class names and supported storage checks #1635

nirs opened this issue Oct 31, 2024 · 0 comments
Labels
test Testing related issue

Comments

@nirs
Copy link
Member

nirs commented Oct 31, 2024

The e2e framework uses a list of storage class names and access modes:

pvcspecs:
  - storageclassname: rook-cephfs
    accessmodes: ReadWriteMany
  - storageclassname: rook-ceph-block
    accessmodes: ReadWriteOnce

Based on this list, we generate test names:

func generateSuffix(storageClassName string) string {
	suffix := storageClassName

	if strings.ToLower(storageClassName) == "rook-ceph-block" {
		suffix = "rbd"
	}

	if strings.ToLower(storageClassName) == "rook-cephfs" {
		suffix = "cephfs"
	}

	return suffix
}

This works only for drenv environment. For openshift environment the storage class names are different so the returned suffix with be the actual storage class name, which is way to long to use as a test name or for using resource names.

Even worse, there is code hidden deployers/discoveredapps.go, filtering out cephfs workloads for discovered apps, based on the suffix:

func (d DiscoveredApps) IsWorkloadSupported(w workloads.Workload) bool {
	return w.GetName() != "Deploy-cephfs"
}

This will not match for when using real cluster storage classes, trying to run unsupported combination.

Possible fix

Move the logic to the config:

storage:
  - name: file
    storageclassname: rook-cephfs
    accessmodes: ReadWriteMany
    supports-discovered-apps: false
  - name: block
    storageclassname: rook-ceph-block
    accessmodes: ReadWriteOnce
    supports-discovered-apps: true
  • With this layout we can define any storage class and enable the storage class for discovered apps without changing the code.
  • We don't need the code mapping the actual storage class names to test names, instead we can use the name property.
@nirs nirs added the test Testing related issue label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Testing related issue
Projects
None yet
Development

No branches or pull requests

1 participant