Created
February 12, 2025 09:34
-
-
Save aufi/332a2aeb8e8a03eac3c82fe5a57afaad to your computer and use it in GitHub Desktop.
kantra containerless dep labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cmd/analyze-bin.go b/cmd/analyze-bin.go | |
index 47b663f..5ed82e7 100644 | |
--- a/cmd/analyze-bin.go | |
+++ b/cmd/analyze-bin.go | |
@@ -98,14 +98,17 @@ func (a *analyzeCommand) RunAnalysisContainerless(ctx context.Context) error { | |
selectors = append(selectors, selector) | |
} | |
+ // analyze internal deps by default | |
var dependencyLabelSelector *labels.LabelSelector[*konveyor.Dep] | |
- depLabel := fmt.Sprintf("!%v=open-source", provider.DepSourceLabel) | |
- if !a.analyzeKnownLibraries { | |
- dependencyLabelSelector, err = labels.NewLabelSelector[*konveyor.Dep](depLabel, nil) | |
- if err != nil { | |
- errLog.Error(err, "failed to create label selector from expression", "selector", depLabel) | |
- os.Exit(1) | |
- } | |
+ depLabel := fmt.Sprintf("%v=internal", provider.DepSourceLabel) | |
+ // include also open-source if requested | |
+ if a.analyzeKnownLibraries { | |
+ depLabel = fmt.Sprintf("%s || %v=open-source", depLabel, provider.DepSourceLabel) | |
+ } | |
+ dependencyLabelSelector, err = labels.NewLabelSelector[*konveyor.Dep](depLabel, nil) | |
+ if err != nil { | |
+ errLog.Error(err, "failed to create label selector from expression", "selector", depLabel) | |
+ os.Exit(1) | |
} | |
err = a.setBinMapContainerless() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but why this worked on linux??