Use latest tag for KRM functions in E2E tests#4546
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
8942069 to
e41aa3e
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates test fixtures and expected outputs across the kpt e2e and unit tests to pin function references to the :latest tag of the krm-functions-catalog images (replacing pinned versions like v0.1.5, v0.2.0, and v0.4.1), and refreshes the corresponding expected diff/config outputs to match the new function behavior.
Changes:
- Replace pinned
set-namespace/set-labelsimage tags with:latestin Kptfiles and test scripts undere2e/testdata/fn-render,e2e/testdata/fn-eval, andpkg/lib/kptops. - Regenerate
.expected/diff.patch,.expected/config.yaml, and.expected/results.yamloutputs to reflect new function output (e.g., addedresultsblocks, removednamespacemutations on Kptfile metadata, removedspec.templateblock in Deployments). - Update copyright header ranges from
2021/2022to2021-2026/2022-2026in updated expected files.
Reviewed changes
Copilot reviewed 266 out of 266 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/lib/kptops/helpers_test.go, fs_test.go | Update test runtime image keys/Kptfile fixtures to :latest. |
| e2e/testdata/fn-render/**/Kptfile | Switch pipeline mutator/validator images to :latest. |
| e2e/testdata/fn-render/**/.expected/diff.patch | Regenerate diffs to match new function outputs (no namespace on Kptfile/Custom, removed Deployment template labels). |
| e2e/testdata/fn-render/**/.expected/config.yaml | Update expected stderr to include [Results] lines and renew copyright. |
| e2e/testdata/fn-eval/**/Kptfile, .expected/* | Same :latest rollover and expected-output regeneration for fn-eval suite. |
| e2e/testdata/fn-render/no-fnconfig/.expected/* | Behavior change: set-labels now passes with info result FunctionConfig is not given instead of failing with a config error. |
| e2e/testdata/fn-eval/missing-fn-config/.expected/config.yaml | Behavior change: missing fn config now exits 0 with an error severity result, instead of failing with exit code 1. |
Comments suppressed due to low confidence (4)
e2e/testdata/fn-render/save-on-render-failure/no-save-on-render-failure/Kptfile:1
- Pinning test fixtures to the
:latesttag makes these tests non-reproducible: any upstream change toset-namespace/set-labelswill silently alter test behavior and likely break CI without a corresponding code change in this repo. This is already visible in this PR, where regenerated.expected/diff.patchfiles show behavioral drift (e.g., Kptfilenamespaceno longer set, Deploymentspec.template.metadata.labelsno longer applied, set-labels no longer fails when fnConfig is missing). Consider pinning to a specific released version (or a digest) instead of:latest, and bumping it intentionally when desired. This applies to every Kptfile, exec.sh, and expected-output file changed in this PR.
e2e/testdata/fn-render/no-fnconfig/.expected/diff.patch:1 - The expected result records severity
infofor\\FunctionConfig\is not givenwhile exit code is 1 and stderr isfunction failure. This inconsistency (a non-zero exit treated effectively as an info message) suggests the test is encoding a regression in the upstream function rather than asserting intended behavior. Pin the image to a known-good version and assert anerror-severity result so the test fails clearly if upstream re-introduces the regression.
e2e/testdata/fn-render/out-of-place-stdout/.expected/config.yaml:1 - These annotation values changed from double-quoted (
\"0\",\"resources.yaml\") to single-quoted in the expected output. Since the values are strings either way, this is purely a serializer formatting change caused by switching to:latest. Test assertions that depend on quote style are brittle; consider normalizing quoting viaactualStripLines/ a comparator, or pinning the function version so the YAML emitter's behavior is stable. Same observation applies toout-of-place-fnchain-stdout/.expected/config.yaml.
e2e/testdata/fn-render/subpkg-has-invalid-kptfile/db/Kptfile:1 - This file is intentionally malformed (per the comment), but the PR still updates only the image tags. Confirm whether the malformed structure is still triggering the same parse error path the test expects; if the expected error message has changed because of upstream function behavior, the corresponding
.expected/*should be updated too. Nothing in this diff updates a corresponding expected error file for this fixture, so verify the test still asserts the intended failure.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
Description
Switch
set-namespace,set-annotationsandset-labelsKRM function images from pinned versions (v0.2.0/v0.4.1,v0.1.andv0.1.5) to:latestacross E2E tests and unit test fixtures.Updated expected test outputs to reflect behavioural changes in the latest image versions:
Issues
Testing