Skip to content

Fix incorrect warning message for forced machine image updates#2775

Merged
grolu merged 3 commits intomasterfrom
bug/fix_expiration_messages
Feb 27, 2026
Merged

Fix incorrect warning message for forced machine image updates#2775
grolu merged 3 commits intomasterfrom
bug/fix_expiration_messages

Conversation

@grolu
Copy link
Copy Markdown
Member

@grolu grolu commented Feb 12, 2026

Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message

What this PR does / why we need it:
Clusters that had no update for the updateStrategy (e.g. minor) defined in cloud profile are incorrectly flagged as error even if there is a higher supported version available (e.g. major)
Screenshot 2026-02-12 at 13 20 13

This PR ensures correct handling for this case
Screenshot 2026-02-12 at 13 19 41

Which issue(s) this PR fixes:
Fixes #2772

Special notes for your reviewer:

Release note:

Fixed an incorrect warning message for forced machine image update

Summary by CodeRabbit

  • New Features

    • Clearer expiration messaging with explicit version labels and distinct regular/forced/no-update states.
    • Improved machine image auto-update eligibility that respects update strategy and informs hint severity.
  • Tests

    • Updated test suites to validate the new expiration messages, update-availability flags, and updated utility behavior.

@gardener-prow gardener-prow Bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. labels Feb 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 12, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Refactors expiration/update logic: replaces severity strings with boolean flags (regularUpdate, forcedUpdate, noUpdate), adds utilities (machineImageHasUpdate, machineImageHasUpdateForAutoUpdateStrategy, getVersionExpirationWarning), and updates composables and components to compute and pass the new flags and version values.

Changes

Cohort / File(s) Summary
Tests
frontend/__tests__/composables/useCloudProfile/useKubernetesVersions.spec.js, frontend/__tests__/utils/index.spec.js
Updated expectations to include version and boolean flags; added/adjusted tests for machineImageHasUpdateForAutoUpdateStrategy while keeping compatibility checks for machineImageHasUpdate.
Utilities
frontend/src/utils/index.js
Added machineImageHasUpdate(), machineImageHasUpdateForAutoUpdateStrategy() (respects updateStrategy diffs), and getVersionExpirationWarning() (returns severity + flags regularUpdate, forcedUpdate, noUpdate).
Composables
frontend/src/composables/useCloudProfile/useKubernetesVersions.js, frontend/src/composables/useShootMessages.js
Replaced internal severity logic with getVersionExpirationWarning; return shapes now include version and spread expiration-warning flags; useShootMessages uses machineImageHasUpdateForAutoUpdateStrategy to determine auto-update eligibility and filters out falsy worker-group entries.
Message Components
frontend/src/components/ShootMessages/GK8sExpirationMessage.vue, frontend/src/components/ShootMessages/GWorkerGroupExpirationMessage.vue
Removed severity prop; added required props version, regularUpdate, forcedUpdate, noUpdate; updated conditional rendering and text to use booleans and version.
Consumers / UI wiring
frontend/src/components/ShootMessages/GShootMessages.vue, frontend/src/components/ShootWorkers/GMachineImage.vue
Adjusted prop destructuring/passing to provide version and boolean flags instead of severity; switched imports/usage from machineImageHasUpdate to machineImageHasUpdateForAutoUpdateStrategy in GMachineImage.vue; hint severity changed from warning → info.

Sequence Diagram(s)

sequenceDiagram
  participant UI as GShootMessages / GMachineImage
  participant Composable as useShootMessages / useKubernetesVersions
  participant Utils as utils (getVersionExpirationWarning, machineImageHasUpdateForAutoUpdateStrategy)
  participant Message as GK8s/GWorkerGroupExpirationMessage

  UI->>Composable: request expiration/update data
  Composable->>Utils: machineImageHasUpdateForAutoUpdateStrategy(...)
  Utils-->>Composable: updateAvailable / autoUpdatePossible
  Composable->>Utils: getVersionExpirationWarning({isExpirationWarning, autoPatchEnabled, updateAvailable, autoUpdatePossible})
  Utils-->>Composable: {severity, regularUpdate, forcedUpdate, noUpdate}
  Composable-->>UI: payloads with version + boolean flags
  UI->>Message: render with version, regularUpdate, forcedUpdate, noUpdate
  Message-->>UI: rendered messages
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Poem

