Skip to content

Rustfs#907

Open
desmax74 wants to merge 1 commit into
trustification:release/3.y.zfrom
desmax74:rustfs
Open

Rustfs#907
desmax74 wants to merge 1 commit into
trustification:release/3.y.zfrom
desmax74:rustfs

Conversation

@desmax74

@desmax74 desmax74 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary by Sourcery

Add optional RustFS S3-compatible storage backend support to the E2E Minikube workflow and fixtures.

New Features:

  • Allow the E2E Minikube GitHub workflow to be manually triggered with a selectable storage backend (filesystem or RustFS).
  • Introduce RustFS deployment and bucket initialization manifests for use as an S3-compatible storage backend in E2E tests.
  • Add a dedicated TrustedProfileAnalyzer CR fixture configured to use RustFS S3 storage instead of filesystem PVCs.

Enhancements:

  • Extend E2E Minikube debugging and status reporting to distinguish between filesystem PVC-based storage and RustFS-based storage.

Assisted by Claude Opus 4.6

Summary by Sourcery

Introduce RustFS as an S3-compatible storage backend option and integrate it into development, Helm values, and E2E Minikube workflows, replacing filesystem PVC storage where appropriate.

New Features:

  • Add selectable storage backend (filesystem or RustFS) to the E2E Minikube GitHub workflow, with RustFS as the default.
  • Provide RustFS deployment and service manifests for both development and E2E namespaces, including bucket initialization via a MinIO mc client.
  • Add a dedicated E2E TrustedProfileAnalyzer CR fixture configured to use RustFS S3 storage.

Enhancements:

  • Update development demo and OCP manifests, as well as non-AWS Helm values, to use S3 storage backed by RustFS instead of filesystem PVCs.
  • Extend E2E Minikube debugging and status output to report either PVC-based filesystem storage or RustFS deployment status depending on the selected backend.
  • Remove the generic PersistentVolumeClaim storage template from the Helm chart in favor of S3-based RustFS storage.

Documentation:

  • Document RustFS usage as the preferred S3-compatible storage backend, including deployment steps, bucket creation, and access credentials, and clarify that filesystem storage is only suitable for dev/demo.

@sourcery-ai

sourcery-ai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds optional RustFS S3-compatible storage backend support for E2E Minikube workflows and development/demo setups, replacing filesystem PVC storage where appropriate and updating fixtures, documentation, and diagnostics accordingly.

Sequence diagram for E2E Minikube workflow with selectable RustFS storage backend

sequenceDiagram
  participant GitHubActions
  participant MinikubeCluster
  participant RustFS
  participant MinIOmc
  participant TrustedProfileAnalyzer

  GitHubActions->>GitHubActions: set STORAGE_TYPE from workflow_dispatch

  alt STORAGE_TYPE == rustfs
    GitHubActions->>MinikubeCluster: kubectl apply -f test/e2e/fixtures/rustfs.yaml
    MinikubeCluster-->>RustFS: create deployment rustfs
    GitHubActions->>MinikubeCluster: kubectl wait deployment/rustfs
    GitHubActions->>MinikubeCluster: kubectl run create-bucket (minio/mc)
    MinikubeCluster-->>MinIOmc: start create-bucket pod
    MinIOmc->>RustFS: mc alias set rustfs
    MinIOmc->>RustFS: mc mb rustfs/trustify
    GitHubActions->>MinikubeCluster: envsubst < e2e-minikube-rustfs-cr.yaml | kubectl apply -f -
    MinikubeCluster-->>TrustedProfileAnalyzer: create CR with storage type s3
  else STORAGE_TYPE == filesystem
    GitHubActions->>MinikubeCluster: rely on PVC storage
    GitHubActions->>MinikubeCluster: envsubst < e2e-minikube-cr.yaml | kubectl apply -f -
    MinikubeCluster-->>TrustedProfileAnalyzer: create CR with storage type filesystem
  end

  GitHubActions->>MinikubeCluster: run status and diagnostics
  alt STORAGE_TYPE == rustfs
    GitHubActions->>MinikubeCluster: get deployment rustfs
  else STORAGE_TYPE == filesystem
    GitHubActions->>MinikubeCluster: get pvc storage
  end
Loading

File-Level Changes

Change Details Files
Make the E2E Minikube GitHub workflow selectable between filesystem PVC storage and RustFS S3 storage, including RustFS deployment and bucket initialization and conditional diagnostics.
  • Add workflow_dispatch input storage_type with filesystem/rustfs options and expose it via STORAGE_TYPE env var
  • Conditionally deploy RustFS in the e2e-test namespace and create the trustify bucket using the MinIO mc client when STORAGE_TYPE is rustfs
  • Select between filesystem-based and RustFS-based TrustedProfileAnalyzer CR fixtures based on STORAGE_TYPE
  • Adjust status and failure debugging to show PVC details for filesystem or RustFS deployment/logs for rustfs
