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

Fixes invalid JSON in crictl info #1429

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

laozc
Copy link
Member

@laozc laozc commented May 20, 2024

containerd on Windows may not escape the return message for Status request
lastCNILoadStatus: "cni config load failed: no network config found in C:\Program Files\containerd\cni\conf: cni plugin not initialized: failed to load cni config"
This may result in invalid JSON in crictl info
getting status of runtime: invalid character 'P' in string escape code

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes: #1426

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 20, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 20, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label May 20, 2024
for _, k := range keys {
var res interface{}
// We attempt to convert key into JSON if possible else use it directly
Copy link
Member

Choose a reason for hiding this comment

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

as you working on this, can you please add a unit test as well to cover this case and others. On a surface, this looks OK, but having unit tests will make reviewing of this much easier

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 3, 2024
@feiskyer
Copy link
Member

feiskyer commented Jun 4, 2024

Thanks for the fix, could you fix the lint errors?

containerd on Windows may not escape the return message which may
result in invalid JSON in crictl info.
Message from containerd:
cni config load failed: no network config found in C:\Program Files
\containerd\cni\conf: cni plugin
not initialized: failed to load cni config
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 4, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: laozc, 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:

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2024
@k8s-ci-robot k8s-ci-robot merged commit 4e314cd into kubernetes-sigs:master Jun 4, 2024
23 checks passed
@saschagrunert
Copy link
Member

This seems to break usage with CRI-O:

FATA[0000] getting status of runtime: json: cannot unmarshal array into Go value of type map[string]interface {}

Coming from: https://github.com/kubernetes-sigs/cri-tools/pull/1429/files#diff-10fd578be2b3eb945db0ff6ff5fa5433d9f0de3ad7b773b9a45460a99f0c3910R250-R255

I'm going to revert for now to unblock our CI.

@laozc
Copy link
Member Author

laozc commented Jun 4, 2024

Sure. I will double check the case with CRI-O.

@saschagrunert
Copy link
Member

@laozc do you mind reopening this?

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/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubeadm join fails on Windows return getting status of runtime: invalid character 'P' in string escape code
5 participants