From 0779296bf3609f43e62bffb98c3f05aa107539ad Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Sun, 13 Oct 2019 10:08:20 -0700 Subject: [PATCH] Check error return from snapshot Restore --- pkg/registry/core/service/ipallocator/allocator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/registry/core/service/ipallocator/allocator.go b/pkg/registry/core/service/ipallocator/allocator.go index 722d299683c..fb421e4e9c5 100644 --- a/pkg/registry/core/service/ipallocator/allocator.go +++ b/pkg/registry/core/service/ipallocator/allocator.go @@ -225,7 +225,9 @@ func (r *Range) Restore(net *net.IPNet, data []byte) error { if !ok { return fmt.Errorf("not a snapshottable allocator") } - snapshottable.Restore(net.String(), data) + if err := snapshottable.Restore(net.String(), data); err != nil { + return fmt.Errorf("restoring snapshot encountered %v", err) + } return nil }