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

add 'state' test; using WaitingForStatus in insideValidation #562

Merged
merged 2 commits into from
Feb 5, 2018

Conversation

liangchenye
Copy link
Member

Signed-off-by: Liang Chenye [email protected]

@liangchenye
Copy link
Member Author

liangchenye commented Jan 25, 2018

  1. more diagnostic information
    'r.State' returns an extra stderr
    PreCreate/PostCreate/PreDelete/PostDelete returns an extra stderr
  2. move SetID out of lifecycle function
    Because container ID is also a testing item.
    But leave bundle prepare in the lifecycle function.
  3. Add LifecycleActionNone
    So we can test cases like 'state/start' with invalid/non-exist ID
  4. Add state.go
    Similar approach to current 'create.go'
  5. Split 'Delete' from 'r.Clean'
    We don't always need to 'r.Delete' if the container is never not created, so the 'r.Delete' in r.Clean is not always necessary.
    It is up to the developer to 'delete' the container inside the lifecycle function or 'delete' it in other way.

PostCreate func(runtime *Runtime) error
PreDelete func(runtime *Runtime) error
PostDelete func(runtime *Runtime) error
PreCreate func(runtime *Runtime) ([]byte, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather not assume that these functions will include something that has a stderr. Can we use *ExitError instead, and have the test include that stderr in their YAML diagnostic if the error casts to *ExitError? I'll work up a PR with that narrow pivot to help show what I'm suggesting.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll work up a PR with that narrow pivot to help show what I'm suggesting.

Filed as #564.

@liangchenye liangchenye force-pushed the cli-complete branch 7 times, most recently from bb65534 to 6e50906 Compare January 30, 2018 03:36
@liangchenye liangchenye changed the title add detailed info to lifecycle function; add 'state' test add 'state' test Jan 30, 2018
@liangchenye
Copy link
Member Author

need to rebase after #563

@liangchenye liangchenye changed the title add 'state' test add 'state' test; using WaitingForStatus in insideValidation Jan 30, 2018
@liangchenye
Copy link
Member Author

Updated.
The second commit removes the 'fixme' in RuntimeInsideValidation by using 'WaitingForStatus'.

PTAL @wking @Mashimiao @q384566678

@zhouhao3
Copy link

zhouhao3 commented Feb 2, 2018

LGTM

Approved with PullApprove

@liangchenye liangchenye merged commit c785e93 into opencontainers:master Feb 5, 2018
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.

3 participants