mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Fix tests
This commit is contained in:
@@ -83,6 +83,9 @@ func TestAPITopologyAddsKubernetes(t *testing.T) {
|
||||
{ContainerID: "container2"},
|
||||
},
|
||||
},
|
||||
Spec: api.PodSpec{
|
||||
SecurityContext: &api.PodSecurityContext{},
|
||||
},
|
||||
}).GetNode("")
|
||||
buf := &bytes.Buffer{}
|
||||
encoder := codec.NewEncoder(buf, &codec.MsgpackHandle{})
|
||||
|
||||
@@ -64,7 +64,7 @@ func (p *pod) GetNode(probeID string) report.Node {
|
||||
report.ControlProbeID: probeID,
|
||||
}
|
||||
|
||||
if p.Pod.Spec.SecurityContext.HostNetwork {
|
||||
if sc := p.Pod.Spec.SecurityContext; sc != nil && sc.HostNetwork {
|
||||
latests[IsInHostNetwork] = "true"
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ var (
|
||||
},
|
||||
Spec: api.PodSpec{
|
||||
NodeName: nodeName,
|
||||
SecurityContext: &api.PodSecurityContext{
|
||||
HostNetwork: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
apiPod2 = api.Pod{
|
||||
@@ -65,7 +68,8 @@ var (
|
||||
},
|
||||
},
|
||||
Spec: api.PodSpec{
|
||||
NodeName: nodeName,
|
||||
NodeName: nodeName,
|
||||
SecurityContext: &api.PodSecurityContext{},
|
||||
},
|
||||
}
|
||||
apiService1 = api.Service{
|
||||
|
||||
Reference in New Issue
Block a user