diff --git a/README.md b/README.md index 438768a3..147e5c9d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ ```shell helm repo add kwatch https://kwatch.dev/charts -helm install [RELEASE_NAME] kwatch/kwatch --namespace kwatch --create-namespace --version 0.9.0 +helm install [RELEASE_NAME] kwatch/kwatch --namespace kwatch --create-namespace --version 0.9.1 ``` To get more details, please check [chart's configuration](https://github.com/abahmed/kwatch/blob/main/deploy/chart/README.md) @@ -46,7 +46,7 @@ To get more details, please check [chart's configuration](https://github.com/aba You need to get config template to add your configs ```shell -curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.9.0/deploy/config.yaml -o config.yaml +curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.9.1/deploy/config.yaml -o config.yaml ``` Then edit `config.yaml` file and apply your configuration @@ -58,7 +58,7 @@ kubectl apply -f config.yaml To deploy **kwatch**, execute following command: ```shell -kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.0/deploy/deploy.yaml +kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.1/deploy/deploy.yaml ``` ## High Level Architecture @@ -326,8 +326,8 @@ basic auth ### Cleanup ```shell -kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.0/deploy/config.yaml -kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.0/deploy/deploy.yaml +kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.1/deploy/config.yaml +kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.9.1/deploy/deploy.yaml ``` ## 👍 Contribute & Support diff --git a/deploy/chart/Chart.yaml b/deploy/chart/Chart.yaml index 94a65fa4..87b543fe 100644 --- a/deploy/chart/Chart.yaml +++ b/deploy/chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: kwatch -version: "0.9.0" -appVersion: "v0.9.0" +version: "0.9.1" +appVersion: "v0.9.1" description: monitor all changes in your Kubernetes(K8s) cluster, detects crashes in your running apps in realtime, and publishes notifications to your channels (Slack, Discord, etc.) instantly diff --git a/deploy/chart/README.md b/deploy/chart/README.md index ca122c04..d0fa5ba6 100644 --- a/deploy/chart/README.md +++ b/deploy/chart/README.md @@ -13,7 +13,7 @@ helm repo update ## Install Chart ```console -helm install [RELEASE_NAME] kwatch/kwatch --version 0.9.0 +helm install [RELEASE_NAME] kwatch/kwatch --version 0.9.1 ``` ## Uninstall Chart diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml index 616942b3..4c7e4e82 100644 --- a/deploy/deploy.yaml +++ b/deploy/deploy.yaml @@ -49,7 +49,7 @@ spec: serviceAccountName: kwatch containers: - name: kwatch - image: ghcr.io/abahmed/kwatch:v0.9.0 + image: ghcr.io/abahmed/kwatch:v0.9.1 imagePullPolicy: Always volumeMounts: - name: config-volume diff --git a/handler/executeContainersFilters.go b/handler/executeContainersFilters.go index dbafd439..7bb4c525 100644 --- a/handler/executeContainersFilters.go +++ b/handler/executeContainersFilters.go @@ -45,6 +45,11 @@ func (h *handler) executeContainersFilters(ctx *filter.Context) { ownerName = ctx.Owner.Name } + if ctx.Events == nil { + events, _ := util.GetPodEvents(ctx.Client, ctx.Pod.Name, ctx.Pod.Namespace) + ctx.Events = &events.Items + } + logrus.Printf( "container only issue %s %s %s %s %s %d", ctx.Container.Container.Name, diff --git a/util/util.go b/util/util.go index 1b276dd7..cf68db48 100644 --- a/util/util.go +++ b/util/util.go @@ -18,6 +18,10 @@ import ( // GetPodEventsStr returns formatted events as a string for specified pod func GetPodEventsStr(events *[]v1.Event) string { + if events == nil { + return "" + } + eventsString := "" for _, ev := range *events { diff --git a/util/util_test.go b/util/util_test.go index 2ba4841a..0a5474d5 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -76,6 +76,14 @@ func TestGetPodEventsStr(t *testing.T) { assert.Equal(result, expectedOutput) } +func TestGetPodEventsStrNil(t *testing.T) { + assert := assert.New(t) + + result := GetPodEventsStr(nil) + expectedOutput := "" + assert.Equal(result, expectedOutput) +} + func TestContainsKillingStoppingContainerEvents(t *testing.T) { assert := assert.New(t)