From 3c7e19ecaedf18089723ae34d9b57baec39ca738 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 17 Jan 2017 01:32:19 -0500 Subject: [PATCH] Validate that bastion IdleTimeout < 1 hour Fix #1198 --- pkg/apis/kops/validation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/apis/kops/validation.go b/pkg/apis/kops/validation.go index 723546e18a..485b7b7a7f 100644 --- a/pkg/apis/kops/validation.go +++ b/pkg/apis/kops/validation.go @@ -326,6 +326,10 @@ func (c *Cluster) Validate(strict bool) error { if bastion.IdleTimeoutSeconds != nil && *bastion.IdleTimeoutSeconds <= 0 { return fmt.Errorf("Bastion IdleTimeoutSeconds should be greater than zero") } + if bastion.IdleTimeoutSeconds != nil && *bastion.IdleTimeoutSeconds > 3600 { + return fmt.Errorf("Bastion IdleTimeoutSeconds cannot be greater than one hour") + } + } }