Merge pull request #125537 from seans3/rc-fallback-log
Adds logging during remote command executor fallback
This commit is contained in:
		@@ -18,6 +18,8 @@ package remotecommand
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"context"
 | 
			
		||||
 | 
			
		||||
	"k8s.io/klog/v2"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var _ Executor = &FallbackExecutor{}
 | 
			
		||||
@@ -51,6 +53,7 @@ func (f *FallbackExecutor) Stream(options StreamOptions) error {
 | 
			
		||||
func (f *FallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error {
 | 
			
		||||
	err := f.primary.StreamWithContext(ctx, options)
 | 
			
		||||
	if f.shouldFallback(err) {
 | 
			
		||||
		klog.V(4).Infof("RemoteCommand fallback: %v", err)
 | 
			
		||||
		return f.secondary.StreamWithContext(ctx, options)
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user