Skip to content

Commit

Permalink
Validate if the openshift master is running with mutitenant network p…
Browse files Browse the repository at this point in the history
…lugin
  • Loading branch information
xiangpengzhao committed Nov 11, 2016
1 parent 59619ed commit a289a74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/cmd/admin/network/project_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ func (p *ProjectOptions) Validate() error {
errList = append(errList, errors.New("must provide --selector=<project_selector> or projects"))
}

// TODO: Validate if the openshift master is running with mutitenant network plugin
clusterNetwork, err := p.Oclient.ClusterNetwork().Get(sdnapi.ClusterNetworkDefault)
if err != nil {
errList = append(errList, errors.New("could not manage pod network: error on getting the running network plugin"))
} else if !sdnapi.IsOpenShiftMultitenantNetworkPlugin(clusterNetwork.PluginName) {
err := fmt.Errorf("could not manage pod network: the running plugin %s is not OpenShift mutitenant network plugin", clusterNetwork.PluginName)
errList = append(errList, err)
}

return kerrors.NewAggregate(errList)
}

Expand Down

0 comments on commit a289a74

Please sign in to comment.