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

[tink-worker] Use workflowID instead of workerID in getWorkflowData #604

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

detiber
Copy link
Contributor

@detiber detiber commented Apr 6, 2022

Description

All other workflow data operations in tink-worker are using workflowID, this aligns getWorkflowData to use the same convention.

Why is this needed

This was causing tink-worker to fail to successfully run through workflows complaining that it couldn't open the right data file for tracking the workflow.

How Has This Been Tested?

Tested this locally using the sandbox configured to use the latest published components, and a version of tink-worker that I had build and pushed to a registry that I control.

How are existing users impacted? What migration steps/scripts do we need?

No existing users should be impacted, since the issue does not exist in the previous sandbox release.

@detiber
Copy link
Contributor Author

detiber commented Apr 6, 2022

/assign @micahhausler @jacobweinstock

@detiber detiber self-assigned this Apr 6, 2022
@detiber detiber requested a review from micahhausler April 6, 2022 18:56
Copy link
Contributor

@micahhausler micahhausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #604 (838a8a6) into main (d3512cb) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #604   +/-   ##
=======================================
  Coverage   45.96%   45.96%           
=======================================
  Files          56       56           
  Lines        3283     3283           
=======================================
  Hits         1509     1509           
  Misses       1684     1684           
  Partials       90       90           
Impacted Files Coverage Δ
cmd/tink-worker/worker/worker.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3512cb...838a8a6. Read the comment docs.

detiber added a commit to detiber/sandbox that referenced this pull request Apr 6, 2022
@@ -471,7 +471,7 @@ func (w *Worker) getWorkflowData(ctx context.Context, workflowID string) {
}

if len(res.GetData()) != 0 {
wfDir := filepath.Join(w.dataDir, w.workerID)
wfDir := filepath.Join(w.dataDir, workflowID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do we know these are the same values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other places where we are creating the filepath for the data directory, we are using workflowID.

See lines 317 and 498 in this file. Without this change, tink-worker exits pre-maturely trying to access a directory that doesn't exist (created using the workerID instead of the workflowID).

@jacobweinstock jacobweinstock added the ready-to-merge Signal to Mergify to merge the PR. label Apr 6, 2022
@detiber
Copy link
Contributor Author

detiber commented Apr 6, 2022

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Apr 6, 2022

refresh

✅ Pull request refreshed

@austinpapp
Copy link

Thanks 🌮👍

@mergify mergify bot merged commit 08a2e12 into tinkerbell:main Apr 6, 2022
@detiber detiber deleted the idBug branch April 6, 2022 22:29
@displague displague added this to the 0.7.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Signal to Mergify to merge the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants