From 09f1740f0dcab30d2342b3a12337193086340cae Mon Sep 17 00:00:00 2001 From: Keerthi Thatipally <99229993+kthatipally@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:07:57 -0600 Subject: [PATCH] Container-less Kantra: Update dep label selector to explicitly not scan open-source libraries when analyze-known-libraries is not set (#407) * Update dep label selector to explictly not scan open-source libraries when analyze-known-libraries is not set Signed-off-by: kthatipally <99229993+kthatipally@users.noreply.github.com> * :bug: fix podman installation Signed-off-by: Pranav Gaikwad --------- Signed-off-by: kthatipally <99229993+kthatipally@users.noreply.github.com> Signed-off-by: Pranav Gaikwad Co-authored-by: Pranav Gaikwad --- .github/workflows/testing.yaml | 22 ---------------------- cmd/analyze-bin.go | 4 ++-- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/testing.yaml b/.github/workflows/testing.yaml index cadd07da..af9e6bfd 100644 --- a/.github/workflows/testing.yaml +++ b/.github/workflows/testing.yaml @@ -23,17 +23,6 @@ jobs: if: github.event_name == 'push' || github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - - name: Setup Homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Upgrade podman - run: | - sudo apt-get install -y ansible - export DEB=$(curl -s https://passt.top/builds/latest/x86_64/ | grep deb | awk -F '"' '{ print $4}') - sudo ansible -m apt -a deb=https://passt.top/builds/latest/x86_64/${DEB} localhost - sudo apt-get remove podman crun - brew install crun podman - - name: Extract pull request number from inputs or PR description run: | echo "${{ github.event.pull_request.body }}" @@ -105,17 +94,6 @@ jobs: if: github.event_name != 'push' && github.event_name != 'pull_request' runs-on: ubuntu-latest steps: - - name: Setup Homebrew - uses: Homebrew/actions/setup-homebrew@master - - - name: Upgrade podman - run: | - sudo apt-get install -y ansible - export DEB=$(curl -s https://passt.top/builds/latest/x86_64/ | grep deb | awk -F '"' '{ print $4}') - sudo ansible -m apt -a deb=https://passt.top/builds/latest/x86_64/${DEB} localhost - sudo apt-get remove podman crun - brew install crun podman - - uses: actions/checkout@v3 with: ref: ${{ inputs.tag == 'latest' && 'main' || inputs.tag }} diff --git a/cmd/analyze-bin.go b/cmd/analyze-bin.go index 2278a4c8..d44b2854 100644 --- a/cmd/analyze-bin.go +++ b/cmd/analyze-bin.go @@ -100,8 +100,8 @@ func (a *analyzeCommand) RunAnalysisContainerless(ctx context.Context) error { } var dependencyLabelSelector *labels.LabelSelector[*konveyor.Dep] - depLabel := fmt.Sprintf("%v=open-source", provider.DepSourceLabel) - if a.analyzeKnownLibraries { + 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)