fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.41k stars 1.46k forks source link

OpenshiftClient scale deploymentConfig Error #5236

Closed cgcgccg closed 1 year ago

cgcgccg commented 1 year ago

Describe the bug

When I use openshift-client v6.7.1 to scale openshift deploymentConfig like below:

image

It will return error like this:

image

Fabric8 Kubernetes Client version

6.7.1

Steps to reproduce

Init openshift client then use scale func will return this error

Expected behavior

openshift client can scale deploymentConfig normal

Runtime

OpenShift

Kubernetes API Server version

1.25.3@latest

Environment

Windows, Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

manusa commented 1 year ago

We changed the way we scale resources to use the scale subresource. Maybe the OpenShift cluster is not supporting this operation. Could you share your cluster details (version, and so on).

/cc @shawkins

cgcgccg commented 1 year ago

We changed the way we scale resources to use the scale subresource. Maybe the OpenShift cluster is not supporting this operation. Could you share your cluster details (version, and so on).

/cc @shawkins

Hi, this is the version info: Openshift version : 4.10 and

image
shawkins commented 1 year ago

Yes more than likely DeploymetConfigs don't support v1 scale. We have overriden support for jobs and v1beta1 resources that will likely be applicable here.

shawkins commented 1 year ago

Sure enough:

{"kind":"Scale","apiVersion":"extensions/v1beta1", ...

Supprising that it's still using the deprecated api.

cgcgccg commented 1 year ago

Sure enough:

{"kind":"Scale","apiVersion":"extensions/v1beta1", ...

Supprising that it's still using the deprecated api.

Thanks shawkins. So that's mean I should config my openshift-client apiVersion is v1beta1, is right?

shawkins commented 1 year ago

So that's mean I should config my openshift-client apiVersion is v1beta1, is right?

No, it means that /scale on a DeploymentConfig resource understands v1beta1 scale, not v1.

I guess they haven't committed to addressing this upstream: https://bugzilla.redhat.com/show_bug.cgi?id=1931897 https://issues.redhat.com/browse/OCPBUGS-865

cgcgccg commented 1 year ago

I understand. Thanks.

manusa commented 1 year ago

So that's mean I should config my openshift-client apiVersion is v1beta1, is right?

We'll probably release a 6.7 patch to address this and other issues.