-
Notifications
You must be signed in to change notification settings - Fork 100
Ensure Unmanaged Field Is Stored Correctly In Manifest #1417
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1417 +/- ##
==========================================
- Coverage 86.39% 86.29% -0.11%
==========================================
Files 102 102
Lines 12622 12649 +27
==========================================
+ Hits 10905 10915 +10
- Misses 1236 1251 +15
- Partials 481 483 +2
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| if fws.enabled.Load() { | ||
| fws.checkForUpdates(ctx, ch) | ||
| } else { | ||
| slog.DebugContext(ctx, "Skipping check for file updates, file watcher is disabled") |
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.
Do we need to log this every tick? It might be more beneficial to just log once whenever the watcher is enabled or disabled
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.
I copied the same behaviour as the instance watcher, this wont be logged every tick it will only be logged if we are skipping a file update that hasnt cleared the channel by the time we disable it.
| } | ||
|
|
||
| func (r *ResourceService) manifestFile() (map[string]*model.ManifestFile, error) { | ||
| if _, err := os.Stat(r.agentConfig.LibDir + "/manifest.json"); err != 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.
Could the manifest file name be stored in a variable, maybe as a const somewhere? It will save us having to change it in a lot of places if the name changes in future
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 whole function will be removed in a PR that is coming up soon to remove the file plugin, I also don't see us changing the name of the manifest as it would cause a lot of confusion
Proposed changes
If config applys were preformed in quick succession there was a chance that unmanaged files would be marked as managed.
This updates the resource plugin so that when it creates the config context it then reads the manifest to determine what files are unmanaged and updates them in the config context.
Also fixes issue where file watcher wasn't properly disabled.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentmake install-toolsand have attached any dependency changes to this pull requestREADME.md)