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

OpenShift s2i binary builds seem broken in 6.3 #4735

Closed
manusa opened this issue Jan 5, 2023 · 4 comments
Closed

OpenShift s2i binary builds seem broken in 6.3 #4735

manusa opened this issue Jan 5, 2023 · 4 comments
Assignees
Milestone

Comments

@manusa
Copy link
Member

manusa commented Jan 5, 2023

Describe the bug

While upgrading Eclipse JKube to use Kubernetes Client 6.3.1 eclipse-jkube/jkube#1988, we've detected that binary builds are not completed.

It seems that the binary upload is not working as expected and the HTTP request never completes.

The call:

client.buildConfigs()
  .inNamespace(namespace)
  .withName(buildName)
  .instantiateBinary()
  .fromFile(binaryTarFile);

will hang forever.

There's a very simple unit test to verify this logic:

void testBinaryBuildFromFileWithDefaults() throws IOException {

But there's no real e2e test verifying this scenario.

Fabric8 Kubernetes Client version

6.3.1

Steps to reproduce

Create an OpenShift binary build:

client.buildConfigs()
  .inNamespace(namespace)
  .withName(buildName)
  .instantiateBinary()
  .fromFile(binaryTarFile);

Expected behavior

The binary build should complete successfully

Runtime

OpenShift

Kubernetes API Server version

other (please specify in additional context)

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

Point of failure:

return waitForResult(handleResponse(newClient, requestBuilder, new TypeReference<Build>() {
@Override
public Type getType() {
return Build.class;
}

protected <T> T waitForResult(CompletableFuture<T> future) throws IOException {

@shawkins
Copy link
Contributor

shawkins commented Jan 6, 2023

Ignore my previous comment. This is the place in the code that uses expectContinue - which is broken against things like the mock server depending upon which client is be used. What client is being used in this scenario?

@manusa
Copy link
Member Author

manusa commented Jan 7, 2023

What client is being used in this scenario?

OkHttp / OpenShiftClient

https://github.com/eclipse/jkube/blob/d7b92219c2fe94d68831e9016b943d851a0040e0/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/openshift/OpenshiftBuildService.java#L443

When upgrading JKube to 6.3.1 (eclipse-jkube/jkube#1988) the oc:build goal which performs an S2i binary build will freeze in the step in which the binary is uploaded to the server. Cancelling the local operation after a while will unlock the server process so the cluster will continue with the build. It's my understanding that the binary is uploaded, but the client doesn't get notified of the request completion (but need to investigate more though)

@manusa
Copy link
Member Author

manusa commented Jan 11, 2023

It seems that the Expect header is using a wrong value:

This value is case-sensitive and should be 100-continue instead.

Since expectContinue is used here:

and this is the switch to the constant is the most notable change between 6.1 and 6.3, it's very likely that the problem is related to it.

An easy way to check this is by using the JDK client instead, since it's not relying on the constant.

@manusa manusa self-assigned this Jan 13, 2023
@manusa manusa added this to the 6.4.0 milestone Jan 16, 2023
@manusa
Copy link
Member Author

manusa commented Jan 16, 2023

Should be fixed by #4766

@manusa manusa closed this as completed Jan 16, 2023
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

No branches or pull requests

2 participants