Skip to content

Commit

Permalink
Revert "Scheduledjob e2e"
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish Kalele authored Aug 12, 2016
1 parent f279e61 commit f64c052
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 267 deletions.
4 changes: 1 addition & 3 deletions cmd/kube-controller-manager/app/controllermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"k8s.io/kubernetes/cmd/kube-controller-manager/app/options"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/batch"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/leaderelection"
"k8s.io/kubernetes/pkg/client/record"
Expand Down Expand Up @@ -129,7 +128,6 @@ func Run(s *options.CMServer) error {
}

kubeconfig.ContentConfig.ContentType = s.ContentType
kubeconfig.ContentConfig.GroupVersion = &unversioned.GroupVersion{Group: batch.GroupName, Version: "v2alpha1"}
// Override kubeconfig qps/burst settings from flags
kubeconfig.QPS = s.KubeAPIQPS
kubeconfig.Burst = int(s.KubeAPIBurst)
Expand Down Expand Up @@ -392,7 +390,7 @@ func StartControllers(s *options.CMServer, kubeClient *client.Client, kubeconfig
glog.Infof("Starting %s apis", groupVersion)
if containsResource(resources, "scheduledjobs") {
glog.Infof("Starting scheduledjob controller")
go scheduledjob.NewScheduledJobController(kubeClient).
go scheduledjob.NewScheduledJobController(clientset.NewForConfigOrDie(restclient.AddUserAgent(kubeconfig, "scheduledjob-controller"))).
Run(wait.NeverStop)
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
time.Sleep(wait.Jitter(s.ControllerStartInterval.Duration, ControllerStartJitter))
Expand Down
2 changes: 0 additions & 2 deletions hack/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@ func TearDown() bool {

// Up brings an e2e cluster up, recreating it if one is already running.
func Up() bool {
// force having batch/v2alpha1 always on for e2e tests
os.Setenv("KUBE_RUNTIME_CONFIG", "batch/v2alpha1=true")
return finishRunning("up", exec.Command("./hack/e2e-internal/e2e-up.sh"))
}

Expand Down
15 changes: 8 additions & 7 deletions pkg/controller/scheduledjob/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apis/batch"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/unversioned"
"k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/controller/job"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/metrics"
Expand All @@ -49,20 +50,20 @@ import (
// Utilities for dealing with Jobs and ScheduledJobs and time.

type ScheduledJobController struct {
kubeClient *client.Client
kubeClient clientset.Interface
jobControl jobControlInterface
sjControl sjControlInterface
recorder record.EventRecorder
}

func NewScheduledJobController(kubeClient *client.Client) *ScheduledJobController {
func NewScheduledJobController(kubeClient clientset.Interface) *ScheduledJobController {
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(glog.Infof)
// TODO: remove the wrapper when every clients have moved to use the clientset.
eventBroadcaster.StartRecordingToSink(kubeClient.Events(""))
eventBroadcaster.StartRecordingToSink(&unversionedcore.EventSinkImpl{Interface: kubeClient.Core().Events("")})

if kubeClient != nil && kubeClient.GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("scheduledjob_controller", kubeClient.GetRateLimiter())
if kubeClient != nil && kubeClient.Batch().GetRESTClient().GetRateLimiter() != nil {
metrics.RegisterMetricAndTrackRateLimiterUsage("scheduledjob_controller", kubeClient.Batch().GetRESTClient().GetRateLimiter())
}

jm := &ScheduledJobController{
Expand All @@ -75,7 +76,7 @@ func NewScheduledJobController(kubeClient *client.Client) *ScheduledJobControlle
return jm
}

func NewScheduledJobControllerFromClient(kubeClient *client.Client) *ScheduledJobController {
func NewScheduledJobControllerFromClient(kubeClient clientset.Interface) *ScheduledJobController {
jm := NewScheduledJobController(kubeClient)
return jm
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/scheduledjob/injection.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"sync"

"k8s.io/kubernetes/pkg/apis/batch"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/record"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/labels"
)

Expand All @@ -33,7 +33,7 @@ type sjControlInterface interface {

// realSJControl is the default implementation of sjControlInterface.
type realSJControl struct {
KubeClient *client.Client
KubeClient clientset.Interface
}

var _ sjControlInterface = &realSJControl{}
Expand Down Expand Up @@ -69,7 +69,7 @@ type jobControlInterface interface {

// realJobControl is the default implementation of jobControlInterface.
type realJobControl struct {
KubeClient *client.Client
KubeClient clientset.Interface
Recorder record.EventRecorder
}

Expand Down
9 changes: 2 additions & 7 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_4"
"k8s.io/kubernetes/pkg/api"
apierrs "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/clientset_generated/release_1_2"
"k8s.io/kubernetes/pkg/client/clientset_generated/release_1_3"
"k8s.io/kubernetes/pkg/client/restclient"
Expand Down Expand Up @@ -96,9 +95,8 @@ type TestDataSummary interface {
}

type FrameworkOptions struct {
ClientQPS float32
ClientBurst int
GroupVersion *unversioned.GroupVersion
ClientQPS float32
ClientBurst int
}

// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
Expand Down Expand Up @@ -174,9 +172,6 @@ func (f *Framework) BeforeEach() {
Expect(err).NotTo(HaveOccurred())
config.QPS = f.options.ClientQPS
config.Burst = f.options.ClientBurst
if f.options.GroupVersion != nil {
config.GroupVersion = f.options.GroupVersion
}
if TestContext.KubeAPIContentType != "" {
config.ContentType = TestContext.KubeAPIContentType
}
Expand Down
245 changes: 0 additions & 245 deletions test/e2e/scheduledjob.go

This file was deleted.

0 comments on commit f64c052

Please sign in to comment.