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

PatchParams::default_apply().field_manager is always kube #300

Closed
nightkr opened this issue Aug 5, 2020 · 3 comments
Closed

PatchParams::default_apply().field_manager is always kube #300

nightkr opened this issue Aug 5, 2020 · 3 comments
Labels
api Api abstraction related bug Something isn't working

Comments

@nightkr
Copy link
Member

nightkr commented Aug 5, 2020

$CARGO_PKG_NAME is the name of the library crate, not the "root" application crate.

@nightkr nightkr added the bug Something isn't working label Aug 5, 2020
@clux
Copy link
Member

clux commented Aug 5, 2020

We could change default_apply signature to return Result<Self> and infer a reasonable name from std::env::current_exe() and passing it through Path::file_name?

Can't think of a better solution atm :(

@clux clux added the api Api abstraction related label Aug 5, 2020
@nightkr
Copy link
Member Author

nightkr commented Aug 6, 2020

IMO, just take the name as a parameter. current_exe is way too gotcha-prone for this to be safe (what about running multiple controllers in the same executable? cohabitating a controller with some other direct manipulation? symlinks?). Besides, it's not like kube-derive is trying to infer the API group from the crate version number or the primary author's email address.

@clux
Copy link
Member

clux commented Aug 6, 2020

Yeah, that's a fair argument. I was only hiding the value because I felt it didn't really matter unless you were in a case with multiple owning controllers, but it's at least less gotcha-y to be explicit.

@clux clux closed this as completed in 8efbf60 Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Api abstraction related bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants