Skip to content

Commit

Permalink
Remove pre-CRD network APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
danwinship committed Apr 6, 2019
1 parent 754d808 commit e721893
Show file tree
Hide file tree
Showing 24 changed files with 150 additions and 2,158 deletions.
13 changes: 0 additions & 13 deletions hack/import-restrictions.json
Expand Up @@ -263,19 +263,6 @@
]
},

{
"checkedPackages": [
"github.com/openshift/origin/pkg/network/apis/network",
"github.com/openshift/origin/pkg/network/apis/network/v1"
],
"allowedImportPackageRoots": [
"vendor/k8s.io/apimachinery",
"vendor/k8s.io/api",
"vendor/github.com/openshift/api"
],
"allowedImportPackages": []
},

{
"checkedPackages": [
"github.com/openshift/origin/pkg/oauth/apis/oauth",
Expand Down
1 change: 0 additions & 1 deletion hack/update-generated-conversions.sh
Expand Up @@ -15,7 +15,6 @@ ALL_FQ_APIS=(
github.com/openshift/origin/pkg/build/apis/build/v1
github.com/openshift/origin/pkg/cmd/server/apis/config/v1
github.com/openshift/origin/pkg/image/apis/image/v1
github.com/openshift/origin/pkg/network/apis/network/v1
github.com/openshift/origin/pkg/oauth/apis/oauth/v1
github.com/openshift/origin/pkg/project/apis/project/v1
github.com/openshift/origin/pkg/quota/apis/quota/v1
Expand Down
1 change: 0 additions & 1 deletion hack/update-generated-deep-copies.sh
Expand Up @@ -36,7 +36,6 @@ ALL_FQ_APIS=(
github.com/openshift/origin/pkg/authorization/apis/authorization
github.com/openshift/origin/pkg/build/apis/build
github.com/openshift/origin/pkg/image/apis/image
github.com/openshift/origin/pkg/network/apis/network
github.com/openshift/origin/pkg/oauth/apis/oauth
github.com/openshift/origin/pkg/project/apis/project
github.com/openshift/origin/pkg/quota/apis/quota
Expand Down
1 change: 0 additions & 1 deletion hack/update-generated-defaulters.sh
Expand Up @@ -15,7 +15,6 @@ ALL_FQ_APIS=(
github.com/openshift/origin/pkg/build/apis/build/v1
github.com/openshift/origin/pkg/cmd/server/apis/config/v1
github.com/openshift/origin/pkg/image/apis/image/v1
github.com/openshift/origin/pkg/network/apis/network/v1
github.com/openshift/origin/pkg/oauth/apis/oauth/v1
github.com/openshift/origin/pkg/project/apis/project/v1
github.com/openshift/origin/pkg/quota/apis/quota/v1
Expand Down
2 changes: 0 additions & 2 deletions pkg/api/install/install.go
Expand Up @@ -30,7 +30,6 @@ import (
authz "github.com/openshift/origin/pkg/authorization/apis/authorization/install"
build "github.com/openshift/origin/pkg/build/apis/build/install"
image "github.com/openshift/origin/pkg/image/apis/image/install"
network "github.com/openshift/origin/pkg/network/apis/network/install"
oauth "github.com/openshift/origin/pkg/oauth/apis/oauth/install"
project "github.com/openshift/origin/pkg/project/apis/project/install"
quota "github.com/openshift/origin/pkg/quota/apis/quota/install"
Expand All @@ -45,7 +44,6 @@ func InstallInternalOpenShift(scheme *runtime.Scheme) {
authz.Install(scheme)
build.Install(scheme)
image.Install(scheme)
network.Install(scheme)
oauth.Install(scheme)
project.Install(scheme)
quota.Install(scheme)
Expand Down
1 change: 0 additions & 1 deletion pkg/api/legacy/install.go
Expand Up @@ -31,7 +31,6 @@ func InstallInternalLegacyAll(scheme *runtime.Scheme) {
InstallInternalLegacyAuthorization(scheme)
InstallInternalLegacyBuild(scheme)
InstallInternalLegacyImage(scheme)
InstallInternalLegacyNetwork(scheme)
InstallInternalLegacyOAuth(scheme)
InstallInternalLegacyProject(scheme)
InstallInternalLegacyQuota(scheme)
Expand Down
28 changes: 0 additions & 28 deletions pkg/api/legacy/network.go
Expand Up @@ -5,24 +5,10 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"

networkv1 "github.com/openshift/api/network/v1"
"github.com/openshift/origin/pkg/network/apis/network"
networkv1helpers "github.com/openshift/origin/pkg/network/apis/network/v1"
)

// InstallLegacyNetwork this looks like a lot of duplication, but the code in the individual versions is living and may
// change. The code here should never change and needs to allow the other code to move independently.
func InstallInternalLegacyNetwork(scheme *runtime.Scheme) {
InstallExternalLegacyNetwork(scheme)

schemeBuilder := runtime.NewSchemeBuilder(
addUngroupifiedInternalNetworkTypes,

networkv1helpers.RegisterDefaults,
networkv1helpers.RegisterConversions,
)
utilruntime.Must(schemeBuilder.AddToScheme(scheme))
}

func InstallExternalLegacyNetwork(scheme *runtime.Scheme) {
schemeBuilder := runtime.NewSchemeBuilder(
addUngroupifiedNetworkTypes,
Expand All @@ -44,17 +30,3 @@ func addUngroupifiedNetworkTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion, types...)
return nil
}

func addUngroupifiedInternalNetworkTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(InternalGroupVersion,
&network.ClusterNetwork{},
&network.ClusterNetworkList{},
&network.HostSubnet{},
&network.HostSubnetList{},
&network.NetNamespace{},
&network.NetNamespaceList{},
&network.EgressNetworkPolicy{},
&network.EgressNetworkPolicyList{},
)
return nil
}
11 changes: 5 additions & 6 deletions pkg/api/legacygroupification/groupification.go
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/openshift/origin/pkg/authorization/apis/authorization"
"github.com/openshift/origin/pkg/build/apis/build"
"github.com/openshift/origin/pkg/image/apis/image"
"github.com/openshift/origin/pkg/network/apis/network"
"github.com/openshift/origin/pkg/oauth/apis/oauth"
"github.com/openshift/origin/pkg/project/apis/project"
"github.com/openshift/origin/pkg/quota/apis/quota"
Expand Down Expand Up @@ -110,11 +109,11 @@ func OAPIToGroupified(uncast runtime.Object, gvk *schema.GroupVersionKind) {
gvk.Group = image.GroupName
uncast.GetObjectKind().SetGroupVersionKind(*gvk)

case *network.ClusterNetwork, *networkv1.ClusterNetwork, *network.ClusterNetworkList, *networkv1.ClusterNetworkList,
*network.NetNamespace, *networkv1.NetNamespace, *network.NetNamespaceList, *networkv1.NetNamespaceList,
*network.HostSubnet, *networkv1.HostSubnet, *network.HostSubnetList, *networkv1.HostSubnetList,
*network.EgressNetworkPolicy, *networkv1.EgressNetworkPolicy, *network.EgressNetworkPolicyList, *networkv1.EgressNetworkPolicyList:
gvk.Group = network.GroupName
case *networkv1.ClusterNetwork, *networkv1.ClusterNetworkList,
*networkv1.NetNamespace, *networkv1.NetNamespaceList,
*networkv1.HostSubnet, *networkv1.HostSubnetList,
*networkv1.EgressNetworkPolicy, *networkv1.EgressNetworkPolicyList:
gvk.Group = networkv1.GroupName
uncast.GetObjectKind().SetGroupVersionKind(*gvk)

case *project.Project, *projectv1.Project, *project.ProjectList, *projectv1.ProjectList,
Expand Down
7 changes: 0 additions & 7 deletions pkg/api/validation/register.go
Expand Up @@ -5,7 +5,6 @@ import (
authorizationvalidation "github.com/openshift/origin/pkg/authorization/apis/authorization/validation"
buildvalidation "github.com/openshift/origin/pkg/build/apis/build/validation"
imagevalidation "github.com/openshift/origin/pkg/image/apis/image/validation"
sdnvalidation "github.com/openshift/origin/pkg/network/apis/network/validation"
oauthvalidation "github.com/openshift/origin/pkg/oauth/apis/oauth/validation"
projectvalidation "github.com/openshift/origin/pkg/project/apis/project/validation"
quotavalidation "github.com/openshift/origin/pkg/quota/apis/quota/validation"
Expand All @@ -18,7 +17,6 @@ import (
authorizationapi "github.com/openshift/origin/pkg/authorization/apis/authorization"
buildapi "github.com/openshift/origin/pkg/build/apis/build"
imageapi "github.com/openshift/origin/pkg/image/apis/image"
networkapi "github.com/openshift/origin/pkg/network/apis/network"
oauthapi "github.com/openshift/origin/pkg/oauth/apis/oauth"
projectapi "github.com/openshift/origin/pkg/project/apis/project"
quotaapi "github.com/openshift/origin/pkg/quota/apis/quota"
Expand Down Expand Up @@ -77,11 +75,6 @@ func registerAll() {

Validator.MustRegister(&routeapi.Route{}, true, routevalidation.ValidateRoute, routevalidation.ValidateRouteUpdate)

Validator.MustRegister(&networkapi.ClusterNetwork{}, false, sdnvalidation.ValidateClusterNetwork, sdnvalidation.ValidateClusterNetworkUpdate)
Validator.MustRegister(&networkapi.HostSubnet{}, false, sdnvalidation.ValidateHostSubnet, sdnvalidation.ValidateHostSubnetUpdate)
Validator.MustRegister(&networkapi.NetNamespace{}, false, sdnvalidation.ValidateNetNamespace, sdnvalidation.ValidateNetNamespaceUpdate)
Validator.MustRegister(&networkapi.EgressNetworkPolicy{}, true, sdnvalidation.ValidateEgressNetworkPolicy, sdnvalidation.ValidateEgressNetworkPolicyUpdate)

Validator.MustRegister(&templateapi.Template{}, true, templatevalidation.ValidateTemplate, templatevalidation.ValidateTemplateUpdate)
Validator.MustRegister(&templateapi.TemplateInstance{}, true, templatevalidation.ValidateTemplateInstance, templatevalidation.ValidateTemplateInstanceUpdate)
Validator.MustRegister(&templateapi.BrokerTemplateInstance{}, false, templatevalidation.ValidateBrokerTemplateInstance, templatevalidation.ValidateBrokerTemplateInstanceUpdate)
Expand Down
5 changes: 0 additions & 5 deletions pkg/network/apis/network/doc.go

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/network/apis/network/install/install.go

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/network/apis/network/plugin.go

This file was deleted.

43 changes: 0 additions & 43 deletions pkg/network/apis/network/register.go

This file was deleted.

135 changes: 0 additions & 135 deletions pkg/network/apis/network/types.go

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/network/apis/network/v1/doc.go

This file was deleted.

0 comments on commit e721893

Please sign in to comment.