-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.0.8: Adding Experimental feature flags for the new experimental fea…
…tures (#1459) * Add Experimental features flags to EdgeHub * Enable experimental features in EdgeAgent * Remove enabled check * Fix casing and registering * Log experimental features
- Loading branch information
1 parent
602472f
commit 9e6ea0c
Showing
10 changed files
with
122 additions
and
29 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Service/ExperimentalFeatures.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
namespace Microsoft.Azure.Devices.Edge.Agent.Service | ||
{ | ||
using Microsoft.Azure.Devices.Edge.Storage; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.Logging; | ||
|
||
public class ExperimentalFeatures | ||
{ | ||
ExperimentalFeatures(bool enabled, bool disableCloudSubscriptions, bool enableUploadLogs) | ||
{ | ||
this.Enabled = enabled; | ||
this.DisableCloudSubscriptions = disableCloudSubscriptions; | ||
this.EnableUploadLogs = enableUploadLogs; | ||
} | ||
|
||
public static ExperimentalFeatures Init(IConfiguration experimentalFeaturesConfig, ILogger logger) | ||
{ | ||
bool enabled = experimentalFeaturesConfig.GetValue("enabled", false); | ||
bool disableCloudSubscriptions = enabled && experimentalFeaturesConfig.GetValue("disableCloudSubscriptions", false); | ||
bool enableUploadLogs = enabled && experimentalFeaturesConfig.GetValue("enableUploadLogs", false); | ||
var experimentalFeatures = new ExperimentalFeatures(enabled, disableCloudSubscriptions, enableUploadLogs); | ||
logger.LogInformation($"Experimental features configuration: {experimentalFeatures.ToJson()}"); | ||
return experimentalFeatures; | ||
} | ||
|
||
public bool Enabled { get; } | ||
|
||
public bool DisableCloudSubscriptions { get; } | ||
|
||
public bool EnableUploadLogs { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
edge-hub/src/Microsoft.Azure.Devices.Edge.Hub.Service/ExperimentalFeatures.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
namespace Microsoft.Azure.Devices.Edge.Hub.Service | ||
{ | ||
using Microsoft.Extensions.Configuration; | ||
|
||
public class ExperimentalFeatures | ||
{ | ||
public ExperimentalFeatures(bool enabled, bool disableCloudSubscriptions, bool disableConnectivityCheck) | ||
{ | ||
this.Enabled = enabled; | ||
this.DisableCloudSubscriptions = disableCloudSubscriptions; | ||
this.DisableConnectivityCheck = disableConnectivityCheck; | ||
} | ||
|
||
public static ExperimentalFeatures Init(IConfiguration experimentalFeaturesConfig) | ||
{ | ||
bool enabled = experimentalFeaturesConfig.GetValue("enabled", false); | ||
bool disableCloudSubscriptions = enabled && experimentalFeaturesConfig.GetValue("disableCloudSubscriptions", false); | ||
bool disableConnectivityCheck = enabled && experimentalFeaturesConfig.GetValue("disableConnectivityCheck", false); | ||
return new ExperimentalFeatures(enabled, disableCloudSubscriptions, disableConnectivityCheck); | ||
} | ||
|
||
public bool Enabled { get; } | ||
|
||
public bool DisableCloudSubscriptions { get; } | ||
|
||
public bool DisableConnectivityCheck { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters