@@ -214,51 +214,55 @@ 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 openStackCluster .Status .Bastion == nil {
218+ Logf ("Skipping log collection for machine %q since no bastion is available" , m .Name )
219+ } else {
220+ srvUser := o .E2EContext .E2EConfig .GetVariable (SSHUserMachine )
221+ executeCommands (
222+ ctx ,
223+ o .E2EContext .Settings .ArtifactFolder ,
224+ o .E2EContext .Settings .Debug ,
225+ outputPath ,
226+ ip ,
227+ openStackCluster .Status .Bastion .FloatingIP ,
228+ srvUser ,
229+ []command {
230+ // don't do this for now, it just takes to long
231+ // {
232+ // title: "systemd",
233+ // cmd: "journalctl --no-pager --output=short-precise | grep -v 'audit:\\|audit\\['",
234+ // },
235+ {
236+ title : "kern" ,
237+ cmd : "journalctl --no-pager --output=short-precise -k" ,
238+ },
239+ {
240+ title : "containerd-info" ,
241+ cmd : "crictl --runtime-endpoint unix:///run/containerd/containerd.sock info" ,
242+ },
243+ {
244+ title : "containerd-containers" ,
245+ cmd : "crictl --runtime-endpoint unix:///run/containerd/containerd.sock ps" ,
246+ },
247+ {
248+ title : "containerd-pods" ,
249+ cmd : "crictl --runtime-endpoint unix:///run/containerd/containerd.sock pods" ,
250+ },
251+ {
252+ title : "cloud-final" ,
253+ cmd : "journalctl --no-pager -u cloud-final" ,
254+ },
255+ {
256+ title : "kubelet" ,
257+ cmd : "journalctl --no-pager -u kubelet.service" ,
258+ },
259+ {
260+ title : "containerd" ,
261+ cmd : "journalctl --no-pager -u containerd.service" ,
262+ },
235263 },
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- )
264+ )
265+ }
262266 return nil
263267}
264268
0 commit comments