1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 15:06:23 +00:00

add comments and other minor improvements

This commit is contained in:
Jiaqi Luo
2022-11-22 11:04:42 -07:00
parent 4741eb8fb1
commit b183dd71ce
4 changed files with 13 additions and 8 deletions

View File

@@ -684,6 +684,10 @@ func validatePodSecurity(c *Cluster) error {
return err
}
logrus.Debugf("Checking PodSecurity for cluster version [%s]", c.Version)
// The following requirements must be met to set the default Pod Security Admission Config:
// - RBAC is enabled on the cluster
// - Cluster version is at least 1.23
// - valid values are privileged and restricted
level := c.Services.KubeAPI.PodSecurityConfiguration
if len(level) != 0 {
if c.Authorization.Mode != services.RBACAuthorizationMode {