Skip to content

Adding run tag#1179

Open
paigerube14 wants to merge 1 commit intokrkn-chaos:mainfrom
paigerube14:tag_in_krknctl
Open

Adding run tag#1179
paigerube14 wants to merge 1 commit intokrkn-chaos:mainfrom
paigerube14:tag_in_krknctl

Conversation

@paigerube14
Copy link
Collaborator

Type of change

  • Refactor
  • New feature
  • Bug fix
  • Optimization

Description

Need to be able to set run tag in krknctl config

Related Tickets & Documents

If no related issue, please create one and start the converasation on wants of

  • Related Issue #:
  • Closes #:

Documentation

  • Is documentation needed for this update?

If checked, a documentation PR must be created and merged in the website repository.

Related Documentation PR (if applicable)

<-- Add the link to the corresponding documentation PR in the website repository -->

Checklist before requesting a review

[ ] Ensure the changes and proposed solution have been discussed in the relevant issue and have received acknowledgment from the community or maintainers. See contributing guidelines
See testing your changes and run on any Kubernetes or OpenShift cluster to validate your changes

  • I have performed a self-review of my code by running krkn and specific scenario
  • If it is a core feature, I have added thorough unit tests with above 80% coverage

REQUIRED:
Description of combination of tests performed and output of run

python run_kraken.py
...
<---insert test results output--->

OR

python -m coverage run -a -m unittest discover -s tests -v
...
<---insert test results output--->

Signed-off-by: Paige Patton <prubenda@redhat.com>
@qodo-code-review
Copy link

Review Summary by Qodo

Add Elasticsearch run tag configuration to krknctl

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add es-run-tag configuration parameter to krknctl
• Enable setting Elasticsearch run tag for comparing similar runs
• New string configuration option with empty default value
Diagram
flowchart LR
  A["krknctl config"] -- "add es-run-tag parameter" --> B["ES_RUN_TAG variable"]
  B -- "enables" --> C["Compare similar Elasticsearch runs"]
Loading

Grey Divider

File Changes

1. containers/krknctl-input.json ✨ Enhancement +9/-0

Add es-run-tag parameter to krknctl configuration

• Added new es-run-tag configuration parameter to krknctl input schema
• Parameter maps to ES_RUN_TAG environment variable
• Configured as optional string type with empty default value
• Allows users to tag Elasticsearch runs for comparison purposes

containers/krknctl-input.json


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 5, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. ES_RUN_TAG likely ineffective 🐞 Bug ✓ Correctness
Description
The PR exposes ES_RUN_TAG via krknctl input metadata, but the container entrypoint does not apply
env vars to configuration and run_kraken.py reads the Elasticsearch run tag from elastic.run_tag
in the YAML config. If krknctl sets ES_RUN_TAG as an environment variable (rather than writing
elastic.run_tag into the config), this option will be a no-op and silently fail to tag runs.
Code

containers/krknctl-input.json[R166-174]

+  {
+    "name": "es-run-tag",
+    "short_description": "Elasticsearch run tag",
+    "description": "Elasticsearch run tag to compare similar runs",
+    "variable": "ES_RUN_TAG",
+    "type": "string",
+    "default": "",
+    "required": "false"
+  },
Evidence
The new field defines variable: ES_RUN_TAG, but the runtime flow is: entrypoint directly executes
run_kraken.py with CLI args (no env-to-config translation), and run_kraken.py derives
elastic_run_tag exclusively from the YAML config key elastic.run_tag (which exists in
config/config.yaml).

containers/krknctl-input.json[166-174]
containers/entrypoint.sh[1-8]
run_kraken.py[57-107]
config/config.yaml[72-83]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`containers/krknctl-input.json` now exposes `ES_RUN_TAG`, but the runtime reads the Elasticsearch run tag from the YAML config key `elastic.run_tag` and the container entrypoint does not translate environment variables into config. If `ES_RUN_TAG` is only provided as an environment variable, it will not affect tagging.

### Issue Context
- `run_kraken.py` reads `elastic_run_tag` from `config[&quot;elastic&quot;][&quot;run_tag&quot;]`.
- `containers/entrypoint.sh` directly execs `run_kraken.py` and does not mutate the config.

### Fix Focus Areas
- run_kraken.py[57-107]
- containers/entrypoint.sh[1-8]
- containers/krknctl-input.json[166-174]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

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