Skip to content

Commit

Permalink
Parse duration value before setting hard-stop-after annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
frobware committed Jan 11, 2021
1 parent f87a2d2 commit af74ad7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/operator/controller/ingress/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"sort"
"strconv"
"strings"
"time"

"github.com/davecgh/go-spew/spew"
"github.com/google/go-cmp/cmp"
Expand Down Expand Up @@ -649,7 +650,9 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, ingressController
}

if enabled, value := HardStopAfterIsEnabled(ci, ingressConfig); enabled {
env = append(env, corev1.EnvVar{Name: RouterHardStopAfterEnvName, Value: value})
if _, err := time.ParseDuration(value); err != nil {
env = append(env, corev1.EnvVar{Name: RouterHardStopAfterEnvName, Value: value})
}
}

deployment.Spec.Template.Spec.Volumes = volumes
Expand Down

0 comments on commit af74ad7

Please sign in to comment.