knight42 / kubectl-blame

Show who edited resource fields.
MIT License
134 stars 8 forks source link

support `kubectl.kubernetes.io/last-applied-configuration` annotation #5

Closed georgettica closed 2 years ago

georgettica commented 2 years ago

this tool uses the manageFields to see the last applied configuration

knight42 commented 2 years ago

@georgettica Actually this tool is meant to show the manager of each field(i.e. to show who edited the fields) and it reads such info from the managedFields. The annotation kubectl.kubernetes.io/last-applied-configuration only contains the last applied configuration, which is not useful to this tool.

georgettica commented 2 years ago

I still think this is useful, as sometimes the manager is not working and the last field is also important

knight42 commented 2 years ago

@georgettica IIUC you only want to see the last applied configuration, right? If so, you could see it by running command similar to the following:

kubectl get deploy nginx -o jsonpath="{.metadata.annotations['kubectl\.kubernetes\.io/last-applied-configuration']}"

The goal of this tool is only to annotate each line of the resource's YAML with information about field manager saved in .metadata.managedFields.

georgettica commented 2 years ago

I meant, see the diff between the last resource and the current one. I understand I can extract it, but I want to blame with that data, as it's available in the resource

knight42 commented 2 years ago

Oh I see, I understand this a useful feature, but this may beyond the scope of this tool IMHO. Such job might be done by a tool named kubectl diff rather than kubectl blame.

georgettica commented 2 years ago

Yeah, Ill try to open an issue there and link to this one

georgettica commented 2 years ago

(feel free to comment there if you think this is a good addition)