commit | 340819a1b9fabbbe69552988232e5e14fc06291c | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Fri Nov 05 17:22:50 2021 +0900 |
committer | Jian Li <pyguni@gmail.com> | Sat Nov 06 06:57:06 2021 +0000 |
tree | 465941e086f9c7d201f8168975fe72cc9532a989 | |
parent | f9a00a5ce0796e3420f0ee2ccbace7d771fa8e7d [diff] |
Fix: make the network type be always in uppercase Change-Id: I2ce6f0e50548ddd366f6e6169d96e1d948e35227 (cherry picked from commit 035cc3e343104c9d00cfe1369cbe23945f915e8c)
diff --git a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/NetworkAttachmentDefinitionWatcher.java b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/NetworkAttachmentDefinitionWatcher.java index 7d40fee..bde6454 100644 --- a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/NetworkAttachmentDefinitionWatcher.java +++ b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/impl/NetworkAttachmentDefinitionWatcher.java
@@ -49,6 +49,7 @@ import java.io.IOException; import java.util.HashSet; +import java.util.Locale; import java.util.Objects; import java.util.Set; import java.util.concurrent.ExecutorService; @@ -282,7 +283,7 @@ KubevirtNetwork.Builder builder = DefaultKubevirtNetwork.builder(); JSONObject configJson = new JSONObject(networkConfig); - String type = configJson.getString(TYPE); + String type = configJson.getString(TYPE).toUpperCase(Locale.ROOT); Integer mtu = configJson.getInt(MTU); String gatewayIp = configJson.getString(GATEWAY_IP); boolean defaultRoute = configJson.getBoolean(DEFAULT_ROUTE);