Skip to content

Commit

Permalink
Merge pull request #1569 from dgageot/fix-master-branch
Browse files Browse the repository at this point in the history
Fix master branch
  • Loading branch information
dgageot committed Jan 31, 2019
2 parents 5b138e5 + 4a6bec4 commit b62bfbb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/skaffold/watch/triggers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func NewTrigger(opts *config.SkaffoldOptions) (Trigger, error) {
switch strings.ToLower(opts.Trigger) {
case "polling":
return &pollTrigger{
interval: time.Duration(opts.WatchPollInterval) * time.Millisecond,
Interval: time.Duration(opts.WatchPollInterval) * time.Millisecond,
}, nil
case "manual":
return &manualTrigger{}, nil
Expand All @@ -54,7 +54,7 @@ func NewTrigger(opts *config.SkaffoldOptions) (Trigger, error) {

// pollTrigger watches for changes on a given interval of time.
type pollTrigger struct {
interval time.Duration
Interval time.Duration
}

// Debounce tells the watcher to debounce rapid sequence of changes.
Expand All @@ -63,14 +63,14 @@ func (t *pollTrigger) Debounce() bool {
}

func (t *pollTrigger) WatchForChanges(out io.Writer) {
color.Yellow.Fprintf(out, "Watching for changes every %v...\n", t.interval)
color.Yellow.Fprintf(out, "Watching for changes every %v...\n", t.Interval)
}

// Start starts a timer.
func (t *pollTrigger) Start(ctx context.Context) (<-chan bool, error) {
trigger := make(chan bool)

ticker := time.NewTicker(t.interval)
ticker := time.NewTicker(t.Interval)
go func() {
for {
select {
Expand Down
3 changes: 0 additions & 3 deletions pkg/skaffold/watch/triggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,15 @@ func TestNewTrigger(t *testing.T) {
expected: &pollTrigger{
Interval: time.Duration(1) * time.Millisecond,
},
shouldErr: false,
},
{
description: "manual trigger",
opts: &config.SkaffoldOptions{Trigger: "manual"},
expected: &manualTrigger{},
shouldErr: false,
},
{
description: "unknown trigger",
opts: &config.SkaffoldOptions{Trigger: "unknown"},
expected: nil,
shouldErr: true,
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/watch/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func TestWatch(t *testing.T) {

// Watch folder
watcher := NewWatcher(&pollTrigger{
interval: 10 * time.Millisecond,
Interval: 10 * time.Millisecond,
})
err := watcher.Register(folder.List, folderChanged.call)
testutil.CheckError(t, false, err)
Expand Down

0 comments on commit b62bfbb

Please sign in to comment.