Skip to content

Commit

Permalink
incorporate review
Browse files Browse the repository at this point in the history
  • Loading branch information
mandelsoft committed Dec 9, 2024
1 parent a088511 commit 98d61bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
6 changes: 1 addition & 5 deletions api/ocm/plugin/ppi/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func NewEnforceTransportDesision(desc string, h ComponentReferenceQuestionFunc,
return NewDecisionHandler(Q_ENFORCE_TRANSPORT, desc, ForComponentReferenceQuestion(h))
}

func NewTransferversionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler {
func NewTransferVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler {
return NewDecisionHandler(Q_TRANSFER_VERSION, desc, ForComponentReferenceQuestion(h))
}

Expand All @@ -254,10 +254,6 @@ func NewUpdateVersionDecision(desc string, h ComponentReferenceQuestionFunc, lab
return NewDecisionHandler(Q_UPDATE_VERSION, desc, ForComponentReferenceQuestion(h))
}

func NewOUpdateVersionDecision(desc string, h ComponentReferenceQuestionFunc, labels ...string) DecisionHandler {
return NewDecisionHandler(Q_UPDATE_VERSION, desc, ForComponentReferenceQuestion(h))
}

////////////////////////////////////////////////////////////////////////////////

// Config is a generic structured config stored in a string map.
Expand Down
11 changes: 6 additions & 5 deletions api/ocm/tools/transfer/transferhandler/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (

//////////////////////////////////////////////////////////////////////////////

// ConfigOption describes generic non-standard options.
// Specialized option set implementation maps such generic
// ConfigOptionConsumer is an interface for option sets supporting generic
// non-standard options.
// Specialized option set implementations map such generic
// config to their specialized settings. The format depends
// on the option target. For example, for spiff it is a spiff
// script.
type ConfigOption interface {
type ConfigOptionConsumer interface {
SetConfig([]byte)
GetConfig() []byte
}
Expand All @@ -21,7 +22,7 @@ type configOption struct {
}

func (o *configOption) ApplyTransferOption(to TransferOptions) error {
if eff, ok := to.(ConfigOption); ok {
if eff, ok := to.(ConfigOptionConsumer); ok {
eff.SetConfig(o.config)
return nil
} else {
Expand All @@ -30,7 +31,7 @@ func (o *configOption) ApplyTransferOption(to TransferOptions) error {
}

// WithConfig configures a handler specific configuration.
// It is accepted by all handler featuring such a config possibility.
// It is accepted by all handlers featuring such a config possibility.
func WithConfig(config []byte) TransferOption {
return &configOption{
config: config,
Expand Down
4 changes: 2 additions & 2 deletions api/ocm/tools/transfer/transferhandler/plugin/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type Options struct {
}

var (
_ transferhandler.TransferOption = (*Options)(nil)
_ transferhandler.ConfigOption = (*Options)(nil)
_ transferhandler.TransferOption = (*Options)(nil)
_ transferhandler.ConfigOptionConsumer = (*Options)(nil)

_ PluginNameOption = (*Options)(nil)
_ TransferHandlerOption = (*Options)(nil)
Expand Down

0 comments on commit 98d61bf

Please sign in to comment.