Skip to content

Instantly share code, notes, and snippets.

@aufi
Created February 12, 2025 09:34
Show Gist options
  • Save aufi/332a2aeb8e8a03eac3c82fe5a57afaad to your computer and use it in GitHub Desktop.
Save aufi/332a2aeb8e8a03eac3c82fe5a57afaad to your computer and use it in GitHub Desktop.
kantra containerless dep labels
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()
@aufi
Copy link
Author

aufi commented Feb 12, 2025

	// analyze internal deps by default
	var dependencyLabelSelector *labels.LabelSelector[*konveyor.Dep]
	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)
	}

but why this worked on linux??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment