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

Revert "Add state to event handler to track logrus output events" #6306

Merged
merged 1 commit into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pkg/skaffold/event/v2/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ var handler = newHandler()
func newHandler() *eventHandler {
h := &eventHandler{
eventChan: make(chan *proto.Event),
task: constants.DevLoop,
}
go func() {
for {
Expand All @@ -74,7 +73,6 @@ type eventHandler struct {
cfg Config

iteration int
task constants.Phase
state proto.State
stateLock sync.Mutex
eventChan chan *proto.Event
Expand Down Expand Up @@ -305,7 +303,6 @@ func TaskInProgress(task constants.Phase, description string) {
handler.applicationLogs = []proto.Event{}
}

handler.task = task
handler.handleTaskEvent(&proto.TaskEvent{
Id: fmt.Sprintf("%s-%d", task, handler.iteration),
Task: string(task),
Expand All @@ -316,7 +313,6 @@ func TaskInProgress(task constants.Phase, description string) {
}

func TaskFailed(task constants.Phase, err error) {
handler.task = constants.DevLoop
ae := sErrors.ActionableErrV2(handler.cfg, task, err)
handler.handleTaskEvent(&proto.TaskEvent{
Id: fmt.Sprintf("%s-%d", task, handler.iteration),
Expand All @@ -328,7 +324,6 @@ func TaskFailed(task constants.Phase, err error) {
}

func TaskSucceeded(task constants.Phase) {
handler.task = constants.DevLoop
handler.handleTaskEvent(&proto.TaskEvent{
Id: fmt.Sprintf("%s-%d", task, handler.iteration),
Task: string(task),
Expand Down
6 changes: 2 additions & 4 deletions pkg/skaffold/event/v2/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,8 @@ func (h logHook) Levels() []logrus.Level {
// Fire constructs a SkaffoldLogEvent and sends it to the event channel
func (h logHook) Fire(entry *logrus.Entry) error {
handler.handleSkaffoldLogEvent(&proto.SkaffoldLogEvent{
TaskId: fmt.Sprintf("%s-%d", handler.task, handler.iteration),
SubtaskId: SubtaskIDNone,
Level: levelFromEntry(entry),
Message: entry.Message,
Level: levelFromEntry(entry),
Message: entry.Message,
})
return nil
}
Expand Down