Skip to content

Commit

Permalink
boring changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Dec 13, 2017
1 parent cf235c2 commit 4bc612e
Show file tree
Hide file tree
Showing 812 changed files with 1,595 additions and 1,718 deletions.
2 changes: 1 addition & 1 deletion cmd/gitserver/gitserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/oc/oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/openshift-diagnostics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/template-service-broker/tsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down
11 changes: 6 additions & 5 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/yaml"
apirequest "k8s.io/apiserver/pkg/endpoints/request"
kapi "k8s.io/kubernetes/pkg/api"
kvalidation "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/api/legacyscheme"
kapi "k8s.io/kubernetes/pkg/apis/core"
kvalidation "k8s.io/kubernetes/pkg/apis/core/validation"
"k8s.io/kubernetes/pkg/capabilities"

"github.com/openshift/origin/pkg/api/validation"
Expand All @@ -28,7 +29,7 @@ import (

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
)

Expand Down Expand Up @@ -153,7 +154,7 @@ func TestExampleObjectSchemas(t *testing.T) {
t.Logf("%q is skipped", path)
return
}
if err := runtime.DecodeInto(kapi.Codecs.UniversalDecoder(), data, expectedType); err != nil {
if err := runtime.DecodeInto(legacyscheme.Codecs.UniversalDecoder(), data, expectedType); err != nil {
t.Errorf("%s did not decode correctly: %v\n%s", path, err, string(data))
return
}
Expand Down Expand Up @@ -203,7 +204,7 @@ func validateObject(path string, obj runtime.Object, t *testing.T) {

case *kapi.List, *imageapi.ImageStreamList:
if list, err := meta.ExtractList(typedObj); err == nil {
runtime.DecodeList(list, kapi.Codecs.UniversalDecoder())
runtime.DecodeList(list, legacyscheme.Codecs.UniversalDecoder())
for i := range list {
validateObject(path, list[i], t)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/validation"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/core/validation"
)

func TestCompatibility_v1_Pod(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/graph/graphview/veneering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/gonum/graph/concrete"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kapi "k8s.io/kubernetes/pkg/api"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
osgraphtest "github.com/openshift/origin/pkg/api/graph/test"
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/graph/test/runtimeobject_nodebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (

"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/autoscaling"
kapi "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubectl/resource"

osgraph "github.com/openshift/origin/pkg/api/graph"
Expand Down Expand Up @@ -129,13 +130,13 @@ func BuildGraph(path string) (osgraph.Graph, []runtime.Object, error) {
return g, objs, err
}

mapper := kapi.Registry.RESTMapper()
typer := kapi.Scheme
mapper := legacyscheme.Registry.RESTMapper()
typer := legacyscheme.Scheme
clientMapper := resource.ClientMapperFunc(func(mapping *meta.RESTMapping) (resource.RESTClient, error) {
return nil, nil
})

r := resource.NewBuilder(mapper, resource.SimpleCategoryExpander{}, typer, clientMapper, kapi.Codecs.UniversalDecoder()).
r := resource.NewBuilder(mapper, resource.SimpleCategoryExpander{}, typer, clientMapper, legacyscheme.Codecs.UniversalDecoder()).
FilenameParam(false, &resource.FilenameOptions{Recursive: false, Filenames: []string{abspath}}).
Flatten().
Do()
Expand Down
21 changes: 11 additions & 10 deletions pkg/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package install
import (
kv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
kapi "k8s.io/kubernetes/pkg/api"
kapiv1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/api/legacyscheme"
kapi "k8s.io/kubernetes/pkg/apis/core"
kapiv1 "k8s.io/kubernetes/pkg/apis/core/v1"

// we have a strong dependency on kube objects for deployments and scale
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/apps/install"
_ "k8s.io/kubernetes/pkg/apis/authentication/install"
_ "k8s.io/kubernetes/pkg/apis/authorization/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/certificates/install"
_ "k8s.io/kubernetes/pkg/apis/core/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
_ "k8s.io/kubernetes/pkg/apis/policy/install"
_ "k8s.io/kubernetes/pkg/apis/rbac/install"
Expand Down Expand Up @@ -73,7 +74,7 @@ func init() {
// This is a "fast-path" that avoids reflection for common types. It focuses on the objects that are
// converted the most in the cluster.
// TODO: generate one of these for every external API group - this is to prove the impact
kapi.Scheme.AddGenericConversionFunc(func(objA, objB interface{}, s conversion.Scope) (bool, error) {
legacyscheme.Scheme.AddGenericConversionFunc(func(objA, objB interface{}, s conversion.Scope) (bool, error) {
switch a := objA.(type) {
case *metav1.WatchEvent:
switch b := objB.(type) {
Expand Down Expand Up @@ -107,34 +108,34 @@ func init() {
case *kv1.ServiceAccount:
switch b := objB.(type) {
case *kapi.ServiceAccount:
return true, kapiv1.Convert_v1_ServiceAccount_To_api_ServiceAccount(a, b, s)
return true, kapiv1.Convert_v1_ServiceAccount_To_core_ServiceAccount(a, b, s)
}
case *kapi.ServiceAccount:
switch b := objB.(type) {
case *kv1.ServiceAccount:
return true, kapiv1.Convert_api_ServiceAccount_To_v1_ServiceAccount(a, b, s)
return true, kapiv1.Convert_core_ServiceAccount_To_v1_ServiceAccount(a, b, s)
}

case *kv1.SecretList:
switch b := objB.(type) {
case *kapi.SecretList:
return true, kapiv1.Convert_v1_SecretList_To_api_SecretList(a, b, s)
return true, kapiv1.Convert_v1_SecretList_To_core_SecretList(a, b, s)
}
case *kapi.SecretList:
switch b := objB.(type) {
case *kv1.SecretList:
return true, kapiv1.Convert_api_SecretList_To_v1_SecretList(a, b, s)
return true, kapiv1.Convert_core_SecretList_To_v1_SecretList(a, b, s)
}

case *kv1.Secret:
switch b := objB.(type) {
case *kapi.Secret:
return true, kapiv1.Convert_v1_Secret_To_api_Secret(a, b, s)
return true, kapiv1.Convert_v1_Secret_To_core_Secret(a, b, s)
}
case *kapi.Secret:
switch b := objB.(type) {
case *kv1.Secret:
return true, kapiv1.Convert_api_Secret_To_v1_Secret(a, b, s)
return true, kapiv1.Convert_core_Secret_To_v1_Secret(a, b, s)
}

case *routev1.RouteList:
Expand Down
14 changes: 7 additions & 7 deletions pkg/api/install/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/sets"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"

configapi "github.com/openshift/origin/pkg/cmd/server/api"
configapiv1 "github.com/openshift/origin/pkg/cmd/server/api/v1"
)

func TestDescriptions(t *testing.T) {
for _, version := range kapi.Registry.RegisteredGroupVersions() {
for _, version := range legacyscheme.Registry.RegisteredGroupVersions() {
seen := map[reflect.Type]bool{}

for _, apiType := range kapi.Scheme.KnownTypes(version) {
for _, apiType := range legacyscheme.Scheme.KnownTypes(version) {
checkDescriptions(apiType, &seen, t)
}
}
Expand Down Expand Up @@ -63,14 +63,14 @@ func TestInternalJsonTags(t *testing.T) {
seen := map[reflect.Type]bool{}
seenGroups := sets.String{}

for _, version := range kapi.Registry.RegisteredGroupVersions() {
for _, version := range legacyscheme.Registry.RegisteredGroupVersions() {
if seenGroups.Has(version.Group) {
continue
}
seenGroups.Insert(version.Group)

internalVersion := schema.GroupVersion{Group: version.Group, Version: runtime.APIVersionInternal}
for _, apiType := range kapi.Scheme.KnownTypes(internalVersion) {
for _, apiType := range legacyscheme.Scheme.KnownTypes(internalVersion) {
checkInternalJsonTags(apiType, &seen, t)
}
}
Expand Down Expand Up @@ -122,8 +122,8 @@ func checkInternalJsonTags(objType reflect.Type, seen *map[reflect.Type]bool, t
func TestExternalJsonTags(t *testing.T) {
seen := map[reflect.Type]bool{}

for _, version := range kapi.Registry.RegisteredGroupVersions() {
for _, apiType := range kapi.Scheme.KnownTypes(version) {
for _, version := range legacyscheme.Registry.RegisteredGroupVersions() {
for _, apiType := range legacyscheme.Scheme.KnownTypes(version) {
checkExternalJsonTags(apiType, &seen, t)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kubegraph/analysis/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"

"k8s.io/apimachinery/pkg/util/sets"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/autoscaling"
kapi "k8s.io/kubernetes/pkg/apis/core"

graphapi "github.com/gonum/graph"
"github.com/gonum/graph/path"
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kubegraph/analysis/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/MakeNowJust/heredoc"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kapi "k8s.io/kubernetes/pkg/api"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/kubegraph/edge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
kapi "k8s.io/kubernetes/pkg/api"
_ "k8s.io/kubernetes/pkg/api/install"
kapps "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
kapi "k8s.io/kubernetes/pkg/apis/core"
_ "k8s.io/kubernetes/pkg/apis/core/install"

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/kubegraph/edges.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"strings"

"github.com/gonum/graph"
"k8s.io/kubernetes/pkg/api/legacyscheme"

"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
kapi "k8s.io/kubernetes/pkg/api"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
Expand Down Expand Up @@ -229,7 +230,7 @@ func AddHPAScaleRefEdges(g osgraph.Graph) {
groupVersionResource = schema.GroupVersionResource{Resource: resource}
}

groupVersionResource, err := kapi.Registry.RESTMapper().ResourceFor(groupVersionResource)
groupVersionResource, err := legacyscheme.Registry.RESTMapper().ResourceFor(groupVersionResource)
if err != nil {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kubegraph/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package nodes
import (
"github.com/gonum/graph"

kapi "k8s.io/kubernetes/pkg/api"
kapps "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kubegraph/nodes/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nodes
import (
"testing"

kapi "k8s.io/kubernetes/pkg/api"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kubegraph/nodes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"reflect"

kapi "k8s.io/kubernetes/pkg/api"
kapps "k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/apis/autoscaling"
kapi "k8s.io/kubernetes/pkg/apis/core"

osgraph "github.com/openshift/origin/pkg/api/graph"
)
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/latest/latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"sync"

"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/legacyscheme"
)

// HACK TO ELIMINATE CYCLES UNTIL WE KILL THIS PACKAGE
Expand Down Expand Up @@ -72,7 +72,7 @@ func getOrCreateOriginKinds() map[schema.GroupVersionKind]bool {

// enumerate all supported versions, get the kinds, and register with the mapper how to address our resources
for _, version := range Versions {
for kind, t := range api.Scheme.KnownTypes(version) {
for kind, t := range legacyscheme.Scheme.KnownTypes(version) {
// these don't require special handling at the RESTMapping level since they are either "normal" when groupified
// or under /api (not /oapi)
if kind == "SecurityContextConstraints" {
Expand Down
Loading

0 comments on commit 4bc612e

Please sign in to comment.