CLI: add support for deployments in oc status#18439
CLI: add support for deployments in oc status#18439openshift-merge-robot merged 2 commits intoopenshift:masterfrom
Conversation
| ref := getRef(d) | ||
| glog.V(4).Infof("Examining %s", getKindName(ref)) | ||
| dNode := appsgraph.EnsureDeploymentNode(p.g, d) | ||
| dNode := kubegraph.EnsureDeploymentNode(p.g, d) |
There was a problem hiding this comment.
if you wonder why, I moved 'Deployments' from appsgraph which seems to hold only apps.openshift.io resources to kubegraph as Deployments are upstream.
There was a problem hiding this comment.
Would you mind moving DaemonSets as well, it's the function before this one?
There was a problem hiding this comment.
Same for ReplicaSets a few lines below.
There was a problem hiding this comment.
interesting, I thought I moved replica sets already... seems like they are not used/loaded anywhere
There was a problem hiding this comment.
done. moved both to kube nodes
| func describeDeploymentStatus(rs *kapisext.ReplicaSet, revision int64, first bool, restartCount int32) string { | ||
| timeAt := strings.ToLower(formatRelativeTime(rs.CreationTimestamp.Time)) | ||
| replicaSetRevision, _ := deployutil.Revision(rs) | ||
| if replicaSetRevision == revision { |
There was a problem hiding this comment.
@spadgett since you did the console pages for deployments
| // ScalingEdgeKind goes from HorizontalPodAutoscaler to scaled objects indicating that the HPA scales the object | ||
| ScalingEdgeKind = "Scaling" | ||
| // TriggersDeploymentEdgeKind points from DeploymentConfigs to ImageStreamTags that trigger the deployment | ||
| TriggersDeploymentEdgeKind = "TriggersDeployment" |
There was a problem hiding this comment.
this was duplicated from appsgraph because of import cycles... we should probably move this into some common package
There was a problem hiding this comment.
follow up, don't want to pollute this PR
pkg/oc/graph/kubegraph/edges.go
Outdated
| } | ||
|
|
||
| // AddTriggerEdges creates edges that point to named Docker image repositories for each image used in the deployment. | ||
| func AddTriggerEdges(g osgraph.MutableUniqueGraph, node *kubegraph.DeploymentNode) *kubegraph.DeploymentNode { |
There was a problem hiding this comment.
we should rework this to make it usable for StatefulSets and DaemonSets?
There was a problem hiding this comment.
done, this now works for statefulsets as well
|
Happy dance
On Feb 5, 2018, at 5:30 AM, Michal Fojtik <notifications@github.com> wrote:
@smarterclayton <https://github.com/smarterclayton> this is a long
overdue...
current state:
$ oc status
In project My Project (myproject) on server https://127.0.0.1:8443
svc/ruby-deploy - 172.30.174.234:8080
deployment/ruby-deploy deploys istag/ruby-deploy:latest <-
bc/ruby-deploy source builds
https://github.com/openshift/ruby-ex.git on
istag/ruby-22-centos7:latest
build #1 failed 3 hours ago - bbb6701: Merge pull request #18
from durandom/master (Ben Parees <bparees@users.noreply.github.com>)
pod/ruby-deploy-7556484b56-bpsqs runs
busybox@sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d
TODO:
- Add rollouts similar to deployment configs
- Fix unit tests / Add unit tests
- Deal with HPA
…------------------------------
You can view, comment on, or merge this pull request online at:
#18439
Commit Summary
- cli: fix kube client name
- wip: add support for deployments in oc status
File Changes
- *M* pkg/oc/admin/prune/imageprune/prune.go
<https://github.com/openshift/origin/pull/18439/files#diff-0> (2)
- *M* pkg/oc/cli/cmd/status.go
<https://github.com/openshift/origin/pull/18439/files#diff-1> (2)
- *M* pkg/oc/cli/describe/deployments.go
<https://github.com/openshift/origin/pull/18439/files#diff-2> (2)
- *M* pkg/oc/cli/describe/projectstatus.go
<https://github.com/openshift/origin/pull/18439/files#diff-3> (93)
- *M* pkg/oc/cli/describe/projectstatus_test.go
<https://github.com/openshift/origin/pull/18439/files#diff-4> (4)
- *M* pkg/oc/graph/appsgraph/nodes/nodes.go
<https://github.com/openshift/origin/pull/18439/files#diff-5> (27)
- *M* pkg/oc/graph/appsgraph/nodes/types.go
<https://github.com/openshift/origin/pull/18439/files#diff-6> (27)
- *M* pkg/oc/graph/genericgraph/graphview/dc_pipeline.go
<https://github.com/openshift/origin/pull/18439/files#diff-7> (6)
- *A* pkg/oc/graph/genericgraph/graphview/deployments.go
<https://github.com/openshift/origin/pull/18439/files#diff-8> (59)
- *M* pkg/oc/graph/genericgraph/graphview/service_group.go
<https://github.com/openshift/origin/pull/18439/files#diff-9> (13)
- *M* pkg/oc/graph/genericgraph/graphview/veneering_test.go
<https://github.com/openshift/origin/pull/18439/files#diff-10> (4)
- *M* pkg/oc/graph/kubegraph/edges.go
<https://github.com/openshift/origin/pull/18439/files#diff-11> (82)
- *M* pkg/oc/graph/kubegraph/nodes/nodes.go
<https://github.com/openshift/origin/pull/18439/files#diff-12> (31)
- *M* pkg/oc/graph/kubegraph/nodes/types.go
<https://github.com/openshift/origin/pull/18439/files#diff-13> (56)
Patch Links:
- https://github.com/openshift/origin/pull/18439.patch
- https://github.com/openshift/origin/pull/18439.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18439>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p7UVeCvw73TG-mjIec57V_i85nDcks5tRwJrgaJpZM4R5cQ6>
.
|
|
@smarterclayton ready for review :-) |
soltysh
left a comment
There was a problem hiding this comment.
A few suggestions, but this lgtm
|
|
||
| o.describer = &describe.ProjectStatusDescriber{ | ||
| K: kclientset, | ||
| KubeClient: kclientset, |
| ref := getRef(d) | ||
| glog.V(4).Infof("Examining %s", getKindName(ref)) | ||
| dNode := appsgraph.EnsureDeploymentNode(p.g, d) | ||
| dNode := kubegraph.EnsureDeploymentNode(p.g, d) |
There was a problem hiding this comment.
Would you mind moving DaemonSets as well, it's the function before this one?
| ref := getRef(d) | ||
| glog.V(4).Infof("Examining %s", getKindName(ref)) | ||
| dNode := appsgraph.EnsureDeploymentNode(p.g, d) | ||
| dNode := kubegraph.EnsureDeploymentNode(p.g, d) |
There was a problem hiding this comment.
Same for ReplicaSets a few lines below.
b035d04 to
86a8bc9
Compare
soltysh
left a comment
There was a problem hiding this comment.
lgtm, but would you mind removing the wip from the 2nd commit title ;) ?
| func describeStatefulSetInServiceGroup(f formatter, node *kubegraph.StatefulSetNode) []string { | ||
| func describeDeploymentInServiceGroup(f formatter, deploy graphview.Deployment, restartFn func(node *kubegraph.ReplicaSetNode) int32) []string { | ||
| local := namespacedFormatter{currentNamespace: deploy.Deployment.Deployment.Namespace} | ||
| // TODO: Figure out what this is |
|
/retest |
c587158 to
02412d4
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mfojtik, soltysh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
Automatic merge from submit-queue. |
@smarterclayton this is a long overdue...
current state:
TODO: