Merge pull request #51208 from simo5/pshfatal

Automatic merge from submit-queue (batch tested with PRs 47115, 51196, 51204, 51208, 51206)

Add an OrDie version for AddPostStartHook

Simplifies usage and consolidate the error message so it is always
the same everywhere.

```release-note
NONE
```

Kubernetes-commit: 2c214baefc06cefd68cc282b532bfe526613e36c
This commit is contained in:
Kubernetes Publisher 2017-08-24 07:20:13 -07:00
commit 9f63165961
2 changed files with 65 additions and 58 deletions

116
Godeps/Godeps.json generated
View File

@ -840,235 +840,235 @@
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/equality", "ImportPath": "k8s.io/apimachinery/pkg/api/equality",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing", "ImportPath": "k8s.io/apimachinery/pkg/api/testing",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/fuzzer",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip", "ImportPath": "k8s.io/apimachinery/pkg/api/testing/roundtrip",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/validation", "ImportPath": "k8s.io/apimachinery/pkg/api/validation",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/validation/path", "ImportPath": "k8s.io/apimachinery/pkg/api/validation/path",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/announced",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/fuzzer",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/validation",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/conversion/unstructured",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/httpstream", "ImportPath": "k8s.io/apimachinery/pkg/util/httpstream",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/proxy", "ImportPath": "k8s.io/apimachinery/pkg/util/proxy",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/rand", "ImportPath": "k8s.io/apimachinery/pkg/util/rand",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/uuid", "ImportPath": "k8s.io/apimachinery/pkg/util/uuid",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/netutil",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "d62cf72a0abe0cce52774b5136fb672a1f37f70e" "Rev": "c64b638dee05ac8335a0c7e28c9e7cc17d0df6a5"
}, },
{ {
"ImportPath": "k8s.io/client-go/discovery", "ImportPath": "k8s.io/client-go/discovery",

View File

@ -90,6 +90,13 @@ func (s *GenericAPIServer) AddPostStartHook(name string, hook PostStartHookFunc)
return nil return nil
} }
// AddPostStartHookOrDie allows you to add a PostStartHook, but dies on failure
func (s *GenericAPIServer) AddPostStartHookOrDie(name string, hook PostStartHookFunc) {
if err := s.AddPostStartHook(name, hook); err != nil {
glog.Fatalf("Error registering PostStartHook %q: %v", name, err)
}
}
// RunPostStartHooks runs the PostStartHooks for the server // RunPostStartHooks runs the PostStartHooks for the server
func (s *GenericAPIServer) RunPostStartHooks(stopCh <-chan struct{}) { func (s *GenericAPIServer) RunPostStartHooks(stopCh <-chan struct{}) {
s.postStartHookLock.Lock() s.postStartHookLock.Lock()