| 54 | |
| 55 | |
| 56 | void WhitelistWatcher::initialize() |
| 57 | { |
| 58 | // If no whitelist file is given (loaded whitelist is in state |
| 59 | // (1) absent), then there is no need to watch. In case the |
| 60 | // subscriber's initial policy was not permissive (initial |
| 61 | // whitelist is not in (1) absent), notify the subscriber that |
| 62 | // there is no whitelist any more. |
| 63 | // |
| 64 | // TODO(cmaloney): In older versions of Mesos the default value for |
| 65 | // 'whitelist' which represented "accept all nodes" was the string |
| 66 | // value '*' rather than 'None'. For backwards compatibility we |
| 67 | // still check for '*'. Can be removed after 0.23. |
| 68 | if (path.isSome() && path->string() == "*") { |
| 69 | LOG(WARNING) |
| 70 | << "Explicitly specifying '*' for the whitelist in order to " |
| 71 | << "\"accept all\" is deprecated and will be removed in a future " |
| 72 | << "release; simply don't specify the whitelist flag in order to " |
| 73 | << "\"accept all\" agents"; |
| 74 | } |
| 75 | |
| 76 | if (path.isNone() || path->string() == "*") { // Accept all nodes. |
| 77 | VLOG(1) << "No whitelist given"; |
| 78 | if (lastWhitelist.isSome()) { |
| 79 | subscriber(None()); |
| 80 | } |
| 81 | } else { |
| 82 | watch(); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | |
| 87 | void WhitelistWatcher::watch() |
no test coverage detected