Skip to content

Commit a289a74

Browse files
committed
Validate if the openshift master is running with mutitenant network plugin
1 parent 59619ed commit a289a74

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/cmd/admin/network/project_options.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ func (p *ProjectOptions) Validate() error {
8484
errList = append(errList, errors.New("must provide --selector=<project_selector> or projects"))
8585
}
8686

87-
// TODO: Validate if the openshift master is running with mutitenant network plugin
87+
clusterNetwork, err := p.Oclient.ClusterNetwork().Get(sdnapi.ClusterNetworkDefault)
88+
if err != nil {
89+
errList = append(errList, errors.New("could not manage pod network: error on getting the running network plugin"))
90+
} else if !sdnapi.IsOpenShiftMultitenantNetworkPlugin(clusterNetwork.PluginName) {
91+
err := fmt.Errorf("could not manage pod network: the running plugin %s is not OpenShift mutitenant network plugin", clusterNetwork.PluginName)
92+
errList = append(errList, err)
93+
}
94+
8895
return kerrors.NewAggregate(errList)
8996
}
9097

0 commit comments

Comments
 (0)