Skip to content

Commit

Permalink
Return nil if ResourceMeta is nil when deleting the node (flyteorg#310)
Browse files Browse the repository at this point in the history
* wip

Signed-off-by: Kevin Su <pingsutw@apache.org>

* wip

Signed-off-by: Kevin Su <pingsutw@apache.org>

* wip

Signed-off-by: Kevin Su <pingsutw@apache.org>

* transition to failed state if task isn't created

Signed-off-by: Kevin Su <pingsutw@apache.org>

* wip

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* fix

Signed-off-by: Kevin Su <pingsutw@apache.org>

* fix

Signed-off-by: Kevin Su <pingsutw@apache.org>

---------

Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Mar 1, 2023
1 parent acb6297 commit c2c633e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions flyteplugins/go/tasks/plugins/webapi/databricks/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
}

func (p Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error {
if taskCtx.ResourceMeta() == nil {
return nil
}
exec := taskCtx.ResourceMeta().(ResourceMetaWrapper)
req, err := buildRequest(post, nil, p.cfg.databricksEndpoint,
p.cfg.DatabricksInstance, exec.Token, exec.RunID, true)
Expand Down
3 changes: 3 additions & 0 deletions flyteplugins/go/tasks/plugins/webapi/snowflake/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ func (p Plugin) Get(ctx context.Context, taskCtx webapi.GetContext) (latest weba
}

func (p Plugin) Delete(ctx context.Context, taskCtx webapi.DeleteContext) error {
if taskCtx.ResourceMeta() == nil {
return nil
}
exec := taskCtx.ResourceMeta().(*ResourceMetaWrapper)
req, err := buildRequest(post, QueryInfo{}, p.cfg.snowflakeEndpoint,
exec.Account, exec.Token, exec.QueryID, true)
Expand Down

0 comments on commit c2c633e

Please sign in to comment.