Switch api.ObjetaMetaFor to meta.Accessor

This commit is contained in:
Wojciech Tyczynski
2016-03-25 09:57:45 +01:00
parent 5e159695d9
commit 2699be2e7e
17 changed files with 160 additions and 108 deletions

View File

@@ -23,6 +23,7 @@ import (
"strconv"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/extensions"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
@@ -128,9 +129,9 @@ func PrintRolloutHistory(historyInfo HistoryInfo, resource, name string) (string
// getChangeCause returns the change-cause annotation of the input object
func getChangeCause(obj runtime.Object) string {
meta, err := api.ObjectMetaFor(obj)
accessor, err := meta.Accessor(obj)
if err != nil {
return ""
}
return meta.Annotations[ChangeCauseAnnotation]
return accessor.GetAnnotations()[ChangeCauseAnnotation]
}