Skip to content

OCPBUGS-85428: Lowercase the start of all error messages#6106

Open
anandram2 wants to merge 5 commits into
openshift:mainfrom
anandram2:fix-error-message-casing
Open

OCPBUGS-85428: Lowercase the start of all error messages#6106
anandram2 wants to merge 5 commits into
openshift:mainfrom
anandram2:fix-error-message-casing

Conversation

@anandram2
Copy link
Copy Markdown

@anandram2 anandram2 commented May 29, 2026

- What I did
Lowercased the first letter of error messages to comply with Staticcheck rule ST1005.

- How to verify it
Run staticcheck -checks ST1005 ./...

- Description for the changelog
Lowercased first letter of all error messages. Fixes: OCPBUGS-85428

Summary by CodeRabbit

  • Style

    • Standardized error-message wording, capitalization, and punctuation across controllers, utilities, and tests for more consistent logs.
  • Bug Fixes

    • Improved error formatting and wrapping to produce clearer, more consistent diagnostic messages throughout the system.

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR standardizes error message formatting and, in some returns, switches to Go %w wrapping across controllers, operator, server, daemon, and test helpers; no control flow, behavior, or public API signatures were changed.

Changes

Error Message Standardization

Layer / File(s) Summary
Error message casing and %w wrapping updates
pkg/controller/*, pkg/operator/*, pkg/server/*, pkg/daemon/*, pkg/osimagestream/*, test/extended-priv/*, test/helpers/*
Many fmt.Errorf and utilruntime.HandleError messages were lowercased/reworded for consistency; several error returns were changed to wrap underlying errors using %w. No functional or API changes.

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels: lgtm

Suggested reviewers:

  • djoshy
🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 67.39% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly and precisely summarizes the primary change: lowercasing error message prefixes across the entire codebase to comply with Staticcheck rule ST1005.
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.
Stable And Deterministic Test Names ✅ Passed PR focuses on error message casing and does not modify any Ginkgo test names. Existing Ginkgo tests use stable, deterministic, static strings without dynamic content.
Test Structure And Quality ✅ Passed This PR changes only error message capitalization and wrapping. No Ginkgo test structure, setup/cleanup, timeouts, assertions, or test patterns were modified.
Microshift Test Compatibility ✅ Passed This PR only modifies error message capitalization and error wrapping semantics in production code and test helpers—no new Ginkgo e2e tests are added. The custom check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR makes no changes to Ginkgo e2e tests; it only updates error message capitalization in existing controller, operator, and utility code. The SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only error message text (capitalization/wrapping) in Go source files; no deployment manifests or scheduling constraints introduced.
Ote Binary Stdout Contract ✅ Passed PR only changes error message strings (lowercasing) and error wrapping. No new process-level stdout writes (fmt.Print) are introduced that would violate OTE's JSON stdout contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR does not add new Ginkgo e2e tests; it only adjusts error message casing and wrapping in existing source code and test utilities. Check not applicable.
No-Weak-Crypto ✅ Passed PR contains only error message capitalization changes with no cryptographic code additions, imports, or modifications that would trigger the no-weak-crypto check.
Container-Privileges ✅ Passed PR modifies only Go source files with error message casing changes; no K8s manifests or container privilege configurations are modified.
No-Sensitive-Data-In-Logs ✅ Passed PR changes only lowercase error message text and modify error wrapping (%v→%w); no new sensitive data logging introduced. Pre-existing kubeconfig logging was not added by this PR.

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

✨ 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 and usage tips.

@openshift-ci openshift-ci Bot requested review from djoshy and dkhater-redhat May 29, 2026 17:28
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anandram2
Once this PR has been reviewed and has the lgtm label, please assign dkhater-redhat 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 29, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

Hi @anandram2. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

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.

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/operator/render.go (1)

411-432: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix accidental leading L in error messages.

Line 411 and Line 432 prepend an unintended L ("LInvalid", "LAzure"), which looks like a typo and breaks message standardization.

Proposed fix
-					return nil, fmt.Errorf("LInvalid AWS Load Balancer Type provided : %s", lbType)
+					return nil, fmt.Errorf("invalid AWS Load Balancer Type provided : %s", lbType)
...
-				return nil, fmt.Errorf("LAzure %s Load Balancer IPs unavailable when the DNSType is ClusterHosted", lbType)
+				return nil, fmt.Errorf("azure %s Load Balancer IPs unavailable when the DNSType is ClusterHosted", lbType)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/operator/render.go` around lines 411 - 432, In pkg/operator/render.go,
fix the typo in the error message strings returned by the logic that handles
AWS/Azure load balancer IP state (functions/branches using
cloudPlatformLoadBalancerIPState, availableLBIPState, absentLBIPState and the
lbType switch): remove the accidental leading "L" from the messages ("LInvalid"
-> "Invalid" and "LAzure" -> "Azure") so fmt.Errorf calls produce standardized
messages; keep the surrounding logic and return values unchanged.
🧹 Nitpick comments (2)
pkg/operator/sync.go (1)

1157-1157: ⚡ Quick win

Wrap the create error with %w.

Line 1157 still uses %v, which prevents error unwrapping and diverges from adjacent %w migrations.

Proposed fix
-					return fmt.Errorf("could not make kubeconfig-data CM, %v", err)
+					return fmt.Errorf("could not make kubeconfig-data CM: %w", err)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/operator/sync.go` at line 1157, Replace the non-wrapping fmt.Errorf call
that uses "%v" when returning the create error (the statement returning
fmt.Errorf("could not make kubeconfig-data CM, %v", err)) with an error wrap
using "%w" so callers can unwrap the original error (e.g., produce a message
like "could not make kubeconfig-data CM: %w" wrapping err); locate the
fmt.Errorf(...) that references kubeconfig-data CM and change the format verb
only, preserving the same message text and the err variable.
test/extended-priv/machineosconfig.go (1)

131-131: ⚡ Quick win

Keep the underlying error in these returned errors.

These new messages drop the original err, which weakens failure triage. Wrap/include the original error (%w) so callers retain full context.

Suggested fix
-			return NewMachineOSConfig(oc, name), fmt.Errorf("could not extract dockerConfig from the namespaced pull secret")
+			return NewMachineOSConfig(oc, name), fmt.Errorf("could not extract dockerConfig from the namespaced pull secret: %w", err)

-			return NewMachineOSConfig(oc, name), fmt.Errorf("could not extract dockerConfig from the cluster's pull secret")
+			return NewMachineOSConfig(oc, name), fmt.Errorf("could not extract dockerConfig from the cluster's pull secret: %w", err)

-			return NewMachineOSConfig(oc, name), fmt.Errorf("could not merge the namespaced pull-secret dockerconfig and the cluster's pull-secret docker config")
+			return NewMachineOSConfig(oc, name), fmt.Errorf("could not merge the namespaced pull-secret dockerconfig and the cluster's pull-secret docker config: %w", err)

-			return NewMachineOSConfig(oc, name), fmt.Errorf("could not configure the cluster's pull-secret with the merged dockerconfig")
+			return NewMachineOSConfig(oc, name), fmt.Errorf("could not configure the cluster's pull-secret with the merged dockerconfig: %w", err)

-		return nil, fmt.Errorf("error copying the resulting authorization file to local")
+		return nil, fmt.Errorf("error copying the resulting authorization file to local: %w", err)

Also applies to: 137-137, 142-142, 147-147, 437-437

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/extended-priv/machineosconfig.go` at line 131, The error returns
currently discard the original error; change the fmt.Errorf calls that return
NewMachineOSConfig(oc, name), fmt.Errorf("could not extract dockerConfig from
the namespaced pull secret") to wrap the underlying err (use fmt.Errorf("...:
%w", err)) so the original error is preserved; update the similar return sites
(the fmt.Errorf uses at the lines referenced, i.e. the occurrences around the
NewMachineOSConfig(oc, name) returns) to wrap the original err with %w in each
fmt.Errorf invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/controller/kubelet-config/kubelet_config_features.go`:
- Line 166: Update the tombstone error message to reference the correct object
type: change the fmt.Errorf call in the tombstone handler (the
utilruntime.HandleError(...) invocation in kubelet_config_features.go) so it
reports "*osev1.FeatureGate" (or "FeatureGate") instead of "KubeletConfig";
ensure the message text and any surrounding context reflect that this handler
expects a *osev1.FeatureGate to make debugging accurate.

In `@pkg/operator/status.go`:
- Line 585: Two error return strings have an accidental leading "L" in
pkg/operator/status.go; update the fmt.Errorf calls that build messages for
ctrlcommon.ReleaseImageVersionAnnotationKey (using renderedMC.Name and
releaseVersion) and the similar one for the boot image annotation to remove the
stray "L" prefix so the messages start with "Unable..." and "Boot..."
respectively, leaving the rest of the formatting and variables unchanged.

In `@pkg/operator/sync.go`:
- Around line 2126-2131: The error messages returned after calling setGVK
contain a stray leading "L" ("LFailed...") — fix both occurrences by updating
the fmt.Errorf calls that wrap errors from setGVK (the ones handling the infra
object and the dns object) to start with "Failed setting gvk for infra object:
%w" and "Failed setting gvk for dns object: %w" respectively so the messages
read correctly; locate the fmt.Errorf calls surrounding setGVK(dns,
configclientscheme.Scheme) and the equivalent infra object setGVK call and
remove the accidental leading "L".

In `@pkg/server/server.go`:
- Line 282: The error string returned when downgrade detection fails contains a
stray leading "L" ("LCan't serve version %s with ignition
KernelArguments.ShouldNotExist populated"); remove the leading "L" so the
message reads "Can't serve version %s with ignition
KernelArguments.ShouldNotExist populated". Update the return value in the
function that produces this error (the return fmt.Errorf(...) call in server.go)
to use the corrected string.

In `@test/extended-priv/configmap.go`:
- Around line 59-60: The error message in the ConfigMap error return contains an
accidental leading "L" ("LKey ...") — update the string in the return that
builds the error (the fmt.Errorf call referencing key, cm.GetNamespace(),
cm.GetName()) to remove the stray "L" so it reads "Key %s does not exist in the
.data in Configmap -n %s %s"; locate the fmt.Errorf usage in
test/extended-priv/configmap.go that returns the error with variables key and cm
and correct the prefix.

In `@test/extended-priv/containerruntimeconfig.go`:
- Line 63: The error message in the fmt.Errorf call that returns the finalizer
contains a stray leading "L" ("LIt was not possible..."); update the format
string used where fmt.Errorf is called (the line that references cr.GetKind(),
cr.GetName(), cr.PrettyString()) to remove the stray "L" and produce a clean,
correctly capitalized message such as "It was not possible to get the finalizer
from %s %s: %s".

In `@test/extended-priv/controller.go`:
- Line 112: There are two error messages that mistakenly include a duplicated
"LL" prefix in the string (e.g., the fmt.Errorf call that currently builds
"LLCannot get controller pod name. Failed getting MCO controller logs"); locate
those fmt.Errorf invocations in test/extended-priv/controller.go (the
occurrences around the controller pod name retrieval and the later similar
error) and change the message to remove the extra "LL" so it reads "Cannot get
controller pod name. Failed getting MCO controller logs" (and the analogous
message at the second occurrence) ensuring both error strings are consistent.

In `@test/extended-priv/controllerconfig.go`:
- Line 121: Remove the accidental "LL" prefix in the bundle-not-found error
messages: locate the fmt.Errorf calls that construct the message "LLThere is no
image registry bundle with file name %s" (seen at lines near the return in
controllerconfig.go) and change the format string to "There is no image registry
bundle with file name %s" in both occurrences (also the similar one around line
136) so the error reads correctly without the stray "LL".

In `@test/extended-priv/controlplanemachineset.go`:
- Line 371: The returned error strings contain an accidental leading "L" (e.g.
"LFailed to get disks array: %v" and "LNo ...") — remove the stray "L" from
those error messages so they read "Failed to get disks array: %v" and "No ..."
respectively; update the literal error strings wherever "LFailed" or "LNo"
appear (search for those exact substrings) to fix the returned errors in the
function that constructs those fmt.Errorf calls.

In `@test/extended-priv/inside_node_containers.go`:
- Line 76: Replace the accidental leading "L" in error message prefixes so
returned errors use "Error" instead of "LError"; locate the formatting strings
that read e.g. "LError extracting pull-secret. Error: %s" and similar
occurrences noted (also at the other reported spots) and update them to "Error
extracting pull-secret. Error: %s" (and analogous messages) in the functions
that build those errors so all returned fmt.Errorf(...) calls produce
consistently prefixed "Error ..." messages.

In `@test/extended-priv/machineconfigpool.go`:
- Around line 854-855: The error message uses the pool's name instead of the
node's name; update the fmt.Errorf call that currently passes mcp.GetName() to
instead pass node.GetName() so the returned error "error restoring desired
config in node %s" shows the actual node name (locate the fmt.Errorf invocation
near the mcp and node variables and replace the argument to GetName
accordingly).

In `@test/extended-priv/node.go`:
- Around line 1276-1280: The guard after computing availIndex is wrong: it
checks usedIndex instead of availIndex, which can allow availIndex == -1 and
cause a panic when accessing match[availIndex]; update the condition to check
availIndex (< 0) and return the fmt.Errorf with stdout if missing, ensuring the
code around re.SubexpIndex("Avail"), availIndex, match and strconv.ParseInt uses
the corrected guard before using match[availIndex].
- Around line 405-407: The error path that checks "if lenImageSplit < 2" logs
"%s" with err (which is often nil) and thus loses context; change the formatted
message to include the actual image reference string you attempted to parse (the
variable holding the container image value that was split) instead of err, so
the error becomes something like "wrong container-image-reference in deployment:
<imageRef>\n<deployment>" and update the process/error formatting in that branch
(refer to lenImageSplit, err, and deployment to locate the code).

In `@test/extended-priv/util.go`:
- Around line 964-965: Replace the misspelled error message string "no
current-contenxt in the provided kubeconfig" with the correct text "no
current-context in the provided kubeconfig" so the error returned by the
function (the line returning fmt.Errorf(...)) uses the proper `current-context`
spelling for clarity and reliable grepability.

In `@test/helpers/utils.go`:
- Around line 526-527: The error returned from CreateToken is being discarded;
update the error return to wrap the original err so debugging context is
preserved (e.g., change the fmt.Errorf call used where err != nil in the block
referencing CreateToken to include the original error with %w or errors.Wrap).
Locate the clause that checks `if err != nil` after calling CreateToken in
test/helpers/utils.go and modify the return from `fmt.Errorf("could not request
openshift-monitoring token")` to a wrapped error containing `err` (keeping the
same descriptive message) so callers can inspect the underlying cause.
- Around line 622-623: The code currently discards the original error after
calling Get (the err variable) and returns a generic message; update the error
return to wrap the original error so callers retain context (e.g., change the
return that currently uses fmt.Errorf("could not get in-cluster
kube-apiserver-client-ca configmap") to include the original err using
fmt.Errorf("could not get in-cluster kube-apiserver-client-ca configmap: %w",
err)), locating the change around the Get call and the err variable handling.

---

Outside diff comments:
In `@pkg/operator/render.go`:
- Around line 411-432: In pkg/operator/render.go, fix the typo in the error
message strings returned by the logic that handles AWS/Azure load balancer IP
state (functions/branches using cloudPlatformLoadBalancerIPState,
availableLBIPState, absentLBIPState and the lbType switch): remove the
accidental leading "L" from the messages ("LInvalid" -> "Invalid" and "LAzure"
-> "Azure") so fmt.Errorf calls produce standardized messages; keep the
surrounding logic and return values unchanged.

---

Nitpick comments:
In `@pkg/operator/sync.go`:
- Line 1157: Replace the non-wrapping fmt.Errorf call that uses "%v" when
returning the create error (the statement returning fmt.Errorf("could not make
kubeconfig-data CM, %v", err)) with an error wrap using "%w" so callers can
unwrap the original error (e.g., produce a message like "could not make
kubeconfig-data CM: %w" wrapping err); locate the fmt.Errorf(...) that
references kubeconfig-data CM and change the format verb only, preserving the
same message text and the err variable.

In `@test/extended-priv/machineosconfig.go`:
- Line 131: The error returns currently discard the original error; change the
fmt.Errorf calls that return NewMachineOSConfig(oc, name), fmt.Errorf("could not
extract dockerConfig from the namespaced pull secret") to wrap the underlying
err (use fmt.Errorf("...: %w", err)) so the original error is preserved; update
the similar return sites (the fmt.Errorf uses at the lines referenced, i.e. the
occurrences around the NewMachineOSConfig(oc, name) returns) to wrap the
original err with %w in each fmt.Errorf invocation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ad4c85b8-9e32-454a-bdb8-0b5dafe5a479

📥 Commits

Reviewing files that changed from the base of the PR and between d72b715 and 0fab707.

📒 Files selected for processing (38)
  • pkg/controller/bootimage/vsphere_helpers.go
  • pkg/controller/build/osbuildcontroller.go
  • pkg/controller/common/helpers.go
  • pkg/controller/kubelet-config/kubelet_config_controller.go
  • pkg/controller/kubelet-config/kubelet_config_features.go
  • pkg/controller/kubelet-config/kubelet_config_nodes.go
  • pkg/controller/node/node_controller.go
  • pkg/controller/render/render_controller.go
  • pkg/controller/template/render.go
  • pkg/operator/render.go
  • pkg/operator/status.go
  • pkg/operator/sync.go
  • pkg/server/server.go
  • test/extended-priv/configmap.go
  • test/extended-priv/containerruntimeconfig.go
  • test/extended-priv/controller.go
  • test/extended-priv/controllerconfig.go
  • test/extended-priv/controlplanemachineset.go
  • test/extended-priv/gomega_json_matcher.go
  • test/extended-priv/gomega_matchers.go
  • test/extended-priv/inside_node_containers.go
  • test/extended-priv/jsondata.go
  • test/extended-priv/kubeletconfig.go
  • test/extended-priv/machine.go
  • test/extended-priv/machineconfigpool.go
  • test/extended-priv/machineosbuild.go
  • test/extended-priv/machineosconfig.go
  • test/extended-priv/machineset.go
  • test/extended-priv/mco_bootimages.go
  • test/extended-priv/mco_scale.go
  • test/extended-priv/mco_security.go
  • test/extended-priv/node.go
  • test/extended-priv/remote_images.go
  • test/extended-priv/remotefile_gomegamatchers.go
  • test/extended-priv/resource.go
  • test/extended-priv/util.go
  • test/extended-priv/util/vsphere.go
  • test/helpers/utils.go

Comment thread pkg/controller/kubelet-config/kubelet_config_features.go
Comment thread pkg/operator/status.go Outdated
Comment thread pkg/operator/sync.go Outdated
Comment thread pkg/server/server.go Outdated
Comment thread test/extended-priv/configmap.go Outdated
Comment thread test/extended-priv/node.go
Comment thread test/extended-priv/node.go
Comment thread test/extended-priv/util.go
Comment thread test/helpers/utils.go
Comment thread test/helpers/utils.go
@anandram2
Copy link
Copy Markdown
Author

/retitle OCPBUGS-85428 Lowercase the start of all error messages

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 29, 2026

@anandram2: Re-titling can only be requested by trusted users, like repository collaborators.

Details

In response to this:

/retitle OCPBUGS-85428 Lowercase the start of all error messages

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.

@anandram2 anandram2 changed the title Lowercase the start of all error messages OCPBUGS-85428 Lowercase the start of all error messages May 29, 2026
@isabella-janssen
Copy link
Copy Markdown
Member

/retitle OCPBUGS-85428: Lowercase the start of all error messages

@openshift-ci openshift-ci Bot changed the title OCPBUGS-85428 Lowercase the start of all error messages OCPBUGS-85428: Lowercase the start of all error messages May 29, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 29, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@anandram2: This pull request references Jira Issue OCPBUGS-85428, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

- What I did
Lowercased the first letter of error messages to comply with Staticcheck rule ST1005.

- How to verify it
Run staticcheck -checks ST1005 ./...

- Description for the changelog
Lowercased first letter of all error messages. Fixes: OCPBUGS-85428

Summary by CodeRabbit

  • Style

  • Standardized error message formatting across multiple controllers and utilities, updating capitalization and wording for consistency in error output.

  • Updated error messages in various helper methods and test utilities to use lowercase initial letters and refined phrasing.

  • Bug Fixes

  • Corrected error message formatting in controller configuration and platform-specific utilities.

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 openshift-eng/jira-lifecycle-plugin repository.

@isabella-janssen
Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 29, 2026
@anandram2 anandram2 force-pushed the fix-error-message-casing branch from 5057fa5 to deb1e51 Compare May 29, 2026 20:54
@anandram2
Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@anandram2: This pull request references Jira Issue OCPBUGS-85428, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@anandram2
Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 29, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@anandram2: This pull request references Jira Issue OCPBUGS-85428, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@anandram2
Copy link
Copy Markdown
Author

/retest-required

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@anandram2: This pull request references Jira Issue OCPBUGS-85428, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

- What I did
Lowercased the first letter of error messages to comply with Staticcheck rule ST1005.

- How to verify it
Run staticcheck -checks ST1005 ./...

- Description for the changelog
Lowercased first letter of all error messages. Fixes: OCPBUGS-85428

Summary by CodeRabbit

  • Style

  • Standardized error-message wording, capitalization, and punctuation across controllers, utilities, and tests for more consistent logs.

  • Bug Fixes

  • Corrected numerous inconsistent error-string formats to improve clarity and reliability of logged diagnostics and troubleshooting output.

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown
Member

@cheesesashimi cheesesashimi left a comment

Choose a reason for hiding this comment

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

Nice job on this! In the interest of completeness, we should probably also search for errors that were constructed using errors.New(). Here's a ripgrep incantation you can use:

$ rg -g '!vendor' --context=0 'errors\.New\(\"[A-Z]'
pkg/daemon/daemon.go
191:var ErrAuxiliary = errors.New("Error from auxiliary packages")

pkg/osimagestream/clusterversion.go
29:		return "", errors.New("ClusterVersion desired image is not yet available")
38:		return nil, errors.New("ClusterVersion cannot be nil")
47:		return nil, errors.New("ClusterVersion has no completed updates in history")

pkg/operator/status_test.go
35:	configNotFound := errors.New("Config Not Found")

pkg/controller/bootstrap/bootstrap.go
570:		return errors.New("Manifest: UnmarshalJSON on nil pointer")

pkg/controller/common/iri_secret_merger.go
24:var errIRIDisabled = errors.New("IRI not enabled or not present")

The only one that I would not change is the one in pkg/controller/common/iri_secret_merger.go since that one is an acronym.

There are also a few CodeRabbit comments where it suggests adding additional context to the error being returned by wrapping the error. Those are pretty easy to resolve by doing something like this:

if err != nil {
    return fmt.Errorf("couldn't fulfill request: %w", err)
}

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 3, 2026
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 3, 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/apiserver-watcher/run.go`:
- Line 113: The returned error message contains a typo: change the string
"failed to start heath checker" to "failed to start health checker" in the error
return (the fmt.Errorf call shown in cmd/apiserver-watcher/run.go), so the
returned error reads "failed to start health checker: %w" and preserves the
wrapped err.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 32564bfd-6b55-42bd-8173-02c53d0af160

📥 Commits

Reviewing files that changed from the base of the PR and between 07e38e3 and 34b2b63.

📒 Files selected for processing (12)
  • cmd/apiserver-watcher/run.go
  • pkg/controller/bootimage/cache/cache.go
  • pkg/controller/bootstrap/bootstrap.go
  • pkg/controller/container-runtime-config/helpers.go
  • pkg/controller/drain/drain_controller.go
  • pkg/controller/kubelet-config/kubelet_config_controller.go
  • pkg/daemon/certificate_writer.go
  • pkg/daemon/daemon.go
  • pkg/operator/status_test.go
  • pkg/operator/sync.go
  • pkg/osimagestream/clusterversion.go
  • test/extended-priv/machineosconfig.go
✅ Files skipped from review due to trivial changes (2)
  • pkg/osimagestream/clusterversion.go
  • pkg/operator/status_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/controller/kubelet-config/kubelet_config_controller.go
  • test/extended-priv/machineosconfig.go


if err := h.Start(); err != nil {
return fmt.Errorf("failed to start heath checker: %v", err)
return fmt.Errorf("failed to start heath checker: %w", err)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix typo in error text ("heath" → "health").

Line 113 has a typo in the returned error message, which makes troubleshooting output less clear.

Suggested patch
-		return fmt.Errorf("failed to start heath checker: %w", err)
+		return fmt.Errorf("failed to start health checker: %w", err)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/apiserver-watcher/run.go` at line 113, The returned error message
contains a typo: change the string "failed to start heath checker" to "failed to
start health checker" in the error return (the fmt.Errorf call shown in
cmd/apiserver-watcher/run.go), so the returned error reads "failed to start
health checker: %w" and preserves the wrapped err.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 3, 2026

@anandram2: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/unit 58d7528 link true /test unit
ci/prow/verify 58d7528 link true /test verify
ci/prow/bootstrap-unit 58d7528 link true /test bootstrap-unit
ci/prow/images 58d7528 link true /test images
ci/prow/okd-scos-images 58d7528 link true /test okd-scos-images

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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

Labels

jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants