Capture context from cobra CLI and pass forward (#2551)

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2022-09-22 13:54:05 +05:30
committed by GitHub
parent d03395949b
commit e87c84ee2c
33 changed files with 93 additions and 83 deletions
+2 -2
View File
@@ -59,7 +59,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
return errors.Wrap(err, "error getting function")
}
server, err := util.GetApplicationUrl("application=fission-api", kubeContext)
server, err := util.GetApplicationUrl(input.Context(), "application=fission-api", kubeContext)
if err != nil {
return err
}
@@ -72,7 +72,7 @@ func (opts *LogSubCommand) do(input cli.Input) error {
requestChan := make(chan struct{})
responseChan := make(chan struct{})
ctx := context.Background()
ctx := input.Context()
go func(ctx context.Context, requestChan, responseChan chan struct{}) {
t := time.Unix(0, 0*int64(time.Millisecond))