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

scp: add option types + *WithOpts functions #24234

Closed

Conversation

zackattackz
Copy link

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.

Does this PR introduce a user-facing change?

None

Copy link
Contributor

openshift-ci bot commented Oct 10, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zackattackz
Once this PR has been reviewed and has the lgtm label, please assign ashley-cui for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Oct 10, 2024
@zackattackz
Copy link
Author

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 <[email protected]>
Copy link
Member

@Luap99 Luap99 left a 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.

@zackattackz
Copy link
Author

Ah sweet, I'll make a new PR and close this one.

@zackattackz
Copy link
Author

Closed in favor of #24240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Change to remote API; merits scrutiny release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants