feat: add Minio/S3 test sources support for Testworkflows#6896
feat: add Minio/S3 test sources support for Testworkflows#6896dhimanAbhi wants to merge 1 commit intokubeshop:mainfrom
Conversation
Signed-off-by: Abhishek Dhiman <abhi2002dhiman@gmail.com>
|
@greptile |
Greptile SummaryThis PR adds MinIO/S3 support as a content source for TestWorkflows, enabling test content distribution in air-gapped or restricted environments without Git access. The implementation follows the existing pattern used for Git-based content sources. Key Changes:
Critical Issue Found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TestWorkflow
participant Processor
participant Toolkit
participant MinIO
User->>TestWorkflow: Define workflow with content.minio
TestWorkflow->>Processor: ProcessContentMinio()
Processor->>Processor: Parse endpoint, bucket, path, region
Processor->>Processor: Handle credentials (plain or from secret)
Processor->>Toolkit: Create minio command container
Toolkit->>MinIO: Connect to endpoint with credentials
MinIO-->>Toolkit: List bucket contents
Toolkit->>Toolkit: Download files to /data/minio
Toolkit->>Toolkit: Adjust file permissions
Toolkit-->>TestWorkflow: Files available at mountPath
TestWorkflow->>User: Execute test steps with downloaded content
Last reviewed commit: 73a91e0 |
| func MapContentMinioKubeToAPI(v testworkflowsv1.ContentMinio) testkube.TestWorkflowContentMinio { | ||
| return testkube.TestWorkflowContentMinio{ | ||
| Endpoint: v.Endpoint, | ||
| Bucket: v.Bucket, | ||
| Path: v.Path, | ||
| AccessKey: v.AccessKey, | ||
| SecretKey: v.SecretKey, | ||
| AccessKeyFrom: common.MapPtr(v.AccessKeyFrom, MapEnvVarSourceKubeToAPI), | ||
| SecretKeyFrom: common.MapPtr(v.SecretKeyFrom, MapEnvVarSourceKubeToAPI), | ||
| MountPath: v.MountPath, | ||
| } |
There was a problem hiding this comment.
missing Region field in mapper - will break region-based S3 bucket access
The Region field is defined in the ContentMinio struct (line 65 in api/testworkflows/v1/content_types.go) and used in operations.go (line 312), but is not being mapped here. Add Region: v.Region, after the Path field on line 501.
| func MapContentMinioAPIToKube(v testkube.TestWorkflowContentMinio) testworkflowsv1.ContentMinio { | ||
| return testworkflowsv1.ContentMinio{ | ||
| Endpoint: v.Endpoint, | ||
| Bucket: v.Bucket, | ||
| Path: v.Path, | ||
| AccessKey: v.AccessKey, | ||
| SecretKey: v.SecretKey, | ||
| AccessKeyFrom: common.MapPtr(v.AccessKeyFrom, MapEnvVarSourceAPIToKube), | ||
| SecretKeyFrom: common.MapPtr(v.SecretKeyFrom, MapEnvVarSourceAPIToKube), | ||
| MountPath: v.MountPath, | ||
| } |
There was a problem hiding this comment.
missing Region field in mapper - will break region-based S3 bucket access
The Region field is defined in the ContentMinio struct and used in processing logic, but is not being mapped here. Add Region: v.Region, after the Path field on line 325.
vsukhin
left a comment
There was a problem hiding this comment.
hey @dhimanAbhi thank you for your contribution. please check feedback. btw, did you test it poeprly on your side?
|
@dhimanAbhi please address review issues - would love to get this in 🙏 |
|
Hi @olensmar, |
Pull request description
This PR introduces support for MinIO/S3-based test sources in Testworkflows. It enables fetching test assets directly from MinIO or any S3-compatible object storage as an alternative to Git-based sources. This addition provides a reliable way to distribute test content in environments with no Git access , such as restricted, air-gapped, or production Kubernetes clusters where cloning repositories is not allowed. This PR solves #4270 and #4465
Testworkflow Definition
Users can now define a MinIO/S3-based test source by specifying:
Template
Example
Proof Manifests
These logs are from a TestWorkflow executed locally. I configured a local MinIO instance and uploaded the Cypress test suite located at
testkube/test/cypress/cypress-12from the Testkube repository. This TestWorkflow successfully fetches the test content from the MinIO bucket in the same way Testkube currently fetches content from Git-based sources.Checklist (choose whats happened)
Breaking changes
Changes
Fixes