You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When performing a server-side-apply patch of a deployment which contains a container that has duplicate environment variables with the same name, the api server returns status code 500 and the client continuously retries the same action.
Fabric8 Kubernetes Client version
6.13.5
Steps to reproduce
An example of the server-side-apply using kubectl:
As seen here, the api server returns 500. When performing the same server-side-apply using the Java client:
var deployment = new DeploymentBuilder()
.withNewMetadata()
.withName("admin-service")
.endMetadata()
.withNewSpec()
.withNewTemplate()
.withNewSpec()
.addNewContainer()
.withName("app")
.addNewEnv()
.withName("foo")
.withValue("x")
.endEnv()
.addNewEnv()
.withName("foo")
.withValue("y")
.endEnv()
.endContainer()
.endSpec()
.endTemplate()
.endSpec()
.build();
var pc = new PatchContext.Builder().withForce(true).withPatchType(PatchType.SERVER_SIDE_APPLY).build();
K8S.resource(deployment).patch(pc);
The client gets stuck on the patch(pc) call since the StandardHttpClient continuously retries the same REST call in shouldRetry:
if (code == 429 || code >= 500) {
retryInterval = Math.max(retryAfterMillis(httpResponse), retryInterval);
LOG.debug(
"HTTP operation on url: {} should be retried as the response code was {}, retrying after {} millis",
request.uri(), code, retryInterval);
return retryInterval;
}
Expected behavior
The call to patch(PatchContext) should fail and not be retried in this case.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
Linux
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered:
The problem is that the server is responding with a server error (5xx) to what seems to be a client error (4xx).
This is why the client is automatically retrying with the backoff interval.
I'm not sure why in this case, the server is returning this HTTP status when the problem clearly seems to be in the client-side when sending an invalid body.
Describe the bug
When performing a server-side-apply patch of a deployment which contains a container that has duplicate environment variables with the same name, the api server returns status code 500 and the client continuously retries the same action.
Fabric8 Kubernetes Client version
6.13.5
Steps to reproduce
An example of the server-side-apply using
kubectl
:As seen here, the api server returns 500. When performing the same server-side-apply using the Java client:
The client gets stuck on the
patch(pc)
call since theStandardHttpClient
continuously retries the same REST call inshouldRetry
:Expected behavior
The call to
patch(PatchContext)
should fail and not be retried in this case.Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
Linux
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: