Skip to content

Pluto mistakes a ControllerRevisions resource for a DaemonSet resource #432

Description

@JamesMarino

What happened?

When running pluto detect-api-resources --target-versions k8s=v1.21.0 on my AWS EKS Kubernetes cluster four resources of type DaemonSet with name kube-proxy were listed as being a removed version extensions/v1beta1.

Upon looking at the single kube-proxy resource there was no extensions/v1beta1 value in the kubectl.kubernetes.io/last-applied-configuration or apiVersion fields of this resource.

When debugging and stepping through the code I realised that this was actually referring to a ControllerRevisions resource and not a DaemonSet. It seems the code prioritises the kubectl.kubernetes.io/last-applied-configuration annotation to get the kind of resource rather than carrying through the original resource kind.

What did you expect to happen?

I expected the output to show me the correct resource and where to look, saying the DaemonSet resource was the removed kind did not make me think about the ControllerRevisions resource.

How can we reproduce this?

This might be something OpenShift / AWS EKS related as the ControllerRevisions resource doesn't seem to be standard Kubernetes.

Creating a ControllerRevisions resource and setting the annotation kubectl.kubernetes.io/last-applied-configuration to

{"apiVersion":"apps/v1","kind":"DaemonSet","metadata":{"annotations":{}}}

should be able to reproduce this.

Version

v5.12.0

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

Happy to submit a PR eventually if keeping the original resources Kind and not using the kind in the change annotations JSON is the way to go.

As a work around I am currently editing the ControllerRevisions kubectl.kubernetes.io/last-applied-configuration to manually remove the bad API versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerspinnedPrevents stalebot from removing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions