-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Remove kube Dependency in kube-derive #517
Conversation
Hey, thanks a lot for doing this. I was thinking something like this might be helpful for breaking dependencies, but was never sure what it was going to benefit directly. Fundamentally, I have no qualms with doing this, looks like we can do this in ways that don't break anything and have |
@@ -28,7 +28,7 @@ schema = [] | |||
[dev-dependencies] | |||
serde = { version = "1.0.118", features = ["derive"] } | |||
serde_yaml = "0.8.17" | |||
kube = { path = "../kube", version = "<1.0.0, >=0.51.0" } | |||
kube-core = { path = "../kube-core" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: the version keys need to be in there to avoid cyclic dependencies in publishing, but maybe the first release needs to be special cased.
Great, I will address your comment and take a pass at fixing the tests in a bit. |
There's potentially three more things we could include in this crate. Like the part of the api bindings that doesn't use hyper, I'm thinking:
That way we have a more cohesive story for the non-tokio/non-client wanting crowd. |
Ok, I moved the things you mentioned. Moving I ran most of the tests locally, will see if it passes on Circle. |
5245a28
to
a5148f7
Compare
a5148f7
to
23fc91b
Compare
kube-core/Cargo.toml
Outdated
@@ -26,7 +26,7 @@ http = "0.2.2" | |||
[dependencies.k8s-openapi] | |||
version = "0.11.0" | |||
default-features = false | |||
features = [] | |||
features = ["v1_20"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, this isn't ideal, we can't select this feature for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's possible that the implementations of Resource
and ResourceExt
needs to be in kube
to avoid having this feature issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, that's unfortunate because that's the type that is causing issues for me.
This only caused problems for running the tests, so maybe we can just specify the feature in CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made this change if that works for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, that works. The standard pattern we have is to select the feature* internally:
[dependencies.k8s-openapi]
version = "0.11.0"
default-features = false
features = []
[dev-dependencies.k8s-openapi]
version = "0.11.0"
default-features = false
features = ["v1_20"]
I'll merge this and play around a bit with it in master. Don't see anything obvious here, and CI is passing. Maybe this is just a quick release :-) |
Ended up moving a bunch more core types in there into kube-core in #519 without adding any deps. |
Released with modifications in 0.54.0 (#522 additional imports). Thanks again! |
Closes #516
This gives an idea of how the
kube
dependency can be removed. A few sharp edges still:kube
or always addkube-core
to their Cargo manifest.I've also taken the liberty of fixing some Clippy lints that were preventing compilation (in a separate commit).