From reviews-return-65386-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Tue Aug 29 03:11:31 2017 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7EDB61ACAA for ; Tue, 29 Aug 2017 03:11:31 +0000 (UTC) Received: (qmail 58982 invoked by uid 500); 29 Aug 2017 03:11:31 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 58905 invoked by uid 500); 29 Aug 2017 03:11:31 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 58837 invoked by uid 99); 29 Aug 2017 03:11:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2017 03:11:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DA38B183D7A; Tue, 29 Aug 2017 03:11:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.451 X-Spam-Level: **** X-Spam-Status: No, score=4.451 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, NML_ADSP_CUSTOM_MED=1.2, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kyCxWIpSL9O5; Tue, 29 Aug 2017 03:11:28 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 285295FAC8; Tue, 29 Aug 2017 03:11:28 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A40F2E0059; Tue, 29 Aug 2017 03:11:25 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id 14F8FC404C7; Tue, 29 Aug 2017 03:11:22 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1140996675324182290==" MIME-Version: 1.0 Subject: Re: Review Request 61901: Added common validation for Volume. From: Jie Yu To: Joseph Wu , Gilbert Song Cc: Jie Yu , mesos Date: Tue, 29 Aug 2017 03:11:21 -0000 Message-ID: <20170829031121.20141.60860@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jie Yu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/61901/ X-Sender: Jie Yu References: <20170828191131.20141.56811@reviews-vm2.apache.org> In-Reply-To: <20170828191131.20141.56811@reviews-vm2.apache.org> X-ReviewBoard-Diff-For: src/tests/common_validation_tests.cpp Reply-To: Jie Yu X-ReviewRequest-Repository: mesos --===============1140996675324182290== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Aug. 28, 2017, 7:11 p.m., Joseph Wu wrote: > > src/common/validation.cpp > > Lines 206 (patched) > > > > > > Seems like you could start with adding this: > > ``` > > if (!path::absolute(volume.host_path()) && > > !path::absolute(volume.container_path())) { > > ... > > } > > ``` > > > > (Some form of which exists in the filesystem/linux isolator and Docker containerizer) I'll do that later. > On Aug. 28, 2017, 7:11 p.m., Joseph Wu wrote: > > src/common/validation.cpp > > Lines 212-217 (patched) > > > > > > Might be clearer to count the number of occurrences rather than bit-mask them. > > > > Then error if the number of occurrences is not equal to one. > > > > --- > > > > Also, I'm surprised that we don't have this validation already. > > > > It seems like, in the existing code, if you: > > 1) Specify some value for all three fields. > > 2) Enable the appropriate isolators (filesystem/linux, docker/volume, volume/sandbox_path). > > 3) All three isolators will do their thing, possibly running over each other in the process. Used occurrences! thanks for the tip. - Jie ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61901/#review183968 ----------------------------------------------------------- On Aug. 24, 2017, 11:58 p.m., Jie Yu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61901/ > ----------------------------------------------------------- > > (Updated Aug. 24, 2017, 11:58 p.m.) > > > Review request for mesos, Gilbert Song and Joseph Wu. > > > Bugs: MESOS-7306 > https://issues.apache.org/jira/browse/MESOS-7306 > > > Repository: mesos > > > Description > ------- > > Added common validation for Volume. > > > Diffs > ----- > > src/Makefile.am 5157b2baac4ff6c4493faaeb7a311381e8e76fe7 > src/common/validation.hpp 8c92436eb6c8aa87ffd6d6cf3f42079d6c90e525 > src/common/validation.cpp 33b501bfa6613dab70a663f552a424ffa8a15b0a > src/tests/CMakeLists.txt 6c05ea93c3288fb9608c191234f95e270390d89e > src/tests/common_validation_tests.cpp PRE-CREATION > > > Diff: https://reviews.apache.org/r/61901/diff/1/ > > > Testing > ------- > > make check > > > Thanks, > > Jie Yu > > --===============1140996675324182290==--