devtron-labs / silver-surfer

Kubernetes objects api-version compatibility checker and provides migration path for K8s objects and prepare it for cluster upgrades
https://devtron.ai/
Apache License 2.0
356 stars 37 forks source link

False positive for API deprecation 1.16 for field last-applied-configuration even when apiVersion is correctly set #25

Closed rootnoir closed 2 years ago

rootnoir commented 2 years ago

The apiVersion is clearly set as apps/v1, however in the last-applied-configuration field there is a mention of extensions/v1beta1. The deployment is listed by kubedd as having the deprecation.

Example:

apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "37"
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"extensions/v1beta1","kind":"Deployment" ........
pghildiyal commented 2 years ago

Hi @rootnoir

last-applied-configuration stores the configuration which was used with kubectl apply you can check it in the documentation here

kubectl get returns data in the default apiVersion for corresponding kubernetes version. Internally also it stores data using same apiVersion.

For eg in this case kubernetes has stored this object in the format of app/v1 but the original yaml applied to this cluster used extensions/v1beta1 that is why it deliberately checks last-applied-configuration