diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-11-13 12:08:02 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-11-13 12:08:02 -0800 |
commit | 7bde2c089d2f96bee8a856017c7311eedab1a005 (patch) | |
tree | 5cd4f05709e46356067511a052ec0657140815f2 | |
parent | 90631adb9beda188bd00494f1a84446c0b94d0f9 (diff) | |
parent | 33d7b22abe3988b2682f4bdf87ce632cf6243ae6 (diff) | |
download | infinitytier-7bde2c089d2f96bee8a856017c7311eedab1a005.tar.gz infinitytier-7bde2c089d2f96bee8a856017c7311eedab1a005.zip |
Merge branch 'dev' of http://git.int.zerotier.com/zerotier/ZeroTierOne into dev
-rw-r--r-- | controller/PostgreSQL.cpp | 12 | ||||
-rwxr-xr-x | update_controllers.sh | 16 |
2 files changed, 26 insertions, 2 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 02e2de2b..ea04f551 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -384,7 +384,11 @@ void PostgreSQL::initializeMembers(PGconn *conn) config["nwid"] = networkId; config["activeBridge"] = (strcmp(PQgetvalue(res, i, 2), "t") == 0); config["authorized"] = (strcmp(PQgetvalue(res, i, 3), "t") == 0); - config["capabilities"] = json::parse(PQgetvalue(res, i, 4)); + try { + config["capabilities"] = json::parse(PQgetvalue(res, i, 4)); + } catch (std::exception &e) { + config["capabilities"] = json::array(); + } try { config["creationTime"] = std::stoull(PQgetvalue(res, i, 5)); } catch (std::exception &e) { @@ -410,7 +414,11 @@ void PostgreSQL::initializeMembers(PGconn *conn) config["remoteTraceLevel"] = 0; } config["remoteTraceTarget"] = PQgetvalue(res, i, 10); - config["tags"] = json::parse(PQgetvalue(res, i, 11)); + try { + config["tags"] = json::parse(PQgetvalue(res, i, 11)); + } catch (std::exception &e) { + config["tags"] = json::array(); + } try { config["vMajor"] = std::stoi(PQgetvalue(res, i, 12)); } catch(std::exception &e) { diff --git a/update_controllers.sh b/update_controllers.sh new file mode 100755 index 00000000..8d50c5bf --- /dev/null +++ b/update_controllers.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [ -z "$1" ] +then + echo "Must supply a docker tag" + exit 1 +fi + +TAG=$1 + +CONTROLLERS=( 12ac4a1e71 159924d630 17d709436c 1c33c1ced0 1d71939404 1d71939404 565799d8f6 6ab565387a 8056c2e21c 8850338390 8bd5124fd6 93afae5963 9bee8941b5 9f77fc393e a09acf0233 a84ac5c10a abfd31bd47 af78bf9436 c7c8172af1 d5e5fb6537 e4da7455b2 e5cd7a9e1c ea9349aa9c ) + +for c in ${CONTROLLERS[@]} +do + kubectl set image deployment controller-${c} ztcentral-controller=gcr.io/zerotier-central/ztcentral-controller:${TAG} +done |