Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Raposo <[email protected]>
  • Loading branch information
RRap0so committed Nov 15, 2024
1 parent 404056a commit 6a371a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ func (p *Plugin) Status(ctx context.Context, taskCtx webapi.StatusContext) (phas
resource := taskCtx.Resource().(ResourceWrapper)
taskInfo := &core.TaskInfo{Logs: resource.LogLinks, CustomInfo: resource.CustomInfo}
errorCode := pluginErrors.TaskFailedWithError
if resource.AgentError != nil && resource.AgentError.Code != "" {
errorCode = resource.AgentError.Code
if resource.AgentError != nil && resource.AgentError.GetCode() != "" {
errorCode = resource.AgentError.GetCode()
}

switch resource.Phase {
Expand Down
6 changes: 3 additions & 3 deletions flyteplugins/go/tasks/plugins/webapi/agent/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ func TestPlugin(t *testing.T) {
phase, err := plugin.Status(context.Background(), taskContext)
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhasePermanentFailure, phase.Phase())
assert.Equal(t, "ERROR: 500", phase.Err().Code)
assert.Equal(t, "failed to run the job: boom", phase.Err().Message)
assert.Equal(t, "ERROR: 500", phase.Err().GetCode())
assert.Equal(t, "failed to run the job: boom", phase.Err().GetMessage())
})

t.Run("test TaskExecution_FAILED Status Without Agent Error", func(t *testing.T) {
Expand All @@ -292,7 +292,7 @@ func TestPlugin(t *testing.T) {
phase, err := plugin.Status(context.Background(), taskContext)
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhasePermanentFailure, phase.Phase())
assert.Equal(t, pluginErrors.TaskFailedWithError, phase.Err().Code)
assert.Equal(t, pluginErrors.TaskFailedWithError, phase.Err().GetCode())
})

t.Run("test UNDEFINED Phase", func(t *testing.T) {
Expand Down

0 comments on commit 6a371a0

Please sign in to comment.