Skip to content

Commit

Permalink
Merge pull request #10527 from miaoyq/refactor-ipfailover-code
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Sep 27, 2016
2 parents e752b5d + 714a007 commit 086c1a6
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions pkg/cmd/experimental/ipfailover/ipfailover.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,16 @@ func getConfigurationName(args []string) (string, error) {

// Get the configurator based on the ipfailover type.
func getPlugin(name string, f *clientcmd.Factory, options *ipfailover.IPFailoverConfigCmdOptions) (ipfailover.IPFailoverConfiguratorPlugin, error) {
// Currently, the only supported plugin is keepalived (default).
plugin, err := keepalived.NewIPFailoverConfiguratorPlugin(name, f, options)

switch options.Type {
case ipfailover.DefaultType:
// Default.
// case <new-type>: plugin, err = makeNewTypePlugin()
default:
return nil, fmt.Errorf("No plugins available to handle type %q", options.Type)
}
if options.Type == ipfailover.DefaultType {
plugin, err := keepalived.NewIPFailoverConfiguratorPlugin(name, f, options)
if err != nil {
return nil, fmt.Errorf("IPFailoverConfigurator %q plugin error: %v", options.Type, err)
}

if err != nil {
return nil, fmt.Errorf("IPFailoverConfigurator %q plugin error: %v", options.Type, err)
return plugin, nil
}

return plugin, nil
return nil, fmt.Errorf("No plugins available to handle type %q", options.Type)
}

// Run runs the ipfailover command.
Expand Down

0 comments on commit 086c1a6

Please sign in to comment.