sync code

This commit is contained in:
Ned Wright
2024-09-17 10:53:09 +00:00
parent 3fe0b42fcd
commit 586150fe4f
143 changed files with 1886 additions and 380 deletions

View File

@@ -92,6 +92,7 @@ enum class Service {
HTTP_TRANSACTION_HANDLER,
DEDICATED_NETWORK_HANDLER,
HELLO_WORLD,
PROMETHEUS,
IDA_SAML,
IDA_IDN,
IDA_IDN_BG,
@@ -170,6 +171,7 @@ getServiceString(const Service service)
case (Service::LOGGER_SDWAN): return "logger-sdwan";
case (Service::IOT_WLP): return "workload-protection";
case (Service::HELLO_WORLD): return "hello-world";
case (Service::PROMETHEUS): return "prometheus";
case (Service::IDA_SAML): return "ida-saml";
case (Service::IDA_IDN): return "ida-idn";
case (Service::IDA_IDN_BG): return "ida-idn-bg";
@@ -363,6 +365,11 @@ getServiceConfig (const Service service)
filesystem_path + "/conf/cp-nano-hello-world-conf.json",
log_files_path + "/nano_agent/cp-nano-hello-world.dbg"
);
case (Service::PROMETHEUS):
return ServiceConfig(
filesystem_path + "/conf/cp-nano-prometheus-debug-conf.json",
log_files_path + "/nano_agent/cp-nano-prometheus.dbg"
);
case (Service::IOT_ACCESS_CONTROL):
return ServiceConfig(
filesystem_path + "/conf/cp-nano-iot-access-control-debug-conf.json",
@@ -1308,6 +1315,8 @@ extractServices(const vector<string> &args)
services.push_back(Service::IOT_ACCESS_CONTROL);
} else if (getServiceString(Service::HORIZON_TELEMETRY).find(maybe_service) == 0) {
services.push_back(Service::HORIZON_TELEMETRY);
} else if (getServiceString(Service::PROMETHEUS).find(maybe_service) == 0) {
services.push_back(Service::PROMETHEUS);
} else {
break;
}

View File

@@ -971,12 +971,15 @@ install_orchestration()
if [ -n "${OTP_TOKEN}" ]; then
cp_print "Saving authentication token to file"
printf '{\n "registration type": "token",\n "registration data": "%b"\n}' "$OTP_TOKEN" | ${FILESYSTEM_PATH}/${BIN_PATH}/${CP_NANO_BASE64} -e > ${FILESYSTEM_PATH}/${CONF_PATH}/registration-data.json
rm ${FILESYSTEM_PATH}/${CONF_PATH}/agent_details.json
rm ${FILESYSTEM_PATH}/${CONF_PATH}/orchestration_status.json
echo '{}'>${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
previous_mode=$(awk -F\" '/Orchestration mode/{print $4}' /etc/cp/conf/agent_details.json)
if [ "$previous_mode" = "hybrid_mode" ]; then
rm ${FILESYSTEM_PATH}/${CONF_PATH}/agent_details.json
rm ${FILESYSTEM_PATH}/${CONF_PATH}/orchestration_status.json
echo '{}'>${FILESYSTEM_PATH}/${CONF_PATH}/policy.json
if [ -f ${FILESYSTEM_PATH}/data/data5.a ]; then
rm ${FILESYSTEM_PATH}/data/data5.a
if [ -f ${FILESYSTEM_PATH}/data/data5.a ]; then
rm ${FILESYSTEM_PATH}/data/data5.a
fi
fi
fi