@@ -401,7 +401,8 @@ func runSBOMValidate(cmd *cobra.Command, args []string) error {
401401 return fmt .Errorf ("policy file not found: %s (use --policy to specify)" , policyFile )
402402 }
403403
404- cfg , _ := cmdutil .SetupContext ()
404+ ctx := cmdutil .GetContexts (cmd )
405+ cfg := ctx .Config
405406
406407 // Load policy engine
407408 engine , err := sbom .NewPolicyEngine (policyFile )
@@ -487,7 +488,8 @@ func runSBOMSign(cmd *cobra.Command, args []string) error {
487488 outputPath = sbomPath + ".sig"
488489 }
489490
490- cfg , _ := cmdutil .SetupContext ()
491+ ctx := cmdutil .GetContexts (cmd )
492+ cfg := ctx .Config
491493
492494 // Validate signing options
493495 if ! signKeyless && signKeyPath == "" {
@@ -564,7 +566,8 @@ func runSBOMVerifySignature(cmd *cobra.Command, args []string) error {
564566 return fmt .Errorf ("signature file not found: %s" , verifySignaturePath )
565567 }
566568
567- cfg , _ := cmdutil .SetupContext ()
569+ ctx := cmdutil .GetContexts (cmd )
570+ cfg := ctx .Config
568571
569572 // Validate verification options
570573 if ! verifyUseCosign && verifyPublicKey == "" && verifyCertificate == "" {
@@ -628,7 +631,8 @@ func runSBOMAttest(cmd *cobra.Command, args []string) error {
628631 return fmt .Errorf ("SBOM file not found: %s" , sbomPath )
629632 }
630633
631- cfg , mgr := cmdutil .SetupContext ()
634+ ctx := cmdutil .GetContexts (cmd )
635+ cfg , mgr := ctx .Config , ctx .Manager
632636
633637 // Determine output path
634638 outputPath := attestOutput
0 commit comments