argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.47k stars 5.32k forks source link

unable to upgrade a Cronjob batch/v1beta1 resource to batch/v1. #7608

Open jurgen-weber-deltatre opened 2 years ago

jurgen-weber-deltatre commented 2 years ago

If you are trying to resolve an environment-specific issue or have a one-off question about the edge case that does not require a feature then please consider asking a question in argocd slack channel.

Checklist:

Describe the bug

We are ramping up to upgrade our clusters from 1.20 to 1.21. in 1.21 the cronjob batrh/v1beta1 API is deprecated. I updated a bunch of my resources because apparently we had about 10.

I am then greeted with

image

If the batch/v1beta1 resource already exists if you click into it from the app view I get image

To Reproduce

https://github.com/kubernetes-sigs/descheduler/tree/master/charts/descheduler

install 0.19 descheduler-helm-chart

then upgrade to 0.22.1 descheduler.

Expected behavior

I expect my cronjob resource to sync and update.

Screenshots

above

Version

 $ argocd version
argocd-server: v2.1.6+a346cf9
  BuildDate: 2021-10-28T19:59:40Z
  GitCommit: a346cf933e10d872eae26bff8e58c5e7ac40db25
  GitTreeState: clean
  GoVersion: go1.16.5
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: v4.2.0 2021-06-30T22:49:26Z
  Helm Version: v3.6.0+g7f2df64
  Kubectl Version: v0.21.0
  Jsonnet Version: v0.17.0

  $ kubectl version
  Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.7-eks-d88609", GitCommit:"d886092805d5cc3a47ed5cf0c43de38ce442dfcb", GitTreeState:"clean", BuildDate:"2021-07-31T00:29:12Z", GoVersion:"go1.15.12", Compiler:"gc", Platform:"linux/amd64"}

Logs

argocd-server-7f8b86f786-zjvkh argocd-server 2021-11-03T12:01:32.395553119+11:00 time="2021-11-03T01:01:32Z" level=info msg="finished unary call with code NotFound" error="rpc error: code = NotFound desc = CronJob.batch \"\" not found" grpc.code=NotFound grpc.method=GetResource grpc.service=application.ApplicationService grpc.start_time="2021-11-03T01:01:31Z" grpc.time_ms=427.999 span.kind=server system=grpc
jurgen-weber-deltatre commented 2 years ago

ok, so this one is partially my bad. I mis read the k8s upgrading docs, batch/v1 is not available in 1.20, hence these error.

but maybe we can handle it better?