kubeadmiral
kubeadmiral copied to clipboard
`pkg/util/annotation` and `pkg/util/finalizers` should use `metav1.Object` instead of `pkgruntime.Object` for more ergonomic annotation handling
k8s.io/apimachinery/pkg/runtime.Object
does not have GetAnnotations
and SetAnnotations
methods. As a result the annotation util functions in pkg/controllers/util/annotation/annotation.go
resort to calling meta.Accessor(obj)
to convert the object. But meta.Accessor(obj)
returns an error that must be propagated upwards.
In fact, all current usages of the annotation util functions pass in objects that implement metav1.Object
interface, which allows calling SetAnnotations
and GetAnnotations
without returning errors.
@gary-lgy Hi, I want to try this, can you assign this to me?
@kevin1689-cloud Hi! The major refactor has been completed a while ago. Would you like to continue working on refactoring the annotation util functions as discussed in #144 ?
@kevin1689-cloud Hi! The major refactor has been completed a while ago. Would you like to continue working on refactoring the annotation util functions as discussed in #144 ?
Hi, thanks for the remind. I have been so busy with my work recently that I'm afraid I have no extra time to do the contribute, you can assign it to other people. By the way, wish kubeadmiral will be better and better!
@kevin1689-cloud no worries. @z1cheng Thank you for your work on pkg/util/finalizers
. Would you like to work on pkg/util/annotations
as well? After that, we can close this issue.
@gary-lgy Sure, will finish it this week :)