.github/workflows/e2e-minikube.yml
test/e2e/fixtures/rustfs.yaml
test/e2e/fixtures/e2e-minikube-cr.yaml
test/e2e/fixtures/e2e-minikube-rustfs-cr.yaml
Introduce RustFS as the default S3-compatible storage backend for development/demo and OCP deployments, updating storage configuration and documentation.
  • Add RustFS deployment and service manifest for the trustify namespace with emptyDir-backed data volume
  • Document RustFS usage, bucket creation via MinIO mc, credentials, and behavior in devel README
  • Switch demo and OCP TrustedProfileAnalyzer manifests from filesystem storage to S3 storage pointing at RustFS, including region, bucket, and credentials
  • Update Helm values (values-ocp-no-aws-crc.yaml) to use S3/RustFS storage configuration instead of filesystem
devel/rustfs.yaml
devel/README.md
devel/trusted-profile-analyzer-demo.yaml
devel/trusted-profile-analyzer-ocp.yaml
devel/values-ocp-no-aws-crc.yaml
Align E2E TrustedProfileAnalyzer CR storage configuration with S3-based storage and remove the filesystem PVC template from the Helm chart.
  • Change e2e-minikube CR storage type from filesystem to s3 while keeping size for compatibility
  • Add a dedicated rustfs-specific E2E CR fixture configured to use the RustFS service in e2e-test
  • Delete the common PersistentVolumeClaim storage template from the Helm chart to reflect the move away from filesystem PVCs
test/e2e/fixtures/e2e-minikube-cr.yaml
test/e2e/fixtures/e2e-minikube-rustfs-cr.yaml
helm-charts/redhat-trusted-profile-analyzer/templates/common/010-PersistentVolumeClaim-storage.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues, and left some high level feedback:

  • The storage_type input description says 'filesystem (default)' but the actual default is set to 'rustfs'; consider aligning the default value with the description to avoid confusion.
  • The RustFS deployment uses the rustfs/rustfs:latest image tag, which can introduce non-reproducible behavior; prefer pinning to a specific version or digest for stability in e2e runs.
  • RustFS credentials (rustfsadmin/rustfsadmin) are hard-coded in both the deployment and CR fixture; consider parameterizing these via secrets or environment variables to reduce credential duplication and future changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `storage_type` input description says 'filesystem (default)' but the actual default is set to 'rustfs'; consider aligning the default value with the description to avoid confusion.
- The RustFS deployment uses the `rustfs/rustfs:latest` image tag, which can introduce non-reproducible behavior; prefer pinning to a specific version or digest for stability in e2e runs.
- RustFS credentials (`rustfsadmin`/`rustfsadmin`) are hard-coded in both the deployment and CR fixture; consider parameterizing these via secrets or environment variables to reduce credential duplication and future changes.

## Individual Comments

### Comment 1
<location path=".github/workflows/e2e-minikube.yml" line_range="6-9" />
<code_context>
 on:
+  workflow_dispatch:
+    inputs:
+      storage_type:
+        description: 'Storage backend: filesystem (default) or rustfs (S3-compatible)'
+        required: false
+        default: 'rustfs'
+        type: choice
+        options:
</code_context>
<issue_to_address>
**nitpick (bug_risk):** Align the input description with the actual default value for storage_type.

The description lists `filesystem` as the default, but the actual default is `rustfs`. This mismatch can cause someone triggering the workflow to select an unintended backend. Please update either the description or the default so they match.
</issue_to_address>

### Comment 2
<location path=".github/workflows/e2e-minikube.yml" line_range="97-101" />
<code_context>
+          kubectl apply -f test/e2e/fixtures/rustfs.yaml
+          kubectl -n e2e-test wait --for=condition=available deployment/rustfs --timeout=120s
+          echo "RustFS is ready, creating bucket..."
+          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
+            --image=minio/mc:latest \
+            --command -- sh -c '
+              mc alias set rustfs http://rustfs.e2e-test.svc.cluster.local:9000 rustfsadmin rustfsadmin &&
+              mc mb rustfs/trustify &&
+              echo "Bucket trustify created successfully"
+            '
</code_context>
<issue_to_address>
**issue:** Handle the case where the RustFS bucket already exists to avoid step failures.

If the `trustify` bucket already exists from a prior run, `mc mb rustfs/trustify` will exit non‑zero and fail this step. Please use a pattern that tolerates existing buckets (e.g., `mc mb --ignore-existing` or a pre-check) so the workflow remains idempotent and repeatable.
</issue_to_address>

