Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
(7.0) Add ability to override FSM spec (#2037)
Browse files Browse the repository at this point in the history
  • Loading branch information
r0mant authored Aug 24, 2020
1 parent 80cccfb commit f4ae2c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion e
Submodule e updated from b4751d to a429eb
15 changes: 12 additions & 3 deletions lib/install/fsmspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ import (
"k8s.io/client-go/kubernetes"
)

// FSMSpec returns a function that returns an appropriate phase executor
// based on the provided params
func FSMSpec(config FSMConfig) fsm.FSMSpecFunc {
// FSMSpecFunc defines a function that returns install FSM spec based on the config.
type FSMSpecFunc func(FSMConfig) fsm.FSMSpecFunc

// FSMSpec is the install FSM spec.
//
// It may be overriden by external implementations to support additional
// install operation phases (e.g. by the enterprise version).
var FSMSpec FSMSpecFunc = DefaultFSMSpec

// DefaultFSMSpec returns a function that returns an the default install FSM
// spec for the provided install FSM config.
func DefaultFSMSpec(config FSMConfig) fsm.FSMSpecFunc {
return func(p fsm.ExecutorParams, remote fsm.Remote) (fsm.PhaseExecutor, error) {
switch {
case strings.HasPrefix(p.Phase.ID, phases.InitPhase):
Expand Down

0 comments on commit f4ae2c6

Please sign in to comment.