Skip to content

Commit bcca243

Browse files
committed
Moved appending cosign flag to args to runCommand
Signed-off-by: Keerthan KK <tkthulasimandiram@gmail.com>
1 parent a3622ab commit bcca243

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

pkg/cmd/attest/cmd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (opts *attestOptions) complete(ctx context.Context, args []string) error {
4242
return fmt.Errorf("default config path not set on command context")
4343
}
4444
opts.configHome = configHome
45-
opts.cosignArgs = append([]string{"attest"}, args...)
45+
opts.cosignArgs = args
4646
return nil
4747
}
4848

@@ -66,6 +66,7 @@ func AttestCommand() *cobra.Command {
6666

6767
func runCommand(opts *attestOptions) func(cmd *cobra.Command, args []string) error {
6868
return func(cmd *cobra.Command, args []string) error {
69+
args = append([]string{"attest"}, args...)
6970
if err := opts.complete(cmd.Context(), args); err != nil {
7071
return output.Fatalf("Invalid arguments: %s", err)
7172
}

pkg/cmd/sign/cmd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ func (opts *signOptions) complete(ctx context.Context, args []string) error {
6161
return fmt.Errorf("default config path not set on command context")
6262
}
6363
opts.configHome = configHome
64-
opts.cosignArgs = append([]string{"sign"}, args...)
64+
opts.cosignArgs = args
6565
return nil
6666
}
6767

6868
func runCommand(opts *signOptions) func(cmd *cobra.Command, args []string) error {
6969
return func(cmd *cobra.Command, args []string) error {
70+
args = append([]string{"sign"}, args...)
7071
if err := opts.complete(cmd.Context(), args); err != nil {
7172
return output.Fatalf("Invalid arguments: %s", err)
7273
}

0 commit comments

Comments
 (0)