diff --git a/.github/workflows/release-artifacts.yaml b/.github/workflows/release-artifacts.yaml index a00a134..350a82e 100644 --- a/.github/workflows/release-artifacts.yaml +++ b/.github/workflows/release-artifacts.yaml @@ -49,16 +49,19 @@ jobs: podman cp kantra-download:/bin/fernflower.jar . && zip kantra.linux.${{ matrix.arch }}.zip fernflower.jar podman cp kantra-download:/usr/local/static-report . && zip -r kantra.linux.${{ matrix.arch }}.zip static-report podman cp kantra-download:/opt/rulesets . && zip -r kantra.linux.${{ matrix.arch }}.zip rulesets + podman cp kantra-download:/usr/local/etc/maven.default.index . && zip -r kantra.linux.${{ matrix.arch }}.zip maven.default.index podman cp kantra-download:/jdtls . && zip -r kantra.darwin.${{ matrix.arch }}.zip jdtls podman cp kantra-download:/bin/fernflower.jar . && zip kantra.darwin.${{ matrix.arch }}.zip fernflower.jar podman cp kantra-download:/usr/local/static-report . && zip -r kantra.darwin.${{ matrix.arch }}.zip static-report podman cp kantra-download:/opt/rulesets . && zip -r kantra.darwin.${{ matrix.arch }}.zip rulesets + podman cp kantra-download:/usr/local/etc/maven.default.index . && zip -r kantra.darwin.${{ matrix.arch }}.zip maven.default.index podman cp kantra-download:/jdtls . && zip -r kantra.windows.${{ matrix.arch }}.zip jdtls podman cp kantra-download:/bin/fernflower.jar . && zip kantra.windows.${{ matrix.arch }}.zip fernflower.jar podman cp kantra-download:/usr/local/static-report . && zip -r kantra.windows.${{ matrix.arch }}.zip static-report podman cp kantra-download:/opt/rulesets . && zip -r kantra.windows.${{ matrix.arch }}.zip rulesets + podman cp kantra-download:/usr/local/etc/maven.default.index . && zip -r kantra.windows.${{ matrix.arch }}.zip maven.default.index - name: Upload linux binary uses: actions/upload-release-asset@v1 diff --git a/cmd/analyze-bin.go b/cmd/analyze-bin.go index 6577fd9..7bef2e4 100644 --- a/cmd/analyze-bin.go +++ b/cmd/analyze-bin.go @@ -99,6 +99,16 @@ func (a *analyzeCommand) RunAnalysisContainerless(ctx context.Context) error { selectors = append(selectors, selector) } + 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) + } + } + err = a.setBinMapContainerless() if err != nil { a.log.Error(err, "unable to find kantra dependencies") @@ -128,6 +138,7 @@ func (a *analyzeCommand) RunAnalysisContainerless(ctx context.Context) error { parser := parser.RuleParser{ ProviderNameToClient: providers, Log: analyzeLog.WithName("parser"), + DepLabelSelector: dependencyLabelSelector, } ruleSets := []engine.RuleSet{} @@ -395,6 +406,7 @@ func (a *analyzeCommand) createProviderConfigsContainerless() ([]provider.Config "lspServerName": javaProvider, "bundles": a.reqMap["bundle"], provider.LspServerPathConfigKey: a.reqMap["jdtls"], + "depOpenSourceLabelsFile": filepath.Join(a.kantraDir, "maven.default.index"), }, }, },