From 1eee88cba55cf19b336f1accd5944a97c702fd0a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Dec 2023 14:53:59 +0000 Subject: [PATCH] Moving checking for declarative --- components/security_apps/orchestration/orchestration_comp.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/security_apps/orchestration/orchestration_comp.cc b/components/security_apps/orchestration/orchestration_comp.cc index 4a7e0c4..33af4f5 100755 --- a/components/security_apps/orchestration/orchestration_comp.cc +++ b/components/security_apps/orchestration/orchestration_comp.cc @@ -231,7 +231,6 @@ private: auto orchestration_tools = Singleton::Consume::by(); if (orchestration_tools->doesFileExist(orchestration_policy_file)) { maybe_policy = loadOrchestrationPolicy(); - if (declarative) Singleton::Consume::from()->turnOnApplyPolicyFlag(); if (!maybe_policy.ok()) { dbgWarning(D_ORCHESTRATOR) << "Failed to load Orchestration policy. Error: " << maybe_policy.getErr(); enforce_policy_flag = true; @@ -272,7 +271,6 @@ private: if (enforce_policy_flag) { // Trying to create the Orchestration policy from the general policy file maybe_policy = enforceOrchestrationPolicy(); - if (declarative) Singleton::Consume::from()->turnOnApplyPolicyFlag(); if (!maybe_policy.ok()) { return genError(maybe_policy.getErr()); } @@ -298,6 +296,7 @@ private: } } + if (declarative) Singleton::Consume::from()->turnOnApplyPolicyFlag(); return authentication_res; }