-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Extend plugin API to support transfer handlers #937
base: main
Are you sure you want to change the base?
Conversation
1c0a15f
to
7c7bdfb
Compare
e25337f
to
93d164c
Compare
Since I've been struggling to see the plugin architecture since it is quite scattered throughout the library, is there documentation providing an overview? |
api/ocm/plugin/ppi/utils.go
Outdated
return NewDecisionHandler(Q_UPDATE_VERSION, desc, ForComponentReferenceQuestion(h)) | ||
} | ||
|
||
func NewOUpdateVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { |
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.
func NewOUpdateVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { | |
func NewUpdateVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { |
typo
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.
no, duplicate function with typo in name. (removed)
api/ocm/plugin/ppi/utils.go
Outdated
return NewDecisionHandler(Q_ENFORCE_TRANSPORT, desc, ForComponentReferenceQuestion(h)) | ||
} | ||
|
||
func NewTransferversionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { |
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.
func NewTransferversionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { | |
func NewTransferVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler { |
typo
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.
done
type configOption struct { | ||
config []byte | ||
} |
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 feel like it is confusing that the type configOption
is not the type that's supposed to be implementing the interface ConfigOption
.
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 is supposed as option (like the other structs). In this case an option to feed the ConfigOption 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.
Renamed to ConfigOptionConsumer
and added more docu.
What this PR does / why we need it
The OCM library already provides an extension point to provide transfer handlers
controlling the transport of component versions from one environment into another one.
A transfer handler controls:
So far, there were two implementations:
--recursive
or--copy-resources
the behaviour based on a spiff script.
On the command line interface always the spiff handler was used which works like the standard handler if no script
is configured.
This PR adds three new features:
which can be used un the command line to select and configure supported transfer handler types.
provide an arbitrary rule set controlling the transport process.
Similar to the uploaders and downloaders the naming scheme for transfer handlers looks as follows:
ocm/<builtin handlers>
: used for the already existingstandard
andspiff
handlers.Additional handlers may now add themselves to appropriate names to be usable from the command line.
plugin/'
A dedicated handler maps plugin provided transfer handlers into the naming scheme.It uses the sub scheme
<plugin name>[/<handler name>]
. A plugin may provide multiple (named) handlers.Which issue(s) this PR fixes