FairwindsOps / pluto

A cli tool to help discover deprecated apiVersions in Kubernetes
https://fairwinds.com
Apache License 2.0
2.14k stars 124 forks source link

Results from `detect-api-resources` include a duplicate `networking.k8s.io/v1beta1` Ingress #454

Closed ivanfetch-wt closed 1 year ago

ivanfetch-wt commented 1 year ago

A deprecated and removed Ingress is returned twice in the results from Pluto detect-api-resources. Other resources, such as a PodSecurityPolicy, are not duplicated.

$ ./pluto detect-api-resources -o json 2>/dev/null |jq .
{
  "items": [
    {
      "name": "webapp",
      "namespace": "default",
      "api": {
        "version": "networking.k8s.io/v1beta1",
        "kind": "Ingress",
        "deprecated-in": "v1.19.0",
        "removed-in": "v1.22.0",
        "replacement-api": "networking.k8s.io/v1",
        "component": "k8s"
      },
      "deprecated": true,
      "removed": true
    },
    {
      "name": "webapp",
      "namespace": "default",
      "api": {
        "version": "networking.k8s.io/v1beta1",
        "kind": "Ingress",
        "deprecated-in": "v1.19.0",
        "removed-in": "v1.22.0",
        "replacement-api": "networking.k8s.io/v1",
        "component": "k8s"
      },
      "deprecated": true,
      "removed": true
    },
    {
      "name": "eks.privileged",
      "api": {
        "version": "policy/v1beta1",
        "kind": "PodSecurityPolicy",
        "deprecated-in": "v1.21.0",
        "removed-in": "v1.25.0",
        "replacement-api": "",
        "component": "k8s"
      },
      "deprecated": true,
      "removed": false
    }
  ],
  "target-versions": {
    "cert-manager": "v1.5.3",
    "istio": "v1.11.0",
    "k8s": "v1.22.0"
  }
}

I ran Pluto commit 87f16b1, against a kind 1.21 cluster, with this Ingress.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: webapp
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: test.domain.com
    http:
      paths:
      - path: /
        backend:
          serviceName: webapp
          servicePort: 80