mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Collect Component type for usage data (#4662)
* Add support for componentType to telemetry and replace Execute with ExecuteContext to support context * Make o.Run() compatible with ExecuteContext * Add unit tests for upload with context * Fix ci unit test failure * Move context code to a separate package within the segment package * separate private and public methods, reorganize * fix import
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
"github.com/openshift/odo/pkg/odo/util"
|
||||
"github.com/openshift/odo/pkg/odo/util/completion"
|
||||
"github.com/openshift/odo/pkg/preference"
|
||||
segment "github.com/openshift/odo/pkg/segment/context"
|
||||
"github.com/posener/complete"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
@@ -65,7 +67,7 @@ func main() {
|
||||
updateInfo := make(chan string)
|
||||
go version.GetLatestReleaseInfo(updateInfo)
|
||||
|
||||
util.LogErrorAndExit(root.Execute(), "")
|
||||
util.LogErrorAndExit(root.ExecuteContext(segment.NewContext(context.Background())), "")
|
||||
select {
|
||||
case message := <-updateInfo:
|
||||
log.Italic(message)
|
||||
@@ -73,7 +75,7 @@ func main() {
|
||||
klog.V(4).Info("Could not get the latest release information in time. Never mind, exiting gracefully :)")
|
||||
}
|
||||
} else {
|
||||
util.LogErrorAndExit(root.Execute(), "")
|
||||
util.LogErrorAndExit(root.ExecuteContext(segment.NewContext(context.Background())), "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user