|
@@ -9,6 +9,10 @@ const (
|
|
|
// DriverPrefix constant marks the reserved label space for libnetwork drivers
|
|
|
DriverPrefix = Prefix + ".driver"
|
|
|
|
|
|
+ // DriverPrivatePrefix constant marks the reserved label space
|
|
|
+ // for internal libnetwork drivers
|
|
|
+ DriverPrivatePrefix = DriverPrefix + ".private"
|
|
|
+
|
|
|
// GenericData constant that helps to identify an option as a Generic constant
|
|
|
GenericData = Prefix + ".generic"
|
|
|
|
|
@@ -24,15 +28,6 @@ const (
|
|
|
//EnableIPv6 constant represents enabling IPV6 at network level
|
|
|
EnableIPv6 = Prefix + ".enable_ipv6"
|
|
|
|
|
|
- // KVProvider constant represents the KV provider backend
|
|
|
- KVProvider = DriverPrefix + ".kv_provider"
|
|
|
-
|
|
|
- // KVProviderURL constant represents the KV provider URL
|
|
|
- KVProviderURL = DriverPrefix + ".kv_provider_url"
|
|
|
-
|
|
|
- // KVProviderConfig constant represents the KV provider Config
|
|
|
- KVProviderConfig = DriverPrefix + ".kv_provider_config"
|
|
|
-
|
|
|
// OverlayBindInterface constant represents overlay driver bind interface
|
|
|
OverlayBindInterface = DriverPrefix + ".overlay.bind_interface"
|
|
|
|
|
@@ -43,6 +38,41 @@ const (
|
|
|
Gateway = Prefix + ".gateway"
|
|
|
)
|
|
|
|
|
|
+var (
|
|
|
+ // GlobalKVProvider constant represents the KV provider backend
|
|
|
+ GlobalKVProvider = MakeKVProvider("global")
|
|
|
+
|
|
|
+ // GlobalKVProviderURL constant represents the KV provider URL
|
|
|
+ GlobalKVProviderURL = MakeKVProviderURL("global")
|
|
|
+
|
|
|
+ // GlobalKVProviderConfig constant represents the KV provider Config
|
|
|
+ GlobalKVProviderConfig = MakeKVProviderConfig("global")
|
|
|
+
|
|
|
+ // LocalKVProvider constant represents the KV provider backend
|
|
|
+ LocalKVProvider = MakeKVProvider("local")
|
|
|
+
|
|
|
+ // LocalKVProviderURL constant represents the KV provider URL
|
|
|
+ LocalKVProviderURL = MakeKVProviderURL("local")
|
|
|
+
|
|
|
+ // LocalKVProviderConfig constant represents the KV provider Config
|
|
|
+ LocalKVProviderConfig = MakeKVProviderConfig("local")
|
|
|
+)
|
|
|
+
|
|
|
+// MakeKVProvider returns the kvprovider label for the scope
|
|
|
+func MakeKVProvider(scope string) string {
|
|
|
+ return DriverPrivatePrefix + scope + "kv_provider"
|
|
|
+}
|
|
|
+
|
|
|
+// MakeKVProviderURL returns the kvprovider url label for the scope
|
|
|
+func MakeKVProviderURL(scope string) string {
|
|
|
+ return DriverPrivatePrefix + scope + "kv_provider_url"
|
|
|
+}
|
|
|
+
|
|
|
+// MakeKVProviderConfig returns the kvprovider config label for the scope
|
|
|
+func MakeKVProviderConfig(scope string) string {
|
|
|
+ return DriverPrivatePrefix + scope + "kv_provider_config"
|
|
|
+}
|
|
|
+
|
|
|
// Key extracts the key portion of the label
|
|
|
func Key(label string) string {
|
|
|
kv := strings.SplitN(label, "=", 2)
|