From 789562b1be8dd80270c55305b21b083e32ff31b3 Mon Sep 17 00:00:00 2001 From: Sven Walter Date: Fri, 4 Aug 2017 11:53:34 +0200 Subject: [PATCH] fix waiter --- .../waiter/{deployment.go => interceptor.go} | 4 +-- pkg/interceptors/waiter/interceptors_test.go | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) rename pkg/interceptors/waiter/{deployment.go => interceptor.go} (95%) create mode 100644 pkg/interceptors/waiter/interceptors_test.go diff --git a/pkg/interceptors/waiter/deployment.go b/pkg/interceptors/waiter/interceptor.go similarity index 95% rename from pkg/interceptors/waiter/deployment.go rename to pkg/interceptors/waiter/interceptor.go index eaf54bc..ca07581 100644 --- a/pkg/interceptors/waiter/deployment.go +++ b/pkg/interceptors/waiter/interceptor.go @@ -40,7 +40,7 @@ func NewDeploymentWaitInterceptor(client kubernetes.Interface) *DeploymentWaitIn } } -func (dwi *DeploymentWaitInterceptor) AllManifestsApplied([]runtime.Object) error { +func (dwi *DeploymentWaitInterceptor) PostApply([]runtime.Object) error { dwi.waitgroup.Wait() dwi.cancel() return nil @@ -51,7 +51,7 @@ func (dwi *DeploymentWaitInterceptor) Close() error { return nil } -func (dwi *DeploymentWaitInterceptor) ManifestApplied(obj runtime.Object) error { +func (dwi *DeploymentWaitInterceptor) PreManifestApply(obj runtime.Object) error { deployment, ok := obj.(*v1beta1.Deployment) if !ok { return nil diff --git a/pkg/interceptors/waiter/interceptors_test.go b/pkg/interceptors/waiter/interceptors_test.go new file mode 100644 index 0000000..9d86492 --- /dev/null +++ b/pkg/interceptors/waiter/interceptors_test.go @@ -0,0 +1,25 @@ +package waiter + +import ( + "testing" + + "github.com/rebuy-de/kubernetes-deployment/pkg/interceptors" +) + +func TestTypePostApplier(t *testing.T) { + var inter interceptors.PostApplier + inter = &DeploymentWaitInterceptor{} + _ = inter +} + +func TestTypePreManifestApplier(t *testing.T) { + var inter interceptors.PreManifestApplier + inter = &DeploymentWaitInterceptor{} + _ = inter +} + +func TestTypeCloser(t *testing.T) { + var inter interceptors.Closer + inter = &DeploymentWaitInterceptor{} + _ = inter +}