plugin reorg: merge subdirs, split master/node #305
Conversation
8b23a52
to
27948ad
Compare
case SingleTenantPluginName: | ||
return true | ||
case MultiTenantPluginName: | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L68-L72 can be simplified:
case SingleTenantPluginName, MultiTenantPluginName:
return true
We changed openshift-sdn-docker-setup.sh and openshift-sdn-ovs paths, need to update origin.spec and contrib/node/install-sdn.sh on the origin repo. |
const ( | ||
SingleTenantPluginName string = "redhat/openshift-ovs-subnet" | ||
MultiTenantPluginName string = "redhat/openshift-ovs-multitenant" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these constants under pkg/ so that CLI and plugins/osdn can reuse it.
27948ad
to
909a018
Compare
Updated. I moved the constants into plugins/osdn/api/ rather than pkg/, since that seemed to be consistent with the rest of what we're doing. Corresponding origin branch is "merge-and-split" in danwinship/origin |
LGTM |
@@ -9,6 +9,8 @@ import ( | |||
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" | |||
kerrors "k8s.io/kubernetes/pkg/util/errors" | |||
|
|||
osdnapi "github.com/openshift/openshift-sdn/plugins/osdn/api" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want pkg/cmd to depend on plugins/, please check #233
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then, for now I'm going to just revert the pkg/cmd/ part of the change; we already have origin/pkg/sdn/api and openshift-sdn/plugins/osdn/api, and the latter already depends on random stuff from kubernetes that we presumably don't want "oc" depending on, so it can't be moved wholesale to openshift-sdn/pkg/. So that means we would need some third "api" directory in openshift-sdn/pkg/ with some slightly different name, which will just be confusing.
We can revisit this in a later cleanup.
909a018
to
a41ffea
Compare
Repushed with:
I guess this should probably wait until after #303 though |
typo *osdn |
Good cleanup/reorg, LGTM |
e24a975
to
e398de3
Compare
@openshift/networking updated; I ran the extended networking tests locally, but you might want to wait for the origin PR to finish the other tests before merging this |
btw @pravisankar my version of this rebased on top of #303 is danwinship:merge-and-split-303, though that's based on an earlier version of this branch, and also I never tried compiling it, so it probably has bugs |
Also, move getNodeIP() from common.go to subnets.go since it's only used from there.
e398de3
to
98812b6
Compare
dropped "Move plugin name constants into plugins/osdn/api/" since those constants are no longer used outside of openshift-sdn after Ravi's addition of IsOpenShiftNetworkPlugin() and IsOpenShiftMultiTenantNetworkPlugin(). |
LGTM |
pluginName string | ||
multitenant bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need multitenant
anymore?
Now we got the pluginName, can use IsOpenShiftMultitenantNetworkPlugin(oc.pluginName) where ever required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later in the branch, both pluginName and multitenant go away in OsdnMaster, and pluginName goes away in OsdnNode. (Keeping oc.multitenant rather than keeping oc.pluginName and using IsOpenShiftMultiTenantNetworkPlugin() involved less code change.)
LGTM |
The plugins/osdn vs plugins/osdn/ovs split was based on the idea that the code in plugins/osdn would eventually also be used by other plugins. Given that this is no longer expected to happen, there's no point in keeping the split.
OTOH, we do want to be able to split the master and node code apart more easily, and that's easier to do once everything is merged together, and that's what the second part of this branch does.
@openshift/networking PTAL. You'll probably want to review commit-by-commit.