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

Use job tokens for log chunk uploads #2986

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Conversation

tessereth
Copy link
Contributor

@tessereth tessereth commented Sep 11, 2024

In #2915 we refactored a bunch of this code. In the process, we now take a copy of the apiClient object in NewJobRunner before we replace the apiClient with a new one that uses the job token rather than the session token. We then use the copy for log streaming. This means agents since v3.77.0 use session tokens rather than job tokens for chunk uploads.

I've tested it locally and this change fixes the problem. I'm not sure how to add regression tests for this though. This is tested by updating the fake bk server in the integration tests to require job tokens for everything.

Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

Whoops! LGTM

@tessereth tessereth force-pushed the job-tokens-chunk-uploads branch 2 times, most recently from 978249e to 9e7e25f Compare September 17, 2024 00:59
Copy link
Contributor

@DrJosh9000 DrJosh9000 left a comment

Choose a reason for hiding this comment

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

LGTM again, one comment for you

agent/integration/test_helpers.go Outdated Show resolved Hide resolved
@tessereth tessereth force-pushed the job-tokens-chunk-uploads branch from 098cb3f to 0e5e12e Compare September 17, 2024 01:21
@tessereth tessereth enabled auto-merge September 17, 2024 01:24
@tessereth tessereth merged commit 12e7aa8 into main Sep 17, 2024
1 check passed
@tessereth tessereth deleted the job-tokens-chunk-uploads branch September 17, 2024 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants