Skip to content

[DNM][kuttl] Drop null Job pod template creationTimestamp asserts - #2052

Open
nemarjan wants to merge 1 commit into
openstack-k8s-operators:mainfrom
nemarjan:fix-kuttl-job-pod-template-creationtimestamp
Open

[DNM][kuttl] Drop null Job pod template creationTimestamp asserts#2052
nemarjan wants to merge 1 commit into
openstack-k8s-operators:mainfrom
nemarjan:fix-kuttl-job-pod-template-creationtimestamp

Conversation

@nemarjan

Copy link
Copy Markdown

cifmw-multinode-kuttl started failing this test after the GitHub check jobs moved from OCP 4.20 to 4.22. The dataplane deploy itself succeeds; KUTTL then compares live Jobs against a full YAML dump that still has Job.spec.template.metadata.creationTimestamp: null (leftover from oc get -o yaml).

On 4.20 the API still serialized that null key, so the assert matched. On 4.22 Kubernetes omits empty creationTimestamp (omitempty), so the key is missing from the live object. KUTTL waits the full timeout for a field that will never appear, then fails with:

.spec.template.metadata.creationTimestamp: key is missing from map

Remove the dumped null fields from the Job asserts so the test does not depend on that serialization difference.

cifmw-multinode-kuttl started failing this test after the GitHub check
jobs moved from OCP 4.20 to 4.22. The dataplane deploy itself succeeds;
KUTTL then compares live Jobs against a full YAML dump that still has
Job.spec.template.metadata.creationTimestamp: null (leftover from
oc get -o yaml).

On 4.20 the API still serialized that null key, so the assert matched.
On 4.22 Kubernetes omits empty creationTimestamp (omitempty), so the
key is missing from the live object. KUTTL waits the full timeout for a
field that will never appear, then fails with:

  .spec.template.metadata.creationTimestamp: key is missing from map

Remove the dumped null fields from the Job asserts so the test does not
depend on that serialization difference.

Signed-off-by: Nemanja Marjanovic <nemarjan@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@nemarjan
nemarjan requested review from Valkyrie00 and abays August 25, 2026 12:48
@nemarjan nemarjan self-assigned this Aug 25, 2026
@openshift-ci
openshift-ci Bot requested a review from slagle August 25, 2026 12:48
@openshift-ci

openshift-ci Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nemarjan
Once this PR has been reviewed and has the lgtm label, please assign slagle for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown

OpenStackControlPlane CRD Size Report

Metric Value
CRD JSON size 337535 bytes (330KB)
Base branch size 337535 bytes
Change +0.00%
Status yellow — growing
Threshold reference
Color Range Meaning
🟢 green < 300KB Comfortable
🟡 yellow 300–400KB Growing
🟠 orange 400–750KB Concerning
🔴 red > 750KB Approaching 1.5MB etcd limit (cut in half to allow space for update)

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 13dae020-aa5f-4439-a0c3-ce7d795a23ad

📥 Commits

Reviewing files that changed from the base of the PR and between 84322c7 and d0b1ca9.

📒 Files selected for processing (2)
  • test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml
  • test/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml
💤 Files with no reviewable changes (2)
  • test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml
  • test/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Updated Kubernetes test assertions to omit autogenerated creationTimestamp metadata.
    • Applied the cleanup across Job and pod template assertions without changing expected deployment behavior.

Walkthrough

The Kuttl assertions remove autogenerated creationTimestamp: null fields from dataplane deployment Job metadata.

Changes

Dataplane assertion updates

Layer / File(s) Summary
Remove autogenerated timestamps
test/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml
The download-cache and bootstrap Job pod template assertions no longer include creationTimestamp: null.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to d0b1c

This change removes obsolete null creationTimestamp entries from KUTTL Job assertions, preventing version-dependent test timeouts while leaving dataplane behavior unchanged; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: abays, slagle, valkyrie00

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the removal of null Job pod template creationTimestamp assertions from KUTTL tests.
Description check ✅ Passed The description directly explains the KUTTL failures caused by Kubernetes serialization changes and the proposed assertion updates.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Stabilize KUTTL Job assertions across Kubernetes versions

🐞 Bug fix 🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Removes null pod-template creationTimestamp assertions from 15 dataplane deployment Jobs.
• Prevents KUTTL failures when newer Kubernetes versions omit empty timestamp fields.
Diagram

graph TD
  K["KUTTL Runner"] --> A["Job Assertions"] --> C["Field Comparison"] --> R["Test Result"]
  K --> API["Kubernetes API"] --> J["Live Jobs"] --> C
Loading
High-Level Assessment

Removing assertions for optional, server-generated null metadata is the appropriate approach. Regenerating full YAML fixtures would retain the same version-sensitive coupling, while broader fixture redesign is unnecessary for this focused compatibility fix.

Files changed (2) +0 / -15

Tests (2) +0 / -15
01-assert.yamlRemove null timestamps from global-service Job assertions +0/-13

Remove null timestamps from global-service Job assertions

