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

Make brokers pod use a unique name to avoid collisions #12518

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private Container newContainer(
private Pod newPod() {
return new PodBuilder()
.withNewMetadata()
.withName(BROKERS_POD_NAME)
.withName(generateUniqueName(BROKERS_POD_NAME))
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be better to prefix BrokerPodName with workspace id if it is possible

Copy link
Member

Choose a reason for hiding this comment

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

Looks like you changed code line and no tests affected. I do not think that it is critical functionality that must be tested by still it would be nice to have some check in tests.

Copy link
Author

Choose a reason for hiding this comment

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

Workspace ID would not help to make it unique. Do you mean another purpose?

Copy link
Author

Choose a reason for hiding this comment

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

How to test that something was randomly generated? Should I just test that it starts from something? I do not think such tests are really needed.

Copy link
Member

Choose a reason for hiding this comment

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

As far as I know, there should be one Plugin Broker pod for one starting workspace. Could you elaborate why prefixing with workspace id won't help prevent failure of starting several workspaces concurrently?

Copy link
Member

Choose a reason for hiding this comment

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

Well, I see that name should be prefixed by environmentProvisioner here https://github.com/eclipse/che/blob/a4f8410e6e3bc1797baa10142079f71675596766/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/wsplugins/PluginBrokerManager.java#L104.
But wonder why there are any issues with starting several Che 7 workspaces concurrently in the same kubernetes namespace.

Copy link
Author

Choose a reason for hiding this comment

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

Because if we start several workspaces we start several brokers pods

Copy link
Member

Choose a reason for hiding this comment

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

But they are named workspace2hedhs4g-plugin-broker, workspace90rfhjcgg-plugin-broker, etc. And they are not conflicting. Did I miss something?

Copy link
Author

Choose a reason for hiding this comment

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

You are right. Closing this PR since it is not needed

.endMetadata()
.withNewSpec()
.withRestartPolicy("Never")
Expand Down