-
Notifications
You must be signed in to change notification settings - Fork 100
NGINX Configs to Reference Remote External Files #1389
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 #1389 +/- ##
==========================================
+ Coverage 86.31% 86.51% +0.20%
==========================================
Files 102 102
Lines 12603 12801 +198
==========================================
+ Hits 10878 11075 +197
+ Misses 1249 1242 -7
- Partials 476 484 +8
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| return fso.sendUpdateFileStream(ctx, fileToUpdate, fso.agentConfig.Client.Grpc.FileChunkSize) | ||
| } | ||
|
|
||
| func (fso *FileServiceOperator) RenameExternalFile( |
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.
instead of duplicating the RenameFile function can we update the RenameFile function to just rename the file and have the hash validation in a separate function like this:
func (fso *FileServiceOperator) RenameAndValidateFile(
ctx context.Context, source, destination string,
) error {
err := fso.RenameFile(ctx, source, destination)
if err != nil {
return err
}
return fso.validateFileHash(desination, hash)
}
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.
The core issue with the current implementation is that the function call lacks necessary attributes to make a decision. Specifically, we should only proceed with the hash validation if File.GetExternalDataSource() returns an empty value.
| wantErrMsg string | ||
| wantErr bool | ||
| }{ | ||
| { |
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.
The following scenarios could increase coverage:
- No destination specified
- Restricted directory.
- Two files to the same destination.
Extends the ConfigApply capability to manage NGINX configurations that reference external resources hosted at remote URLs. The agent now handles downloading of these files into the NGINX configuration directory before applying the new configuration.
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)