-
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
Remove the ToOCI functions from the specs-go package #208
Conversation
e6d1ca6
to
1d92347
Compare
1d92347
to
e394a57
Compare
/cc @pohly |
limitations under the License. | ||
*/ | ||
|
||
package cdi |
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.
@klihub @marquiz since moving these functions here is a breaking change, do we want to add "empty" implementations to specs-go
so that we can mark these as deprecated. Something like:
// ToOCI returns the opencontainers runtime Spec Hook for this Hook.
//
// Deprecated: Use cdi.Hook.ToOCI instead.
func (h *Hook) ToOCI() interface{} {
}
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.
Would it make sense to keep these APIs in the specs-go and add deprecation warnings to them, so both old and new APIs would co-exist for a deprecation period?
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.
The issue with that is that it would not remove the dependency, but yes, we could do that. Would you have a recommendation as to what the deprecation period should be?
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 guess if we really deprecate this the right way, we don't get rid of the dependency yet (so we don't return an interface either as suggested). The other alternative would be to do it the 'incorrectly/agressively', and because of the suggested empty interface-return signature change I am not sure if that is what @bart0sh was after, to keep a dummy implementation that is marked as deprecated, and maybe even panic from it.
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.
+1 for doing it aggressively. It makes sense after the above explanation, thanks @klihub
@klihub @bart0sh as a general question, I was wondering whether we should actually REMOVE the If we do have clients that use these directly, we can consider how to better add these APIs. |
This change removes the ToOCI functions from the specs-go package. They are implemented as private toOCI functions in the cdi package instead. This means that there is no dependency on the OCI runtime spec for clients that only need a CDI spec definition. Signed-off-by: Evan Lezar <[email protected]>
e394a57
to
1ebf298
Compare
@elezar Good point. If with this change we don't have cross-package use any more then I think making them private makes sense, since/if we don't consider them useful for external users |
@klihub I have updated the latest revision with private functions. PTAL. |
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.
LGTM
LGTM |
This change removes the ToOCI functions from the specs-go package.
They are implemented as private toOCI functions in the cdi package instead.
This means that there is no dependency on the OCI runtime spec for clients that
only need a CDI spec definition.
NOTE: This is a breaking change in that the
ToOCI
functions no longer exist in thespecs-go
module, but the impact of this should be minimal and is worth the removal of therequire github.com/opencontainers/runtime-spec
dependency from the spec definitions.