Skip to content

Commit 43d108f

Browse files
committed
test: configurable cluster name
Signed-off-by: Peter Wilcsinszky <[email protected]>
1 parent 9dcbb07 commit 43d108f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

e2e/common/cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ type PrintLogConfig struct {
4747
Limit int
4848
}
4949

50-
func WithCluster(t *testing.T, fn func(*testing.T, Cluster), beforeCleanup func(*testing.T, Cluster) error, opts ...cluster.Option) {
51-
cluster, err := GetTestCluster(defaultClusterName, opts...)
50+
func WithCluster(name string, t *testing.T, fn func(*testing.T, Cluster), beforeCleanup func(*testing.T, Cluster) error, opts ...cluster.Option) {
51+
cluster, err := GetTestCluster(name, opts...)
5252
require.NoError(t, err)
5353

5454
ctx, cancel := context.WithCancel(context.Background())
@@ -60,7 +60,7 @@ func WithCluster(t *testing.T, fn func(*testing.T, Cluster), beforeCleanup func(
6060
assert.NoError(t, beforeCleanup(t, cluster))
6161
assert.NoError(t, cluster.Cleanup())
6262
cancel()
63-
require.NoError(t, DeleteTestCluster(defaultClusterName))
63+
require.NoError(t, DeleteTestCluster(name))
6464
}()
6565

6666
fn(t, cluster)

e2e/syslog-ng-aggregator/syslog_ng_aggregator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ func init() {
6464
}
6565

6666
func TestSyslogNGIsRunningAndForwardingLogs(t *testing.T) {
67-
ns := "syslog-ng-1"
68-
common.WithCluster(t, func(t *testing.T, c common.Cluster) {
67+
ns := "default"
68+
common.WithCluster("syslog-ng-1", t, func(t *testing.T, c common.Cluster) {
6969
setup.LoggingOperator(t, c, setup.LoggingOperatorOptionFunc(func(options *setup.LoggingOperatorOptions) {
7070
options.Config.DisableWebhook = true
7171
options.Config.Namespace = ns

e2e/volumedrain/volumedrain_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func init() {
6363

6464
func TestVolumeDrain_Downscale(t *testing.T) {
6565
ns := "testing-1"
66-
common.WithCluster(t, func(t *testing.T, c common.Cluster) {
66+
common.WithCluster("drain", t, func(t *testing.T, c common.Cluster) {
6767
setup.LoggingOperator(t, c, setup.LoggingOperatorOptionFunc(func(options *setup.LoggingOperatorOptions) {
6868
options.Config.DisableWebhook = true
6969
options.Config.Namespace = ns
@@ -223,7 +223,7 @@ func TestVolumeDrain_Downscale(t *testing.T) {
223223

224224
func TestVolumeDrain_Downscale_DeleteVolume(t *testing.T) {
225225
ns := "testing-2"
226-
common.WithCluster(t, func(t *testing.T, c common.Cluster) {
226+
common.WithCluster("drain", t, func(t *testing.T, c common.Cluster) {
227227
setup.LoggingOperator(t, c, setup.LoggingOperatorOptionFunc(func(options *setup.LoggingOperatorOptions) {
228228
options.Config.DisableWebhook = true
229229
options.Config.Namespace = ns

0 commit comments

Comments
 (0)