code: func ValidatePodSecurityContext(securityContext *api.PodSecurityContext, spec *api.PodSpec, specPath, fldPath *field.Path) field.ErrorList {
  	allErrs := field.ErrorList{}
  
  	if securityContext != nil {
  		allErrs = append(allErrs, validateHostNetwork(securityContext.HostNetwork, spec.Containers, specPath.Child("containers"))...)
  		if securityContext.FSGroup != nil && !validation.IsValidGroupId(*securityContext.FSGroup) {
  			allErrs = append(allErrs, field.Invalid(fldPath.Child("fsGroup"), *(securityContext.FSGroup), IdRangeErrorMsg))
  		}
  		if securityContext.RunAsUser != nil && !validation.IsValidUserId(*securityContext.RunAsUser) {
  			allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *(securityContext.RunAsUser), IdRangeErrorMsg))
  		}
  		for i, gid := range securityContext.SupplementalGroups {
  			if !validation.IsValidGroupId(gid) {
  				supplementalGroup := fmt.Sprintf(`supplementalGroups[%d]`, i)
  				allErrs = append(allErrs, field.Invalid(fldPath.Child(supplementalGroup), gid, IdRangeErrorMsg))
  			}
  		}
  	}
  
  	return allErrs
  }
docs: // ValidatePodSecurityContext test that the specified PodSecurityContext has valid data.