mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
e2e: added test to verify read affinity functionality
e2e test case is added to test if read affinity is enabled by verifying read_from_replica=localize option is passed Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -231,15 +231,19 @@ func (yr *yamlResource) Do(action kubectlAction) error {
|
||||
// replaceNamespaceInTemplate() on it. There are several options for adjusting
|
||||
// templates, each has their own comment.
|
||||
type yamlResourceNamespaced struct {
|
||||
filename string
|
||||
namespace string
|
||||
filename string
|
||||
namespace string
|
||||
domainLabel string
|
||||
crushLocationLabels string
|
||||
|
||||
// set the number of replicas in a Deployment to 1.
|
||||
oneReplica bool
|
||||
|
||||
// enable topology support (for RBD)
|
||||
enableTopology bool
|
||||
domainLabel string
|
||||
|
||||
// enable read affinity support (for RBD)
|
||||
enableReadAffinity bool
|
||||
}
|
||||
|
||||
func (yrn *yamlResourceNamespaced) Do(action kubectlAction) error {
|
||||
@ -260,6 +264,14 @@ func (yrn *yamlResourceNamespaced) Do(action kubectlAction) error {
|
||||
data = addTopologyDomainsToDSYaml(data, yrn.domainLabel)
|
||||
}
|
||||
|
||||
if yrn.enableReadAffinity {
|
||||
data = enableReadAffinityInTemplate(data)
|
||||
}
|
||||
|
||||
if yrn.crushLocationLabels != "" {
|
||||
data = addCrsuhLocationLabels(data, yrn.crushLocationLabels)
|
||||
}
|
||||
|
||||
err = retryKubectlInput(yrn.namespace, action, data, deployTimeout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to %s resource %q in namespace %q: %w", action, yrn.filename, yrn.namespace, err)
|
||||
|
Reference in New Issue
Block a user