Skip to content

Commit

Permalink
Analyze known libs for containerless (#385) (#387)
Browse files Browse the repository at this point in the history
analyze known libs for containerless

Signed-off-by: Emily McMullan <[email protected]>
Signed-off-by: Cherry Picker <[email protected]>
Co-authored-by: Emily McMullan <[email protected]>
  • Loading branch information
konveyor-ci-bot[bot] and eemcmullan authored Nov 25, 2024
1 parent 55eef9a commit 8bc156a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions cmd/analyze-bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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{}
Expand Down Expand Up @@ -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"),
},
},
},
Expand Down

0 comments on commit 8bc156a

Please sign in to comment.