Add errdefs package

Providers should use this package so the virtual kubelet core
controllers can understand the errors produced from the provider code.
This commit is contained in:
Brian Goff
2019-05-20 13:39:50 -07:00
parent 8340407f98
commit b9711abff3
7 changed files with 308 additions and 0 deletions

View File

@@ -41,6 +41,10 @@ import (
// PodLifecycleHandler defines the interface used by the PodController to react
// to new and changed pods scheduled to the node that is being managed.
//
// Errors produced by these methods should implement an interface from
// github.com/virtual-kubelet/virtual-kubelet/errdefs package in order for the
// core logic to be able to understand the type of failure.
type PodLifecycleHandler interface {
// CreatePod takes a Kubernetes Pod and deploys it within the provider.
CreatePod(ctx context.Context, pod *corev1.Pod) error