Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct/cg: write unified resources line by line #4186

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kolyshkin
Copy link
Contributor

It has been pointed out (in #4182) that some controllers can not accept multiple lines of output at once. In particular, io.max can only set one device at a time.

Practically, the only multi-line resource values we can get come from unified.* -- let's write those line by line.

Add a test case.

Reported-by: Tao Shen shentaoskyking@gmail.com

Closes: #4182

@kolyshkin
Copy link
Contributor Author

@smileusd does this fix your issue?

It has been pointed out that some controllers can not accept multiple
lines of output at once. In particular, io.max can only set one device
at a time.

Practically, the only multi-line resource values we can get come from
unified.* -- let's write those line by line.

Add a test case.

Reported-by: Tao Shen <shentaoskyking@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@smileusd
Copy link

smileusd commented Apr 2, 2024

-> @smileusd does this fix your issue?
yes could you merge this

@kolyshkin kolyshkin added this to the 1.2.0 milestone Apr 22, 2024
// is is written line by line.
func WriteFileByLine(dir, file, data string) error {
i := strings.Index(data, "\n")
if i == -1 {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this special block.
Others LGTM.

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

Successfully merging this pull request may close these issues.

None yet

3 participants