Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #213 from vishh/events
Browse files Browse the repository at this point in the history
Disable events until a sink is added.
  • Loading branch information
saad-ali committed Apr 1, 2015
2 parents eb577f2 + f235aed commit 35ff9ef
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
32 changes: 32 additions & 0 deletions sources/events_fake.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package sources

import kubeapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"

type fakeEventsSource struct{}

func (self *fakeEventsSource) GetEvents() ([]kubeapi.Event, EventError) {
return []kubeapi.Event{}, nil
}

// Terminates existing watch loop, if any, and starts new instance
func (self *fakeEventsSource) RestartWatchLoop() {
return
}

func NewFakeEventsSource() EventsSource {
return &fakeEventsSource{}
}
3 changes: 2 additions & 1 deletion sources/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ func newKubeSource(pollDuration time.Duration) (*kubeSource, error) {
}
glog.Infof("Using Kubernetes client with master %q and version %s\n", *argMaster, *argKubeVersion)
glog.Infof("Using kubelet port %q", *argKubeletPort)
eventsSource := NewEventsSource(kubeClient)
// TODO: Use real events source once events sink has been added.
eventsSource := NewFakeEventsSource()

return &kubeSource{
pollDuration: pollDuration,
Expand Down

0 comments on commit 35ff9ef

Please sign in to comment.