Skip to content

Commit

Permalink
Add annotations in the pod reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Feb 19, 2024
1 parent abd40d4 commit 47f200f
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions internal/k8s/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ type reconciler struct {
}

type Pod struct {
Name string
NodeName string
Namespace string
IP string
CPULimit float64
CPURequest float64
MemLimit float64
MemRequest float64
Name string
NodeName string
Namespace string
IP string
CPULimit float64
CPURequest float64
MemLimit float64
MemRequest float64
Annotations map[string]string
}

func New(opts ...Option) PodWatcher {
Expand Down Expand Up @@ -142,14 +143,15 @@ func (r *reconciler) Reconcile(ctx context.Context, _ reconcile.Request) (res re
}

pods[podName] = append(pods[podName], Pod{
Name: pod.GetName(),
NodeName: pod.Spec.NodeName,
Namespace: pod.GetNamespace(),
IP: pod.Status.PodIP,
CPULimit: cpuLimit,
CPURequest: cpuRequest,
MemLimit: memLimit,
MemRequest: memRequest,
Name: pod.GetName(),
NodeName: pod.Spec.NodeName,
Namespace: pod.GetNamespace(),
IP: pod.Status.PodIP,
CPULimit: cpuLimit,
CPURequest: cpuRequest,
MemLimit: memLimit,
MemRequest: memRequest,
Annotations: pod.GetAnnotations(),
})
}

Expand Down

0 comments on commit 47f200f

Please sign in to comment.