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

feat: Add Journal #6

Merged
merged 2 commits into from
Dec 28, 2021
Merged

feat: Add Journal #6

merged 2 commits into from
Dec 28, 2021

Conversation

gaocegege
Copy link
Contributor

Signed-off-by: cegao ce.gao@outlook.com

Signed-off-by: cegao <ce.gao@outlook.com>
}
let current = match deploys.get(&name).await {
Ok(current) => Some(current),
Err(kube::KubeError::Api(e)) => None,

Choose a reason for hiding this comment

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

  1. replace kube::KubeError::Api(e) with kube::Error::Api(e)
  2. pattern matching requires a full match, therefore we should consider other candidate of kube::Error instead of just kube::KubeError::Api(e)
    let current = match deploys.get(&name).await {
        Ok(current) => Some(current),
        Err(kube::Error::Api(e)) => None,
        _ => None // should actually throw the err
  1. this will make Option type here insufficient:
    1. OK path
    2. Not found path
    3. actual error path <- consider use another sum type to do this

Choose a reason for hiding this comment

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

make current a Result<Option<Deployment>, Error> maybe a better choice

Signed-off-by: cegao <ce.gao@outlook.com>
@gaocegege gaocegege marked this pull request as ready for review December 28, 2021 02:34
@gaocegege gaocegege merged commit 96fce7f into cow-on-board:main Dec 28, 2021
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.

2 participants