### Comment 3
<location path=".github/workflows/e2e-minikube.yml" line_range="98" />
<code_context>
+          kubectl -n e2e-test wait --for=condition=available deployment/rustfs --timeout=120s
+          echo "RustFS is ready, creating bucket..."
+          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
+            --image=minio/mc:latest \
+            --command -- sh -c '
+              mc alias set rustfs http://rustfs.e2e-test.svc.cluster.local:9000 rustfsadmin rustfsadmin &&
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Avoid using the `latest` tag for the `minio/mc` image to ensure reproducibility.

Using `minio/mc:latest` makes the workflow depend on whatever the current image version is, which can change behavior unexpectedly and introduce subtle bugs or security issues. Please pin a specific, known-good tag (or at least a major/minor version) to keep the E2E workflow stable and reproducible.

Suggested implementation:

```
          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
            --image=minio/mc:RELEASE.2024-05-28T16-45-23Z \

```

1. Verify that `minio/mc:RELEASE.2024-05-28T16-45-23Z` (or another specific tag you prefer) exists and works with your RustFS setup. If you already use a specific `minio/mc` tag elsewhere in the repo or infrastructure, reuse that tag here for consistency.
2. If you select a different tag, replace `RELEASE.2024-05-28T16-45-23Z` in the snippet above with that exact tag.
3. Optionally add a short comment near this step documenting why the tag is pinned (e.g. "Do not use :latest; pin mc version for reproducible E2E runs").
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/e2e-minikube.yml
Comment thread .github/workflows/e2e-minikube.yml Outdated
kubectl -n e2e-test wait --for=condition=available deployment/rustfs --timeout=120s
echo "RustFS is ready, creating bucket..."
kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
--image=minio/mc:latest \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Avoid using the latest tag for the minio/mc image to ensure reproducibility.

Using minio/mc:latest makes the workflow depend on whatever the current image version is, which can change behavior unexpectedly and introduce subtle bugs or security issues. Please pin a specific, known-good tag (or at least a major/minor version) to keep the E2E workflow stable and reproducible.

Suggested implementation:

          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
            --image=minio/mc:RELEASE.2024-05-28T16-45-23Z \

  1. Verify that minio/mc:RELEASE.2024-05-28T16-45-23Z (or another specific tag you prefer) exists and works with your RustFS setup. If you already use a specific minio/mc tag elsewhere in the repo or infrastructure, reuse that tag here for consistency.
  2. If you select a different tag, replace RELEASE.2024-05-28T16-45-23Z in the snippet above with that exact tag.
  3. Optionally add a short comment near this step documenting why the tag is pinned (e.g. "Do not use :latest; pin mc version for reproducible E2E runs").

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the minio client used with rustfs until the rustfs project produce a client to remove this line

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in this workflow the MinIO client is just a convenient S3-compatible CLI used to create the bucket in RustFS until RustFS provides its own tooling or a different recommended way to initialize storage.

Concretely, RustFS exposes an S3-compatible API, and minio/mc is speaking that API to:

  • connect to the RustFS endpoint
  • create the test bucket
  • apply any initial configuration you might need

So this step is an implementation detail of the E2E setup, not something that’s conceptually tied to MinIO itself. Once RustFS offers either:

  • its own client CLI, or
  • a Kubernetes init container / job or CRD to handle bucket creation,

we can replace this kubectl run ... --image=minio/mc line with the RustFS-native mechanism and drop the MinIO dependency entirely.

In the meantime, I’d still recommend pinning the minio/mc image tag so this temporary dependency stays stable and doesn’t introduce flaky runs.

If you’d like, we can add a short comment above the step to make the intent explicit, e.g.:

      # TODO: Replace MinIO mc client with RustFS-native tooling once available
      # Using mc only as a generic S3 client to create the RustFS test bucket
      - name: Deploy RustFS
        if: env.STORAGE_TYPE == 'rustfs'
        run: |
          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
            --image=minio/mc:RELEASE.2024-05-28T16-45-23Z \
            ...

Add workflow_dispatch input to the e2e-minikube workflow allowing
manual selection of RustFS as the storage backend instead of the
default filesystem. Default push/PR behavior is unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@desmax74

desmax74 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • The new RustFS deployment manifests are duplicated between devel/rustfs.yaml and test/e2e/fixtures/rustfs.yaml; consider factoring them into a single reusable manifest or kustomize/helm overlay to keep configuration in one place.
  • Both the RustFS and MinIO mc images use the :latest tag (rustfs/rustfs:latest, minio/mc:latest); pinning to explicit versions would make e2e and dev environments more deterministic and easier to debug when upstream images change.
  • Switching the default STORAGE_TYPE in the e2e Minikube workflow to rustfs changes the default CI behavior; consider keeping filesystem as the default for pull_request runs and using rustfs only when explicitly requested via workflow_dispatch to avoid surprising changes in pipeline behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new RustFS deployment manifests are duplicated between `devel/rustfs.yaml` and `test/e2e/fixtures/rustfs.yaml`; consider factoring them into a single reusable manifest or kustomize/helm overlay to keep configuration in one place.
