Skip to content

Commit

Permalink
Skipping failed application profiles (#138)
Browse files Browse the repository at this point in the history
* Skipping failed application profiles

Signed-off-by: Ben <[email protected]>

* memory limit to use right unit

Signed-off-by: Ben <[email protected]>

* Reducing the test time

Signed-off-by: Ben <[email protected]>

---------

Signed-off-by: Ben <[email protected]>
  • Loading branch information
slashben authored Jan 8, 2024
1 parent 35c419f commit 83f4262
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chart/kubecop/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubecop:
gomemlimit:
enabled: true
# It is recommended to set this value to 3/4 of the memory limit
limit: 384Mi
limit: 384MiB
recording:
samplingInterval: 60s
finalizationDuration: 900s
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/gammazero/workerpool v1.1.3
github.com/go-openapi/strfmt v0.21.7
github.com/inspektor-gadget/inspektor-gadget v0.23.1
github.com/kubescape/kapprofiler v0.0.41
github.com/kubescape/kapprofiler v0.0.42
github.com/prometheus/alertmanager v0.26.0
github.com/prometheus/client_golang v1.17.0
github.com/stretchr/testify v1.8.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubescape/kapprofiler v0.0.41 h1:sK7No7itnVx7DbqmE8y2Cohg26BKTlpxISGhrCnxgcI=
github.com/kubescape/kapprofiler v0.0.41/go.mod h1:3YmtBCW5mspDNXlH148xHgbxyHzr1+bIdYU7iLCHfl0=
github.com/kubescape/kapprofiler v0.0.42 h1:JpwgaLNk2C4jd6Czu7ygVwCsNBEzTkCaal2Scy59EAY=
github.com/kubescape/kapprofiler v0.0.42/go.mod h1:3YmtBCW5mspDNXlH148xHgbxyHzr1+bIdYU7iLCHfl0=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
Expand Down
3 changes: 2 additions & 1 deletion pkg/approfilecache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,10 @@ func (c *ApplicationProfileK8sCache) StartController() {
func (c *ApplicationProfileK8sCache) handleApplicationProfile(appProfileUnstructured *unstructured.Unstructured) {
partial := appProfileUnstructured.GetLabels()["kapprofiler.kubescape.io/partial"] == "true"
final := appProfileUnstructured.GetLabels()["kapprofiler.kubescape.io/final"] == "true"
failed := appProfileUnstructured.GetLabels()["kapprofiler.kubescape.io/failed"] == "true"

// Check if the application profile is final or partial, if not then skip it
if !final {
if !final || failed {
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func TestEngine_LoadEngineWithEvents(t *testing.T) {
return
}

timeToLoadInMinutes := 2
timeToLoadInMinutes := 1

execEventLoader := NewEventLoader(func() {
// Call exec event method
Expand Down

0 comments on commit 83f4262

Please sign in to comment.