Skip to content

Commit 047c984

Browse files
Merge pull request #16060 from liggitt/sdn-darwin
Automatic merge from submit-queue Only start the SDN controller if an openshift network plugin is configured Returning an error causes a process exit. This logs and skips instead.
2 parents 631de37 + 4d50437 commit 047c984

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/cmd/server/origin/controller/network_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
osclient "github.com/openshift/origin/pkg/client"
99
configapi "github.com/openshift/origin/pkg/cmd/server/api"
1010
"github.com/openshift/origin/pkg/cmd/server/bootstrappolicy"
11+
"github.com/openshift/origin/pkg/network"
1112
sdnmaster "github.com/openshift/origin/pkg/network/master"
1213
)
1314

@@ -16,6 +17,10 @@ type SDNControllerConfig struct {
1617
}
1718

1819
func (c *SDNControllerConfig) RunController(ctx ControllerContext) (bool, error) {
20+
if !network.IsOpenShiftNetworkPlugin(c.NetworkConfig.NetworkPluginName) {
21+
return false, nil
22+
}
23+
1924
// TODO: Switch SDN to use client.Interface
2025
clientConfig, err := ctx.ClientBuilder.Config(bootstrappolicy.InfraSDNControllerServiceAccountName)
2126
if err != nil {

pkg/cmd/server/origin/controller/network_unsupported.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ import (
66
"fmt"
77

88
configapi "github.com/openshift/origin/pkg/cmd/server/api"
9+
"github.com/openshift/origin/pkg/network"
910
)
1011

1112
type SDNControllerConfig struct {
1213
NetworkConfig configapi.MasterNetworkConfig
1314
}
1415

1516
func (c *SDNControllerConfig) RunController(ctx ControllerContext) (bool, error) {
17+
if !network.IsOpenShiftNetworkPlugin(c.NetworkConfig.NetworkPluginName) {
18+
return false, nil
19+
}
20+
1621
return false, fmt.Errorf("SDN not supported on this platform")
1722
}

0 commit comments

Comments
 (0)