Skip to content

Commit 9d6effe

Browse files
committed
wip: add support for deployments in oc status
1 parent d4061a5 commit 9d6effe

File tree

12 files changed

+302
-80
lines changed

12 files changed

+302
-80
lines changed

pkg/oc/admin/prune/imageprune/prune.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ func (p *pruner) addDeploymentsToGraph(dmnts *kapisext.DeploymentList) []error {
578578
d := &dmnts.Items[i]
579579
ref := getRef(d)
580580
glog.V(4).Infof("Examining %s", getKindName(ref))
581-
dNode := appsgraph.EnsureDeploymentNode(p.g, d)
581+
dNode := kubegraph.EnsureDeploymentNode(p.g, d)
582582
errs = append(errs, p.addPodSpecToGraph(ref, &d.Spec.Template.Spec, dNode)...)
583583
}
584584

pkg/oc/cli/describe/deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ func (d *LatestDeploymentsDescriber) Describe(namespace, name string) (string, e
478478
activeDeployment, inactiveDeployments := appsedges.RelevantDeployments(g, dcNode)
479479

480480
return tabbedString(func(out *tabwriter.Writer) error {
481-
descriptions := describeDeployments(f, dcNode, activeDeployment, inactiveDeployments, nil, d.count)
481+
descriptions := describeDeploymentConfigDeployments(f, dcNode, activeDeployment, inactiveDeployments, nil, d.count)
482482
for i, description := range descriptions {
483483
descriptions[i] = fmt.Sprintf("%v %v", name, description)
484484
}

pkg/oc/cli/describe/projectstatus.go

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func (d *ProjectStatusDescriber) MakeGraph(namespace string) (osgraph.Graph, set
149149
buildedges.AddAllInputOutputEdges(g)
150150
buildedges.AddAllBuildEdges(g)
151151
appsedges.AddAllTriggerEdges(g)
152+
kubeedges.AddAllTriggerEdges(g)
152153
appsedges.AddAllDeploymentEdges(g)
153154
appsedges.AddAllVolumeClaimEdges(g)
154155
imageedges.AddAllImageStreamRefEdges(g)
@@ -228,7 +229,7 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
228229
printLines(out, "", 0, describeServiceInServiceGroup(f, service, exposes...)...)
229230

230231
for _, dcPipeline := range service.DeploymentConfigPipelines {
231-
printLines(out, indent, 1, describeDeploymentInServiceGroup(local, dcPipeline, func(rc *kubegraph.ReplicationControllerNode) int32 {
232+
printLines(out, indent, 1, describeDeploymentConfigInServiceGroup(local, dcPipeline, func(rc *kubegraph.ReplicationControllerNode) int32 {
232233
return graphview.MaxRecentContainerRestartsForRC(g, rc)
233234
})...)
234235
}
@@ -237,6 +238,10 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
237238
printLines(out, indent, 1, describeStatefulSetInServiceGroup(local, node)...)
238239
}
239240

241+
for _, node := range service.Deployments {
242+
printLines(out, indent, 1, describeDeploymentInServiceGroup(local, node)...)
243+
}
244+
240245
rcNode:
241246
for _, rcNode := range service.FulfillingRCs {
242247
for _, coveredDC := range service.FulfillingDCs {
@@ -267,7 +272,7 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
267272

268273
for _, standaloneDC := range standaloneDCs {
269274
fmt.Fprintln(out)
270-
printLines(out, indent, 0, describeDeploymentInServiceGroup(f, standaloneDC, func(rc *kubegraph.ReplicationControllerNode) int32 {
275+
printLines(out, indent, 0, describeDeploymentConfigInServiceGroup(f, standaloneDC, func(rc *kubegraph.ReplicationControllerNode) int32 {
271276
return graphview.MaxRecentContainerRestartsForRC(g, rc)
272277
})...)
273278
}
@@ -508,6 +513,8 @@ func (f namespacedFormatter) ResourceName(obj interface{}) string {
508513
return namespaceNameWithType("hpa", t.HorizontalPodAutoscaler.Name, t.HorizontalPodAutoscaler.Namespace, f.currentNamespace, f.hideNamespace)
509514
case *kubegraph.StatefulSetNode:
510515
return namespaceNameWithType("statefulset", t.StatefulSet.Name, t.StatefulSet.Namespace, f.currentNamespace, f.hideNamespace)
516+
case *kubegraph.DeploymentNode:
517+
return namespaceNameWithType("deployment", t.Deployment.Name, t.Deployment.Namespace, f.currentNamespace, f.hideNamespace)
511518
case *kubegraph.PersistentVolumeClaimNode:
512519
return namespaceNameWithType("pvc", t.PersistentVolumeClaim.Name, t.PersistentVolumeClaim.Namespace, f.currentNamespace, f.hideNamespace)
513520

@@ -550,36 +557,67 @@ func describeAllProjectsOnServer(f formatter, server string) string {
550557
return fmt.Sprintf("Showing all projects on server %s\n", server)
551558
}
552559

553-
func describeDeploymentInServiceGroup(f formatter, deploy graphview.DeploymentConfigPipeline, restartFn func(*kubegraph.ReplicationControllerNode) int32) []string {
554-
local := namespacedFormatter{currentNamespace: deploy.Deployment.DeploymentConfig.Namespace}
560+
func describeDeploymentConfigInServiceGroup(f formatter, deploy graphview.DeploymentConfigPipeline, restartFn func(*kubegraph.ReplicationControllerNode) int32) []string {
561+
local := namespacedFormatter{currentNamespace: deploy.DeploymentConfig.DeploymentConfig.Namespace}
555562

556563
includeLastPass := deploy.ActiveDeployment == nil
557564
if len(deploy.Images) == 1 {
558565
format := "%s deploys %s %s"
559-
if deploy.Deployment.DeploymentConfig.Spec.Test {
566+
if deploy.DeploymentConfig.DeploymentConfig.Spec.Test {
560567
format = "%s test deploys %s %s"
561568
}
562-
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.Deployment), describeImageInPipeline(local, deploy.Images[0], deploy.Deployment.DeploymentConfig.Namespace), describeDeploymentConfigTrigger(deploy.Deployment.DeploymentConfig))}
569+
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.DeploymentConfig), describeImageInPipeline(local, deploy.Images[0], deploy.DeploymentConfig.DeploymentConfig.Namespace), describeDeploymentConfigTrigger(deploy.DeploymentConfig.DeploymentConfig))}
563570
if len(lines[0]) > 120 && strings.Contains(lines[0], " <- ") {
564571
segments := strings.SplitN(lines[0], " <- ", 2)
565572
lines[0] = segments[0] + " <-"
566573
lines = append(lines, segments[1])
567574
}
568575
lines = append(lines, indentLines(" ", describeAdditionalBuildDetail(deploy.Images[0].Build, deploy.Images[0].LastSuccessfulBuild, deploy.Images[0].LastUnsuccessfulBuild, deploy.Images[0].ActiveBuilds, deploy.Images[0].DestinationResolved, includeLastPass)...)...)
569-
lines = append(lines, describeDeployments(local, deploy.Deployment, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
576+
lines = append(lines, describeDeploymentConfigDeployments(local, deploy.DeploymentConfig, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
570577
return lines
571578
}
572579

573580
format := "%s deploys %s"
574-
if deploy.Deployment.DeploymentConfig.Spec.Test {
581+
if deploy.DeploymentConfig.DeploymentConfig.Spec.Test {
575582
format = "%s test deploys %s"
576583
}
577-
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.Deployment), describeDeploymentConfigTrigger(deploy.Deployment.DeploymentConfig))}
584+
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.DeploymentConfig), describeDeploymentConfigTrigger(deploy.DeploymentConfig.DeploymentConfig))}
585+
for _, image := range deploy.Images {
586+
lines = append(lines, describeImageInPipeline(local, image, deploy.DeploymentConfig.DeploymentConfig.Namespace))
587+
lines = append(lines, indentLines(" ", describeAdditionalBuildDetail(image.Build, image.LastSuccessfulBuild, image.LastUnsuccessfulBuild, image.ActiveBuilds, image.DestinationResolved, includeLastPass)...)...)
588+
lines = append(lines, describeDeploymentConfigDeployments(local, deploy.DeploymentConfig, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
589+
}
590+
return lines
591+
}
592+
593+
func describeDeploymentInServiceGroup(f formatter, deploy graphview.Deployment) []string {
594+
local := namespacedFormatter{currentNamespace: deploy.Deployment.Deployment.Namespace}
595+
// TODO: Figure out what this is
596+
includeLastPass := false
597+
598+
if len(deploy.Images) == 1 {
599+
format := "%s deploys %s %s"
600+
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.Deployment), describeImageInPipeline(local, deploy.Images[0], deploy.Deployment.Deployment.Namespace), "")}
601+
if len(lines[0]) > 120 && strings.Contains(lines[0], " <- ") {
602+
segments := strings.SplitN(lines[0], " <- ", 2)
603+
lines[0] = segments[0] + " <-"
604+
lines = append(lines, segments[1])
605+
}
606+
lines = append(lines, indentLines(" ", describeAdditionalBuildDetail(deploy.Images[0].Build, deploy.Images[0].LastSuccessfulBuild, deploy.Images[0].LastUnsuccessfulBuild, deploy.Images[0].ActiveBuilds, deploy.Images[0].DestinationResolved, includeLastPass)...)...)
607+
// TODO: Add replica sets as deployments
608+
// lines = append(lines, describeDeploymentConfigDeployments(local, deploy.DeploymentConfig, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
609+
return lines
610+
}
611+
612+
format := "%s deploys %s"
613+
lines := []string{fmt.Sprintf(format, f.ResourceName(deploy.Deployment), "")}
578614
for _, image := range deploy.Images {
579-
lines = append(lines, describeImageInPipeline(local, image, deploy.Deployment.DeploymentConfig.Namespace))
615+
lines = append(lines, describeImageInPipeline(local, image, deploy.Deployment.Deployment.Namespace))
580616
lines = append(lines, indentLines(" ", describeAdditionalBuildDetail(image.Build, image.LastSuccessfulBuild, image.LastUnsuccessfulBuild, image.ActiveBuilds, image.DestinationResolved, includeLastPass)...)...)
581-
lines = append(lines, describeDeployments(local, deploy.Deployment, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
617+
// TODO: Add replica sets as deployments
618+
// lines = append(lines, describeDeploymentConfigDeployments(local, deploy.DeploymentConfig, deploy.ActiveDeployment, deploy.InactiveDeployments, restartFn, maxDisplayDeployments)...)
582619
}
620+
583621
return lines
584622
}
585623

@@ -1026,7 +1064,7 @@ func describeSourceInPipeline(source *buildapi.BuildSource) (string, bool) {
10261064
return "", false
10271065
}
10281066

1029-
func describeDeployments(f formatter, dcNode *appsgraph.DeploymentConfigNode, activeDeployment *kubegraph.ReplicationControllerNode, inactiveDeployments []*kubegraph.ReplicationControllerNode, restartFn func(*kubegraph.ReplicationControllerNode) int32, count int) []string {
1067+
func describeDeploymentConfigDeployments(f formatter, dcNode *appsgraph.DeploymentConfigNode, activeDeployment *kubegraph.ReplicationControllerNode, inactiveDeployments []*kubegraph.ReplicationControllerNode, restartFn func(*kubegraph.ReplicationControllerNode) int32, count int) []string {
10301068
if dcNode == nil {
10311069
return nil
10321070
}
@@ -1050,7 +1088,7 @@ func describeDeployments(f formatter, dcNode *appsgraph.DeploymentConfigNode, ac
10501088
if restartFn != nil {
10511089
restartCount = restartFn(deployment)
10521090
}
1053-
out = append(out, describeDeploymentStatus(deployment.ReplicationController, i == 0, dcNode.DeploymentConfig.Spec.Test, restartCount))
1091+
out = append(out, describeDeploymentConfigDeploymentStatus(deployment.ReplicationController, i == 0, dcNode.DeploymentConfig.Spec.Test, restartCount))
10541092
switch {
10551093
case count == -1:
10561094
if appsutil.IsCompleteDeployment(deployment.ReplicationController) {
@@ -1065,7 +1103,7 @@ func describeDeployments(f formatter, dcNode *appsgraph.DeploymentConfigNode, ac
10651103
return out
10661104
}
10671105

1068-
func describeDeploymentStatus(rc *kapi.ReplicationController, first, test bool, restartCount int32) string {
1106+
func describeDeploymentConfigDeploymentStatus(rc *kapi.ReplicationController, first, test bool, restartCount int32) string {
10691107
timeAt := strings.ToLower(formatRelativeTime(rc.CreationTimestamp.Time))
10701108
status := appsutil.DeploymentStatusFor(rc)
10711109
version := appsutil.DeploymentVersionFor(rc)
@@ -1099,6 +1137,11 @@ func describeDeploymentStatus(rc *kapi.ReplicationController, first, test bool,
10991137
}
11001138
}
11011139

1140+
func describeDeploymentStatus(d *kapisext.Deployment) string {
1141+
timeAt := strings.ToLower(formatRelativeTime(d.CreationTimestamp.Time))
1142+
return fmt.Sprintf("created %s ago%s", timeAt, describePodSummaryInline(int32(d.Status.Replicas), int32(d.Status.Replicas), int32(d.Spec.Replicas), false, 0))
1143+
}
1144+
11021145
func describeStatefulSetStatus(p *kapps.StatefulSet) string {
11031146
timeAt := strings.ToLower(formatRelativeTime(p.CreationTimestamp.Time))
11041147
// TODO: Replace first argument in describePodSummaryInline with ReadyReplicas once that's a thing for pet sets.
@@ -1402,7 +1445,7 @@ func (l *deploymentLoader) Load() error {
14021445

14031446
func (l *deploymentLoader) AddToGraph(g osgraph.Graph) error {
14041447
for i := range l.items {
1405-
appsgraph.EnsureDeploymentNode(g, &l.items[i])
1448+
kubegraph.EnsureDeploymentNode(g, &l.items[i])
14061449
}
14071450

14081451
return nil

pkg/oc/graph/appsgraph/nodes/nodes.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,6 @@ func FindOrCreateSyntheticDaemonSetNode(g osgraph.MutableUniqueGraph, ds *kapise
3737
).(*DaemonSetNode)
3838
}
3939

40-
// EnsureDeploymentNode adds the provided upstream deployment to the graph if it does not exist
41-
func EnsureDeploymentNode(g osgraph.MutableUniqueGraph, deployment *kapisext.Deployment) *DeploymentNode {
42-
deploymentName := DeploymentNodeName(deployment)
43-
deploymentNode := osgraph.EnsureUnique(
44-
g,
45-
deploymentName,
46-
func(node osgraph.Node) graph.Node {
47-
return &DeploymentNode{Node: node, Deployment: deployment, IsFound: true}
48-
},
49-
).(*DeploymentNode)
50-
51-
podTemplateSpecNode := kubegraph.EnsurePodTemplateSpecNode(g, &deployment.Spec.Template, deployment.Namespace, deploymentName)
52-
g.AddEdge(deploymentNode, podTemplateSpecNode, osgraph.ContainsEdgeKind)
53-
54-
return deploymentNode
55-
}
56-
57-
func FindOrCreateSyntheticDeploymentNode(g osgraph.MutableUniqueGraph, deployment *kapisext.Deployment) *DeploymentNode {
58-
return osgraph.EnsureUnique(
59-
g,
60-
DeploymentNodeName(deployment),
61-
func(node osgraph.Node) graph.Node {
62-
return &DeploymentNode{Node: node, Deployment: deployment, IsFound: false}
63-
},
64-
).(*DeploymentNode)
65-
}
66-
6740
// EnsureDeploymentConfigNode adds the provided deployment config to the graph if it does not exist
6841
func EnsureDeploymentConfigNode(g osgraph.MutableUniqueGraph, dc *appsapi.DeploymentConfig) *DeploymentConfigNode {
6942
dcName := DeploymentConfigNodeName(dc)

pkg/oc/graph/appsgraph/nodes/types.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,6 @@ func (*DaemonSetNode) Kind() string {
4343
return DaemonSetNodeKind
4444
}
4545

46-
func DeploymentNodeName(o *kapisext.Deployment) osgraph.UniqueName {
47-
return osgraph.GetUniqueRuntimeObjectNodeName(DeploymentNodeKind, o)
48-
}
49-
50-
type DeploymentNode struct {
51-
osgraph.Node
52-
Deployment *kapisext.Deployment
53-
54-
IsFound bool
55-
}
56-
57-
func (n DeploymentNode) Found() bool {
58-
return n.IsFound
59-
}
60-
61-
func (n DeploymentNode) Object() interface{} {
62-
return n.Deployment
63-
}
64-
65-
func (n DeploymentNode) String() string {
66-
return string(DeploymentNodeName(n.Deployment))
67-
}
68-
69-
func (*DeploymentNode) Kind() string {
70-
return DeploymentNodeKind
71-
}
72-
7346
func DeploymentConfigNodeName(o *appsapi.DeploymentConfig) osgraph.UniqueName {
7447
return osgraph.GetUniqueRuntimeObjectNodeName(DeploymentConfigNodeKind, o)
7548
}

pkg/oc/graph/genericgraph/graphview/dc_pipeline.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
type DeploymentConfigPipeline struct {
13-
Deployment *appsgraph.DeploymentConfigNode
13+
DeploymentConfig *appsgraph.DeploymentConfigNode
1414

1515
ActiveDeployment *kubegraph.ReplicationControllerNode
1616
InactiveDeployments []*kubegraph.ReplicationControllerNode
@@ -43,7 +43,7 @@ func NewDeploymentConfigPipeline(g osgraph.Graph, dcNode *appsgraph.DeploymentCo
4343
covered.Insert(dcNode.ID())
4444

4545
dcPipeline := DeploymentConfigPipeline{}
46-
dcPipeline.Deployment = dcNode
46+
dcPipeline.DeploymentConfig = dcNode
4747

4848
// for everything that can trigger a deployment, create an image pipeline and add it to the list
4949
for _, istNode := range g.PredecessorNodesByEdgeKind(dcNode, appsedges.TriggersDeploymentEdgeKind) {
@@ -80,5 +80,5 @@ type SortedDeploymentConfigPipeline []DeploymentConfigPipeline
8080
func (m SortedDeploymentConfigPipeline) Len() int { return len(m) }
8181
func (m SortedDeploymentConfigPipeline) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
8282
func (m SortedDeploymentConfigPipeline) Less(i, j int) bool {
83-
return CompareObjectMeta(&m[i].Deployment.DeploymentConfig.ObjectMeta, &m[j].Deployment.DeploymentConfig.ObjectMeta)
83+
return CompareObjectMeta(&m[i].DeploymentConfig.DeploymentConfig.ObjectMeta, &m[j].DeploymentConfig.DeploymentConfig.ObjectMeta)
8484
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package graphview
2+
3+
import (
4+
osgraph "github.com/openshift/origin/pkg/oc/graph/genericgraph"
5+
kubeedges "github.com/openshift/origin/pkg/oc/graph/kubegraph"
6+
kubegraph "github.com/openshift/origin/pkg/oc/graph/kubegraph/nodes"
7+
)
8+
9+
type Deployment struct {
10+
Deployment *kubegraph.DeploymentNode
11+
12+
OwnedPods []*kubegraph.PodNode
13+
CreatedPods []*kubegraph.PodNode
14+
15+
Images []ImagePipeline
16+
17+
// TODO: handle conflicting once controller refs are present, not worth it yet
18+
}
19+
20+
// AllDeployments returns all the Deployments that aren't in the excludes set and the set of covered NodeIDs
21+
func AllDeployments(g osgraph.Graph, excludeNodeIDs IntSet) ([]Deployment, IntSet) {
22+
covered := IntSet{}
23+
views := []Deployment{}
24+
25+
for _, uncastNode := range g.NodesByKind(kubegraph.DeploymentNodeKind) {
26+
if excludeNodeIDs.Has(uncastNode.ID()) {
27+
continue
28+
}
29+
30+
view, covers := NewDeployment(g, uncastNode.(*kubegraph.DeploymentNode))
31+
covered.Insert(covers.List()...)
32+
views = append(views, view)
33+
}
34+
35+
return views, covered
36+
}
37+
38+
// NewDeployment returns the Deployment and a set of all the NodeIDs covered by the Deployment
39+
func NewDeployment(g osgraph.Graph, node *kubegraph.DeploymentNode) (Deployment, IntSet) {
40+
covered := IntSet{}
41+
covered.Insert(node.ID())
42+
43+
view := Deployment{}
44+
view.Deployment = node
45+
46+
for _, uncastPodNode := range g.PredecessorNodesByEdgeKind(node, kubeedges.ManagedByControllerEdgeKind) {
47+
podNode := uncastPodNode.(*kubegraph.PodNode)
48+
covered.Insert(podNode.ID())
49+
view.OwnedPods = append(view.OwnedPods, podNode)
50+
}
51+
52+
for _, istNode := range g.PredecessorNodesByEdgeKind(node, kubeedges.TriggersDeploymentEdgeKind) {
53+
imagePipeline, covers := NewImagePipelineFromImageTagLocation(g, istNode, istNode.(ImageTagLocation))
54+
covered.Insert(covers.List()...)
55+
view.Images = append(view.Images, imagePipeline)
56+
}
57+
58+
return view, covered
59+
}

pkg/oc/graph/genericgraph/graphview/service_group.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ type ServiceGroup struct {
2121

2222
DeploymentConfigPipelines []DeploymentConfigPipeline
2323
ReplicationControllers []ReplicationController
24+
Deployments []Deployment
2425
StatefulSets []StatefulSet
2526

2627
// TODO: this has to stop
2728
FulfillingStatefulSets []*kubegraph.StatefulSetNode
29+
FulfillingDeployments []*kubegraph.DeploymentNode
2830
FulfillingDCs []*appsgraph.DeploymentConfigNode
2931
FulfillingRCs []*kubegraph.ReplicationControllerNode
3032
FulfillingPods []*kubegraph.PodNode
@@ -71,8 +73,10 @@ func NewServiceGroup(g osgraph.Graph, serviceNode *kubegraph.ServiceNode) (Servi
7173
service.FulfillingPods = append(service.FulfillingPods, castContainer)
7274
case *kubegraph.StatefulSetNode:
7375
service.FulfillingStatefulSets = append(service.FulfillingStatefulSets, castContainer)
76+
case *kubegraph.DeploymentNode:
77+
service.FulfillingDeployments = append(service.FulfillingDeployments, castContainer)
7478
default:
75-
utilruntime.HandleError(fmt.Errorf("unrecognized container: %v", castContainer))
79+
utilruntime.HandleError(fmt.Errorf("unrecognized container: %v (%T)", castContainer, castContainer))
7680
}
7781
}
7882

@@ -109,6 +113,13 @@ func NewServiceGroup(g osgraph.Graph, serviceNode *kubegraph.ServiceNode) (Servi
109113
service.StatefulSets = append(service.StatefulSets, view)
110114
}
111115

116+
for _, fulfillingDeployment := range service.FulfillingDeployments {
117+
view, covers := NewDeployment(g, fulfillingDeployment)
118+
119+
covered.Insert(covers.List()...)
120+
service.Deployments = append(service.Deployments, view)
121+
}
122+
112123
for _, fulfillingPod := range service.FulfillingPods {
113124
_, podCovers := NewPod(g, fulfillingPod)
114125
covered.Insert(podCovers.List()...)

pkg/oc/graph/genericgraph/graphview/veneering_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func TestGraph(t *testing.T) {
399399
}
400400

401401
for _, bareDCPipeline := range bareDCPipelines {
402-
t.Logf("from %s", bareDCPipeline.Deployment.DeploymentConfig.Name)
402+
t.Logf("from %s", bareDCPipeline.DeploymentConfig.DeploymentConfig.Name)
403403
for _, path := range bareDCPipeline.Images {
404404
t.Logf(" %v", path)
405405
}
@@ -413,7 +413,7 @@ func TestGraph(t *testing.T) {
413413
indent := " "
414414

415415
for _, deployment := range serviceGroup.DeploymentConfigPipelines {
416-
t.Logf("%sdeployment %s", indent, deployment.Deployment.DeploymentConfig.Name)
416+
t.Logf("%sdeployment %s", indent, deployment.DeploymentConfig.DeploymentConfig.Name)
417417
for _, image := range deployment.Images {
418418
t.Logf("%s image %s", indent, image.Image.ImageSpec())
419419
if image.Build != nil {

0 commit comments

Comments
 (0)