centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 273 forks source link

[cloud::kubernetes::plugin] error 404 when it list the cronjobs #4713

Closed FreshardF closed 2 weeks ago

FreshardF commented 10 months ago

Hello,

I think than the uri for api cronjob have change in GCP kubernetes (GKE).

old uri : /apis/batch/v1beta1/cronjobs

new uri : /apis/batch/v1/cronjobs

test: beta uri : curl -H "Authorization: Bearer " -H "Accept: application/json" -H "User-Agent: centreon::plugins::backend::http::useragent" https://TTT.PPP.YYYY.XXX:443**/apis/batch/v1beta1/cronjobs**?limit=100 -k

{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}

no beta uri : curl -H "Authorization: Bearer " -H "Accept: application/json" -H "User-Agent: centreon::plugins::backend::http::useragent" https://TTT.PPP.YYYY.XXX:443**/apis/batch/v1/cronjobs**?limit=100 -k

{"kind":"CronJobList","apiVersion":"batch/v1","metadata":{"resourceVersion":"142751960"},"items":[]}

Emanuel-Bourel commented 3 months ago

Good morning,

the problem is still present on the version Global Version: 20240411 (e7bf805) of the centreon_kubernetes_api.pl plugins.

So I modified the line 8774 url_path => $self->{namespace} ne '' ? '/apis/batch/v1beta1/namespaces/' . $self->{namespace} . '/cronjobs': '/apis/batch/v1beta1/cronjobs'

in

url_path => $self->{namespace} ne '' ? '/apis/batch/v1/namespaces/' . $self->{namespace} . '/cronjobs': '/apis/batch/v1/cronjobs'

can you support this modification? Regards

lucie-dubrunfaut commented 2 months ago

Hello :)

This issue is at this moment supported by this PR https://github.com/centreon/centreon-plugins/pull/5026/files could you confirm it to me? I'll close it when the PR will be integrated (it's planned in the coming weeks)

lucie-dubrunfaut commented 2 weeks ago

Hello :)

This issue was resolved with the August release and the following PR: https://github.com/centreon/centreon-plugins/pull/5109