Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename deploy.* imports to apps.* #16281

Merged
merged 1 commit into from
Dec 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"k8s.io/kubernetes/pkg/capabilities"

"github.com/openshift/origin/pkg/api/validation"
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
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"
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestExampleObjectSchemas(t *testing.T) {
},
"../test/extended/testdata/ldap": {
"ldapserver-buildconfig": &buildapi.BuildConfig{},
"ldapserver-deploymentconfig": &deployapi.DeploymentConfig{},
"ldapserver-deploymentconfig": &appsapi.DeploymentConfig{},
"ldapserver-imagestream": &imageapi.ImageStream{},
"ldapserver-imagestream-testenv": &imageapi.ImageStream{},
"ldapserver-service": &kapi.Service{},
Expand All @@ -123,7 +123,7 @@ func TestExampleObjectSchemas(t *testing.T) {
// TODO fix this test to handle json and yaml
"project-request-template-with-quota": nil, // skip a yaml file
"test-replication-controller": nil, // skip &api.ReplicationController
"test-deployment-config": &deployapi.DeploymentConfig{},
"test-deployment-config": &appsapi.DeploymentConfig{},
"test-image": &imageapi.Image{},
"test-image-stream": &imageapi.ImageStream{},
"test-image-stream-mapping": nil, // skip &imageapi.ImageStreamMapping{},
Expand Down
18 changes: 9 additions & 9 deletions pkg/api/graph/graphview/dc_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deployedges "github.com/openshift/origin/pkg/apps/graph"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsedges "github.com/openshift/origin/pkg/apps/graph"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
)

type DeploymentConfigPipeline struct {
Deployment *deploygraph.DeploymentConfigNode
Deployment *appsgraph.DeploymentConfigNode

ActiveDeployment *kubegraph.ReplicationControllerNode
InactiveDeployments []*kubegraph.ReplicationControllerNode
Expand All @@ -23,12 +23,12 @@ func AllDeploymentConfigPipelines(g osgraph.Graph, excludeNodeIDs IntSet) ([]Dep
covered := IntSet{}
dcPipelines := []DeploymentConfigPipeline{}

for _, uncastNode := range g.NodesByKind(deploygraph.DeploymentConfigNodeKind) {
for _, uncastNode := range g.NodesByKind(appsgraph.DeploymentConfigNodeKind) {
if excludeNodeIDs.Has(uncastNode.ID()) {
continue
}

pipeline, covers := NewDeploymentConfigPipeline(g, uncastNode.(*deploygraph.DeploymentConfigNode))
pipeline, covers := NewDeploymentConfigPipeline(g, uncastNode.(*appsgraph.DeploymentConfigNode))
covered.Insert(covers.List()...)
dcPipelines = append(dcPipelines, pipeline)
}
Expand All @@ -38,30 +38,30 @@ func AllDeploymentConfigPipelines(g osgraph.Graph, excludeNodeIDs IntSet) ([]Dep
}

// NewDeploymentConfigPipeline returns the DeploymentConfigPipeline and a set of all the NodeIDs covered by the DeploymentConfigPipeline
func NewDeploymentConfigPipeline(g osgraph.Graph, dcNode *deploygraph.DeploymentConfigNode) (DeploymentConfigPipeline, IntSet) {
func NewDeploymentConfigPipeline(g osgraph.Graph, dcNode *appsgraph.DeploymentConfigNode) (DeploymentConfigPipeline, IntSet) {
covered := IntSet{}
covered.Insert(dcNode.ID())

dcPipeline := DeploymentConfigPipeline{}
dcPipeline.Deployment = dcNode

// for everything that can trigger a deployment, create an image pipeline and add it to the list
for _, istNode := range g.PredecessorNodesByEdgeKind(dcNode, deployedges.TriggersDeploymentEdgeKind) {
for _, istNode := range g.PredecessorNodesByEdgeKind(dcNode, appsedges.TriggersDeploymentEdgeKind) {
imagePipeline, covers := NewImagePipelineFromImageTagLocation(g, istNode, istNode.(ImageTagLocation))

covered.Insert(covers.List()...)
dcPipeline.Images = append(dcPipeline.Images, imagePipeline)
}

// for image that we use, create an image pipeline and add it to the list
for _, tagNode := range g.PredecessorNodesByEdgeKind(dcNode, deployedges.UsedInDeploymentEdgeKind) {
for _, tagNode := range g.PredecessorNodesByEdgeKind(dcNode, appsedges.UsedInDeploymentEdgeKind) {
imagePipeline, covers := NewImagePipelineFromImageTagLocation(g, tagNode, tagNode.(ImageTagLocation))

covered.Insert(covers.List()...)
dcPipeline.Images = append(dcPipeline.Images, imagePipeline)
}

dcPipeline.ActiveDeployment, dcPipeline.InactiveDeployments = deployedges.RelevantDeployments(g, dcNode)
dcPipeline.ActiveDeployment, dcPipeline.InactiveDeployments = appsedges.RelevantDeployments(g, dcNode)
for _, rc := range dcPipeline.InactiveDeployments {
_, covers := NewReplicationController(g, rc)
covered.Insert(covers.List()...)
Expand Down
6 changes: 3 additions & 3 deletions pkg/api/graph/graphview/service_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
osgraph "github.com/openshift/origin/pkg/api/graph"
kubeedges "github.com/openshift/origin/pkg/api/kubegraph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
routeedges "github.com/openshift/origin/pkg/route/graph"
routegraph "github.com/openshift/origin/pkg/route/graph/nodes"
)
Expand All @@ -25,7 +25,7 @@ type ServiceGroup struct {

// TODO: this has to stop
FulfillingStatefulSets []*kubegraph.StatefulSetNode
FulfillingDCs []*deploygraph.DeploymentConfigNode
FulfillingDCs []*appsgraph.DeploymentConfigNode
FulfillingRCs []*kubegraph.ReplicationControllerNode
FulfillingPods []*kubegraph.PodNode

Expand Down Expand Up @@ -63,7 +63,7 @@ func NewServiceGroup(g osgraph.Graph, serviceNode *kubegraph.ServiceNode) (Servi
container := osgraph.GetTopLevelContainerNode(g, uncastServiceFulfiller)

switch castContainer := container.(type) {
case *deploygraph.DeploymentConfigNode:
case *appsgraph.DeploymentConfigNode:
service.FulfillingDCs = append(service.FulfillingDCs, castContainer)
case *kubegraph.ReplicationControllerNode:
service.FulfillingRCs = append(service.FulfillingRCs, castContainer)
Expand Down
28 changes: 14 additions & 14 deletions pkg/api/graph/graphview/veneering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
osgraphtest "github.com/openshift/origin/pkg/api/graph/test"
kubeedges "github.com/openshift/origin/pkg/api/kubegraph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
deployedges "github.com/openshift/origin/pkg/apps/graph"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsedges "github.com/openshift/origin/pkg/apps/graph"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
buildapi "github.com/openshift/origin/pkg/build/apis/build"
buildedges "github.com/openshift/origin/pkg/build/graph"
buildgraph "github.com/openshift/origin/pkg/build/graph/nodes"
Expand All @@ -31,7 +31,7 @@ func TestServiceGroup(t *testing.T) {

kubeedges.AddAllExposedPodTemplateSpecEdges(g)
buildedges.AddAllInputOutputEdges(g)
deployedges.AddAllTriggerEdges(g)
appsedges.AddAllTriggerEdges(g)

coveredNodes := IntSet{}

Expand Down Expand Up @@ -104,7 +104,7 @@ func TestBareDCGroup(t *testing.T) {

kubeedges.AddAllExposedPodTemplateSpecEdges(g)
buildedges.AddAllInputOutputEdges(g)
deployedges.AddAllTriggerEdges(g)
appsedges.AddAllTriggerEdges(g)

coveredNodes := IntSet{}

Expand Down Expand Up @@ -160,7 +160,7 @@ func TestBareBCGroup(t *testing.T) {

kubeedges.AddAllExposedPodTemplateSpecEdges(g)
buildedges.AddAllInputOutputEdges(g)
deployedges.AddAllTriggerEdges(g)
appsedges.AddAllTriggerEdges(g)

coveredNodes := IntSet{}

Expand Down Expand Up @@ -286,12 +286,12 @@ func TestGraph(t *testing.T) {
},
},
})
deploygraph.EnsureDeploymentConfigNode(g, &deployapi.DeploymentConfig{
appsgraph.EnsureDeploymentConfigNode(g, &appsapi.DeploymentConfig{
ObjectMeta: metav1.ObjectMeta{Namespace: "other", Name: "deploy1"},
Spec: deployapi.DeploymentConfigSpec{
Triggers: []deployapi.DeploymentTriggerPolicy{
Spec: appsapi.DeploymentConfigSpec{
Triggers: []appsapi.DeploymentTriggerPolicy{
{
ImageChangeParams: &deployapi.DeploymentTriggerImageChangeParams{
ImageChangeParams: &appsapi.DeploymentTriggerImageChangeParams{
From: kapi.ObjectReference{Kind: "ImageStreamTag", Namespace: "default", Name: "other:tag1"},
ContainerNames: []string{"1", "2"},
},
Expand Down Expand Up @@ -323,9 +323,9 @@ func TestGraph(t *testing.T) {
},
},
})
deploygraph.EnsureDeploymentConfigNode(g, &deployapi.DeploymentConfig{
appsgraph.EnsureDeploymentConfigNode(g, &appsapi.DeploymentConfig{
ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "deploy2"},
Spec: deployapi.DeploymentConfigSpec{
Spec: appsapi.DeploymentConfigSpec{
Template: &kapi.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand All @@ -348,8 +348,8 @@ func TestGraph(t *testing.T) {
kubeedges.AddAllExposedPodTemplateSpecEdges(g)
buildedges.AddAllInputOutputEdges(g)
buildedges.AddAllBuildEdges(g)
deployedges.AddAllTriggerEdges(g)
deployedges.AddAllDeploymentEdges(g)
appsedges.AddAllTriggerEdges(g)
appsedges.AddAllDeploymentEdges(g)

t.Log(g)

Expand Down
6 changes: 3 additions & 3 deletions pkg/api/graph/test/runtimeobject_nodebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
osgraph "github.com/openshift/origin/pkg/api/graph"
_ "github.com/openshift/origin/pkg/api/install"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
buildapi "github.com/openshift/origin/pkg/build/apis/build"
buildgraph "github.com/openshift/origin/pkg/build/graph/nodes"
imageapi "github.com/openshift/origin/pkg/image/apis/image"
Expand All @@ -36,7 +36,7 @@ func init() {
if err := RegisterEnsureNode(&imageapi.ImageStream{}, imagegraph.EnsureImageStreamNode); err != nil {
panic(err)
}
if err := RegisterEnsureNode(&deployapi.DeploymentConfig{}, deploygraph.EnsureDeploymentConfigNode); err != nil {
if err := RegisterEnsureNode(&appsapi.DeploymentConfig{}, appsgraph.EnsureDeploymentConfigNode); err != nil {
panic(err)
}
if err := RegisterEnsureNode(&buildapi.BuildConfig{}, buildgraph.EnsureBuildConfigNode); err != nil {
Expand Down
18 changes: 9 additions & 9 deletions pkg/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
watchapi "k8s.io/apimachinery/pkg/watch"

deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
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"
Expand All @@ -49,7 +49,7 @@ import (
templateapi "github.com/openshift/origin/pkg/template/apis/template"
userapi "github.com/openshift/origin/pkg/user/apis/user"

deployv1 "github.com/openshift/api/apps/v1"
appsv1 "github.com/openshift/api/apps/v1"
authorizationv1 "github.com/openshift/api/authorization/v1"
buildv1 "github.com/openshift/api/build/v1"
imagev1 "github.com/openshift/api/image/v1"
Expand All @@ -59,7 +59,7 @@ import (
templatev1 "github.com/openshift/api/template/v1"
userv1 "github.com/openshift/api/user/v1"

deployconversionv1 "github.com/openshift/origin/pkg/apps/apis/apps/v1"
appsconversionv1 "github.com/openshift/origin/pkg/apps/apis/apps/v1"
authorizationconversionv1 "github.com/openshift/origin/pkg/authorization/apis/authorization/v1"
buildconversionv1 "github.com/openshift/origin/pkg/build/apis/build/v1"
imageconversionv1 "github.com/openshift/origin/pkg/image/apis/image/v1"
Expand Down Expand Up @@ -313,15 +313,15 @@ func init() {
return true, templateconversionv1.Convert_template_BrokerTemplateInstanceList_To_v1_BrokerTemplateInstanceList(a, b, s)
}

case *deployv1.DeploymentConfig:
case *appsv1.DeploymentConfig:
switch b := objB.(type) {
case *deployapi.DeploymentConfig:
return true, deployconversionv1.Convert_v1_DeploymentConfig_To_apps_DeploymentConfig(a, b, s)
case *appsapi.DeploymentConfig:
return true, appsconversionv1.Convert_v1_DeploymentConfig_To_apps_DeploymentConfig(a, b, s)
}
case *deployapi.DeploymentConfig:
case *appsapi.DeploymentConfig:
switch b := objB.(type) {
case *deployv1.DeploymentConfig:
return true, deployconversionv1.Convert_apps_DeploymentConfig_To_v1_DeploymentConfig(a, b, s)
case *appsv1.DeploymentConfig:
return true, appsconversionv1.Convert_apps_DeploymentConfig_To_v1_DeploymentConfig(a, b, s)
}

case *imagev1.ImageStream:
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/kubegraph/analysis/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/openshift/origin/pkg/api/kubegraph"
kubeedges "github.com/openshift/origin/pkg/api/kubegraph"
kubenodes "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deploygraph "github.com/openshift/origin/pkg/apps/graph"
deploynodes "github.com/openshift/origin/pkg/apps/graph/nodes"
appsgraph "github.com/openshift/origin/pkg/apps/graph"
appsnodes "github.com/openshift/origin/pkg/apps/graph/nodes"
)

const (
Expand Down Expand Up @@ -123,11 +123,11 @@ func FindOverlappingHPAs(graph osgraph.Graph, namer osgraph.Namer) []osgraph.Mar
nodeFilter := osgraph.NodesOfKind(
kubenodes.HorizontalPodAutoscalerNodeKind,
kubenodes.ReplicationControllerNodeKind,
deploynodes.DeploymentConfigNodeKind,
appsnodes.DeploymentConfigNodeKind,
)
edgeFilter := osgraph.EdgesOfKind(
kubegraph.ScalingEdgeKind,
deploygraph.DeploymentEdgeKind,
appsgraph.DeploymentEdgeKind,
kubeedges.ManagedByControllerEdgeKind,
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/api/kubegraph/analysis/hpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
osgraph "github.com/openshift/origin/pkg/api/graph"
osgraphtest "github.com/openshift/origin/pkg/api/graph/test"
"github.com/openshift/origin/pkg/api/kubegraph"
deploygraph "github.com/openshift/origin/pkg/apps/graph"
appsgraph "github.com/openshift/origin/pkg/apps/graph"
)

func TestHPAMissingCPUTargetError(t *testing.T) {
Expand Down Expand Up @@ -62,7 +62,7 @@ func TestOverlappingHPAsWarning(t *testing.T) {
}

kubegraph.AddHPAScaleRefEdges(g)
deploygraph.AddAllDeploymentEdges(g)
appsgraph.AddAllDeploymentEdges(g)

markers := FindOverlappingHPAs(g, osgraph.DefaultNamer)
if len(markers) != 8 {
Expand All @@ -87,7 +87,7 @@ func TestOverlappingLegacyHPAsWarning(t *testing.T) {
}

kubegraph.AddHPAScaleRefEdges(g)
deploygraph.AddAllDeploymentEdges(g)
appsgraph.AddAllDeploymentEdges(g)

markers := FindOverlappingHPAs(g, osgraph.DefaultNamer)
if len(markers) != 8 {
Expand Down
8 changes: 4 additions & 4 deletions pkg/api/kubegraph/edge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
_ "github.com/openshift/origin/pkg/apps/apis/apps/install"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
)

type objectifier interface {
Expand Down Expand Up @@ -186,13 +186,13 @@ func TestHPADCEdges(t *testing.T) {
},
}

dc := &deployapi.DeploymentConfig{}
dc := &appsapi.DeploymentConfig{}
dc.Name = "test-dc"
dc.Namespace = "test-ns"

g := osgraph.New()
hpaNode := kubegraph.EnsureHorizontalPodAutoscalerNode(g, hpa)
dcNode := deploygraph.EnsureDeploymentConfigNode(g, dc)
dcNode := appsgraph.EnsureDeploymentConfigNode(g, dc)

AddHPAScaleRefEdges(g)

Expand Down
8 changes: 4 additions & 4 deletions pkg/api/kubegraph/edges.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

osgraph "github.com/openshift/origin/pkg/api/graph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deployapi "github.com/openshift/origin/pkg/apps/apis/apps"
deploygraph "github.com/openshift/origin/pkg/apps/graph/nodes"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsgraph "github.com/openshift/origin/pkg/apps/graph/nodes"
)

const (
Expand Down Expand Up @@ -240,8 +240,8 @@ func AddHPAScaleRefEdges(g osgraph.Graph) {
switch {
case r == kapi.Resource("replicationcontrollers"):
syntheticNode = kubegraph.FindOrCreateSyntheticReplicationControllerNode(g, &kapi.ReplicationController{ObjectMeta: syntheticMeta})
case deployapi.IsResourceOrLegacy("deploymentconfigs", r):
syntheticNode = deploygraph.FindOrCreateSyntheticDeploymentConfigNode(g, &deployapi.DeploymentConfig{ObjectMeta: syntheticMeta})
case appsapi.IsResourceOrLegacy("deploymentconfigs", r):
syntheticNode = appsgraph.FindOrCreateSyntheticDeploymentConfigNode(g, &appsapi.DeploymentConfig{ObjectMeta: syntheticMeta})
default:
continue
}
Expand Down
Loading