Skip to content

Commit

Permalink
Add prefix factory option
Browse files Browse the repository at this point in the history
This allows us to re-use existing clusters and can greatly fasten
the testing time.
  • Loading branch information
flowguru committed Jun 21, 2023
1 parent 0c1132a commit 15c0c7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions e2e/fixtures/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,12 @@ func (factory *Factory) getContainerOverrides(
return mainOverrides, sidecarOverrides
}

// getClusterPrefix returns the cluster name prefix.
func (factory *Factory) getClusterPrefix() string {
return fmt.Sprintf("fdb-cluster-%s", RandStringRunes(8))
prefix := factory.options.prefix
if prefix == "" {
return fmt.Sprintf("fdb-cluster-%s", RandStringRunes(8))
}
return prefix
}

// GetDefaultStorageClass returns either the StorageClass provided by the command line or fetches the StorageClass passed on
Expand Down
7 changes: 7 additions & 0 deletions e2e/fixtures/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
type FactoryOptions struct {
namespace string
chaosNamespace string
prefix string
context string
fdbImage string // TODO (johscheuer): Make this optional if we use the default
sidecarImage string // TODO (johscheuer): Make this optional if we use the default
Expand Down Expand Up @@ -65,6 +66,12 @@ func (options *FactoryOptions) BindFlags(fs *flag.FlagSet) {
"",
"defines the chaos namespace to run experiments (will be created if missing)",
)
fs.StringVar(
&options.prefix,
"prefix",
"",
"defines the prefix of fdb cluster to run the test (will be created if missing)",
)
fs.StringVar(
&options.context,
"context",
Expand Down

0 comments on commit 15c0c7e

Please sign in to comment.