- Both the RustFS and MinIO mc images use the `:latest` tag (`rustfs/rustfs:latest`, `minio/mc:latest`); pinning to explicit versions would make e2e and dev environments more deterministic and easier to debug when upstream images change.
- Switching the default `STORAGE_TYPE` in the e2e Minikube workflow to `rustfs` changes the default CI behavior; consider keeping `filesystem` as the default for pull_request runs and using `rustfs` only when explicitly requested via `workflow_dispatch` to avoid surprising changes in pipeline behavior.

## Individual Comments

### Comment 1
<location path=".github/workflows/e2e-minikube.yml" line_range="99-101" />
<code_context>

+      # TODO: Replace MinIO mc client with RustFS-native tooling once available
+      # Using mc only as a generic S3 client to create the RustFS test bucket
+      - name: Deploy RustFS
+        if: env.STORAGE_TYPE == 'rustfs'
+        run: |
+          echo "Deploying RustFS S3-compatible storage..."
+          kubectl apply -f test/e2e/fixtures/rustfs.yaml
+          kubectl -n e2e-test wait --for=condition=available deployment/rustfs --timeout=120s
+          echo "RustFS is ready, creating bucket..."
+          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
+            --image=minio/mc:latest \
+            --command -- sh -c '
+              mc alias set rustfs http://rustfs.e2e-test.svc.cluster.local:9000 rustfsadmin rustfsadmin &&
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Avoid using the `latest` tag for the MinIO mc image to keep e2e runs stable and reproducible.

Using `minio/mc:latest` makes the RustFS bootstrap step depend on upstream changes, which can introduce flaky or irreproducible e2e failures. Please pin to a specific, tested image tag (e.g. `minio/mc:<version>`) and update it intentionally when needed.

```suggestion
          kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
            --image=minio/mc:RELEASE.2024-05-28T17-19-04Z \
            --command -- sh -c '
```
</issue_to_address>

### Comment 2
<location path=".github/workflows/e2e-minikube.yml" line_range="318" />
<code_context>
+          else
+            echo "=== RustFS Status ==="
+            kubectl -n e2e-test get deployment rustfs || true
+            kubectl -n e2e-test logs deployment/rustfs --tail=50 || true
+          fi

</code_context>
<issue_to_address>
**issue (bug_risk):** The kubectl logs invocation targeting the Deployment is likely to fail; use pod selection instead.

`kubectl logs deployment/rustfs` will not work as written because `kubectl logs` expects a pod name or a label selector, not a bare Deployment. This means RustFS logs likely won’t be collected. Please switch to a pod-based invocation, e.g.:

```sh
echo "=== RustFS Status ==="
kubectl -n e2e-test get pods -l app=rustfs || true
kubectl -n e2e-test logs $(kubectl -n e2e-test get pods -l app=rustfs -o jsonpath='{.items[0].metadata.name}') --tail=50 || true
```

or, if supported in your kubectl version:

```sh
kubectl logs -l app=rustfs -n e2e-test --tail=50 || true
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +99 to +101
kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
--image=minio/mc:latest \
--command -- sh -c '

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Avoid using the latest tag for the MinIO mc image to keep e2e runs stable and reproducible.

Using minio/mc:latest makes the RustFS bootstrap step depend on upstream changes, which can introduce flaky or irreproducible e2e failures. Please pin to a specific, tested image tag (e.g. minio/mc:<version>) and update it intentionally when needed.

Suggested change
kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
--image=minio/mc:latest \
--command -- sh -c '
kubectl -n e2e-test run create-bucket --rm -i --restart=Never \
--image=minio/mc:RELEASE.2024-05-28T17-19-04Z \
--command -- sh -c '

else
echo "=== RustFS Status ==="
kubectl -n e2e-test get deployment rustfs || true
kubectl -n e2e-test logs deployment/rustfs --tail=50 || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The kubectl logs invocation targeting the Deployment is likely to fail; use pod selection instead.

kubectl logs deployment/rustfs will not work as written because kubectl logs expects a pod name or a label selector, not a bare Deployment. This means RustFS logs likely won’t be collected. Please switch to a pod-based invocation, e.g.:

echo "=== RustFS Status ==="
kubectl -n e2e-test get pods -l app=rustfs || true
kubectl -n e2e-test logs $(kubectl -n e2e-test get pods -l app=rustfs -o jsonpath='{.items[0].metadata.name}') --tail=50 || true

or, if supported in your kubectl version:

kubectl logs -l app=rustfs -n e2e-test --tail=50 || true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant