diff --git a/pkg/storage/etcd/etcd_helper.go b/pkg/storage/etcd/etcd_helper.go index 53a9e302e7..31704bd77c 100644 --- a/pkg/storage/etcd/etcd_helper.go +++ b/pkg/storage/etcd/etcd_helper.go @@ -72,6 +72,11 @@ func init() { metrics.Register() } +// Codec provides access to the underlying codec being used by the implementation. +func (h *etcdHelper) Codec() runtime.Codec { + return h.codec +} + // Implements storage.Interface. func (h *etcdHelper) Backends() []string { return h.client.GetCluster() diff --git a/pkg/storage/interfaces.go b/pkg/storage/interfaces.go index 36829f99b7..a30c4b1e2f 100644 --- a/pkg/storage/interfaces.go +++ b/pkg/storage/interfaces.go @@ -69,7 +69,7 @@ func Everything(runtime.Object) bool { type UpdateFunc func(input runtime.Object, res ResponseMeta) (output runtime.Object, ttl *uint64, err error) // Interface offers a common interface for object marshaling/unmarshling operations and -// hids all the storage-related operations behind it. +// hides all the storage-related operations behind it. type Interface interface { // Returns list of servers addresses of the underyling database. // TODO: This method is used only in a single place. Consider refactoring and getting rid @@ -146,4 +146,7 @@ type Interface interface { // } // }) GuaranteedUpdate(key string, ptrToType runtime.Object, ignoreNotFound bool, tryUpdate UpdateFunc) error + + // Codec provides access to the underlying codec being used by the implementation. + Codec() runtime.Codec }