octant
octant copied to clipboard
Issues listing namespace with cronjobs happening on k8s v1.21.4
What steps did you take and what happened: Namespace does not load at all on Octant when it tries to display cronjobs.
What did you expect to happen: Items from workspace to load - cronjobs causing the issue. When displaying only workloads, works fine. When cronjob is part of the view, it fails
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.] Namespace that Octant could not list
[hprado@rancherv2server ~]$ kubectl get all --namespace klustair-scan
NAME READY STATUS RESTARTS AGE
pod/klustair-app-frontend-65cc49594-6nkdq 1/1 Running 0 35m
pod/klustair-app-postgresql-0 1/1 Running 0 35m
pod/klustair-app-runner-58d4d95f95-vfh67 1/1 Running 0 35m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/klustair-app-frontend ClusterIP 10.43.3.162 <none> 80/TCP 35m
service/klustair-app-postgresql ClusterIP 10.43.114.228 <none> 5432/TCP 35m
service/klustair-app-postgresql-headless ClusterIP None <none> 5432/TCP 35m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/klustair-app-frontend 1/1 1 1 35m
deployment.apps/klustair-app-runner 1/1 1 1 35m
NAME DESIRED CURRENT READY AGE
replicaset.apps/klustair-app-frontend-65cc49594 1 1 1 35m
replicaset.apps/klustair-app-runner-58d4d95f95 1 1 1 35m
NAME READY AGE
statefulset.apps/klustair-app-postgresql 1/1 35m
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
cronjob.batch/klustair-app-job 15 9 * * * False 0 <none> 35m
[hprado@rancherv2server ~]$
Log error that repeats when trying to load this namespace:
2021-08-31T13:15:03.378-0300 ERROR api/content_manager.go:159 generate content {"client-id": "8b01d9fa-0a76-11ec-8adc-52540031336b", "err": "generate content: scheme convert: converting (v1.CronJob) to (v1beta1.CronJob): unknown conversion", "content-path": "overview/namespace/klustair-scan"}
github.com/vmware-tanzu/octant/internal/api.(*ContentManager).runUpdate.func1
/__w/octant/octant/internal/api/content_manager.go:159
github.com/vmware-tanzu/octant/internal/api.(*InterruptiblePoller).Run.func1
/__w/octant/octant/internal/api/poller.go:86
github.com/vmware-tanzu/octant/internal/api.(*InterruptiblePoller).Run
/__w/octant/octant/internal/api/poller.go:95
github.com/vmware-tanzu/octant/internal/api.(*ContentManager).Start
/__w/octant/octant/internal/api/content_manager.go:133
2021-08-31T13:15:04.379-0300 ERROR api/content_manager.go:159 generate content {"client-id": "8b01d9fa-0a76-11ec-8adc-52540031336b", "err": "generate content: scheme convert: converting (v1.CronJob) to (v1beta1.CronJob): unknown conversion", "content-path": "overview/namespace/klustair-scan"}
github.com/vmware-tanzu/octant/internal/api.(*ContentManager).runUpdate.func1
/__w/octant/octant/internal/api/content_manager.go:159
github.com/vmware-tanzu/octant/internal/api.(*InterruptiblePoller).Run.func1
/__w/octant/octant/internal/api/poller.go:86
github.com/vmware-tanzu/octant/internal/api.(*InterruptiblePoller).Run
/__w/octant/octant/internal/api/poller.go:95
github.com/vmware-tanzu/octant/internal/api.(*ContentManager).Start
/__w/octant/octant/internal/api/content_manager.go:133
Environment:
- Octant version (use
octant version
):
Version | 0.23.0
Build | fbe2be3b687b3e2199ea32753281c9de1f334171 2021-08-02T22:39:02Z
- Kubernetes version (use
kubectl version
): v1.21.4
[hprado@rancherv2server ~]$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.4", GitCommit:"3cce4a82b44f032d0cd1a1790e6d2f5a55d20aae", GitTreeState:"clean", BuildDate:"2021-08-11T18:10:22Z", GoVersion:"go1.16.7", Compiler:"gc", Platform:"linux/amd64"}
- OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc): Fedora 34
batch/v1beta1 CronJob is deprecated in v1.21+, unavailable in v1.25+; use batch/v1 CronJob
I can confirm this is still happening with apiVersion: batch/v1
CronJobs using 0.25.0
in windows
This should be a simple fix. Any chance to get a new release?
I'm facing the same issue when browsing a namespace with Cron jobs enabled (e.g. a nextcloud deployment from this chart https://github.com/nextcloud/helm/tree/master/charts/nextcloud). The cron jobs use the "batch/v1" API and the kubernetes version is v1.22.
I just hit the same issue.
Same issue here, on kubernetes v1.23.3
same issue
Same issue
same issue
Same issue, even after changing all cron jobs to be v1 instead of v1beta1
Same issue. Using batch/v1
I'm pretty sure the following needs to be updated to batchv1. I haven't fully vetted if it isn't going to break anything, but roughly fixed the issue at hand.
https://github.com/vmware-tanzu/octant/blob/fd077fc3948e1b107f674d527454c4384c6e8ea9/internal/describer/objects.go#L55-L61