Skip to content
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

Stop fetching ReplicaSets and ReplicationControllers #3014

Merged
merged 2 commits into from
Jan 15, 2018

Conversation

rbruggem
Copy link
Contributor

@rbruggem rbruggem commented Jan 3, 2018

They are not reported back to the scope app.

Fixes #3010

@rbruggem rbruggem force-pushed the stop-fetching-replicasets branch from 2e0e111 to 3e5f920 Compare January 3, 2018 16:20
Copy link
Member

@rade rade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor issue and a possible significant simplification. If you do the latter (separate commit, please), I'd want to take another look.

result.nodeStore = result.setupStore(c.CoreV1Client.RESTClient(), "nodes", &apiv1.Node{}, nil)
result.namespaceStore = result.setupStore(c.CoreV1Client.RESTClient(), "namespaces", &apiv1.Namespace{}, nil)

// We list deployments here to check if this version of kubernetes is >= 1.2.
// We would use NegotiateVersion, but Kubernetes 1.1 "supports"
// extensions/v1beta1, but not deployments, replicasets or daemonsets.
// extensions/v1beta1, but not deployments or daemonsets.
if _, err := c.Extensions().Deployments(metav1.NamespaceAll).List(metav1.ListOptions{}); err != nil {
log.Infof("Deployments, ReplicaSets and DaemonSets are not supported by this Kubernetes version: %v", err)

This comment was marked as abuse.

@@ -83,7 +83,6 @@ func (r *Reporter) CaptureResource(f func(xfer.Request, string, string, string)
f func(string) (string, bool)
}{
{report.Deployment, report.ParseDeploymentNodeID},
{report.ReplicaSet, report.ParseReplicaSetNodeID},

This comment was marked as abuse.

They are not reported back to the scope app.
@rbruggem rbruggem force-pushed the stop-fetching-replicasets branch from 3e5f920 to 9f42e1c Compare January 4, 2018 10:55
@@ -78,33 +78,21 @@ func (r *Reporter) CapturePod(f func(xfer.Request, string, string) xfer.Response
func (r *Reporter) CaptureResource(f func(xfer.Request, string, string, string) xfer.Response) func(xfer.Request) xfer.Response {

This comment was marked as abuse.

break
}
if u, ok := report.ParseDeploymentNodeID(req.NodeID); ok {
resource, uid = report.Deployment, u

This comment was marked as abuse.

return nil
})
if deployment != nil {
return f(req, "deployment", deployment.Namespace(), deployment.Name())

This comment was marked as abuse.

This comment was marked as abuse.

@rbruggem rbruggem force-pushed the stop-fetching-replicasets branch 2 times, most recently from b14cb95 to 7f95e51 Compare January 8, 2018 17:46
The function now only takes Deployments into account.
@rbruggem rbruggem force-pushed the stop-fetching-replicasets branch from 7f95e51 to 50b182b Compare January 11, 2018 17:08
@rade rade requested review from rade and removed request for rade January 14, 2018 13:57
@rbruggem rbruggem merged commit f42e220 into master Jan 15, 2018
@rbruggem rbruggem deleted the stop-fetching-replicasets branch January 15, 2018 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants