Closed mojtaba-esk closed 4 days ago
The changes introduce a new field client
of type *miniogo.Client
in the Minio
struct to optimize client reuse across requests. This improvement seeks to enhance performance by reusing a single Minio client instance. The New
method initializes the client, while existing methods utilize this client for network operations, reducing redundant client creation.
Files | Change Summary |
---|---|
pkg/minio/minio.go | Added client field to Minio struct. Introduced New method for client initialization. Updated methods to use client instead of creating a new instance. |
pkg/builder/kaniko/kaniko.go | Renamed K8s to K8sClient and Minio to MinioClient in Kaniko struct. Updated related method calls accordingly. |
e2e/tshark/tshark_test.go | Initialized Minio client with minio.New(ctx, k8sClient) instead of direct deployment in TestTshark . |
pkg/knuu/knuu.go | Renamed variables in Options struct. Added Timeout field. Introduced validateOptions function. Adjusted logic in New function to validate options. |
e2e/system/build_from_git_test.go | Modified kn initialization by passing k8sClient and minioClient . Added TestBuildFromGitWithModifications function. |
e2e/system/main_test.go | Commented out knuu initialization and logging statements in TestMain . |
e2e/bittwister/suite_setup_test.go | Modified SetupSuite method to initialize Knuu with specific options and adjusted error handling. |
pkg/knuu/errors.go | Added new error variables ErrTestScopeNotSet , ErrK8sClientNotSet , and ErrTestScopeMistMatch . |
pkg/knuu/knuu_test.go | Removed minio import. Added test case for Minio enabled. Adjusted test cases for Knuu initialization options. |
sequenceDiagram
participant Client
participant Minio
Client->>Minio: Initialize
Minio->>Client: Return client instance
Client->>Minio: PushToMinio / DeleteFromMinio / GetMinioURL
Minio->>Client: Ensure client initialization via New method
Client->>Minio: Perform Minio operations
Objective | Addressed | Explanation |
---|---|---|
Reuse Minio client across requests for improved performance (Issue #429) | β | |
Refactor to reduce initialization overhead and leverage connection pooling (Issue #429) | β |
In the land of code a change was made,
To stop the Minio client cascade,
One client to rule, to share the load,
Performance lifts, in speed mode.
A leap for bunnies, a hop in time,
Efficiency sings, in codeβs sweet rhyme. ππ°
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Closes #429
Summary by CodeRabbit
New Features
Refactor
K8s
toK8sClient
,Minio
toMinioClient
).Bug Fixes
Tests