Skip to content

Conversation

@pohly
Copy link

@pohly pohly commented Jan 30, 2026

What this PR does / why we need it:

When the hook returns a multi-line string, for example a YAML dump, then continuing directly after the end of that string with the next key/value pair was a bit hard to read:

dra_manager.go:288: I0129 17:41:55.722711] scheduler: Finished GatherAllocatedState allocatedDevices=<struct { Count int "json:\"count\""; Devices []string "json:\"devices\"" }>:
  ...
               - testdra-all-usesallresources-qzvpg.driver/worker-7/worker-7-device-005 err=<nil>: nil

In this example, allocatedDevices was passed by the hook to gomega.Format which added the type description and then produced YAML. With this change, such output becomes:

dra_manager.go:288: I0129 17:41:55.722711] scheduler: Finished GatherAllocatedState allocatedDevices=<
	<struct { Count int "json:\"count\""; Devices []string "json:\"devices\"" }>:
	...
 	              - testdra-all-usesallresources-qzvpg.driver/worker-7/worker-7-device-005
 > err=<nil>: nil

Which issue(s) this PR fixes:

kubernetes/kubernetes#136268 (comment)

Special notes for your reviewer:

Release note:

ktesting: support multi-line result from AnyToStringHook by applying the normal multi-line escaping.

/assign @tallclair

When the hook returns a multi-line string, for example a YAML dump,
then continuing directly after the end of that string with the next key/value
pair was a bit hard to read:

    dra_manager.go:288: I0129 17:41:55.722711] scheduler: Finished GatherAllocatedState allocatedDevices=<struct { Count int "json:\"count\""; Devices []string "json:\"devices\"" }>:
      ...
                   - testdra-all-usesallresources-qzvpg.driver/worker-7/worker-7-device-005 err=<nil>: nil

In this example, allocatedDevices was passed by the hook to gomega.Format which
added the type description and then produced YAML. With this change, such
output becomes:

    dra_manager.go:288: I0129 17:41:55.722711] scheduler: Finished GatherAllocatedState allocatedDevices=<
    	<struct { Count int "json:\"count\""; Devices []string "json:\"devices\"" }>:
    	...
     	              - testdra-all-usesallresources-qzvpg.driver/worker-7/worker-7-device-005
     > err=<nil>: nil
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pohly

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 30, 2026
@k8s-ci-robot k8s-ci-robot requested a review from dims January 30, 2026 17:12
@k8s-ci-robot
Copy link

This issue is currently awaiting triage.

If klog contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 30, 2026
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants