mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Show Pod IP in details panel.
This commit is contained in:
@@ -17,6 +17,7 @@ const (
|
||||
PodContainerIDs = "kubernetes_pod_container_ids"
|
||||
PodState = "kubernetes_pod_state"
|
||||
PodLabelPrefix = "kubernetes_pod_labels_"
|
||||
PodIP = "kubernetes_pod_ip"
|
||||
ServiceIDs = "kubernetes_service_ids"
|
||||
)
|
||||
|
||||
@@ -86,12 +87,13 @@ func (p *pod) NodeName() string {
|
||||
|
||||
func (p *pod) GetNode(probeID string) report.Node {
|
||||
n := report.MakeNodeWith(report.MakePodNodeID(p.Namespace(), p.Name()), map[string]string{
|
||||
PodID: p.ID(),
|
||||
PodName: p.Name(),
|
||||
Namespace: p.Namespace(),
|
||||
PodCreated: p.Created(),
|
||||
PodContainerIDs: strings.Join(p.ContainerIDs(), " "),
|
||||
PodState: p.State(),
|
||||
PodID: p.ID(),
|
||||
PodName: p.Name(),
|
||||
Namespace: p.Namespace(),
|
||||
PodCreated: p.Created(),
|
||||
PodContainerIDs: strings.Join(p.ContainerIDs(), " "),
|
||||
PodState: p.State(),
|
||||
PodIP: p.Status.PodIP,
|
||||
report.ControlProbeID: probeID,
|
||||
})
|
||||
if len(p.serviceIDs) > 0 {
|
||||
|
||||
@@ -18,8 +18,9 @@ var (
|
||||
PodMetadataTemplates = report.MetadataTemplates{
|
||||
PodID: {ID: PodID, Label: "ID", From: report.FromLatest, Priority: 1},
|
||||
PodState: {ID: PodState, Label: "State", From: report.FromLatest, Priority: 2},
|
||||
Namespace: {ID: Namespace, Label: "Namespace", From: report.FromLatest, Priority: 3},
|
||||
PodCreated: {ID: PodCreated, Label: "Created", From: report.FromLatest, Priority: 4},
|
||||
PodIP: {ID: PodIP, Label: "IP", From: report.FromLatest, Priority: 3},
|
||||
Namespace: {ID: Namespace, Label: "Namespace", From: report.FromLatest, Priority: 5},
|
||||
PodCreated: {ID: PodCreated, Label: "Created", From: report.FromLatest, Priority: 6},
|
||||
}
|
||||
|
||||
ServiceMetadataTemplates = report.MetadataTemplates{
|
||||
|
||||
@@ -319,7 +319,7 @@ func TestMakeDetailedPodNode(t *testing.T) {
|
||||
Metadata: []report.MetadataRow{
|
||||
{ID: "kubernetes_pod_id", Label: "ID", Value: "ping/pong-b", Priority: 1},
|
||||
{ID: "kubernetes_pod_state", Label: "State", Value: "running", Priority: 2},
|
||||
{ID: "kubernetes_namespace", Label: "Namespace", Value: "ping", Priority: 3},
|
||||
{ID: "kubernetes_namespace", Label: "Namespace", Value: "ping", Priority: 5},
|
||||
},
|
||||
},
|
||||
Controls: []detailed.ControlInstance{},
|
||||
|
||||
Reference in New Issue
Block a user