Skip to content

Commit 62be321

Browse files
committed
operator: Create new namespace instead of using default in console kuttl tests.
Default namespace doesn't get cleaned up on succeeding tests But no way to reference the auto-generated kuttl namespace in Console clusterKeyRef spec
1 parent 4f5f5a4 commit 62be321

9 files changed

+67
-49
lines changed
Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
1-
apiVersion: redpanda.vectorized.io/v1alpha1
2-
kind: Cluster
1+
apiVersion: v1
2+
kind: Namespace
33
metadata:
4-
name: cluster
5-
namespace: default
6-
status:
7-
replicas: 2
8-
restarting: false
9-
conditions:
10-
- type: ClusterConfigured
11-
status: "True"
12-
13-
---
14-
15-
apiVersion: kuttl.dev/v1beta1
16-
kind: TestAssert
17-
collectors:
18-
- type: pod
19-
selector: app.kubernetes.io/name=redpanda
20-
tail: -1
21-
- type: pod
22-
namespace: redpanda-system
23-
selector: control-plane=controller-manager
24-
tail: -1
25-
- type: command
26-
command: kubectl get clusters -o jsonpath={@} -n $NAMESPACE
27-
- type: command
28-
command: kubectl get pods -o jsonpath={@} -n $NAMESPACE
4+
name: console
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: console
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1-
apiVersion: apps/v1
2-
kind: Deployment
1+
apiVersion: redpanda.vectorized.io/v1alpha1
2+
kind: Cluster
33
metadata:
4-
name: console
5-
namespace: default
4+
name: cluster
5+
namespace: console
66
status:
7-
readyReplicas: 1
7+
replicas: 2
8+
restarting: false
9+
conditions:
10+
- type: ClusterConfigured
11+
status: "True"
12+
813
---
14+
915
apiVersion: kuttl.dev/v1beta1
1016
kind: TestAssert
1117
collectors:
12-
- type: pod
13-
selector: app.kubernetes.io/name=redpanda-console
14-
tail: -1
18+
- type: pod
19+
selector: app.kubernetes.io/name=redpanda
20+
tail: -1
21+
- type: pod
22+
namespace: redpanda-system
23+
selector: control-plane=controller-manager
24+
tail: -1
25+
- type: command
26+
command: kubectl get clusters -o jsonpath={@} -n console
27+
- type: command
28+
command: kubectl get pods -o jsonpath={@} -n console

src/go/k8s/tests/e2e/console/00-redpanda-cluster.yaml renamed to src/go/k8s/tests/e2e/console/01-redpanda-cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: redpanda.vectorized.io/v1alpha1
22
kind: Cluster
33
metadata:
44
name: cluster
5-
namespace: default
5+
namespace: console
66
spec:
77
image: "localhost/redpanda"
88
version: "dev"

src/go/k8s/tests/e2e/console/02-assert.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
apiVersion: batch/v1
2-
kind: Job
1+
apiVersion: apps/v1
2+
kind: Deployment
33
metadata:
4-
name: call-console
5-
namespace: default
4+
name: console
5+
namespace: console
66
status:
7-
conditions:
8-
- status: "True"
9-
type: Complete
10-
succeeded: 1
11-
7+
readyReplicas: 1
128
---
13-
149
apiVersion: kuttl.dev/v1beta1
1510
kind: TestAssert
1611
collectors:

src/go/k8s/tests/e2e/console/01-console.yaml renamed to src/go/k8s/tests/e2e/console/02-console.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ apiVersion: redpanda.vectorized.io/v1alpha1
22
kind: Console
33
metadata:
44
name: console
5-
namespace: default
5+
namespace: console
66
spec:
77
server:
88
listenPort: 8080
99
schema:
1010
enabled: true
1111
clusterRef:
1212
name: cluster
13-
namespace: default
13+
namespace: console
1414
deployment:
1515
image: vectorized/console:master-173596f
1616
connect:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: call-console
5+
namespace: console
6+
status:
7+
conditions:
8+
- status: "True"
9+
type: Complete
10+
succeeded: 1
11+
12+
---
13+
14+
apiVersion: kuttl.dev/v1beta1
15+
kind: TestAssert
16+
collectors:
17+
- type: pod
18+
selector: app.kubernetes.io/name=redpanda-console
19+
tail: -1

src/go/k8s/tests/e2e/console/02-call-console.yaml renamed to src/go/k8s/tests/e2e/console/03-call-console.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: batch/v1
22
kind: Job
33
metadata:
44
name: call-console
5-
namespace: default
5+
namespace: console
66
spec:
77
template:
88
spec:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
delete:
4+
- apiVersion: redpanda.vectorized.io/v1alpha1
5+
kind: Console
6+
name: console
7+
namespace: console
8+
- apiVersion: v1
9+
kind: Namespace
10+
name: console

0 commit comments

Comments
 (0)