diff --git a/pkg/api/vlabs/validate.go b/pkg/api/vlabs/validate.go index 91e699c66a..57b047e1b6 100644 --- a/pkg/api/vlabs/validate.go +++ b/pkg/api/vlabs/validate.go @@ -111,9 +111,28 @@ func (o *OrchestratorProfile) Validate(isUpdate bool) error { } } } - if helpers.IsTrueBoolPointer(o.KubernetesConfig.EnablePodSecurityPolicy) && - !helpers.IsTrueBoolPointer(o.KubernetesConfig.EnableRbac) { - return fmt.Errorf("enablePodSecurityPolicy requires the enableRbac feature as a prerequisite") + if helpers.IsTrueBoolPointer(o.KubernetesConfig.EnablePodSecurityPolicy) { + if !helpers.IsTrueBoolPointer(o.KubernetesConfig.EnableRbac) { + return fmt.Errorf("enablePodSecurityPolicy requires the enableRbac feature as a prerequisite") + } + if o.OrchestratorVersion == common.KubernetesVersion1Dot5Dot7 || + o.OrchestratorVersion == common.KubernetesVersion1Dot5Dot8 || + o.OrchestratorVersion == common.KubernetesVersion1Dot6Dot6 || + o.OrchestratorVersion == common.KubernetesVersion1Dot6Dot9 || + o.OrchestratorVersion == common.KubernetesVersion1Dot6Dot11 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot0 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot1 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot2 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot4 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot5 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot7 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot9 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot10 || + o.OrchestratorVersion == common.KubernetesVersion1Dot7Dot12 { + return fmt.Errorf("enablePodSecurityPolicy is only supported in acs-engine for Kubernetes version %s or greater; unable to validate for Kubernetes version %s", + "1.8.0", o.OrchestratorVersion) + } + } }