🐰 Hop, hop — the old severity hopped away,
Flags now chatter what updates may stay,
regular, forced, or none in sight,
Versions shown bold, no message plight,
The rabbit cheers: clearer flags today! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive While most changes directly address the expiration messaging issue, introducing machineImageHasUpdateForAutoUpdateStrategy and exposing new utility functions may extend beyond the core bug fix scope. Clarify whether the new utility function exports and refactoring are essential to the core fix or represent ancillary improvements that could be separated.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix incorrect warning message for forced machine image updates' accurately describes the main change: correcting misleading expiration messages for machine images by replacing severity-based logic with explicit boolean flags.
Description check ✅ Passed The PR description addresses the template requirements with what the PR does, which issue it fixes (#2772), and includes a properly formatted release note in the bugfix user category.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #2772 by replacing severity-based message logic with explicit regularUpdate, forcedUpdate, and noUpdate flags, enabling correct handling of cases where updateStrategy (e.g., minor) has no update but newer versions exist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/fix_expiration_messages

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

@petersutter
Copy link
Copy Markdown
Member

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 12, 2026

✅ Actions performed

Full review triggered.

@grolu
Copy link
Copy Markdown
Member Author

grolu commented Feb 13, 2026

/cherry-pick hotfix-1.83

@gardener-ci-robot
Copy link
Copy Markdown
Contributor

@grolu: once the present PR merges, I will cherry-pick it on top of hotfix-1.83 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick hotfix-1.83

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Comment thread frontend/src/components/ShootMessages/GK8sExpirationMessage.vue Outdated
Comment thread frontend/src/components/ShootMessages/GShootMessages.vue Outdated
@gardener-robot
Copy link
Copy Markdown

@holgerkoser, @klocke-io You have pull request review open invite, please check

@gardener-prow gardener-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 19, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
backend/package.json (1)

80-80: No security advisories affect undici@7.22.0; be aware of changed request de-duplication behavior.

The update from ^7.18.2 to ^7.22.0 has no known CVEs. However, one behavioral change between these versions: undici v7.22.0 no longer deduplicates non-safe HTTP methods (POST, PUT, PATCH) by default. If your application relies on deduplication for these methods, test to ensure the behavior change is acceptable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/package.json` at line 80, Dependency undici was bumped to ^7.22.0
which changed deduplication behavior for non-safe HTTP methods; run integration
tests that exercise POST/PUT/PATCH paths and search the codebase for usages of
undici (the "undici" entry in package.json and any calls to Pool.request,
Client, or undici.fetch) to confirm no code relies on implicit dedupe; if you do
rely on it either pin the dependency back to ^7.18.2 in package.json or update
the affected requests to use undici's explicit deduplication mechanism per its
docs (or add explicit request-level options) so behavior remains correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@backend/package.json`:
- Line 80: Dependency undici was bumped to ^7.22.0 which changed deduplication
behavior for non-safe HTTP methods; run integration tests that exercise
POST/PUT/PATCH paths and search the codebase for usages of undici (the "undici"
entry in package.json and any calls to Pool.request, Client, or undici.fetch) to
confirm no code relies on implicit dedupe; if you do rely on it either pin the
dependency back to ^7.18.2 in package.json or update the affected requests to
use undici's explicit deduplication mechanism per its docs (or add explicit
request-level options) so behavior remains correct.

@grolu grolu force-pushed the bug/fix_expiration_messages branch from d93a643 to 274624f Compare February 19, 2026 15:27
@gardener-prow gardener-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 19, 2026
Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics
Align Kubernetes machine image expiration message
@grolu grolu force-pushed the bug/fix_expiration_messages branch from 274624f to 184ba16 Compare February 19, 2026 15:28
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/composables/useCloudProfile/useKubernetesVersions.js (1)

138-141: Pre-existing bug: ref validation uses && instead of ||.

The condition !isRef(k8sVersion) && !isRef(k8sAutoPatch) only throws when both arguments are not refs. It should throw if either is not a ref, matching the validation pattern in useAvailableKubernetesUpdates (line 83) and useKubernetesVersionIsNotLatestPatch (line 117).

