-
Notifications
You must be signed in to change notification settings - Fork 32
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
support new event version #171
support new event version #171
Conversation
@junotx @wanjunlei pls help to review |
080938e
to
8d3a49c
Compare
cmd/exporter/main.go
Outdated
masterURL string | ||
kubeconfig string | ||
configFile string | ||
newEventType bool |
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.
Use eventVersion
instead, known values are corev1
and eventsv1
|
||
ns, err := client.CoreV1().Namespaces().Get(context.Background(), "kubesphere-system", metav1.GetOptions{}) | ||
if err != nil { | ||
klog.Errorf("get namespace kubesphere-system error: %s", err) |
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.
The function needs to exit here, otherwise, ns will be nil and the following code will report an error.
@@ -4,6 +4,10 @@ import ( | |||
"context" | |||
"errors" | |||
"fmt" | |||
"github.com/kubesphere/kube-events/pkg/util" |
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.
imports not sort
The ruler should be changed too. |
pkg/exporter/kube_events_exporter.go
Outdated
@@ -6,6 +6,11 @@ import ( | |||
"fmt" | |||
"sync" | |||
|
|||
"github.com/kubesphere/kube-events/pkg/util" | |||
v1 "k8s.io/api/events/v1" |
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.
v1 "k8s.io/api/events/v1" | |
eventsv1 "k8s.io/api/events/v1" |
7d6f812
to
573ba1e
Compare
the arg name is still |
573ba1e
to
6e86d89
Compare
setCluster(client) | ||
c := time.Tick(60 * time.Second) | ||
for { | ||
select { |
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.
成功一次还需要继续 loop 吗
民生银行那个是怎么出错的可以重现吗,他的情况我理解如果第一次没有成功从 annotation获取到 cluster name,retry 到成功就可以了。
会有 cluster 改名的情况吗,很少吧
6e86d89
to
04909f3
Compare
newEventType
参数为true
开启,默认为false
旧版事件输出
新版事件输出