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

Serialize the container_filesystem and image_filesystem in addition for file stats. #1310

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

kannon92
Copy link
Contributor

@kannon92 kannon92 commented Dec 7, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

While testing the split filesystem test case, I found out that we weren't reporting which json object corresponded to which filesystem.

We were not serializing the key. This PR will serialize the image_filesystem and container_filesystem for yaml, json and go-template.

Before this PR, we were returning the following object for json output (default):

{
  "status": {
      {
        "timestamp": "1701985250615496190",
        "fsId": {
          "mountpoint": "/disk/containers/overlay-images"
        },
        "usedBytes": {
          "value": "20844"
        },
        "inodesUsed": {
          "value": "16"
        }
"status":      {
        "timestamp": "1701985250615496190",
        "fsId": {
          "mountpoint": "/disk/containers/overlay-images"
        },
        "usedBytes": {
          "value": "20844"
        },
        "inodesUsed": {
          "value": "16"
        }
      }
    ]
  }
}

Now we return:

{
  "status": {
    "imageFilesystems": [
      {
        "timestamp": "1701985250615496190",
        "fsId": {
          "mountpoint": "/disk/containers/overlay-images"
        },
        "usedBytes": {
          "value": "20844"
        },
        "inodesUsed": {
          "value": "16"
        }
      }
    ],
    "containerFilesystems": [
      {
        "timestamp": "1701985250615496190",
        "fsId": {
          "mountpoint": "/disk/containers/overlay-images"
        },
        "usedBytes": {
          "value": "20844"
        },
        "inodesUsed": {
          "value": "16"
        }
      }
    ]
  }
}

For table, we will output the values of each entry in the filesystem and give a label for each type of filesystem.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add a key for image and container filesystems.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 7, 2023
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 7, 2023
@haircommander
Copy link
Contributor

/approve

LGTM

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2023
@kannon92
Copy link
Contributor Author

kannon92 commented Dec 7, 2023

/cc @SergeyKanzhelev @saschagrunert

The original PR was correct but it wasn't ideal for observability/UX.

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Thanks for the follow-up!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 8, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, kannon92, saschagrunert

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [haircommander,saschagrunert]

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 merged commit 84f9d94 into kubernetes-sigs:master Dec 8, 2023
23 checks passed
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants