Skip to content

Commit

Permalink
Merge pull request #9692 from kargakis/cleanup-deployment-packages
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jul 20, 2016
2 parents 2e48c47 + 9be6c5a commit 4ecbe85
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 27 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/infra/deployer/deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
deployapi "github.com/openshift/origin/pkg/deploy/api"
deploytest "github.com/openshift/origin/pkg/deploy/api/test"
deployv1 "github.com/openshift/origin/pkg/deploy/api/v1"
scalertest "github.com/openshift/origin/pkg/deploy/scaler/test"
cmdtest "github.com/openshift/origin/pkg/deploy/cmd/test"
"github.com/openshift/origin/pkg/deploy/strategy"
deployutil "github.com/openshift/origin/pkg/deploy/util"

Expand All @@ -33,7 +33,7 @@ func TestDeployer_getDeploymentFail(t *testing.T) {
t.Fatal("unexpected call")
return nil, nil
},
scaler: &scalertest.FakeScaler{},
scaler: &cmdtest.FakeScaler{},
}

err := deployer.Deploy("namespace", "name")
Expand Down Expand Up @@ -134,7 +134,7 @@ func TestDeployer_deployScenarios(t *testing.T) {
var actualFrom, actualTo *kapi.ReplicationController
var actualDesired int32
to := findDeployment(s.toVersion)
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

deployer := &Deployer{
out: &bytes.Buffer{},
Expand Down
6 changes: 2 additions & 4 deletions pkg/cmd/util/clientcmd/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ import (
deployapi "github.com/openshift/origin/pkg/deploy/api"
deploycmd "github.com/openshift/origin/pkg/deploy/cmd"
deploygen "github.com/openshift/origin/pkg/deploy/generator"
deployreaper "github.com/openshift/origin/pkg/deploy/reaper"
deployscaler "github.com/openshift/origin/pkg/deploy/scaler"
deployutil "github.com/openshift/origin/pkg/deploy/util"
imageapi "github.com/openshift/origin/pkg/image/api"
routegen "github.com/openshift/origin/pkg/route/generator"
Expand Down Expand Up @@ -258,7 +256,7 @@ func NewFactory(clientConfig kclientcmd.ClientConfig) *Factory {
}

if mapping.GroupVersionKind.GroupKind() == deployapi.Kind("DeploymentConfig") {
return deployscaler.NewDeploymentConfigScaler(oc, kc), nil
return deploycmd.NewDeploymentConfigScaler(oc, kc), nil
}
return kScalerFunc(mapping)
}
Expand All @@ -271,7 +269,7 @@ func NewFactory(clientConfig kclientcmd.ClientConfig) *Factory {

switch mapping.GroupVersionKind.GroupKind() {
case deployapi.Kind("DeploymentConfig"):
return deployreaper.NewDeploymentConfigReaper(oc, kc), nil
return deploycmd.NewDeploymentConfigReaper(oc, kc), nil
case authorizationapi.Kind("Role"):
return authorizationreaper.NewRoleReaper(oc, oc), nil
case authorizationapi.Kind("ClusterRole"):
Expand Down
3 changes: 1 addition & 2 deletions pkg/deploy/reaper/reaper.go → pkg/deploy/cmd/reaper.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// TODO: Move to pkg/deploy/cmd
package reaper
package cmd

import (
"time"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package reaper
package cmd

import (
"reflect"
Expand Down
3 changes: 1 addition & 2 deletions pkg/deploy/scaler/scale.go → pkg/deploy/cmd/scale.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// TODO: Move to pkg/deploy/cmd
package scaler
package cmd

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package scaler
package cmd

import (
"testing"
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions pkg/deploy/reaper/doc.go

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/deploy/scaler/doc.go

This file was deleted.

20 changes: 10 additions & 10 deletions pkg/deploy/strategy/recreate/recreate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
deployapi "github.com/openshift/origin/pkg/deploy/api"
deploytest "github.com/openshift/origin/pkg/deploy/api/test"
deployv1 "github.com/openshift/origin/pkg/deploy/api/v1"
scalertest "github.com/openshift/origin/pkg/deploy/scaler/test"
cmdtest "github.com/openshift/origin/pkg/deploy/cmd/test"
"github.com/openshift/origin/pkg/deploy/strategy"
deployutil "github.com/openshift/origin/pkg/deploy/util"

Expand All @@ -21,7 +21,7 @@ import (

func TestRecreate_initialDeployment(t *testing.T) {
var deployment *kapi.ReplicationController
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}
strategy := &RecreateDeploymentStrategy{
out: &bytes.Buffer{},
errOut: &bytes.Buffer{},
Expand Down Expand Up @@ -55,7 +55,7 @@ func TestRecreate_deploymentPreHookSuccess(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, deployapi.LifecycleHookFailurePolicyAbort, "", "")
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(registered.GroupOrDie(kapi.GroupName).GroupVersions[0]))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

hookExecuted := false
strategy := &RecreateDeploymentStrategy{
Expand Down Expand Up @@ -90,7 +90,7 @@ func TestRecreate_deploymentPreHookFail(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, deployapi.LifecycleHookFailurePolicyAbort, "", "")
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(registered.GroupOrDie(kapi.GroupName).GroupVersions[0]))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

strategy := &RecreateDeploymentStrategy{
out: &bytes.Buffer{},
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestRecreate_deploymentMidHookSuccess(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, "", deployapi.LifecycleHookFailurePolicyAbort, "")
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(deployv1.SchemeGroupVersion))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

hookExecuted := false
strategy := &RecreateDeploymentStrategy{
Expand Down Expand Up @@ -158,7 +158,7 @@ func TestRecreate_deploymentMidHookFail(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, "", deployapi.LifecycleHookFailurePolicyAbort, "")
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(deployv1.SchemeGroupVersion))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

strategy := &RecreateDeploymentStrategy{
out: &bytes.Buffer{},
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestRecreate_deploymentPostHookSuccess(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, "", "", deployapi.LifecycleHookFailurePolicyAbort)
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(registered.GroupOrDie(kapi.GroupName).GroupVersions[0]))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

hookExecuted := false
strategy := &RecreateDeploymentStrategy{
Expand Down Expand Up @@ -225,7 +225,7 @@ func TestRecreate_deploymentPostHookFail(t *testing.T) {
config := deploytest.OkDeploymentConfig(1)
config.Spec.Strategy = recreateParams(30, "", "", deployapi.LifecycleHookFailurePolicyAbort)
deployment, _ := deployutil.MakeDeployment(config, kapi.Codecs.LegacyCodec(registered.GroupOrDie(kapi.GroupName).GroupVersions[0]))
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

hookExecuted := false
strategy := &RecreateDeploymentStrategy{
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestRecreate_deploymentPostHookFail(t *testing.T) {

func TestRecreate_acceptorSuccess(t *testing.T) {
var deployment *kapi.ReplicationController
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

strategy := &RecreateDeploymentStrategy{
out: &bytes.Buffer{},
Expand Down Expand Up @@ -304,7 +304,7 @@ func TestRecreate_acceptorSuccess(t *testing.T) {

func TestRecreate_acceptorFail(t *testing.T) {
var deployment *kapi.ReplicationController
scaler := &scalertest.FakeScaler{}
scaler := &cmdtest.FakeScaler{}

strategy := &RecreateDeploymentStrategy{
out: &bytes.Buffer{},
Expand Down

0 comments on commit 4ecbe85

Please sign in to comment.