-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
scp: add option types + *WithOpts functions #24234
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zackattackz The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
65daca7
to
c82a096
Compare
Amended to appease linter |
Priot to this commit, many scp functions existed without option structs, which would make extending functionality (adding new options) impossible without breaking changes, or without adding redundant wrapper functions. This commit adds in new option types for various scp related functions. It also adds relevant *WithOpts counterparts to existing functions, which use these new option types. This commit also adds in an experimental `ScpWithOpts` function to image engine implementations, which should eventually replace the existing `ImageEngine.Scp()` function. However, this replacement can't be done without breaking the `ImageEngine` interface, so it should happen at a later major version upgrade. The commit also renames the existing `ImageScpOptions` entity type to `ScpTransferImageOptions`, and adds an alias mapping the old to the new name to prevent breakage. This is because the previous `ImageScpOptions` was inaccurate, as it is not the actual options for `ImageEngine.Scp()`. The new name is more accurate. Also, if the signature of `ImageEngine.Scp()` is eventually changed to match `ScpWithOpts` as discussed above, `ImageScpBaseOptions` could then be more accurately renamed to `ImageScpOptions` This commit SHOULD NOT introduce any breaking changes. The breakages could be made in a later commit that would replace the existing functions with the *WithOpts counterparts. Signed-off-by: Zachary Hanham <z.hanham00@gmail.com>
c82a096
to
3bf58be
Compare
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 ImageEngine
and the other internal functions are not stable, we do not provide any API stability outside of pkg/bindings
which is meant to be used as library by other as well.
So by all means you should break this outright so we do not need to deal with two different function for everything.
Ah sweet, I'll make a new PR and close this one. |
Closed in favor of #24240 |
Priot to this commit, many scp functions existed without option structs, which would make extending functionality (adding new options) impossible without breaking changes, or without adding redundant wrapper functions.
This commit adds in new option types for various scp related functions. It also adds relevant *WithOpts counterparts to existing functions, which use these new option types.
This commit also adds in an experimental
ScpWithOpts
function to image engine implementations, which should eventually replace the existingImageEngine.Scp()
function. However, this replacement can't be done without breaking theImageEngine
interface, so it should happen at a later major version upgrade.The commit also renames the existing
ImageScpOptions
entity type toScpTransferImageOptions
, and adds an alias mapping the old to the new name to prevent breakage. This is because the previousImageScpOptions
was inaccurate, as it is not the actual options forImageEngine.Scp()
. The new name is more accurate. Also, if the signature ofImageEngine.Scp()
is eventually changed to matchScpWithOpts
as discussed above,ImageScpBaseOptions
could then be more accurately renamed toImageScpOptions
This commit SHOULD NOT introduce any breaking changes. The breakages could be made in a later commit that would replace the existing functions with the *WithOpts counterparts.
Does this PR introduce a user-facing change?