private Set < String > validateAddCapabilities ( final Job job ) { final Set < String > caps = job . getAddCapabilities ( ) ; if ( caps == null ) { return emptySet ( ) ; } final Set < String > errors = Sets . newHashSet ( ) ; final Set < String > disallowedCaps = Sets . difference ( caps , whitelistedCapabilities ) ; if ( ! disallowedCaps . isEmpty ( ) ) { errors . add ( String . format ( "The following Linux capabilities aren't allowed by the Helios master: '%s'. " + "The allowed capabilities are: '%s'." , Joiner . on ( ", " ) . join ( disallowedCaps ) , Joiner . on ( ", " ) . join ( whitelistedCapabilities ) ) ) ; } return errors ; }
Validate the Job s added Linux capabilities .