Skip to content

Commit

Permalink
Support k8s client-go 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Daishan committed Jul 22, 2020
1 parent 59c2bf8 commit 1373118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion stern/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (t *Tail) Start(ctx context.Context, i v1.PodInterface, logC chan<- string)
TailLines: t.Options.TailLines,
})

stream, err := req.Stream()
stream, err := req.Stream(ctx)
if err != nil {
fmt.Println(errors.Wrapf(err, "Error opening stream to %s/%s: %s\n", t.Namespace, t.PodName, t.ContainerName))
t.Active = false
Expand Down
2 changes: 1 addition & 1 deletion stern/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (t *Target) GetID() string {
// containers/pods. The first result is targets added, the second is targets
// removed
func Watch(ctx context.Context, i v1.PodInterface, podFilter *regexp.Regexp, containerFilter *regexp.Regexp, containerExcludeFilter *regexp.Regexp, initContainers bool, containerState ContainerState, labelSelector labels.Selector) (chan *Target, chan *Target, error) {
watcher, err := i.Watch(metav1.ListOptions{Watch: true, LabelSelector: labelSelector.String()})
watcher, err := i.Watch(ctx, metav1.ListOptions{Watch: true, LabelSelector: labelSelector.String()})
if err != nil {
return nil, nil, errors.Wrap(err, "failed to set up watch")
}
Expand Down

0 comments on commit 1373118

Please sign in to comment.