Skip to content

Commit

Permalink
PodStatus instead of Pod
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Dec 2, 2016
1 parent 29bd659 commit 93d0e15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/backend/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,15 @@ func (c *KubeClient) getProfile(k model.ProfileKey) (*model.KVPair, error) {
func (c *KubeClient) applyWorkloadEndpoint(k *model.KVPair) (*model.KVPair, error) {
ips := k.Value.(*model.WorkloadEndpoint).IPv4Nets
if len(ips) > 0 {
log.Debugf("Applying workload with IPs: %+v", ips)
ns, name := c.converter.parseWorkloadID(k.Key.(model.WorkloadEndpointKey).WorkloadID)
pod, err := c.clientSet.Pods(ns).Get(name)
if err != nil {
return nil, err
}
pod.Status.PodIP = ips[0].IP.String()
pod, err = c.clientSet.Pods(ns).Update(pod)
log.Debugf("Pod IP: %+v", pod.Status.PodIP)
pod, err = c.clientSet.Pods(ns).UpdateStatus(pod)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 93d0e15

Please sign in to comment.