kudobuilder / kudobuilder/kuttl

Allow partial comparison of slices in asserts

Open
#76 24 comments 34 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
824
Forks
103
Avg merge
1d 11h
Merged PRs (30d)
6

Description

**Edit 2025-02-03:**

Note the [recently added CEL support](https://github.com/kudobuilder/kuttl/issues/76#issuecomment-2630344898) which should help with this issue

---

**What would you like to be added**:

It would be great to check only the subset of a slice in a test step assertion. Currently, it is required to specify all the array elements, otherwise, a test fails with `slice length mismatch` error.

**Why is this needed**:

Here are some real-life pain points:
- if istio injection is enabled, a sidecar is running alongside with the main container in a pod, and it needs to be reflected in test assertions;
- testing mutating webhook, which updates environment variables or volume/volume mounts for some container in a pod, and a test case checks the applied patch;
- pod's status conditions (say, the goal of a test step is to check the only one, final condition);
- and so on

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the KEP process at keps/0001-kep-process.md and review the recent CEL support referenced in the issue comments. Compare the requested partial slice assertions with the existing assertion behavior and determine the intended scope and completion criteria through the KEP process.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.