Repository: kubernetes
Issue: failed to get api resources with kubectl 1.30
Labels: kind/bug,kind/support,sig/api-machinery,sig/cli,triage/accepted

### What happened?

we installed Istio CRD within standard container to perform some upgrade test, mainly the installation below CRD 

```
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: fortio
spec:
  hosts:
  - '*'
  gateways:
  - fortio-gateway
  http:
  - route:
    - destination:
        host: fortio
        port:
          number: 8080
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: fortio-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - hosts:
    - '*'
    port:
      name: http
      number: 80
      protocol: HTTP`
```

it depends on the api resources to be available, while the default kubelctl is 1.30, it does not list the api-resources with "Istio"
```
bash-4.4$ kubectl api-resources |grep istio
bash-4.4$ 
```
while if I change to use a 1.29 kubectl, it will list the istio api-resources; then I run with 1.30 kubectl again, it can get the Istio api resources as well. But if I don't run the 1.29 kubect, we kee retry, it take 10 + mins to get the Istio api -resources using 1.30 kubectl. 


```
bash-4.4$ /tmp/kubectl.129 api-resources |grep istio
adapters                                         config.istio.io/v1alpha2          true         adapter
attributemanifests                               config.istio.io/v1alpha2          true         attributemanifest
handlers                                         config.istio.io/v1alpha2          true         handler
httpapispecbindings                              config.istio.io/v1alpha2          true         HTTPAPISpecBinding
httpapispecs                                     config.istio.io/v1alpha2          true         HTTPAPISpec
instances                                        config.istio.io/v1alpha2          true         instance
quotaspecbindings                                config.istio.io/v1alpha2          true         QuotaSpecBinding
quotaspecs                                       config.istio.io/v1alpha2          true         QuotaSpec
rules                                            config.istio.io/v1alpha2          true         rule
templates                                        config.istio.io/v1alpha2          true         template
wasmplugins                                      extensions.istio.io/v1alpha1      true         WasmPlugin
destinationrules                    dr           networking.istio.io/v1beta1       true         DestinationRule
envoyfilters                                     networking.istio.io/v1alpha3      true         EnvoyFilter
gateways                            gw           networking.istio.io/v1beta1       true         Gateway
proxyconfigs                                     networking.istio.io/v1beta1       true         ProxyConfig
serviceentries                      se           networking.istio.io/v1beta1       true         ServiceEntry
sidecars                                         networking.istio.io/v1beta1       true         Sidecar
virtualservices                     vs           networking.istio.io/v1beta1       true         VirtualService
workloadentries                     we           networking.istio.io/v1beta1       true         WorkloadEntry
workloadgroups                      wg           networking.istio.io/v1beta1       true         WorkloadGroup
rbacconfigs                                      rbac.istio.io/v1alpha1            true         RbacConfig
servicerolebindings                              rbac.istio.io/v1alpha1            true         ServiceRoleBinding
serviceroles                                     rbac.istio.io/v1alpha1            true         ServiceRole
authorizationpolicies                            security.istio.io/v1beta1         true         AuthorizationPolicy
peerauthentications                 pa           security.istio.io/v1beta1         true         PeerAuthentication
requestauthentications              ra           security.istio.io/v1beta1         true         RequestAuthentication
telemetries                         telemetry    telemetry.istio.io/v1alpha1       true         Telemetry
```


### What did you expect to happen?

There shall be no delay of 10+ mins by using the 1.30 kubectl to get the api resoures

### How can we reproduce it (as minimally and precisely as possible)?

1. running from docker container
```
docker --version
Docker version 24.0.7, build 24.0.7-0ubuntu2~22.04.1
```
2. install Istio api-resources
3. using 1.30 kubectl to get the Istio api -resources
```
kubectl api-resources |grep istio
```

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
Client Version: v1.30.7
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.31.1

```

</details>


### Cloud provider

<details>
Kubeadm brought up cluster
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>