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

Support State.Error field in inspect command #242

Closed
ningziwen opened this issue Feb 25, 2023 · 1 comment
Closed

Support State.Error field in inspect command #242

ningziwen opened this issue Feb 25, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ningziwen
Copy link
Member

ningziwen commented Feb 25, 2023

What is the problem you're trying to solve?.
finch inspect cannot return State.Error field today.

finch run -d public.ecr.aws/amazonlinux/amazonlinux:2
21763af8553f5c077ba53b2cd0bb1857a77aeae979fa06829060209ceafaa7e5

finch inspect --format
{{.State.Status}}:{{.State.Error}} 21763af8553f5c077ba53b2cd0bb1857a77aeae979fa06829060209ceafaa7e5
WARN[0000] failed to inspect NetNS                       error="failed to Statfs \"/proc/3772/ns/net\": no such file or directory" id=21763af8553f5c077ba53b2cd0bb1857a77aeae979fa06829060209ceafaa7e5
FATA[0000] 1 errors: [template parsing error: template: :1:26: executing "" at <.State.Error>: map has no entry for key "Error"]
FATA[0000] exit status 1

# State.Error does not exist
finch inspect 21763af8553f5c077ba53b2cd0bb1857a77aeae979fa06829060209ceafaa7e5
...
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "Pid": 3772,
            "ExitCode": 0,
            "FinishedAt": "2023-02-25T10:57:13.718764398Z"
        },
...

Describe the feature you'd like
State.Error should exist in the inspect response

Additional context
Can reproduce in nerdctl.

$ nerdctl run -d public.ecr.aws/amazonlinux/amazonlinux:2
2fd4c9d197320279055bfca5a109433935e762fc91bcbe371815a6cf7f39fe03
$ nerdctl inspect --format {{.State.Status}}:{{.State.Error}} 2fd4c9d197320279055bfca5a109433935e762fc91bcbe371815a6cf7f39fe03
WARN[0000] failed to inspect NetNS                       error="failed to Statfs \"/proc/4058/ns/net\": no such file or directory" id=2fd4c9d197320279055bfca5a109433935e762fc91bcbe371815a6cf7f39fe03
FATA[0000] 1 errors: [template parsing error: template: :1:26: executing "" at <.State.Error>: map has no entry for key "Error"]
@ningziwen
Copy link
Member Author

Validated it is supported in Finch 0.6.0.

~ finch run -d public.ecr.aws/amazonlinux/amazonlinux:2
0301124f92521745f5668574337b26956dce7c01a795d8a27b8cfed61d62b4e2

~ finch inspect --format
 {{.State.Status}}:{{.State.Error}} 0301124f92521745f5668574337b26956dce7c01a795d8a27b8cfed61d62b4e2
running:

ningziwen added a commit to runfinch/common-tests that referenced this issue May 19, 2023
…rror (#64)

verify the result of finch inspect has State.Status and State.Error

runfinch/finch#242

*Description of changes:*
Test for the scenario of the issue

*Testing done:*
Tested locally.


- [ X ] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Ziwen Ning <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant