working on it

This commit is contained in:
kai
2024-08-30 15:21:05 +01:00
committed by Puskar Basu
parent faead86d26
commit cd07bf20f1
148 changed files with 309 additions and 1711 deletions

View File

@@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
putils "github.com/turbot/pipe-fittings/ociinstaller"
"strings"
"sync"
"time"
@@ -15,7 +14,10 @@ import (
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
perror_helpers "github.com/turbot/pipe-fittings/error_helpers"
putils "github.com/turbot/pipe-fittings/ociinstaller"
"github.com/turbot/pipe-fittings/ociinstaller/versionfile"
"github.com/turbot/pipe-fittings/plugin"
"github.com/turbot/pipe-fittings/utils"
"github.com/turbot/steampipe-plugin-sdk/v5/sperr"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
@@ -25,11 +27,9 @@ import (
"github.com/turbot/steampipe/pkg/error_helpers"
"github.com/turbot/steampipe/pkg/installationstate"
"github.com/turbot/steampipe/pkg/ociinstaller"
"github.com/turbot/steampipe/pkg/plugin"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/steampipeconfig"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/utils"
)
type installedPlugin struct {
@@ -489,7 +489,7 @@ func runPluginUpdateCmd(cmd *cobra.Command, args []string) {
defer cancel()
statushooks.SetStatus(ctx, "Checking for available updates")
reports := plugin.GetUpdateReport(timeoutCtx, state.InstallationID, runUpdatesFor)
reports := plugin.GetUpdateReport(timeoutCtx, state.InstallationID, runUpdatesFor, constants.SteampipeHubOCIBase)
statushooks.Done(ctx)
if len(reports) == 0 {
// this happens if for some reason the update server could not be contacted,
@@ -535,7 +535,7 @@ func runPluginUpdateCmd(cmd *cobra.Command, args []string) {
fmt.Println()
}
func doPluginUpdate(ctx context.Context, bar *uiprogress.Bar, pvr plugin.VersionCheckReport, wg *sync.WaitGroup, returnChannel chan *display.PluginInstallReport) {
func doPluginUpdate(ctx context.Context, bar *uiprogress.Bar, pvr plugin.PluginVersionCheckReport, wg *sync.WaitGroup, returnChannel chan *display.PluginInstallReport) {
var report *display.PluginInstallReport
if plugin.UpdateRequired(pvr) {

View File

@@ -14,6 +14,7 @@ import (
"github.com/spf13/viper"
"github.com/thediveo/enumflag/v2"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/pipe-fittings/utils"
"github.com/turbot/steampipe-plugin-sdk/v5/sperr"
"github.com/turbot/steampipe/pkg/cloud"
"github.com/turbot/steampipe/pkg/cmdconfig"
@@ -29,7 +30,6 @@ import (
"github.com/turbot/steampipe/pkg/snapshot"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/workspace"
)

View File

@@ -9,16 +9,17 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
filehelpers "github.com/turbot/go-kit/files"
"github.com/turbot/pipe-fittings/utils"
"github.com/turbot/steampipe/pkg/constants"
"github.com/turbot/steampipe/pkg/error_helpers"
"github.com/turbot/steampipe/pkg/filepaths"
"github.com/turbot/steampipe/pkg/statushooks"
"github.com/turbot/steampipe/pkg/utils"
"github.com/turbot/steampipe/pkg/version"
)
var exitCode int
// rootCmd represents the base command when called without any subcommands
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "steampipe [--version] [--help] COMMAND [args]",

View File

@@ -14,6 +14,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/turbot/go-kit/helpers"
putils "github.com/turbot/pipe-fittings/utils"
"github.com/turbot/steampipe-plugin-sdk/v5/sperr"
"github.com/turbot/steampipe/pkg/cmdconfig"
"github.com/turbot/steampipe/pkg/constants"
@@ -136,9 +137,9 @@ func serviceRestartCmd() *cobra.Command {
func runServiceStartCmd(cmd *cobra.Command, _ []string) {
ctx := cmd.Context()
utils.LogTime("runServiceStartCmd start")
putils.LogTime("runServiceStartCmd start")
defer func() {
utils.LogTime("runServiceStartCmd end")
putils.LogTime("runServiceStartCmd end")
if r := recover(); r != nil {
error_helpers.ShowError(ctx, helpers.ToError(r))
if exitCode == constants.ExitCodeSuccessful {
@@ -304,9 +305,9 @@ func runServiceInForeground(ctx context.Context) {
func runServiceRestartCmd(cmd *cobra.Command, _ []string) {
ctx := cmd.Context()
utils.LogTime("runServiceRestartCmd start")
putils.LogTime("runServiceRestartCmd start")
defer func() {
utils.LogTime("runServiceRestartCmd end")
putils.LogTime("runServiceRestartCmd end")
if r := recover(); r != nil {
error_helpers.ShowError(ctx, helpers.ToError(r))
if exitCode == constants.ExitCodeSuccessful {
@@ -380,9 +381,9 @@ to force a restart.
func runServiceStatusCmd(cmd *cobra.Command, _ []string) {
ctx := cmd.Context()
utils.LogTime("runServiceStatusCmd status")
putils.LogTime("runServiceStatusCmd status")
defer func() {
utils.LogTime("runServiceStatusCmd end")
putils.LogTime("runServiceStatusCmd end")
if r := recover(); r != nil {
error_helpers.ShowError(ctx, helpers.ToError(r))
}
@@ -424,14 +425,14 @@ func composeStateError(dbStateErr error, pmStateErr error) error {
func runServiceStopCmd(cmd *cobra.Command, _ []string) {
ctx := cmd.Context()
utils.LogTime("runServiceStopCmd stop")
putils.LogTime("runServiceStopCmd stop")
var status db_local.StopStatus
var dbStopError error
var dbState *db_local.RunningDBInstanceInfo
defer func() {
utils.LogTime("runServiceStopCmd end")
putils.LogTime("runServiceStopCmd end")
if r := recover(); r != nil {
error_helpers.ShowError(ctx, helpers.ToError(r))
if exitCode == constants.ExitCodeSuccessful {