Skip to content

Commit 842679a

Browse files
committed
e2e: remove bastion from common-patches/cni
The bastion isn't used anywhere in e2e and we'll write proper tests for it, see #1821 This involve not collecting machine logs if there is no bastion in the cluster.
1 parent 5fca0e5 commit 842679a

File tree

9 files changed

+48
-95
lines changed

9 files changed

+48
-95
lines changed

test/e2e/data/kustomize/common-patches/cni/patch-cluster.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
---
2-
- op: add
3-
path: /spec/bastion
4-
value:
5-
enabled: true
6-
instance:
7-
flavor: ${OPENSTACK_BASTION_MACHINE_FLAVOR}
8-
image:
9-
name: ${OPENSTACK_BASTION_IMAGE_NAME}
10-
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
112
- op: add
123
path: /spec/controlPlaneAvailabilityZones
134
value:

test/e2e/data/kustomize/v1alpha5/bastion.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/e2e/data/kustomize/v1alpha5/kustomization.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ resources:
66
components:
77
- ../common-patches/cni
88
- ../common-patches/ccm
9-
10-
patches:
11-
- path: bastion.yaml
12-
target:
13-
kind: OpenStackCluster
14-
name: \${CLUSTER_NAME}

test/e2e/data/kustomize/v1alpha6/bastion.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/e2e/data/kustomize/v1alpha6/kustomization.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ patches:
2020
- {}
2121
target:
2222
kind: OpenStackMachineTemplate
23-
- path: bastion.yaml
24-
target:
25-
kind: OpenStackCluster
26-
name: \${CLUSTER_NAME}

test/e2e/data/kustomize/v1alpha7/bastion.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/e2e/data/kustomize/v1alpha7/kustomization.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ patches:
2020
- {}
2121
target:
2222
kind: OpenStackMachineTemplate
23-
- path: bastion.yaml
24-
target:
25-
kind: OpenStackCluster
26-
name: \${CLUSTER_NAME}

test/e2e/shared/common.go

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -214,51 +214,54 @@ func (o OpenStackLogCollector) CollectMachineLog(ctx context.Context, management
214214
return fmt.Errorf("error writing server JSON %s: %s", serverJSON, err)
215215
}
216216

217-
srvUser := o.E2EContext.E2EConfig.GetVariable(SSHUserMachine)
218-
executeCommands(
219-
ctx,
220-
o.E2EContext.Settings.ArtifactFolder,
221-
o.E2EContext.Settings.Debug,
222-
outputPath,
223-
ip,
224-
openStackCluster.Status.Bastion.FloatingIP,
225-
srvUser,
226-
[]command{
227-
// don't do this for now, it just takes to long
228-
// {
229-
// title: "systemd",
230-
// cmd: "journalctl --no-pager --output=short-precise | grep -v 'audit:\\|audit\\['",
231-
// },
232-
{
233-
title: "kern",
234-
cmd: "journalctl --no-pager --output=short-precise -k",
217+
// If the machine has a bastion, collect logs from there.
218+
if openStackCluster.Status.Bastion != nil {
219+
srvUser := o.E2EContext.E2EConfig.GetVariable(SSHUserMachine)
220+
executeCommands(
221+
ctx,
222+
o.E2EContext.Settings.ArtifactFolder,
223+
o.E2EContext.Settings.Debug,
224+
outputPath,
225+
ip,
226+
openStackCluster.Status.Bastion.FloatingIP,
227+
srvUser,
228+
[]command{
229+
// don't do this for now, it just takes to long
230+
// {
231+
// title: "systemd",
232+
// cmd: "journalctl --no-pager --output=short-precise | grep -v 'audit:\\|audit\\['",
233+
// },
234+
{
235+
title: "kern",
236+
cmd: "journalctl --no-pager --output=short-precise -k",
237+
},
238+
{
239+
title: "containerd-info",
240+
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock info",
241+
},
242+
{
243+
title: "containerd-containers",
244+
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock ps",
245+
},
246+
{
247+
title: "containerd-pods",
248+
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock pods",
249+
},
250+
{
251+
title: "cloud-final",
252+
cmd: "journalctl --no-pager -u cloud-final",
253+
},
254+
{
255+
title: "kubelet",
256+
cmd: "journalctl --no-pager -u kubelet.service",
257+
},
258+
{
259+
title: "containerd",
260+
cmd: "journalctl --no-pager -u containerd.service",
261+
},
235262
},
236-
{
237-
title: "containerd-info",
238-
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock info",
239-
},
240-
{
241-
title: "containerd-containers",
242-
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock ps",
243-
},
244-
{
245-
title: "containerd-pods",
246-
cmd: "crictl --runtime-endpoint unix:///run/containerd/containerd.sock pods",
247-
},
248-
{
249-
title: "cloud-final",
250-
cmd: "journalctl --no-pager -u cloud-final",
251-
},
252-
{
253-
title: "kubelet",
254-
cmd: "journalctl --no-pager -u kubelet.service",
255-
},
256-
{
257-
title: "containerd",
258-
cmd: "journalctl --no-pager -u containerd.service",
259-
},
260-
},
261-
)
263+
)
264+
}
262265
return nil
263266
}
264267

test/e2e/suites/e2e/e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
152152

153153
securityGroupsList, err := shared.DumpOpenStackSecurityGroups(e2eCtx, groups.ListOpts{Tags: clusterName})
154154
Expect(err).NotTo(HaveOccurred())
155-
Expect(securityGroupsList).To(HaveLen(3))
155+
Expect(securityGroupsList).To(HaveLen(2))
156156
})
157157
})
158158

0 commit comments

Comments
 (0)