@@ -162,7 +162,6 @@ func (fms *FileManagerService) ConfigApply(ctx context.Context,
162162 return model .Error , errors .New ("fileOverview is nil" )
163163 }
164164
165- // check if any file in request is outside the allowed directories
166165 allowedErr := fms .checkAllowedDirectory (fileOverview .GetFiles ())
167166 if allowedErr != nil {
168167 return model .Error , allowedErr
@@ -356,28 +355,18 @@ func (fms *FileManagerService) DetermineFileActions(
356355 // if file is in manifestFiles but not in modified files, file has been deleted
357356 // copy contents, set file action
358357 for fileName , manifestFile := range filesMap {
359- _ , existsInReq := modifiedFiles [fileName ]
358+ _ , exists := modifiedFiles [fileName ]
360359
361- // allowed directories may have been updated since manifest file was written
362- // if file is outside allowed directories skip deletion and return error
363360 if ! fms .agentConfig .IsDirectoryAllowed (fileName ) {
364361 return nil , fmt .Errorf ("error deleting file %s: file not in allowed directories" , fileName )
365362 }
366363
367- // if file is unmanaged skip deletion
368- if manifestFile .GetUnmanaged () {
369- slog .DebugContext (ctx , "Skipping unmanaged file deletion" , "file_name" , fileName )
370- continue
371- }
372-
373- // if file doesn't exist on disk skip deletion
374364 if _ , err := os .Stat (fileName ); os .IsNotExist (err ) {
375365 slog .DebugContext (ctx , "File already deleted, skipping" , "file" , fileName )
376366 continue
377367 }
378368
379- // go ahead and delete the file
380- if ! existsInReq {
369+ if ! exists {
381370 fileDiff [fileName ] = & model.FileCache {
382371 File : manifestFile ,
383372 Action : model .Delete ,
@@ -393,7 +382,6 @@ func (fms *FileManagerService) DetermineFileActions(
393382
394383 // if file is unmanaged, action is set to unchanged so file is skipped when performing actions
395384 if modifiedFile .File .GetUnmanaged () {
396- slog .DebugContext (ctx , "Skipping unmanaged file updates" , "file_name" , fileName )
397385 continue
398386 }
399387 // if file doesn't exist in the current files, file has been added
@@ -741,7 +729,6 @@ func (fms *FileManagerService) convertToManifestFile(file *mpi.File, referenced
741729 Size : file .GetFileMeta ().GetSize (),
742730 Hash : file .GetFileMeta ().GetHash (),
743731 Referenced : referenced ,
744- Unmanaged : file .GetUnmanaged (),
745732 },
746733 }
747734}
@@ -763,7 +750,6 @@ func (fms *FileManagerService) convertToFile(manifestFile *model.ManifestFile) *
763750 Hash : manifestFile .ManifestFileMeta .Hash ,
764751 Size : manifestFile .ManifestFileMeta .Size ,
765752 },
766- Unmanaged : manifestFile .ManifestFileMeta .Unmanaged ,
767753 }
768754}
769755
0 commit comments