// ValidateTrustedCluster checks and sets Trusted Cluster defaults
ValidateTrustedCluster checks and sets Trusted Cluster defaults
// ValidateTrustedCluster checks and sets Trusted Cluster defaults
func ValidateTrustedCluster(tc TrustedCluster) error {
	if err := tc.CheckAndSetDefaults(); err != nil {
		return trace.Wrap(err)
	}
	if len(tc.GetRoles()) == 0 && len(tc.GetRoleMap()) == 0 {
		if err := modules.GetModules().EmptyRolesHandler(); err != nil {
			return trace.Wrap(err)
		}
		tc.SetRoleMap(RoleMap{
			RoleMapping{
				Remote: teleport.AdminRoleName,
				Local:  []string{teleport.AdminRoleName},
			},
		})
	}
	return nil
}
func ValidateTrustedCluster ( tc TrustedCluster ) error { if err := tc . CheckAndSetDefaults ( ) ; err != nil { return trace . Wrap ( err ) } if len ( tc . GetRoles ( ) ) == 0 && len ( tc . GetRoleMap ( ) ) == 0 { if err := modules . GetModules ( ) . EmptyRolesHandler ( ) ; err != nil { return trace . Wrap ( err ) } tc . SetRoleMap ( RoleMap { RoleMapping { Remote : teleport . AdminRoleName , Local : [ ] string { teleport . AdminRoleName } , } , } ) } return nil }
ValidateTrustedCluster checks and sets Trusted Cluster defaults
ValidateTrustedCluster checks and sets Trusted Cluster defaults
// we are not mentioning Roles parameter because we are deprecating it // OSS teleport uses 'admin' by default: