-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: add support for deployments in oc status #18439
Conversation
@@ -578,7 +578,7 @@ func (p *pruner) addDeploymentsToGraph(dmnts *kapisext.DeploymentList) []error { | |||
d := &dmnts.Items[i] | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind moving DaemonSets as well, it's the function before this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for ReplicaSets a few lines below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I thought I moved replica sets already... seems like they are not used/loaded anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spadgett since you did the console pages for deployments
@@ -33,6 +38,12 @@ const ( | |||
ReferencedServiceAccountEdgeKind = "ReferencedServiceAccount" | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow up, don't want to pollute this PR
pkg/oc/graph/kubegraph/edges.go
Outdated
default: | ||
continue | ||
} | ||
|
||
g.AddEdge(hpaNode, syntheticNode, ScalingEdgeKind) | ||
} | ||
} | ||
|
||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should rework this to make it usable for StatefulSets and DaemonSets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, this now works for statefulsets as well
Happy dance
On Feb 5, 2018, at 5:30 AM, Michal Fojtik <[email protected]> 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 <[email protected]>)
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 :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions, but this lgtm
@@ -160,7 +160,7 @@ func (o *StatusOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command, baseC | |||
canRequestProjects, _ := loginutil.CanRequestProjects(config, o.namespace) | |||
|
|||
o.describer = &describe.ProjectStatusDescriber{ | |||
K: kclientset, | |||
KubeClient: kclientset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -578,7 +578,7 @@ func (p *pruner) addDeploymentsToGraph(dmnts *kapisext.DeploymentList) []error { | |||
d := &dmnts.Items[i] | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind moving DaemonSets as well, it's the function before this one?
@@ -578,7 +578,7 @@ func (p *pruner) addDeploymentsToGraph(dmnts *kapisext.DeploymentList) []error { | |||
d := &dmnts.Items[i] | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for ReplicaSets a few lines below.
b035d04
to
86a8bc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
/retest |
c587158
to
02412d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[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.
Needs 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: