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

Fix master branch #1569

Merged
merged 1 commit into from
Jan 31, 2019
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
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