You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/12/14 02:03:38 UTC
[mesos] branch 1.7.x updated (4afe10a -> 2b26edd)
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a change to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git.
from 4afe10a Added UCR bridge network for Mesos Mini.
new 8785ec5 Added MESOS-9340 to the 1.7.1 CHANGELOG.
new 5e49943 Added an optional `vendor` field to `Resource.DiskInfo.Source`.
new 3c0b147 Set up the `Resource.DiskInfo.Source.vendor` field in SLRP.
new 30dbd96 Fixed `AgentResourceProviderConfigApiTest.Update` for `vendor` field.
new 2b26edd Added MESOS-9321 to the 1.7.1 CHANGELOG.
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGELOG | 2 +
include/mesos/mesos.proto | 28 ++++++++----
include/mesos/v1/mesos.proto | 28 ++++++++----
src/common/resources.cpp | 36 +++++++--------
src/resource_provider/storage/provider.cpp | 33 ++++++++++----
.../agent_resource_provider_config_api_tests.cpp | 51 ++++++++++++++++------
src/v1/resources.cpp | 36 +++++++--------
7 files changed, 141 insertions(+), 73 deletions(-)
[mesos] 04/05: Fixed `AgentResourceProviderConfigApiTest.Update`
for `vendor` field.
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 30dbd9644a9f8b7078b7e81618c87f1a82c02971
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Thu Dec 6 20:20:46 2018 -0800
Fixed `AgentResourceProviderConfigApiTest.Update` for `vendor` field.
The introduction of the `Resource.DiskInfo.Source.vendor` changes the
resource comparison and thus breaks this test. This patch fixes the test
and make it more robust.
NOTE: The updated test will fail unless the previous patch (which sets
up the `vendor` field) is also applied.
Review: https://reviews.apache.org/r/69521
---
.../agent_resource_provider_config_api_tests.cpp | 51 ++++++++++++++++------
1 file changed, 38 insertions(+), 13 deletions(-)
diff --git a/src/tests/agent_resource_provider_config_api_tests.cpp b/src/tests/agent_resource_provider_config_api_tests.cpp
index e6a68ba..f55953e 100644
--- a/src/tests/agent_resource_provider_config_api_tests.cpp
+++ b/src/tests/agent_resource_provider_config_api_tests.cpp
@@ -85,18 +85,19 @@ public:
// This extra closure is necessary in order to use `ASSERT_*`, as
// these macros require a void return type.
- [&]() {
- // Randomize the plugin name so we get a clean work directory for
- // each created config.
+ [&] {
+ // Randomize the plugin name so every created config uses its own CSI
+ // plugin instance. We use this to check if the config has been updated in
+ // some tests.
const string testCsiPluginName =
- "test_csi_plugin_" +
- strings::remove(id::UUID::random().toString(), "-");
+ "local_" + strings::remove(id::UUID::random().toString(), "-");
const string testCsiPluginPath =
path::join(tests::flags.build_dir, "src", "test-csi-plugin");
const string testCsiPluginWorkDir =
path::join(sandbox.get(), testCsiPluginName);
+
ASSERT_SOME(os::mkdir(testCsiPluginWorkDir));
Try<string> resourceProviderConfig = strings::format(
@@ -508,10 +509,12 @@ TEST_P(AgentResourceProviderConfigApiTest, ROOT_Update)
slaveFlags.resource_provider_config_dir = resourceProviderConfigDir;
// Generate a pre-existing config.
+ const string volumes = "volume1:4GB";
const string configPath = path::join(resourceProviderConfigDir, "test.json");
+
ASSERT_SOME(os::write(
configPath,
- stringify(JSON::protobuf(createResourceProviderInfo("volume1:4GB")))));
+ stringify(JSON::protobuf(createResourceProviderInfo(volumes)))));
Future<SlaveRegisteredMessage> slaveRegisteredMessage =
FUTURE_PROTOBUF(SlaveRegisteredMessage(), _, _);
@@ -544,14 +547,22 @@ TEST_P(AgentResourceProviderConfigApiTest, ROOT_Update)
Future<vector<Offer>> oldOffers;
EXPECT_CALL(sched, resourceOffers(&driver, OffersHaveAnyResource(
- std::bind(&Resources::hasResourceProvider, lambda::_1))))
+ &Resources::hasResourceProvider)))
.WillOnce(FutureArg<1>(&oldOffers));
driver.start();
// Wait for an offer having the old provider resource.
AWAIT_READY(oldOffers);
- ASSERT_FALSE(oldOffers->empty());
+ ASSERT_EQ(1u, oldOffers->size());
+
+ Resource oldResource = *Resources(oldOffers->at(0).resources())
+ .filter(&Resources::hasResourceProvider)
+ .begin();
+
+ ASSERT_TRUE(oldResource.has_disk());
+ ASSERT_TRUE(oldResource.disk().has_source());
+ ASSERT_TRUE(oldResource.disk().source().has_vendor());
Future<OfferID> rescinded;
@@ -564,7 +575,8 @@ TEST_P(AgentResourceProviderConfigApiTest, ROOT_Update)
std::bind(&Resources::hasResourceProvider, lambda::_1))))
.WillOnce(FutureArg<1>(&newOffers));
- ResourceProviderInfo info = createResourceProviderInfo("volume1:2GB");
+ // Create a new config that serves the same volumes with a different vendor.
+ ResourceProviderInfo info = createResourceProviderInfo(volumes);
AWAIT_EXPECT_RESPONSE_STATUS_EQ(
http::OK().status,
@@ -585,6 +597,7 @@ TEST_P(AgentResourceProviderConfigApiTest, ROOT_Update)
Try<ResourceProviderInfo> _info =
::protobuf::parse<ResourceProviderInfo>(json.get());
+
ASSERT_SOME(_info);
EXPECT_EQ(_info.get(), info);
@@ -593,10 +606,22 @@ TEST_P(AgentResourceProviderConfigApiTest, ROOT_Update)
// Wait for an offer having the new provider resource.
AWAIT_READY(newOffers);
-
- // The new provider resource is smaller than the old provider resource.
- EXPECT_FALSE(Resources(newOffers->at(0).resources()).contains(
- oldOffers->at(0).resources()));
+ ASSERT_EQ(1u, newOffers->size());
+
+ Resource newResource = *Resources(newOffers->at(0).resources())
+ .filter(&Resources::hasResourceProvider)
+ .begin();
+
+ ASSERT_TRUE(newResource.has_disk());
+ ASSERT_TRUE(newResource.disk().has_source());
+ ASSERT_TRUE(newResource.disk().source().has_vendor());
+
+ // The resource from the new resource provider has the same provider ID but a
+ // different vendor as that from the old one.
+ EXPECT_EQ(oldResource.provider_id(), newResource.provider_id());
+ EXPECT_NE(
+ oldResource.disk().source().vendor(),
+ newResource.disk().source().vendor());
}
[mesos] 01/05: Added MESOS-9340 to the 1.7.1 CHANGELOG.
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 8785ec52349728474e577dbfd5256d6dc224270c
Author: Benjamin Mahler <bm...@apache.org>
AuthorDate: Wed Oct 24 17:36:38 2018 -0700
Added MESOS-9340 to the 1.7.1 CHANGELOG.
---
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG b/CHANGELOG
index d530cb7..2dffc67 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -39,6 +39,7 @@ Release Notes - Mesos - Version 1.7.1 (WIP)
* [MESOS-9249] - Avoid dirtying the DRF sorter when allocating resources.
* [MESOS-9255] - Use consistent "totals" across role / framework DRF.
* [MESOS-9305] - Create cgoup recursively to workaround systemd deleting cgroups_root.
+ * [MESOS-9340] - Log all socket errors in libprocess.
Release Notes - Mesos - Version 1.7.0
[mesos] 05/05: Added MESOS-9321 to the 1.7.1 CHANGELOG.
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 2b26edd6560fbd21aed9bf42652efe18d6e36433
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Thu Dec 13 14:24:23 2018 -0800
Added MESOS-9321 to the 1.7.1 CHANGELOG.
---
CHANGELOG | 1 +
1 file changed, 1 insertion(+)
diff --git a/CHANGELOG b/CHANGELOG
index 2dffc67..6f102a2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -39,6 +39,7 @@ Release Notes - Mesos - Version 1.7.1 (WIP)
* [MESOS-9249] - Avoid dirtying the DRF sorter when allocating resources.
* [MESOS-9255] - Use consistent "totals" across role / framework DRF.
* [MESOS-9305] - Create cgoup recursively to workaround systemd deleting cgroups_root.
+ * [MESOS-9321] - Add an optional `vendor` field in `Resource.DiskInfo.Source`.
* [MESOS-9340] - Log all socket errors in libprocess.
[mesos] 03/05: Set up the `Resource.DiskInfo.Source.vendor` field
in SLRP.
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 3c0b147fe3409984e78eb9b43b45253ea6b89883
Author: Chun-Hung Hsiao <ch...@mesosphere.io>
AuthorDate: Thu Dec 6 15:28:16 2018 -0800
Set up the `Resource.DiskInfo.Source.vendor` field in SLRP.
For a CSI-backed disk resource, this field is set to the concatenation
of the type and name of its CSI plugin, with a dot in between. This
enables frameworks to identify the storage backend the disk resource.
Review: https://reviews.apache.org/r/69520
---
src/resource_provider/storage/provider.cpp | 33 ++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/resource_provider/storage/provider.cpp b/src/resource_provider/storage/provider.cpp
index 93df4a2..a151ead 100644
--- a/src/resource_provider/storage/provider.cpp
+++ b/src/resource_provider/storage/provider.cpp
@@ -246,32 +246,41 @@ static inline Resource createRawDiskResource(
const ResourceProviderInfo& info,
const Bytes& capacity,
const Option<string>& profile,
+ const Option<string>& vendor,
const Option<string>& id = None(),
const Option<Labels>& metadata = None())
{
CHECK(info.has_id());
+ CHECK(info.has_storage());
Resource resource;
resource.set_name("disk");
resource.set_type(Value::SCALAR);
resource.mutable_scalar()
- ->set_value((double) capacity.bytes() / Bytes::MEGABYTES);
+ ->set_value(static_cast<double>(capacity.bytes()) / Bytes::MEGABYTES);
+
resource.mutable_provider_id()->CopyFrom(info.id()),
resource.mutable_reservations()->CopyFrom(info.default_reservations());
- resource.mutable_disk()->mutable_source()
- ->set_type(Resource::DiskInfo::Source::RAW);
+
+ Resource::DiskInfo::Source* source =
+ resource.mutable_disk()->mutable_source();
+
+ source->set_type(Resource::DiskInfo::Source::RAW);
if (profile.isSome()) {
- resource.mutable_disk()->mutable_source()->set_profile(profile.get());
+ source->set_profile(profile.get());
+ }
+
+ if (vendor.isSome()) {
+ source->set_vendor(vendor.get());
}
if (id.isSome()) {
- resource.mutable_disk()->mutable_source()->set_id(id.get());
+ source->set_id(id.get());
}
if (metadata.isSome()) {
- resource.mutable_disk()->mutable_source()->mutable_metadata()
- ->CopyFrom(metadata.get());
+ source->mutable_metadata()->CopyFrom(metadata.get());
}
return resource;
@@ -296,6 +305,9 @@ public:
metaDir(slave::paths::getMetaRootDir(_workDir)),
contentType(ContentType::PROTOBUF),
info(_info),
+ vendor(
+ info.storage().plugin().type() + "." +
+ info.storage().plugin().name()),
slaveId(_slaveId),
authToken(_authToken),
strict(_strict),
@@ -455,6 +467,7 @@ private:
const string metaDir;
const ContentType contentType;
ResourceProviderInfo info;
+ const string vendor;
const SlaveID slaveId;
const Option<string> authToken;
const bool strict;
@@ -1374,6 +1387,8 @@ ResourceConversion StorageLocalResourceProviderProcess::reconcileResources(
Bytes(resource.scalar().value() * Bytes::MEGABYTES),
resource.disk().source().has_profile()
? resource.disk().source().profile() : Option<string>::none(),
+ resource.disk().source().has_vendor()
+ ? resource.disk().source().vendor() : Option<string>::none(),
resource.disk().source().has_id()
? resource.disk().source().id() : Option<string>::none(),
resource.disk().source().has_metadata()
@@ -2913,6 +2928,7 @@ Future<Resources> StorageLocalResourceProviderProcess::listVolumes()
volumesToProfiles.contains(entry.volume().id())
? volumesToProfiles.at(entry.volume().id())
: Option<string>::none(),
+ vendor,
entry.volume().id(),
entry.volume().attributes().empty()
? Option<Labels>::none()
@@ -2960,7 +2976,8 @@ Future<Resources> StorageLocalResourceProviderProcess::getCapacities()
return createRawDiskResource(
info,
Bytes(response.available_capacity()),
- profile);
+ profile,
+ vendor);
})));
}
[mesos] 02/05: Added an optional `vendor` field to
`Resource.DiskInfo.Source`.
Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
chhsiao pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 5e49943cfb15684dbea91c3323dfee68ca9b31e0
Author: Chun-Hung Hsiao <ch...@apache.org>
AuthorDate: Thu Nov 15 23:06:22 2018 -0800
Added an optional `vendor` field to `Resource.DiskInfo.Source`.
The new `vendor` field together with the `id` field provide the means of
uniquely identifying a CSI volume upon a CSI plugin migration (e.g.,
there is a change in the agent ID).
Review: https://reviews.apache.org/r/69037/
---
include/mesos/mesos.proto | 28 ++++++++++++++++++++--------
include/mesos/v1/mesos.proto | 28 ++++++++++++++++++++--------
src/common/resources.cpp | 36 ++++++++++++++++++------------------
src/v1/resources.cpp | 36 ++++++++++++++++++------------------
4 files changed, 76 insertions(+), 52 deletions(-)
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 043a737..e984541 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -1026,7 +1026,7 @@ message CSIPluginContainerInfo {
* Describes a CSI plugin.
*/
message CSIPluginInfo {
- // The type of the CSI service. This uniquely identifies a CSI
+ // The type of the CSI plugin. This uniquely identifies a CSI
// implementation. For instance:
// org.apache.mesos.csi.test
//
@@ -1035,11 +1035,17 @@ message CSIPluginInfo {
// to avoid conflicts on type names.
required string type = 1;
- // The name of the CSI service. There could be mutliple instances of a
- // type of CSI service. The name field is used to distinguish these
- // instances. It should be a legal Java identifier
+ // The name of the CSI plugin. There could be multiple instances of a
+ // type of CSI plugin within a Mesos cluster. The name field is used to
+ // distinguish these instances. It should be a legal Java identifier
// (https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html)
// to avoid conflicts on concatenation of type and name.
+ //
+ // The type and name together provide the means to uniquely identify a storage
+ // backend and its resources in the cluster, so the operator should ensure
+ // that the concatenation of type and name is unique in the cluster, and it
+ // remains the same if the instance is migrated to another agent (e.g., there
+ // is a change in the agent ID).
required string name = 2;
// A list of container configurations to run CSI plugin components.
@@ -1451,12 +1457,18 @@ message Resource {
optional Path path = 2;
optional Mount mount = 3;
- // An identifier for this source. This field maps onto CSI
- // volume IDs and is not expected to be set by frameworks.
+ // The vendor of this source. If present, this field provides the means to
+ // uniquely identify the storage backend of this source in the cluster.
+ optional string vendor = 7; // EXPERIMENTAL.
+
+ // The identifier of this source. This field maps onto CSI volume IDs and
+ // is not expected to be set by frameworks. If both `vendor` and `id` are
+ // present, these two fields together provide the means to uniquely
+ // identify this source in the cluster.
optional string id = 4; // EXPERIMENTAL.
- // Additional metadata for this source. This field maps onto CSI
- // volume metadata and is not expected to be set by frameworks.
+ // Additional metadata for this source. This field maps onto CSI volume
+ // attributes and is not expected to be set by frameworks.
optional Labels metadata = 5; // EXPERIMENTAL.
// This field serves as an indirection to a set of storage
diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto
index 9830c0b..dac7f51 100644
--- a/include/mesos/v1/mesos.proto
+++ b/include/mesos/v1/mesos.proto
@@ -1018,7 +1018,7 @@ message CSIPluginContainerInfo {
* Describes a CSI plugin.
*/
message CSIPluginInfo {
- // The type of the CSI service. This uniquely identifies a CSI
+ // The type of the CSI plugin. This uniquely identifies a CSI
// implementation. For instance:
// org.apache.mesos.csi.test
//
@@ -1027,11 +1027,17 @@ message CSIPluginInfo {
// to avoid conflicts on type names.
required string type = 1;
- // The name of the CSI service. There could be mutliple instances of a
- // type of CSI service. The name field is used to distinguish these
- // instances. It should be a legal Java identifier
+ // The name of the CSI plugin. There could be multiple instances of a
+ // type of CSI plugin within a Mesos cluster. The name field is used to
+ // distinguish these instances. It should be a legal Java identifier
// (https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html)
// to avoid conflicts on concatenation of type and name.
+ //
+ // The type and name together provide the means to uniquely identify a storage
+ // backend and its resources in the cluster, so the operator should ensure
+ // that the concatenation of type and name is unique in the cluster, and it
+ // remains the same if the instance is migrated to another agent (e.g., there
+ // is a change in the agent ID).
required string name = 2;
// A list of container configurations to run CSI plugin components.
@@ -1443,12 +1449,18 @@ message Resource {
optional Path path = 2;
optional Mount mount = 3;
- // An identifier for this source. This field maps onto CSI
- // volume IDs and is not expected to be set by frameworks.
+ // The vendor of this source. If present, this field provides the means to
+ // uniquely identify the storage backend of this source in the cluster.
+ optional string vendor = 7; // EXPERIMENTAL.
+
+ // The identifier of this source. This field maps onto CSI volume IDs and
+ // is not expected to be set by frameworks. If both `vendor` and `id` are
+ // present, these two fields together provide the means to uniquely
+ // identify this source in the cluster.
optional string id = 4; // EXPERIMENTAL.
- // Additional metadata for this source. This field maps onto CSI
- // volume metadata and is not expected to be set by frameworks.
+ // Additional metadata for this source. This field maps onto CSI volume
+ // attributes and is not expected to be set by frameworks.
optional Labels metadata = 5; // EXPERIMENTAL.
// This field serves as an indirection to a set of storage
diff --git a/src/common/resources.cpp b/src/common/resources.cpp
index 3989b66..7a77eca 100644
--- a/src/common/resources.cpp
+++ b/src/common/resources.cpp
@@ -192,6 +192,14 @@ bool operator==(
return false;
}
+ if (left.has_vendor() != right.has_vendor()) {
+ return false;
+ }
+
+ if (left.has_vendor() && left.vendor() != right.vendor()) {
+ return false;
+ }
+
if (left.has_id() != right.has_id()) {
return false;
}
@@ -2381,29 +2389,21 @@ Resources& Resources::operator-=(const Resources& that)
ostream& operator<<(ostream& stream, const Resource::DiskInfo::Source& source)
{
+ const Option<string> csiSource = source.has_id() || source.has_profile()
+ ? "(" + source.vendor() + "," + source.id() + "," + source.profile() + ")"
+ : Option<string>::none();
+
switch (source.type()) {
case Resource::DiskInfo::Source::MOUNT:
- return stream
- << "MOUNT"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")"
- : (source.mount().has_root() ? ":" + source.mount().root() : ""));
+ return stream << "MOUNT" << csiSource.getOrElse(
+ source.mount().has_root() ? ":" + source.mount().root() : "");
case Resource::DiskInfo::Source::PATH:
- return stream
- << "PATH"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")"
- : (source.path().has_root() ? ":" + source.path().root() : ""));
+ return stream << "PATH" << csiSource.getOrElse(
+ source.path().has_root() ? ":" + source.path().root() : "");
case Resource::DiskInfo::Source::BLOCK:
- return stream
- << "BLOCK"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")" : "");
+ return stream << "BLOCK" << csiSource.getOrElse("");
case Resource::DiskInfo::Source::RAW:
- return stream
- << "RAW"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")" : "");
+ return stream << "RAW" << csiSource.getOrElse("");
case Resource::DiskInfo::Source::UNKNOWN:
return stream << "UNKNOWN";
}
diff --git a/src/v1/resources.cpp b/src/v1/resources.cpp
index efbc7c34..d953c63 100644
--- a/src/v1/resources.cpp
+++ b/src/v1/resources.cpp
@@ -194,6 +194,14 @@ bool operator==(
return false;
}
+ if (left.has_vendor() != right.has_vendor()) {
+ return false;
+ }
+
+ if (left.has_vendor() && left.vendor() != right.vendor()) {
+ return false;
+ }
+
if (left.has_id() != right.has_id()) {
return false;
}
@@ -2382,29 +2390,21 @@ Resources& Resources::operator-=(const Resources& that)
ostream& operator<<(ostream& stream, const Resource::DiskInfo::Source& source)
{
+ const Option<string> csiSource = source.has_id() || source.has_profile()
+ ? "(" + source.vendor() + "," + source.id() + "," + source.profile() + ")"
+ : Option<string>::none();
+
switch (source.type()) {
case Resource::DiskInfo::Source::MOUNT:
- return stream
- << "MOUNT"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")"
- : (source.mount().has_root() ? ":" + source.mount().root() : ""));
+ return stream << "MOUNT" << csiSource.getOrElse(
+ source.mount().has_root() ? ":" + source.mount().root() : "");
case Resource::DiskInfo::Source::PATH:
- return stream
- << "PATH"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")"
- : (source.path().has_root() ? ":" + source.path().root() : ""));
+ return stream << "PATH" << csiSource.getOrElse(
+ source.path().has_root() ? ":" + source.path().root() : "");
case Resource::DiskInfo::Source::BLOCK:
- return stream
- << "BLOCK"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")" : "");
+ return stream << "BLOCK" << csiSource.getOrElse("");
case Resource::DiskInfo::Source::RAW:
- return stream
- << "RAW"
- << ((source.has_id() || source.has_profile())
- ? "(" + source.id() + "," + source.profile() + ")" : "");
+ return stream << "RAW" << csiSource.getOrElse("");
case Resource::DiskInfo::Source::UNKNOWN:
return stream << "UNKNOWN";
}