This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push:
new 25caff9 fix: do not add probes to knative services
25caff9 is described below
commit 25caff999ee2da1ed41d1df061e8cff99527148b
Author: lburgazzoli <[email protected]>
AuthorDate: Wed Mar 6 21:23:47 2019 +0100
fix: do not add probes to knative services
---
pkg/trait/probes.go | 6 ------
pkg/trait/probes_test.go | 9 ++-------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/pkg/trait/probes.go b/pkg/trait/probes.go
index 2ece7bb..4fb582d 100644
--- a/pkg/trait/probes.go
+++ b/pkg/trait/probes.go
@@ -24,7 +24,6 @@ import (
"github.com/apache/camel-k/pkg/util"
"k8s.io/apimachinery/pkg/util/intstr"
- serving "github.com/knative/serving/pkg/apis/serving/v1alpha1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
)
@@ -81,11 +80,6 @@ func (t *probesTrait) Apply(e *Environment) error {
deployment.Spec.Template.Spec.Containers[0].LivenessProbe = t.newLivenessProbe()
deployment.Spec.Template.Spec.Containers[0].ReadinessProbe =
t.newReadinessProbe()
})
-
- e.Resources.VisitKnativeService(func(service *serving.Service) {
-
service.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.LivenessProbe
= t.newLivenessProbe()
-
service.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe
= t.newReadinessProbe()
- })
}
return nil
diff --git a/pkg/trait/probes_test.go b/pkg/trait/probes_test.go
index 8250de9..82c95cf 100644
--- a/pkg/trait/probes_test.go
+++ b/pkg/trait/probes_test.go
@@ -127,11 +127,6 @@ func TestProbesOnKnativeService(t *testing.T) {
err = tr.Apply(&e)
assert.Nil(t, err)
- assert.Equal(t, "",
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.LivenessProbe.HTTPGet.Host)
- assert.Equal(t, int32(9191),
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.LivenessProbe.HTTPGet.Port.IntVal)
- assert.Equal(t, "/health",
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.LivenessProbe.HTTPGet.Path)
- assert.Equal(t, "",
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe.HTTPGet.Host)
- assert.Equal(t, int32(9191),
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe.HTTPGet.Port.IntVal)
- assert.Equal(t, "/health",
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe.HTTPGet.Path)
- assert.Equal(t, int32(4321),
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe.TimeoutSeconds)
+ assert.Nil(t,
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.LivenessProbe)
+ assert.Nil(t,
target.Spec.RunLatest.Configuration.RevisionTemplate.Spec.Container.ReadinessProbe)
}