Skip to content

Commit

Permalink
fix controller exit before process pod update event (#1621)
Browse files Browse the repository at this point in the history
* fix controller exit before process pod update event

* fix vpc gateway image build
  • Loading branch information
halfcrazy committed Jun 18, 2022
1 parent 0ac7e7b commit c54cafa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
3 changes: 0 additions & 3 deletions dist/images/vpcnatgateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
FROM alpine:3.16

RUN set -ex \
&& echo "http://nl.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
&& echo "http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& echo "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add --no-cache \
Expand Down
9 changes: 4 additions & 5 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ func (c *Controller) enqueueAddPod(obj interface{}) {

if p.Annotations != nil &&
p.Annotations[fmt.Sprintf(util.AllocatedAnnotationTemplate, podNet.ProviderName)] == "true" &&
p.Status.HostIP != "" && p.Status.PodIP != "" {
if p.Annotations[fmt.Sprintf(util.RoutedAnnotationTemplate, podNet.ProviderName)] != "true" {
c.updatePodQueue.Add(key)
return
}
p.Annotations[fmt.Sprintf(util.RoutedAnnotationTemplate, podNet.ProviderName)] != "true" &&
p.Status.HostIP != "" && p.Status.PodIP == "" {
c.updatePodQueue.Add(key)
return
}

if p.Annotations != nil && p.Annotations[fmt.Sprintf(util.AllocatedAnnotationTemplate, podNet.ProviderName)] == "true" {
Expand Down

0 comments on commit c54cafa

Please sign in to comment.