Skip to content

Conversation

loktev-d
Copy link
Contributor

@loktev-d loktev-d commented Oct 8, 2025

Description

Fixed mirrord local development setup for both virtualization-controller and virtualization-api:

  1. Health probes removal: Modified mirrord.sh to remove livenessProbe and readinessProbe from the mirrored container (alpine sleep
    container) to prevent probe failures.

  2. Certificate path fix: Set TMPDIR=/tmp in both mirrord tasks to ensure os.TempDir() returns /tmp for macOS, matching the
    certificate mount path in pods (/tmp/k8s-webhook-server/serving-certs).

  3. Typo fix: Corrected certificate path typos in apiserver task: virtualziationvirtualization.

Why do we need it, and what problem does it solve?

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: ci
type: fix
summary: Fixed mirrord health probes and certificate paths for local development.

Signed-off-by: Daniil Loktev <[email protected]>
@loktev-d loktev-d added this to the v1.2.0 milestone Oct 8, 2025
Copy link
Contributor

sourcery-ai bot commented Oct 8, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR enhances the mirrord-based CI setup by setting a dedicated TMPDIR, correcting certificate path typos in flag definitions, and stripping health probes from mirrored deployments.

Flow diagram for mirrord.sh deployment mirroring process

flowchart TD
    A["Original Deployment"] -->|"Check if Mirrored Deployment Exists"| B{"Mirrored Deployment Exists?"}
    B -- No --> C["Create Mirrored Deployment"]
    C --> D["Set container image to alpine:3.20.1"]
    D --> E["Remove livenessProbe"]
    E --> F["Remove readinessProbe"]
    F --> G["Set labels: mirror=true, ownerName"]
    B -- Yes --> H["Skip creation"]
Loading

File-Level Changes

Change Details Files
Ensure mirrord uses a writable temp directory
  • Prefixed mirrord.sh invocations with TMPDIR=/tmp
  • Applied to both virtualization-controller and virtualization-api tasks
images/virtualization-artifact/Taskfile.yaml
Fix certificate path typos in mirrord flags
  • Renamed /etc/virtualziation-api/... to /etc/virtualization-api/... for TLS key and cert
  • Fixed proxy-client cert/key paths similarly
images/virtualization-artifact/Taskfile.yaml
Remove health probes from mirrored deployments
  • Added del(.livenessProbe) in the jq transformation
  • Added del(.readinessProbe) in the jq transformation
images/virtualization-artifact/hack/mirrord.sh

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `images/virtualization-artifact/Taskfile.yaml:95-96` </location>
<code_context>
       flags+=( "--kubevirt-cabundle=/etc/virt-api/certificates/ca.crt" )
       flags+=( "--kubevirt-endpoint=virt-api.{{ .BaseNamespace }}.svc" )
       flags+=( "--secure-port=8443" )
-      flags+=( "--tls-private-key-file=/etc/virtualziation-api/certificates/tls.key" )
-      flags+=( "--tls-cert-file=/etc/virtualziation-api/certificates/tls.crt" )
+      flags+=( "--tls-private-key-file=/etc/virtualization-api/certificates/tls.key" )
+      flags+=( "--tls-cert-file=/etc/virtualization-api/certificates/tls.crt" )
       flags+=( "--v=7" )
</code_context>

<issue_to_address>
**issue (typo):** Typo correction in path improves reliability.

Correcting the path ensures the application can locate the required certificate files and prevents runtime failures.

```suggestion
      flags+=( "--tls-private-key-file=/etc/virtualization-api/certificates/tls.key" )
      flags+=( "--tls-cert-file=/etc/virtualization-api/certificates/tls.crt" )
```
</issue_to_address>

### Comment 2
<location> `images/virtualization-artifact/Taskfile.yaml:98-99` </location>
<code_context>
+      flags+=( "--tls-private-key-file=/etc/virtualization-api/certificates/tls.key" )
+      flags+=( "--tls-cert-file=/etc/virtualization-api/certificates/tls.crt" )
       flags+=( "--v=7" )
-      flags+=( "--proxy-client-cert-file=/etc/virtualziation-api-proxy/certificates/tls.crt" )
-      flags+=( "--proxy-client-key-file=/etc/virtualziation-api-proxy/certificates/tls.key" )
+      flags+=( "--proxy-client-cert-file=/etc/virtualization-api-proxy/certificates/tls.crt" )
+      flags+=( "--proxy-client-key-file=/etc/virtualization-api-proxy/certificates/tls.key" )
       flags+=( "--service-account-name=virtualization-api" )
</code_context>

<issue_to_address>
**issue (typo):** Typo fix in proxy client cert path prevents misconfiguration.

This spelling correction ensures the proxy client certificate path is valid and prevents referencing a non-existent file.

```suggestion
      flags+=( "--proxy-client-cert-file=/etc/virtualization-api-proxy/certificates/tls.crt" )
      flags+=( "--proxy-client-key-file=/etc/virtualization-api-proxy/certificates/tls.key" )
```
</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.

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