@@ -442,6 +442,12 @@ func (fms *FileManagerService) UpdateManifestFile(ctx context.Context,
442442 slog .DebugContext (ctx , "Updating manifest file" , "current_files" , currentFiles , "referenced" , referenced )
443443 currentManifestFiles , _ , readError := fms .manifestFile ()
444444
445+ slog .DebugContext (ctx , "Current manifest file" )
446+ for _ , file := range currentManifestFiles {
447+ slog .DebugContext (ctx , "Manifest File: " , "file" , file .ManifestFileMeta .Name , "hash" ,
448+ file .ManifestFileMeta .Hash , "unmanaged" , file .ManifestFileMeta .Unmanaged )
449+ }
450+
445451 // When agent is first started the manifest is updated when an NGINX instance is found, but the manifest file
446452 // will be empty leading to previousManifestFiles being empty. This was causing issues if the first config
447453 // apply failed leading to the manifest file being rolled back to an empty file.
@@ -462,10 +468,17 @@ func (fms *FileManagerService) UpdateManifestFile(ctx context.Context,
462468 updatedFiles := make (map [string ]* model.ManifestFile )
463469
464470 manifestFiles := fms .convertToManifestFileMap (currentFiles , referenced )
471+ slog .DebugContext (ctx , "Files being updated" )
472+ for _ , file := range currentFiles {
473+ slog .DebugContext (ctx , "Updated File: " , "file" , file .GetFileMeta ().GetName (), "hash" ,
474+ file .GetFileMeta ().GetHash (), "unmanaged" , file .GetUnmanaged ())
475+ }
476+
465477 // During a config apply every file is set to unreferenced
466478 // When a new NGINX config context is detected
467479 // we update the files in the manifest by setting the referenced bool to true
468480 if currentManifestFiles != nil && referenced {
481+ slog .DebugContext (ctx , "Referenced set to ture, add current files to updated files " )
469482 for _ , currentManifestFile := range currentManifestFiles {
470483 // if file from manifest file is unreferenced add it to updatedFiles map
471484 if ! currentManifestFile .ManifestFileMeta .Referenced {
0 commit comments