Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/cli/cmd/artifact_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"errors"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/spf13/cobra"
"google.golang.org/grpc"
Expand All @@ -39,7 +39,7 @@ func newArtifactDownloadCmd() *cobra.Command {
}

// Retrieve temporary credentials for uploading
artifactCASConn, err = wrappedArtifactConn(actionOpts.CPConnection,
artifactCASConn, err = wrappedArtifactConn(ActionOpts.CPConnection,
pb.CASCredentialsServiceGetRequest_ROLE_DOWNLOADER, digest)
if err != nil {
return err
Expand All @@ -49,7 +49,7 @@ func newArtifactDownloadCmd() *cobra.Command {
},
RunE: func(cmd *cobra.Command, args []string) error {
opts := &action.ArtifactDownloadOpts{
ActionsOpts: actionOpts,
ActionsOpts: ActionOpts,
ArtifactsCASConn: artifactCASConn,
Stdout: cmd.OutOrStdout(),
}
Expand Down
6 changes: 3 additions & 3 deletions app/cli/cmd/artifact_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package cmd

import (
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
pb "github.com/chainloop-dev/chainloop/app/controlplane/api/controlplane/v1"
"github.com/spf13/cobra"
"google.golang.org/grpc"
Expand All @@ -33,7 +33,7 @@ func newArtifactUploadCmd() *cobra.Command {
var err error

// Retrieve temporary credentials for uploading
artifactCASConn, err = wrappedArtifactConn(actionOpts.CPConnection, pb.CASCredentialsServiceGetRequest_ROLE_UPLOADER, "")
artifactCASConn, err = wrappedArtifactConn(ActionOpts.CPConnection, pb.CASCredentialsServiceGetRequest_ROLE_UPLOADER, "")
if err != nil {
return err
}
Expand All @@ -42,7 +42,7 @@ func newArtifactUploadCmd() *cobra.Command {
},
RunE: func(cmd *cobra.Command, args []string) error {
opts := &action.ArtifactUploadOpts{
ActionsOpts: actionOpts,
ActionsOpts: ActionOpts,
ArtifactsCASConn: artifactCASConn,
}

Expand Down
8 changes: 4 additions & 4 deletions app/cli/cmd/attached_integration_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package cmd

import (
"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand All @@ -36,13 +36,13 @@ func newAttachedIntegrationAttachCmd() *cobra.Command {
chainloop integration attached add --workflow deadbeef --project my-project --integration dependency-track --opt projectName=MyProject --opt filter="environment=prod,team=security"`,
RunE: func(_ *cobra.Command, _ []string) error {
// Find the integration to extract the kind of integration we care about
integration, err := action.NewRegisteredIntegrationDescribe(actionOpts).Run(integrationName)
integration, err := action.NewRegisteredIntegrationDescribe(ActionOpts).Run(integrationName)
if err != nil {
return err
}

// Retrieve schema for validation and options marshaling
item, err := action.NewAvailableIntegrationDescribe(actionOpts).Run(integration.Kind)
item, err := action.NewAvailableIntegrationDescribe(ActionOpts).Run(integration.Kind)
if err != nil {
return err
}
Expand All @@ -57,7 +57,7 @@ func newAttachedIntegrationAttachCmd() *cobra.Command {
return err
}

res, err := action.NewAttachedIntegrationAdd(actionOpts).Run(integrationName, workflowName, projectName, opts)
res, err := action.NewAttachedIntegrationAdd(ActionOpts).Run(integrationName, workflowName, projectName, opts)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attached_integration_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package cmd

import (
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand All @@ -28,7 +28,7 @@ func newAttachedIntegrationDeleteCmd() *cobra.Command {
Aliases: []string{"detach"},
Short: "Detach an integration that's attached to a workflow",
RunE: func(cmd *cobra.Command, args []string) error {
if err := action.NewAttachedIntegrationDelete(actionOpts).Run(attachmentID); err != nil {
if err := action.NewAttachedIntegrationDelete(ActionOpts).Run(attachmentID); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attached_integration_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"time"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"golang.org/x/exp/maps"
Expand All @@ -34,7 +34,7 @@ func newAttachedIntegrationListCmd() *cobra.Command {
Aliases: []string{"ls"},
Short: "List integrations attached to workflows",
RunE: func(cmd *cobra.Command, args []string) error {
res, err := action.NewAttachedIntegrationList(actionOpts).Run(projectName, workflowName)
res, err := action.NewAttachedIntegrationList(ActionOpts).Run(projectName, workflowName)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attestation_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"google.golang.org/grpc"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
schemaapi "github.com/chainloop-dev/chainloop/app/controlplane/api/workflowcontract/v1"
"github.com/chainloop-dev/chainloop/pkg/resourceloader"
)
Expand Down Expand Up @@ -68,7 +68,7 @@ func newAttestationAddCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, _ []string) error {
a, err := action.NewAttestationAdd(
&action.AttestationAddOpts{
ActionsOpts: actionOpts,
ActionsOpts: ActionOpts,
CASURI: viper.GetString(confOptions.CASAPI.viperKey),
CASCAPath: viper.GetString(confOptions.CASCA.viperKey),
ConnectionInsecure: apiInsecure(),
Expand Down
6 changes: 3 additions & 3 deletions app/cli/cmd/attestation_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -72,7 +72,7 @@ func newAttestationInitCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, _ []string) error {
a, err := action.NewAttestationInit(
&action.AttestationInitOpts{
ActionsOpts: actionOpts,
ActionsOpts: ActionOpts,
DryRun: attestationDryRun,
Force: force,
UseRemoteState: useAttestationRemoteState,
Expand Down Expand Up @@ -112,7 +112,7 @@ func newAttestationInitCmd() *cobra.Command {
logger.Info().Msg("Attestation initialized! now you can check its status or add materials to it")

// Show the status information
statusAction, err := action.NewAttestationStatus(&action.AttestationStatusOpts{ActionsOpts: actionOpts, UseAttestationRemoteState: useAttestationRemoteState, LocalStatePath: attestationLocalStatePath})
statusAction, err := action.NewAttestationStatus(&action.AttestationStatusOpts{ActionsOpts: ActionOpts, UseAttestationRemoteState: useAttestationRemoteState, LocalStatePath: attestationLocalStatePath})
if err != nil {
return newGracefulError(err)
}
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attestation_push.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"google.golang.org/grpc/status"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
)

func newAttestationPushCmd() *cobra.Command {
Expand Down Expand Up @@ -68,7 +68,7 @@ func newAttestationPushCmd() *cobra.Command {
return fmt.Errorf("getting executable information: %w", err)
}
a, err := action.NewAttestationPush(&action.AttestationPushOpts{
ActionsOpts: actionOpts, KeyPath: pkPath, BundlePath: bundle,
ActionsOpts: ActionOpts, KeyPath: pkPath, BundlePath: bundle,
CLIVersion: info.Version, CLIDigest: info.Digest,
LocalStatePath: attestationLocalStatePath,
SignServerOpts: &action.SignServerOpts{
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attestation_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"errors"
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand All @@ -41,7 +41,7 @@ func newAttestationResetCmd() *cobra.Command {
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
a, err := action.NewAttestationReset(&action.AttestationResetOpts{ActionsOpts: actionOpts, LocalStatePath: attestationLocalStatePath})
a, err := action.NewAttestationReset(&action.AttestationResetOpts{ActionsOpts: ActionOpts, LocalStatePath: attestationLocalStatePath})
if err != nil {
return fmt.Errorf("failed to load action: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/attestation_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/spf13/cobra"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/chainloop-dev/chainloop/pkg/attestation/renderer/chainloop"
)

Expand All @@ -46,7 +46,7 @@ func newAttestationStatusCmd() *cobra.Command {
a, err := action.NewAttestationStatus(
&action.AttestationStatusOpts{
UseAttestationRemoteState: attestationID != "",
ActionsOpts: actionOpts,
ActionsOpts: ActionOpts,
LocalStatePath: attestationLocalStatePath,
},
)
Expand Down
2 changes: 1 addition & 1 deletion app/cli/cmd/attestation_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package cmd
import (
"testing"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/stretchr/testify/assert"
)

Expand Down
8 changes: 4 additions & 4 deletions app/cli/cmd/attestation_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand All @@ -35,14 +35,14 @@ func newAttestationVerifyCmd() *cobra.Command {
# verify an attestation stored in an https endpoint
chainloop attestation verify -b https://myrepository/attestation.json`,
RunE: func(cmd *cobra.Command, _ []string) error {
res, err := action.NewAttestationVerifyAction(actionOpts).Run(cmd.Context(), fileOrURL)
res, err := action.NewAttestationVerifyAction(ActionOpts).Run(cmd.Context(), fileOrURL)
if err != nil {
return fmt.Errorf("verifying attestation: %w", err)
}
if res {
actionOpts.Logger.Info().Msg("attestation verified successfully")
ActionOpts.Logger.Info().Msg("attestation verified successfully")
} else {
actionOpts.Logger.Warn().Msg("attestation couldn't be verified")
ActionOpts.Logger.Warn().Msg("attestation couldn't be verified")
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions app/cli/cmd/auth_delete_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand All @@ -31,7 +31,7 @@ func newAuthDeleteAccountCmd() *cobra.Command {
Short: "delete your account",
RunE: func(cmd *cobra.Command, args []string) error {
// Get user information to make sure the user knows the account she is deleting
contextResp, err := action.NewConfigCurrentContext(actionOpts).Run()
contextResp, err := action.NewConfigCurrentContext(ActionOpts).Run()
if err != nil {
return err
}
Expand All @@ -44,7 +44,7 @@ func newAuthDeleteAccountCmd() *cobra.Command {
}

// Account deletion
if err := action.NewDeleteAccount(actionOpts).Run(); err != nil {
if err := action.NewDeleteAccount(ActionOpts).Run(); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion app/cli/cmd/auth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func openbrowser(url string) error {

// Retrieve loginURL from the control plane
func retrieveLoginURL() (string, error) {
client := pb.NewStatusServiceClient(actionOpts.CPConnection)
client := pb.NewStatusServiceClient(ActionOpts.CPConnection)
resp, err := client.Infoz(context.Background(), &pb.InfozRequest{})
if err != nil {
return "", err
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/available_integration_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sort"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/chainloop-dev/chainloop/app/controlplane/plugins/sdk/v1"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/jedib0t/go-pretty/v6/text"
Expand All @@ -36,7 +36,7 @@ func newAvailableIntegrationDescribeCmd() *cobra.Command {
Use: "describe",
Short: "Describe integration",
RunE: func(cmd *cobra.Command, args []string) error {
item, err := action.NewAvailableIntegrationDescribe(actionOpts).Run(integrationName)
item, err := action.NewAvailableIntegrationDescribe(ActionOpts).Run(integrationName)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions app/cli/cmd/available_integration_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strings"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
)
Expand All @@ -31,7 +31,7 @@ func newAvailableIntegrationListCmd() *cobra.Command {
Aliases: []string{"ls"},
Short: "List available integrations",
RunE: func(cmd *cobra.Command, args []string) error {
res, err := action.NewAvailableIntegrationList(actionOpts).Run()
res, err := action.NewAvailableIntegrationList(ActionOpts).Run()
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion app/cli/cmd/casbackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/spf13/cobra"
)

Expand Down
6 changes: 3 additions & 3 deletions app/cli/cmd/casbackend_add_azureblob.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"

"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/chainloop-dev/chainloop/pkg/blobmanager/azureblob"
"github.com/go-kratos/kratos/v2/log"
"github.com/spf13/cobra"
Expand All @@ -43,7 +43,7 @@ func newCASBackendAddAzureBlobStorageCmd() *cobra.Command {
cobra.CheckErr(err)

if isDefault {
if confirmed, err := confirmDefaultCASBackendOverride(actionOpts, ""); err != nil {
if confirmed, err := confirmDefaultCASBackendOverride(ActionOpts, ""); err != nil {
return err
} else if !confirmed {
log.Info("Aborting...")
Expand All @@ -64,7 +64,7 @@ func newCASBackendAddAzureBlobStorageCmd() *cobra.Command {
Default: isDefault,
}

res, err := action.NewCASBackendAdd(actionOpts).Run(opts)
res, err := action.NewCASBackendAdd(ActionOpts).Run(opts)
if err != nil {
return err
} else if res == nil {
Expand Down
6 changes: 3 additions & 3 deletions app/cli/cmd/casbackend_add_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package cmd

import (
"github.com/chainloop-dev/chainloop/app/cli/cmd/output"
"github.com/chainloop-dev/chainloop/app/cli/internal/action"
"github.com/chainloop-dev/chainloop/app/cli/pkg/action"
"github.com/go-kratos/kratos/v2/log"
"github.com/spf13/cobra"
)
Expand All @@ -40,7 +40,7 @@ func newCASBackendAddOCICmd() *cobra.Command {
cobra.CheckErr(err)

if isDefault {
if confirmed, err := confirmDefaultCASBackendOverride(actionOpts, ""); err != nil {
if confirmed, err := confirmDefaultCASBackendOverride(ActionOpts, ""); err != nil {
return err
} else if !confirmed {
log.Info("Aborting...")
Expand All @@ -59,7 +59,7 @@ func newCASBackendAddOCICmd() *cobra.Command {
Default: isDefault,
}

res, err := action.NewCASBackendAdd(actionOpts).Run(opts)
res, err := action.NewCASBackendAdd(ActionOpts).Run(opts)
if err != nil {
return err
} else if res == nil {
Expand Down
Loading
Loading