Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluto mistakes a ControllerRevisions resource for a DaemonSet resource #432

Closed
2 tasks done
JamesMarino opened this issue Jan 12, 2023 · 1 comment · Fixed by #542
Closed
2 tasks done

Pluto mistakes a ControllerRevisions resource for a DaemonSet resource #432

JamesMarino opened this issue Jan 12, 2023 · 1 comment · Fixed by #542
Labels
bug Something isn't working good first issue Good for newcomers pinned Prevents stalebot from removing

Comments

@JamesMarino
Copy link

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.

@JamesMarino JamesMarino added bug Something isn't working triage This bug needs triage labels Jan 12, 2023
@sudermanjr sudermanjr removed the triage This bug needs triage label Feb 9, 2023
@sudermanjr
Copy link
Member

Thanks for the detailed report!

Seems like your suggestion to carry through the kind from the originally discovered resource is the right way to go. If you're willing to submit a PR that would be greatly appreciated.

@sudermanjr sudermanjr added the pinned Prevents stalebot from removing label Feb 9, 2023
@sudermanjr sudermanjr added the good first issue Good for newcomers label May 16, 2023
bbensky added a commit that referenced this issue Jun 14, 2024
…plied-configuration

Co-authored-by: Ryan <ryanisfluffy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers pinned Prevents stalebot from removing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants