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 eviction subresource - for #127 #393

Merged
merged 3 commits into from
Feb 7, 2021
Merged

add eviction subresource - for #127 #393

merged 3 commits into from
Feb 7, 2021

Conversation

clux
Copy link
Member

@clux clux commented Feb 6, 2021

might rebase against the big hyper pr, but it was fairly trivial to get this to work at least.

@clux clux mentioned this pull request Feb 6, 2021
11 tasks
@chroche
Copy link

chroche commented Feb 6, 2021

Wow that was fast! :-)

Thanks a lot for that

}

/// Marker trait for objects that can be evicted
pub trait EvictionObject {}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Evictable, maybe? EvictionObject sounds like it's the reified object created when evicting something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, I thought we had a convention, on noun-ing. But I am wrong.
Maybe we should just go full on on the conjugated form and rename all the traits?

i.e.

pub trait Loggable
pub trait Evictable
pub trait Executable
pub trait Atttachable

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking EvictableObject like AttachableObject.
Logging and Executing sounds fine to me, but not against making them consistent.
Naming is hard.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good to me. I have been thinking about proposing that for all resource actions at some point (for example: ComponentStatus is read-only: https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#componentstatus-v1-core).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll make a follow up PR for standardising. Sounds like we are OK with the conjugation as a convention.

pub delete_options: Option<DeleteParams>,
/// Metadata describing the pod being evicted
/// we somehow need this despite providing the name of the pod..
pub metadata: ObjectMeta,
Copy link
Member

Choose a reason for hiding this comment

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

That feels like a pretty big footgun.. Maybe Api::evict could take the name from the Eviction (or the reverse)?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, we could just pave over that interface, and take a (DeleteParams, PostParams, name) and only have the Eviction struct be internal. I don't see what good the metadata would do if it's tied to a named pod anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made an EvictParams object containing the two params objects, and hid Eviction in the body of Resource::evict

@clux
Copy link
Member Author

clux commented Feb 7, 2021

false negative on kind ci again, need to fix that at some point.
circleci took almost 30 minutes to run cargo_test on everything.. hopefully that gets better once the caching kicks in.

@clux clux merged commit d1b4925 into master Feb 7, 2021
@clux clux deleted the eviction branch February 7, 2021 11:48
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.

4 participants