-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Manifest file to manage files on disk #994
base: v3
Are you sure you want to change the base?
Conversation
// Update map of current files on disk | ||
fms.UpdateCurrentFilesOnDisk(files.ConvertToMapOfFiles(fileOverview.GetFiles())) | ||
manifestFileErr := fms.UpdateManifestFile(files.ConvertToMapOfFiles(fileOverview.GetFiles())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing, could the converting of the map to files be done once
manifestFileErr := fms.UpdateManifestFile(files.ConvertToMapOfFiles(fileOverview.GetFiles())) | |
files := files.ConvertToMapOfFiles(fileOverview.GetFiles()) | |
fms.UpdateCurrentFilesOnDisk(files) | |
manifestFileErr := fms.UpdateManifestFile(files) |
// if file is in currentFiles but not in modified files, file has been deleted | ||
manifestFiles, manifestFileErr := fms.getManifestFile(currentFiles) | ||
|
||
if manifestFileErr != nil && manifestFiles == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be ||
? Or can there be an error but we are still able to read the files ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually caters all other scenarios when there is actual error in getting the manifest file except the first time when the file is still to be created (in that case manifestFiles won't be nil)
Proposed changes
Testing:
Adding certs

Successfully added certs in the location and updated the manifest file. (Contains both referenced/unreferenced files)
Deleting certs
Restarted the agent and performed deletion
Successfully deleted the files from the location
and sucessfully updated the manifest file.
Rollback action
Successfully Rollback
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentmake install-tools
and have attached any dependency changes to this pull requestREADME.md
)