Skip to content

Commit

Permalink
fix not proper log message (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanYiLin authored and k8s-ci-robot committed Jul 18, 2018
1 parent 21f3ea4 commit 46808ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/controller.v2/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,19 @@ func (tc *TFJobController) processNextWorkItem() bool {

tfJob, err := tc.getTFJobFromKey(key.(string))
if err != nil {
log.Errorf("Failed to get TFJob from key %s: %v", key, err)
if err == errNotExists {
log.Infof("TFJob has been deleted: %v", key)
return true
}

// Log the failure to conditions.
log.Errorf("Failed to get TFJob from key %s: %v", key, err)
if err == errFailedMarshal {
errMsg := fmt.Sprintf("Failed to unmarshal the object to TFJob object: %v", err)
loggerForTFJob(tfJob).Warn(errMsg)
tc.recorder.Event(tfJob, v1.EventTypeWarning, failedMarshalTFJobReason, errMsg)
}

return true
}

Expand Down

0 comments on commit 46808ba

Please sign in to comment.