Skip to content

Commit

Permalink
🎉 release v0.3.0 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
abahmed authored Jan 4, 2022
1 parent 73e2a04 commit 92031b0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

You need to get config template to add your configs
```shell
curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.2.0/deploy/config.yaml -o config.yaml
curl -L https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/config.yaml -o config.yaml
```

Then edit `config.yaml` file and apply your configuration
Expand All @@ -47,7 +47,7 @@ kubectl apply -f config.yaml
To deploy **kwatch**, execute following command:

```shell
kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.2.0/deploy/deploy.yaml
kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/deploy.yaml
```

### Configuration
Expand Down Expand Up @@ -144,8 +144,8 @@ If you want to enable Rocket Chat, provide the webhook with optional text
### Cleanup

```shell
kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.2.0/deploy/config.yaml
kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.2.0/deploy/deploy.yaml
kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/config.yaml
kubectl delete -f https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/deploy.yaml
```

## Who uses kwatch?
Expand Down
10 changes: 5 additions & 5 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ func (c *Controller) processItem(key string) error {
return nil
}

c.processPod(pod)
c.processPod(key, pod)

return nil
}

// processPod checks status of pod and notify in abnormal cases
func (c *Controller) processPod(pod *v1.Pod) {
func (c *Controller) processPod(key string, pod *v1.Pod) {
for _, container := range pod.Status.ContainerStatuses {
// filter running containers
if container.Ready ||
(container.State.Waiting == nil &&
container.State.Terminated == nil) {
c.store.DelPodContainer(pod.Name, container.Name)
c.store.DelPodContainer(key, container.Name)
continue
}

Expand All @@ -152,7 +152,7 @@ func (c *Controller) processPod(pod *v1.Pod) {
}

// if reported, continue
if c.store.HasPodContainer(pod.Name, container.Name) {
if c.store.HasPodContainer(key, container.Name) {
continue
}

Expand Down Expand Up @@ -199,7 +199,7 @@ func (c *Controller) processPod(pod *v1.Pod) {
}

// save container as it's reported to avoid duplication
c.store.AddPodContainer(pod.Name, container.Name)
c.store.AddPodContainer(key, container.Name)

// send event to providers
util.SendProvidersEvent(c.providers, evnt)
Expand Down
2 changes: 1 addition & 1 deletion deploy/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
serviceAccountName: kwatch
containers:
- name: kwatch
image: ghcr.io/abahmed/kwatch:v0.2.0
image: ghcr.io/abahmed/kwatch:v0.3.0
imagePullPolicy: Always
volumeMounts:
- name: config-volume
Expand Down

0 comments on commit 92031b0

Please sign in to comment.