Skip to content

Commit

Permalink
Merge pull request #508 from l1b0k/fix/eip
Browse files Browse the repository at this point in the history
eip: override pod annotation
  • Loading branch information
BSWANG authored Jul 19, 2023
2 parents fa2c083 + c059bf9 commit 16d7b26
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions daemon/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,8 @@ func (k *k8s) PatchEipInfo(info *types.PodInfo) error {
return err
}

if pod.GetAnnotations() != nil {
if eip, ok := pod.GetAnnotations()[podEipAddress]; ok {
if eip == info.EipInfo.PodEipIP {
return nil
}
return errors.Errorf("Pod already have eip annotation: %v", eip)
}
if pod.Annotations == nil {
pod.Annotations = map[string]string{}
}
pod.Annotations[podEipAddress] = info.EipInfo.PodEipIP

Expand Down

0 comments on commit 16d7b26

Please sign in to comment.