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
353 stars 37 forks source link

False positive for API deprecation 1.24 for field last-applied-configuration #30

Closed BJKupka closed 1 year ago

BJKupka commented 1 year ago

I pulled the latest release version of silver-surfer as of creation of this issue, installed and ran according to the documentation called out in the README, and witnessed that the report being generated called out one of our daemonset resources on some clusters are using a deprecated version:

Results for cluster at version 1.24+ to 1.24
-------------------------------------------
>>>> Removed API Version's <<<<
 Namespace    Name                     Kind                 API Version (Current Available)     Replace With API Version (Latest Available)   Migration Status                             
 monitoring   node-exporter            DaemonSet            apps/v1beta2                        apps/v1                                       can be migrated with just apiVersion change  

I combed through the configuration and found that both the current apiVersion and the last-applied-configuration reference the latest available version that the report calls out:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  annotations:
    deprecated.daemonset.template.generation: "35"
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"apps/v1","kind":"DaemonSet","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"node-exporter"},"name":"node-exporter","namespace":"monitoring"}

I'm trying to understand if this is a true false-positive situation or if there is something wrong on my end. Any advice/help would be greatly appreciated!

I read through all of your current and prior issues and what I am running into is, in my eyes, distinctly different from https://github.com/devtron-labs/silver-surfer/issues/25. Apologies if you feel that this is a duplicate of that issue.

pghildiyal commented 1 year ago

It should not show any false positive because its simply parsing data from kubectl.kubernetes.io/last-applied-configuration. Please check the namespace and name of the DaemonSet spec shared by you. I am closing this for now but please reopen it with additional data if you need any further information/clarification

showpopulous commented 1 year ago

Thanks for your feedback @pghildiyal , However, this same issue is still happening in the same environment for k8s 1.25 I have looked in the namespace for the node-exporter in the cluster and inspected its entire -o yaml output there is no single copy of v1beta2 in it. We are unsure of where silver surfer is finding the API it is flagging.

Namespace    Name                                  Kind                 API Version (Current Available)     Replace With API Version (Latest Available)   Migration Status                             

 monitoring   node-exporter                         DaemonSet            apps/v1beta2                        apps/v1                                       can be migrated with just apiVersion change