Prepare EtcdHelper to extract more data from Node

In order to support graceful deletion, the resource object will
need access to the TTL value in etcd.  Also, in the future we
may want to get the creation index (distinct from modifiedindex)
and expose it to clients.  Change EtcdResourceVersioner to be
more type specific (objects vs lists) and provide a default
implementation that relies on the internal API convention.

Also, rename etcd_tools.go to etcd_helper.go and split a few
things up.
This commit is contained in:
Clayton Coleman
2015-03-05 00:17:29 -05:00
parent 4ca90e0343
commit bddef32193
22 changed files with 251 additions and 163 deletions

View File

@@ -178,7 +178,7 @@ func NewEtcdHelper(client tools.EtcdGetSet, version string) (helper tools.EtcdHe
if err != nil {
return helper, err
}
return tools.EtcdHelper{client, versionInterfaces.Codec, tools.RuntimeVersionAdapter{versionInterfaces.MetadataAccessor}}, nil
return tools.NewEtcdHelper(client, versionInterfaces.Codec), nil
}
// setDefaults fills in any fields not set that are required to have valid data.