• Removes 'spec.template.metadata.creationTimestamp: null' from 13 asserted Jobs. This prevents serialization differences in newer Kubernetes versions from causing false KUTTL failures.

test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml

02-assert.yamlRemove null timestamps from multinodeset Job assertions +0/-2

Remove null timestamps from multinodeset Job assertions

• Removes the null pod-template creation timestamp from the download-cache and bootstrap Job assertions. The expected resources now match clusters that omit empty timestamp fields.

test/kuttl/tests/dataplane-deploy-global-service-test/02-assert.yaml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Remaining Job asserts still brittle 🐞 Bug ≡ Correctness
Description
The PR removes the null pod-template timestamp from only the global-service asserts, while other
KUTTL Job asserts still require spec.template.metadata.creationTimestamp: null. Those tests can
hit the same missing-key timeout on Kubernetes versions that omit this omitempty field, so the
serialization-related failures are not fully eliminated.
Code

test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml[208]

-      creationTimestamp: null
Evidence
The deleted line demonstrates that the PR is removing a brittle exact-null assertion from a Job pod
template. Equivalent Job assertions remain in multiple KUTTL suites, including several
dataplane-deploy-no-nodes-test and TLS/service fixtures, each retaining the same null field under
spec.template.metadata; therefore those tests remain vulnerable to the exact missing-key behavior
described by the PR.

test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml[205-210]
test/kuttl/tests/dataplane-deploy-no-nodes-test/04-assert.yaml[69-98]
test/kuttl/tests/dataplane-deploy-no-nodes-test/06-assert.yaml[74-97]
test/kuttl/tests/dataplane-deploy-tls-test/02-assert.yaml[137-164]
test/kuttl/tests/dataplane-service-config/00-assert.yaml[10-38]

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

## Issue description
Other KUTTL Job assertions still contain `spec.template.metadata.creationTimestamp: null`, which can fail when the Kubernetes API omits the empty field.

## Issue Context
The current PR removes this field from `test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml` and `02-assert.yaml`, but equivalent assertions remain in other KUTTL fixtures.

## Fix Focus Areas
- test/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml[96-96]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/04-assert.yaml[97-97]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/06-assert.yaml[96-96]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/06-assert.yaml[206-206]
- test/kuttl/tests/dataplane-deploy-tls-test/02-assert.yaml[164-164]
- test/kuttl/tests/dataplane-deploy-tls-test/02-assert.yaml[298-298]
- test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml[170-170]
- test/kuttl/tests/dataplane-extramounts/00-assert.yaml[58-58]
- test/kuttl/tests/dataplane-service-config/00-assert.yaml[38-38]
- test/kuttl/tests/dataplane-service-custom-image/00-assert.yaml[85-85]
- test/kuttl/tests/dataplane-service-failure/00-assert.yaml[37-37]

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


Grey Divider

Context sources
Review mode: 🚀 Fast: This is a localized, low-risk test-fixture cleanup removing obsolete null-field assertions, with no runtime, API, or security behavior changes.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

suspend: false
template:
metadata:
creationTimestamp: null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Remaining job asserts still brittle 🐞 Bug ≡ Correctness

The PR removes the null pod-template timestamp from only the global-service asserts, while other
KUTTL Job asserts still require spec.template.metadata.creationTimestamp: null. Those tests can
hit the same missing-key timeout on Kubernetes versions that omit this omitempty field, so the
serialization-related failures are not fully eliminated.
Agent Prompt
## Issue description
Other KUTTL Job assertions still contain `spec.template.metadata.creationTimestamp: null`, which can fail when the Kubernetes API omits the empty field.

## Issue Context
The current PR removes this field from `test/kuttl/tests/dataplane-deploy-global-service-test/01-assert.yaml` and `02-assert.yaml`, but equivalent assertions remain in other KUTTL fixtures.

## Fix Focus Areas
- test/kuttl/tests/dataplane-deploy-no-nodes-test/01-assert.yaml[96-96]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/04-assert.yaml[97-97]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/06-assert.yaml[96-96]
- test/kuttl/tests/dataplane-deploy-no-nodes-test/06-assert.yaml[206-206]
- test/kuttl/tests/dataplane-deploy-tls-test/02-assert.yaml[164-164]
- test/kuttl/tests/dataplane-deploy-tls-test/02-assert.yaml[298-298]
- test/kuttl/tests/dataplane-deploy-tls-test/03-assert.yaml[170-170]
- test/kuttl/tests/dataplane-extramounts/00-assert.yaml[58-58]
- test/kuttl/tests/dataplane-service-config/00-assert.yaml[38-38]
- test/kuttl/tests/dataplane-service-custom-image/00-assert.yaml[85-85]
- test/kuttl/tests/dataplane-service-failure/00-assert.yaml[37-37]

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

@nemarjan nemarjan changed the title [kuttl] Drop null Job pod template creationTimestamp asserts [DNM][kuttl] Drop null Job pod template creationTimestamp asserts Aug 25, 2026
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