From 287cef8c3643414e1381ca894225ad9453fdd0c2 Mon Sep 17 00:00:00 2001 From: Ned Wright Date: Tue, 19 Dec 2023 09:18:04 +0000 Subject: [PATCH] Checking for declarative mode on start --- .../security_apps/orchestration/orchestration_comp.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/security_apps/orchestration/orchestration_comp.cc b/components/security_apps/orchestration/orchestration_comp.cc index 6d8036a..00b9f83 100755 --- a/components/security_apps/orchestration/orchestration_comp.cc +++ b/components/security_apps/orchestration/orchestration_comp.cc @@ -218,6 +218,14 @@ private: Maybe start() { + auto update_communication = Singleton::Consume::by(); + auto agent_mode = Singleton::Consume::by()->getOrchestrationMode(); + auto policy_mgmt_mode = getSettingWithDefault("management", "profileManagedMode"); + if (agent_mode == OrchestrationMode::HYBRID || policy_mgmt_mode == "declarative") { + update_communication->authenticateAgent(); + return Maybe(); + } + bool enforce_policy_flag = false; Maybe maybe_policy = genError("Empty policy"); string policy_version = ""; @@ -281,7 +289,6 @@ private: return genError("Failed to set fog address from policy"); } - auto update_communication = Singleton::Consume::by(); auto authentication_res = update_communication->authenticateAgent(); if (authentication_res.ok() && !policy_version.empty()) { auto service_controller = Singleton::Consume::by(); @@ -292,7 +299,6 @@ private: } } - auto agent_mode = Singleton::Consume::by()->getOrchestrationMode(); if (agent_mode == OrchestrationMode::HYBRID) { return Maybe(); }