Skip to content

Conversation

@kolyshkin
Copy link
Contributor

@kolyshkin kolyshkin commented Jun 18, 2025

This results in different JSON than the older version:

Before commit fd4995c:

    "cgroups": {
      ...
      "devices": [
        ...

After:

    "cgroups": {
      ...
      "Resources": {
        "devices": [
          ...

This breaks backward compatibility for runc.

Fixes: fd4995c ("Add omitempty JSON attribute for some fields")

This results in different JSON than the older version:

Before commit fd4995c:

    "cgroups": {
      ...
      "devices": [
        ...

After:

    "cgroups": {
      ...
      "Resources": {
        "devices": [

This breaks backward compatibility for runc.

Fixes: fd4995c ("Add omitempty JSON attribute for some fields")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin kolyshkin added this to the 0.0.3 milestone Jun 18, 2025
@kolyshkin
Copy link
Contributor Author

This is a regression in v0.0.2, so I'll release v0.0.3 as a hotfix as soon as this is merged. @opencontainers/cgroups-maintainers PTAL.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

oof; thanks!

As a follow-up, should we add some basic unit-tests with fixtures for JSON produced to make sure changes more apparent ?

LGTM

@thaJeztah thaJeztah merged commit b970779 into opencontainers:main Jun 18, 2025
14 checks passed
@kolyshkin
Copy link
Contributor Author

kolyshkin commented Jun 18, 2025

oof; thanks!

As a follow-up, should we add some basic unit-tests with fixtures for JSON produced to make sure changes more apparent ?

I thought about that and basically almost all changes to JSON attributes result in changes to JSON being produced (but only some changes result in a change to JSON structure). So I am not really sure how to test it in a generic way :-\

kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 18, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   (opencontainers#4772).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 18, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 18, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 19, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 19, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Due to item 2, modify some tests accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
kolyshkin added a commit to kolyshkin/runc that referenced this pull request Jun 19, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Due to item 2, modify some tests accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
jaredledvina pushed a commit to DataDog/runc that referenced this pull request Sep 23, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Due to item 2, modify some tests accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
jaredledvina pushed a commit to DataDog/runc that referenced this pull request Sep 23, 2025
For changelog, see https://github.com/opencontainers/cgroups/releases/tag/v0.0.3

This fixes two runc issues:

1. JSON incompatibility introduced in cgroups v0.0.2 (see
   opencontainers/cgroups#22).

2. Bad CPU shares to CPU weight conversion (see
   opencontainers#4772).

Due to item 2, modify some tests accordingly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
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.

4 participants