From 525fbba1bda3e9a123cf231d43fcc417fd98482a Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Sun, 13 Aug 2017 17:38:12 -0700 Subject: [PATCH] etcdctl3: update to use RequestV2 instead of Request --- etcdctl/ctlv3/command/migrate_command.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/etcdctl/ctlv3/command/migrate_command.go b/etcdctl/ctlv3/command/migrate_command.go index 634ebb944..48c17c8ab 100644 --- a/etcdctl/ctlv3/command/migrate_command.go +++ b/etcdctl/ctlv3/command/migrate_command.go @@ -218,8 +218,9 @@ func applyConf(cc raftpb.ConfChange, cl *membership.RaftCluster) { } } -func applyRequest(r *pb.Request, applyV2 etcdserver.ApplierV2) { - toTTLOptions(r) +func applyRequest(req *pb.Request, applyV2 etcdserver.ApplierV2) { + r := (*etcdserver.RequestV2)(req) + r.TTLOptions() switch r.Method { case "POST": applyV2.Post(r) @@ -236,15 +237,6 @@ func applyRequest(r *pb.Request, applyV2 etcdserver.ApplierV2) { } } -func toTTLOptions(r *pb.Request) store.TTLOptionSet { - refresh, _ := pbutil.GetBool(r.Refresh) - ttlOptions := store.TTLOptionSet{Refresh: refresh} - if r.Expiration != 0 { - ttlOptions.ExpireTime = time.Unix(0, r.Expiration) - } - return ttlOptions -} - func writeStore(w io.Writer, st store.Store) uint64 { all, err := st.Get("/1", true, true) if err != nil {