-
Notifications
You must be signed in to change notification settings - Fork 84
Add support for large NGINX config file sizes #1053
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: v3
Are you sure you want to change the base?
Conversation
@@ -26,6 +29,107 @@ import ( | |||
"github.com./stretchr/testify/require" | |||
) | |||
|
|||
type FakeClientStreamingClient struct { |
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.
Can these fakes be put in a a file in the fakes directory ?
fileName: filePath, | ||
} | ||
|
||
t.Logf("fakeServerStreamingClient: %v", fakeServerStreamingClient) |
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.
Was this log meant to be left in ?
fakeServerStreamingClient.chunks[uint32(i)] = []byte{fileContent[i]} | ||
} | ||
|
||
t.Logf("fakeServerStreamingClient: %v", fakeServerStreamingClient) |
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.
Same with this one
fileManagerService := NewFileManagerService(fakeFileServiceClient, agentConfig) | ||
|
||
request := protos.CreateConfigApplyRequest(overview) | ||
t.Logf("request: %v", request) |
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.
Same here too
@@ -30,6 +33,7 @@ import ( | |||
"google.golang.org/protobuf/types/known/timestamppb" | |||
|
|||
backoffHelpers "github.com./nginx/agent/v3/internal/backoff" | |||
grpc2 "google.golang.org/grpc" |
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.
can we change the import name from grpc2 ?
return nil | ||
} | ||
|
||
func (fms *FileManagerService) writeChunkedFile( |
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 in file_operator.go
?
return fms.getChunkedFile(ctx, file) | ||
} | ||
|
||
func (fms *FileManagerService) getFile(ctx context.Context, file *mpi.File) error { |
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.
func (fms *FileManagerService) getFile(ctx context.Context, file *mpi.File) error { | |
func (fms *FileManagerService) file(ctx context.Context, file *mpi.File) error { |
return fms.validateFileHash(file.GetFileMeta().GetName()) | ||
} | ||
|
||
func (fms *FileManagerService) getChunkedFile(ctx context.Context, file *mpi.File) error { |
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.
func (fms *FileManagerService) getChunkedFile(ctx context.Context, file *mpi.File) error { | |
func (fms *FileManagerService) chunkedFile(ctx context.Context, file *mpi.File) error { |
"context" | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"io" |
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 has nothing to do with this import just wondering if we could look at refactoring this file or look at the whole file plugin, operator and manager service or something. There is now a lot going on in this file and wondering if we could do something
Proposed changes
Add support for file chunking when uploading and downloading NGINX config from a management plane.
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
)