Fix manifest handling

This commit is contained in:
Ned Wright 2023-07-16 12:51:20 +00:00
parent c89001b6e0
commit 01b6544ca5
2 changed files with 10 additions and 4 deletions

View File

@ -160,16 +160,21 @@ ManifestController::Impl::updateManifest(const string &new_manifest_file)
{
auto i_env = Singleton::Consume<I_Environment>::by<ManifestController>();
auto span_scope = i_env->startNewSpanScope(Span::ContextType::CHILD_OF);
auto orchestration_tools = Singleton::Consume<I_OrchestrationTools>::by<ManifestController>();
if (isIgnoreFile(new_manifest_file)) return true;
if (isIgnoreFile(new_manifest_file)) {
if (!orchestration_tools->copyFile(new_manifest_file, manifest_file_path)) {
dbgWarning(D_ORCHESTRATOR) << "Failed to copy a new manifest file";
return false;
}
return true;
}
dbgDebug(D_ORCHESTRATOR) << "Starting to update manifest file";
auto ignored_settings_packages = getProfileAgentSetting<IgnoredPackages>("orchestration.IgnoredPackagesList");
set<string> packages_to_ignore = ignore_packages;
if (ignored_settings_packages.ok()) packages_to_ignore = *(*ignored_settings_packages);
auto orchestration_tools = Singleton::Consume<I_OrchestrationTools>::by<ManifestController>();
if (packages_to_ignore.count("all") > 0) {
dbgTrace(D_ORCHESTRATOR) << "Nothing to update (\"ignore all\" turned on)";

View File

@ -1087,7 +1087,8 @@ private:
vector<string> data_updates;
update_results[OrchestrationStatusConfigType::DATA] = handleDataUpdate(orch_data, data_updates);
if (!orch_manifest.ok() && orch_policy.ok()) {
auto orch_mode = agent_details->getOrchestrationMode();
if ((!orch_manifest.ok() || orch_mode == OrchestrationMode::HYBRID) && orch_policy.ok()) {
update_results[OrchestrationStatusConfigType::POLICY] = handlePolicyUpdate(
orch_policy,
settings_path,