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

Add prefix factory option #1695

Merged
merged 3 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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