-
Notifications
You must be signed in to change notification settings - Fork 712
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
Conversation
2e0e111
to
3e5f920
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.
One minor issue and a possible significant simplification. If you do the latter (separate commit, please), I'd want to take another look.
probe/kubernetes/client.go
Outdated
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.
This comment was marked as abuse.
Sorry, something went wrong.
probe/kubernetes/controls.go
Outdated
@@ -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.
This comment was marked as abuse.
Sorry, something went wrong.
They are not reported back to the scope app.
3e5f920
to
9f42e1c
Compare
probe/kubernetes/controls.go
Outdated
@@ -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.
This comment was marked as abuse.
Sorry, something went wrong.
probe/kubernetes/controls.go
Outdated
break | ||
} | ||
if u, ok := report.ParseDeploymentNodeID(req.NodeID); ok { | ||
resource, uid = report.Deployment, u |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
probe/kubernetes/controls.go
Outdated
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.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
b14cb95
to
7f95e51
Compare
The function now only takes Deployments into account.
7f95e51
to
50b182b
Compare
They are not reported back to the scope app.
Fixes #3010