From 8d9cb42b84e67fcda5f2adfebd78f588a2513326 Mon Sep 17 00:00:00 2001 From: Sebas Risco Date: Fri, 10 Jul 2020 13:42:28 +0200 Subject: [PATCH] Fix addition of Watchdog environment variables --- pkg/backends/openfaas.go | 3 +-- pkg/types/service.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/backends/openfaas.go b/pkg/backends/openfaas.go index d8616ef9..a3d9a733 100644 --- a/pkg/backends/openfaas.go +++ b/pkg/backends/openfaas.go @@ -119,7 +119,7 @@ func (of *OpenfaasBackend) CreateService(service types.Service) error { } // Watch for deployment changes in services namespace - var timeoutSeconds int64 = 130 + var timeoutSeconds int64 = 30 var deploymentCreated = false listOpts := metav1.ListOptions{ TimeoutSeconds: &timeoutSeconds, @@ -226,7 +226,6 @@ func (of *OpenfaasBackend) ReadService(name string) (*types.Service, error) { } return svc, nil - } // UpdateService updates an existent service diff --git a/pkg/types/service.go b/pkg/types/service.go index 18d09c85..ca69073d 100644 --- a/pkg/types/service.go +++ b/pkg/types/service.go @@ -240,9 +240,9 @@ func addWatchdogEnvVars(p *v1.PodSpec) { }, } - for _, cont := range p.Containers { + for i, cont := range p.Containers { if cont.Name == ContainerName { - cont.Env = append(cont.Env, requiredEnvVars...) + p.Containers[i].Env = append(p.Containers[i].Env, requiredEnvVars...) } } }