Skip to content

Commit

Permalink
code review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty committed Jan 18, 2023
1 parent 14f8791 commit 45aa516
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/init-container/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {
eventBroadcast := util.NewRecorder(ctx, kubeClient)
defer eventBroadcast.Shutdown()

recorder := eventBroadcast.NewRecorder(scheme.Scheme, v1.EventSource{Component: "k8s.io.api.core.v1.Pod"})
recorder := eventBroadcast.NewRecorder(scheme.Scheme, v1.EventSource{Component: "virtual kubelet"})
vkVersion, err := strconv.ParseBool(os.Getenv("USE_VK_VERSION_2"))
if err != nil {
log.G(ctx).Warn("cannot get USE_VK_VERSION_2 environment variable, the provider will use VK version 1. Skipping init container checks")
Expand Down
5 changes: 2 additions & 3 deletions pkg/util/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import (
func NewRecorder(ctx context.Context, kubeClient *kubernetes.Clientset) record.EventBroadcaster {
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartStructuredLogging(3)
if eventBroadcaster != nil && kubeClient != nil {
eventBroadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")})
}
eventBroadcaster.StartRecordingToSink(&corev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")})

return eventBroadcaster
}

0 comments on commit 45aa516

Please sign in to comment.