-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Abstracting pod interface in kubernetes plugin to enable easier vendoring #4152
Conversation
d3fb9f4
to
dfc223b
Compare
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
1 similar comment
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run. |
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.
I like the introduction of the interface so each beat is not dependent on the kubernetes API directly.This will make it also possible to potentially change the client without breaking the beats implementations.
Also great that we have now local vendor dir.
@@ -8,6 +8,8 @@ import ( | |||
"github.com/elastic/beats/libbeat/common" | |||
"github.com/elastic/beats/libbeat/logp" | |||
|
|||
"encoding/json" |
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.
some goimports fun ...
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.
bleh! i hate it when it does that.
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.
updated.
@@ -160,187 +160,6 @@ | |||
"revisionTime": "2016-09-16T08:04:11Z" | |||
}, | |||
{ | |||
"checksumSHA1": "K0iEPnt2DZL5/YrrzAQoMnA+9Pc=", |
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.
👍
@exekias Could also please have a look? |
jenkins, test it |
dfc223b
to
352f637
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.
Great contribution, should make external plugins leaner and fixes vendoring, thanks!
Left 2 minor comments, LGTM once addressed
@@ -20,7 +20,7 @@ import ( | |||
"github.com/elastic/beats/filebeat/spooler" | |||
|
|||
// Add filebeat level processors | |||
_ "github.com/elastic/beats/filebeat/processors/kubernetes" | |||
_ "github.com/elastic/beats/filebeat/processor/kubernetes" |
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.
I think we should keep consistency with libbeat (which uses processors
)
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.
@exekias I disagree on this one as we should change it for some time in libbeat to processor
. It is processors
for historical reasons.
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.
Ok then, it seems this was agreed some time ago 👍
|
||
for _, index := range p.indexers.GetIndexes(pod) { | ||
delete(p.annotationCache.annotations, index) | ||
} | ||
} | ||
|
||
func (p *PodWatcher) getPodMeta(pod *corev1.Pod) *Pod { | ||
|
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.
Could you please remove the spurious empty lines at the beginning and end of this function?
352f637
to
bcbae50
Compare
When a user creates an Indexer outside of the beats repo, he/she needs to vendor in the k8s repo. This should ideally be unnecessary as the retrieval of Pods is abstracted from the user. This PR aims at adding a wrapper struct
Pod
which would be passed to Indexers to retrieve metadata.