kubeslice / kubeslice/worker-operator

Bug: `isAppPodStatusChanged` does not detect IP changes for existing pods

Open
#476 0 comments 0 reactions 4 assignees Claimed by @richiesebastian View on GitHub
bug
Dominant language
Go
Stars
62
Forks
33
Avg merge
3d 10h
Merged PRs (30d)
3

Description

### 📜 Description

`controllers/slice/app_pod.go`, `isAppPodStatusChanged` (lines 35–53) builds a `oldPodMap[podName] = podIP` but only checks for the existence of the pod name in the old map — it never compares IP values. If a pod is rescheduled and gets a new IP but keeps the same name, the function returns `false` (no change detected) and the hub is not updated with the new IP.

```go
for _, cp := range current {
if _, ok := oldPodMap[cp.PodName]; !ok { // only checks existence, not IP
return true
}
}
```

### 👟 Reproduction steps

1. Have a running slice with app pods.
2. Delete and recreate a pod so it gets a new IP but the same name.
3. Observe that `slice.Status.AppPods` is not updated until the next full reconcile cycle.

### 👍 Expected behavior

Detect IP changes for existing pods and trigger an update.

### 👎 Actual Behavior

Pod IP changes are invisible to `isAppPodStatusChanged`.

### 🐚 Relevant log output

```shell

```

### Version

_No response_

### 🖥️ What operating system are you seeing the problem on?

_No response_

### ✅ Proposed Solution

Also compare the IP: `if oldPodMap[cp.PodName] != cp.PodIP { return true }`.

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find any similar issue

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.