This isn't introduced by this PR but could cause silent failures if only one argument is incorrectly passed.

Suggested fix
   function useKubernetesVersionExpiration (k8sVersion, k8sAutoPatch) {
-    if (!isRef(k8sVersion) && !isRef(k8sAutoPatch)) {
-      throw Error('k8sVersion and k8sAutoPatch must be a ref!')
+    if (!isRef(k8sVersion) || !isRef(k8sAutoPatch)) {
+      throw Error('k8sVersion and k8sAutoPatch must be refs!')
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/composables/useCloudProfile/useKubernetesVersions.js` around
lines 138 - 141, The ref validation in useKubernetesVersionExpiration currently
throws only when both k8sVersion and k8sAutoPatch are non-refs; change the
condition to throw when either is not a ref by replacing the logical AND with OR
(i.e., use !isRef(k8sVersion) || !isRef(k8sAutoPatch)), keeping the Error
message and leaving the rest of the function intact so it matches the validation
pattern used in useAvailableKubernetesUpdates and
useKubernetesVersionIsNotLatestPatch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/composables/useCloudProfile/useKubernetesVersions.js`:
- Around line 138-141: The ref validation in useKubernetesVersionExpiration
currently throws only when both k8sVersion and k8sAutoPatch are non-refs; change
the condition to throw when either is not a ref by replacing the logical AND
with OR (i.e., use !isRef(k8sVersion) || !isRef(k8sAutoPatch)), keeping the
Error message and leaving the rest of the function intact so it matches the
validation pattern used in useAvailableKubernetesUpdates and
useKubernetesVersionIsNotLatestPatch.

…when both arguments are not refs. It should throw if either is not a ref, matching the validation pattern in useAvailableKubernetesUpdates (line 83) and useKubernetesVersionIsNotLatestPatch (line 117).
Copy link
Copy Markdown
Member

@petersutter petersutter left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Feb 27, 2026

LGTM label has been added.

DetailsGit tree hash: 4d1bb764d4df4976bb5fe5059e2d06b9a1121e5b

@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: petersutter

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

The pull request process is described 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

@gardener-prow gardener-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2026
@grolu grolu merged commit f86088e into master Feb 27, 2026
35 of 36 checks passed
@grolu grolu deleted the bug/fix_expiration_messages branch February 27, 2026 11:30
@gardener-ci-robot
Copy link
Copy Markdown
Contributor

@grolu: #2775 failed to apply on top of branch "hotfix-1.83":

Applying: Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message
Using index info to reconstruct a base tree...
A	frontend/__tests__/composables/useCloudProfile/useKubernetesVersions.spec.js
M	frontend/src/components/ShootMessages/GShootMessages.vue
M	frontend/src/components/ShootWorkers/GMachineImage.vue
A	frontend/src/composables/useCloudProfile/useKubernetesVersions.js
A	frontend/src/composables/useShootMessages.js
M	frontend/src/utils/index.js
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): frontend/__tests__/composables/useCloudProfile/useKubernetesVersions.spec.js deleted in HEAD and modified in Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message.  Version Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message of frontend/__tests__/composables/useCloudProfile/useKubernetesVersions.spec.js left in tree.
Auto-merging frontend/src/components/ShootMessages/GShootMessages.vue
CONFLICT (content): Merge conflict in frontend/src/components/ShootMessages/GShootMessages.vue
Auto-merging frontend/src/components/ShootWorkers/GMachineImage.vue
CONFLICT (modify/delete): frontend/src/composables/useCloudProfile/useKubernetesVersions.js deleted in HEAD and modified in Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message.  Version Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message of frontend/src/composables/useCloudProfile/useKubernetesVersions.js left in tree.
CONFLICT (modify/delete): frontend/src/composables/useShootMessages.js deleted in HEAD and modified in Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message.  Version Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message of frontend/src/composables/useShootMessages.js left in tree.
Auto-merging frontend/src/utils/index.js
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Fix incorrect warning message for forced machine image updates Improve code readability by explicitly passing regularUpdate, forcedUpdate, and noUpdate parameters instead of using severity, which had implicit semantics Align Kubernetes machine image expiration message

Details

In response to this:

/cherry-pick hotfix-1.83

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misleading image version expiration message

4 participants