knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
354 stars 261 forks source link

Distinguish missing Serving/Eventing API from unsupported version #1858

Closed dsimansk closed 7 months ago

dsimansk commented 1 year ago

Feature request

In the current implementation when kn is unable to query Knative resource, we display combined "no or newer" error on missing API or incompatible API.

Per feedback from users, that might be confusing how to approach the troubleshooting of such issue with the Knative installation.

Error: no or newer Knative Serving API found on the backend, please verify the installation or update the 'kn' client

Use case

There are 2 main scenarios to cover:

  1. There's no Knative Serving/Eventing API found on the cluster. This might be mangled installation, operators still installing, missing CRDs, controllers not up.
Error: no Knative Serving API found on the backend, please verify the installation
  1. The incompatible API version, e.g. removed v1alpha1 and therefore backend x kn mismatch.
    Error: incompatible Knative Serving API found on the backend, please verify the installation or update the 'kn' client to matchin version

/cc @rhuss

rhuss commented 1 year ago

For scenario 1, I guess or udpdate the kn client won't help :-)

dsimansk commented 1 year ago

For scenario 1, I guess or udpdate the kn client won't help :-)

Yep, fixed the proposed errors.

xiangpingjiang commented 1 year ago

/assign @xiangpingjiang

xiangpingjiang commented 1 year ago

@dsimansk Hello, David

To resolve this issue, my idea is when client gets an no or newer Knative Serving API found on the backend error, client need to get all knative crds installed in the cluster, if there is a crd same with requested resource but different version, the error becomes incompatible Knative Serving API found on the backend, otherwise the error becomes no Knative Serving API found on the backend .

Do you think is it ok ?

rhuss commented 1 year ago

Sounds good, I think you can get over the /apis endpoint and I also think its good enough to check whether there is a KService resource in any version, then --> "no Knative API found", otherwise just assume that that there is a version mismatch (the only other possible error),. so no need to really check the version.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

rhuss commented 11 months ago

/remove-lifecycle stale

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.