Skip to content

Commit

Permalink
fix reflection for kubernetes 1.29
Browse files Browse the repository at this point in the history
  • Loading branch information
aleoli committed Jan 8, 2024
1 parent 4456cf7 commit 34d22b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/virtualKubelet/forge/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ func LocalPodStatus(remote *corev1.PodStatus, translator PodIPTranslator, restar
remote.PodIPs = []corev1.PodIP{{IP: remote.PodIP}}
}
remote.HostIP = LiqoNodeIP
remote.HostIPs = []corev1.HostIP{{
IP: LiqoNodeIP,
}}

// Increase the restart count if necessary
for idx := range remote.ContainerStatuses {
Expand Down
2 changes: 2 additions & 0 deletions pkg/virtualKubelet/forge/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ var _ = Describe("Pod forging", func() {
Expect(output.Status.PodIP).To(Equal("remote-ip-reflected"))
Expect(output.Status.PodIPs).To(ConsistOf(corev1.PodIP{IP: "remote-ip-reflected"}))
Expect(output.Status.HostIP).To(Equal(LiqoNodeIP))
Expect(output.Status.HostIPs).To(HaveLen(1))
Expect(output.Status.HostIPs[0]).To(Equal(corev1.HostIP{IP: LiqoNodeIP}))
Expect(output.Status.ContainerStatuses).To(HaveLen(1))
Expect(output.Status.ContainerStatuses[0].Ready).To(BeTrue())
Expect(output.Status.ContainerStatuses[0].RestartCount).To(BeNumerically("==", 4))
Expand Down
1 change: 1 addition & 0 deletions pkg/virtualKubelet/reflection/workload/podns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ var _ = Describe("Namespaced Pod Reflection Tests", func() {
local.Status.PodIP = "192.168.201.25"
local.Status.PodIPs = []corev1.PodIP{{IP: "192.168.201.25"}}
local.Status.HostIP = LiqoNodeIP
local.Status.HostIPs = []corev1.HostIP{{IP: LiqoNodeIP}}
local.Status.ContainerStatuses = []corev1.ContainerStatus{{RestartCount: 1}}
local.Status.Conditions = []corev1.PodCondition{{Type: corev1.PodReady, Status: corev1.ConditionTrue}}

Expand Down

0 comments on commit 34d22b0

Please sign in to comment.