Skip to content

Commit e3ee78d

Browse files
fix tests
1 parent 8efdc90 commit e3ee78d

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

cmd/compliance/sbom.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

scripts/test-stdlib/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
func main() {
1515
cfg := config.Load()
16-
mgr := manager.NewManager(cfg)
16+
mgr := manager.NewManager(cfg, nil)
1717
enhancer := sbom.NewEnhancer(cfg, mgr)
1818

1919
// Test stdlib detection on current directory (goenv root)

0 commit comments

Comments
 (0)