Skip to content

Conversation

@glevi-rh
Copy link
Contributor

@glevi-rh glevi-rh commented Jan 1, 2026

What

  1. Changed data extraction logic in defrag.sh to use grep command instead of jq.
  2. Created test file for defrag.sh using a mock endpoint status extracted from quay.io/coreos/etcd:v3.5.18 image with etcdctl and podman
  3. Removed all the associated files and references that used jq to enable the hermetic build.

Why

  1. Enable an hermetic build. When we use jq and enable hermetic build, the build pipeline in Konflux fails the verify-conforma check because jq package source (https://cdn-ubi.redhat.com) isn't among the allowed package sources:
  1. Simplify defrag.sh and the Dockerfile
  2. Validate the suggested change.

Validation

The output from running the new test-defrag.sh:

=== Testing extraction logic ===

Mock JSON:
[{"Endpoint":"http://localhost:2379","Status":{"header":{"cluster_id":14841639068965178418,"member_id":10276657743932975437,"revision":1,"raft_term":2},"version":"3.5.18","dbSize":20480,"leader":10276657743932975437,"raftIndex":4,"raftTerm":2,"raftAppliedIndex":4,"dbSizeInUse":16384}}]

=== Extracting with grep ===
  revision:    1
  dbSize:      20480
  dbSizeInUse: 16384
  diff:        4096

=== Validating results ===
✅ revision: 1 (expected: 1)
✅ dbSize: 20480 (expected: 20480)
✅ dbSizeInUse: 16384 (expected: 16384)
✅ diff: 4096 (expected: 4096)

✅ All tests passed!

Signed-off-by: Gal Levi <glevi@redhat.com>
Signed-off-by: Gal Levi <glevi@redhat.com>
Signed-off-by: Gal Levi <glevi@redhat.com>
@gbenhaim
Copy link
Member

gbenhaim commented Jan 4, 2026

Thanks for working on this. TBH, if this is the direction we are taking, I prefer that you'll change the bash script to a small go program with proper unit tests.

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.

2 participants