-
Notifications
You must be signed in to change notification settings - Fork 38
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
dependencies: github.com/xeipuuv pulled into Kubernetes #80
Comments
I looked into this, and compared the situation with containerd. In containerd, which declares a dependency on CDI Updating the CDI dependencies to If this is something we need to prevent from happening and if this is happening because of how |
Kubernetes pulls it in like this:
That looks like a hard dependency to me, even if it is indirect. When you developed #62, did you or someone else verify that container-device-interface/pkg/cdi can be used without pulling in github.com/xeipuuv/gojsonschema? Perhaps something has changed in the meantime and the dependency is back? |
I cannot reproduce that. I checked out github.com/containerd/containerd main (currently 217aa160cff03c6ffc1d242f871c5171ba1e8e3d), then ran:
The xeipuuv repos are still in vendor:
|
Yes, sorry. You're right and I was wrong. The statement should have been 'No code that would depend directly on any of the xeipuuv repos gets pulled in from CDI`. Looking at the output of |
Can runtime-tools/generate be changed to not have those dependencies, perhaps similar to how you did it in cdi? |
It looks like as it should/would be possible in an even simpler way. JSON schema validation is pulled in merely due to how the code is organised. It is not used by runtime-tools/generate. It only calls into runtime-tools/validate to get the list of capabilites, check if a capability is valid, and to check what is the last capability. I rolled a quick test to split the generator-relevant few functions out from
And indeed vendor/github.com/xeipuuv is completely gone. So technically clearly possible. Whether politically achievable (IOW if such a PR would be accepted upstream) is a different story. If we can come up with a properly, politely and politically correctly formulated justification of why we want to avoid that dependency, then I guess filing a PR and testing the reception in practice is just a matter of giving it a go. |
The justification is simply "the less dependencies, the better". It isn't about these particular dependencies, just that any additional dependency introduces work (for review in Kubernetes) and a potential source for future CVEs that would have to be addressed.
Can you please try? |
Filed PR to upstream repo. |
The upstream fix was merged and updating those dependencies in Kubernetes removes the JSON validation packages. No new release of CDI is needed. |
When using github.com/container-orchestrated-devices/container-device-interface in Kubernetes without enabling validation, packages from github.com/xeipuuv still get pulled in as new dependencies. It would be good to avoid that when it's not needed.
See kubernetes/kubernetes#111023, commit "kubelet: add support for dynamic resource allocation".
The text was updated successfully, but these errors were encountered: