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

Fix context propagation for bootstrap and server checks #8924

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

akorneta
Copy link
Contributor

What does this PR do?

After the merge of #8836, we got a problem with start of workspaces in rh-che. The reason for these failures is there are no token in environment context while a machine is bootstrapping. The absence of the token in context causes the kubernetes client to attempt to make requests on behalf of an anonymous user.

@akorneta akorneta added kind/bug Outline of a bug - must adhere to the bug report template. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Feb 27, 2018
@akorneta akorneta self-assigned this Feb 27, 2018
Copy link
Contributor

@davidfestal davidfestal left a comment

Choose a reason for hiding this comment

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

With the change it seems to provide the right environment context to the threads that effectively perform the workspace start.
And multi-tenant rh-che on Che6 is not broken anymore.
So approving even if I didn't catch fully how environment context propagation works.

Copy link
Member

@sleshchenko sleshchenko left a comment

Choose a reason for hiding this comment

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

LGTM

serversAndProbesFuture.whenComplete((ok, ex) -> serversReadyFuture.cancel(true));
} catch (InfrastructureException ex) {
serversAndProbesFuture.completeExceptionally(ex);
EnvironmentContext.setCurrent(context);

Choose a reason for hiding this comment

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

What if there would be a method that wraps anything with context setting. Would the code be simpler with less indentation (which leads to complexity of code reading)?
Example:

.thenCompose(setContext(context, bootstrap(toCancelFutures, machine)))

Copy link
Contributor Author

@akorneta akorneta Feb 27, 2018

Choose a reason for hiding this comment

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

sure, that makes sense, I'll think about that

@akorneta akorneta merged commit 188bd5b into master Feb 27, 2018
@akorneta akorneta deleted the fix-context-propagation branch February 27, 2018 13:54
@akorneta akorneta removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Feb 27, 2018
@benoitf benoitf added this to the 6.2.0 milestone Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants