Skip to content

Updates for openshift certification#12

Open
chandrams wants to merge 1 commit into
kruize:mvp_demofrom
chandrams:fix_cert_failures
Open

Updates for openshift certification#12
chandrams wants to merge 1 commit into
kruize:mvp_demofrom
chandrams:fix_cert_failures

Conversation

@chandrams
Copy link
Copy Markdown
Contributor

@chandrams chandrams commented May 12, 2026

Summary by Sourcery

Add Helm chart resources to validate Kruize service connectivity using Kubernetes test hooks.

Tests:

  • Introduce a Helm test pod that installs kubectl and verifies the Kruize service /health endpoint is reachable via node IP and nodePort.
  • Define dedicated test service account, role/cluster role, and corresponding bindings to grant the Helm test pod permissions to read services and nodes.

Signed-off-by: Chandrakala Subramanyam <csubrama@redhat.com>
@chandrams chandrams self-assigned this May 12, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 12, 2026

Reviewer's Guide

Adds Helm test hooks and RBAC resources to validate Kruize service connectivity using a dedicated test Pod and service account.

File-Level Changes

Change Details Files
Introduce a Helm test Pod that exercises the exposed Kruize service /health endpoint via kubectl and curl.
  • Create a test Pod template that runs as a Helm test hook using the chart fullname and release namespace.
  • Install tar, gzip, and kubectl in a UBI9 minimal container at test runtime.
  • Resolve the NodePort and node IP for the Kruize service via kubectl and poll the /health endpoint up to 10 times, failing the test if it never reports UP.
charts/kruize/templates/tests/test-connection.yaml
Define dedicated RBAC and service account resources to support the Helm test Pod’s cluster and namespace-level access needs.
  • Add a Helm test ServiceAccount bound to the chart fullname for use by the test Pod.
  • Create a helm test Role and RoleBinding to allow namespace-level access to services and nodes.
  • Create a helm test ClusterRole and ClusterRoleBinding to permit cluster-level get/list on services and nodes for the test Pod.
charts/kruize/templates/tests/test-serviceaccount.yaml
charts/kruize/templates/tests/test-role.yaml
charts/kruize/templates/tests/test-rolebinding.yaml
charts/kruize/templates/tests/test-clusterrole.yaml
charts/kruize/templates/tests/test-clusterrolebinding.yaml
Add a NOTES file for post-install Helm output and guidance.
  • Introduce a NOTES.txt template file under the chart’s templates directory to surface post-install information to users.
charts/kruize/templates/NOTES.txt

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

@chandrams chandrams changed the base branch from main to mvp_demo May 12, 2026 04:38
Copy link
Copy Markdown

@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 - I've left some high level feedback:

  • The test Pod currently shells out to install kubectl and tools at runtime; consider using a purpose-built image (e.g., with kubectl preinstalled) to reduce network dependencies, startup time, and potential failure points for the Helm test hook.
  • The health check logic assumes a NodePort service and directly queries a node IP, which will not work for ClusterIP, LoadBalancer, or OpenShift Route–based exposures; consider driving the test against the service DNS name inside the cluster or making the access method configurable.
  • The test ClusterRole/Roles grant get/list on nodes, which is often restricted in hardened/OpenShift environments; if possible, narrow the RBAC to the minimal resources needed (e.g., avoid node access and rely on service discovery instead).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The test Pod currently shells out to install `kubectl` and tools at runtime; consider using a purpose-built image (e.g., with `kubectl` preinstalled) to reduce network dependencies, startup time, and potential failure points for the Helm test hook.
- The health check logic assumes a `NodePort` service and directly queries a node IP, which will not work for `ClusterIP`, `LoadBalancer`, or OpenShift Route–based exposures; consider driving the test against the service DNS name inside the cluster or making the access method configurable.
- The test ClusterRole/Roles grant `get`/`list` on `nodes`, which is often restricted in hardened/OpenShift environments; if possible, narrow the RBAC to the minimal resources needed (e.g., avoid node access and rely on service discovery instead).

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