diff --git a/.circleci/config.yml b/.circleci/config.yml index bc204f2d94..3196ac2e50 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1226,13 +1226,13 @@ workflows: requires: - dev-upload-docker nightly-acceptance-tests: - # triggers: - # - schedule: - # cron: "0 0 * * *" - # filters: - # branches: - # only: - # - main + triggers: + - schedule: + cron: "0 0 * * *" + filters: + branches: + only: + - main jobs: - build-distro: OS: "linux" @@ -1241,48 +1241,44 @@ workflows: - dev-upload-docker: requires: - build-distros-linux - # - # - cleanup-gcp-resources - # - cleanup-azure-resources - # - cleanup-eks-resources + - cleanup-gcp-resources + - cleanup-azure-resources + - cleanup-eks-resources # Disable until we can use UBI images. # - acceptance-openshift: # requires: # - cleanup-azure-resources - # - acceptance-gke-1-23: - # requires: - # - cleanup-gcp-resources - # - dev-upload-docker + - acceptance-gke-1-23: + requires: + - cleanup-gcp-resources + - dev-upload-docker - acceptance-gke-cni-1-23: requires: - # - acceptance-gke-1-23 + - acceptance-gke-1-23 + - acceptance-eks-1-21: + requires: + - cleanup-eks-resources - dev-upload-docker - # - acceptance-eks-1-21: - # requires: - # - cleanup-eks-resources - # - dev-upload-docker - acceptance-eks-cni-1-21: requires: - # - acceptance-eks-1-21 + - acceptance-eks-1-21 + - acceptance-aks-1-22: + requires: + - cleanup-azure-resources - dev-upload-docker - # - acceptance-aks-1-22: - # requires: - # - cleanup-azure-resources - # - dev-upload-docker - acceptance-aks-cni-1-22: requires: - # - acceptance-aks-1-22 - - dev-upload-docker - - # nightly-acceptance-tests-consul: - # triggers: - # - schedule: - # cron: "0 0 * * *" - # filters: - # branches: - # only: - # - main - # jobs: - # - acceptance-kind-1-23-consul-nightly-1-11 - # - acceptance-kind-1-23-consul-nightly-1-12 - # - acceptance-kind-1-23-consul-nightly-1-13 + - acceptance-aks-1-22 + + nightly-acceptance-tests-consul: + triggers: + - schedule: + cron: "0 0 * * *" + filters: + branches: + only: + - main + jobs: + - acceptance-kind-1-23-consul-nightly-1-11 + - acceptance-kind-1-23-consul-nightly-1-12 + - acceptance-kind-1-23-consul-nightly-1-13 diff --git a/control-plane/cni/main.go b/control-plane/cni/main.go index ddf8ea5327..24c473a853 100644 --- a/control-plane/cni/main.go +++ b/control-plane/cni/main.go @@ -188,7 +188,7 @@ func (c *Command) cmdAdd(args *skel.CmdArgs) error { // We do not throw an error here because kubernetes will often throw a benign error where the pod has been // updated in between the get and update of the annotation. Eventually kubernetes will update the annotation - ok := c.updateTransparentProxyStatusAnnotation(pod, podNamespace, waiting) + ok := c.updateTransparentProxyStatusAnnotation(podName, podNamespace, waiting) if !ok { logger.Info("unable to update %s pod annotation to waiting", keyTransparentProxyStatus) } @@ -215,7 +215,7 @@ func (c *Command) cmdAdd(args *skel.CmdArgs) error { // We do not throw an error here because kubernetes will often throw a benign error where the pod has been // updated in between the get and update of the annotation. Eventually kubernetes will update the annotation - ok = c.updateTransparentProxyStatusAnnotation(pod, podNamespace, complete) + ok = c.updateTransparentProxyStatusAnnotation(podName, podNamespace, complete) if !ok { logger.Info("unable to update %s pod annotation to complete", keyTransparentProxyStatus) } @@ -272,8 +272,13 @@ func parseAnnotation(pod corev1.Pod, annotation string) (iptables.Config, error) // updateTransparentProxyStatusAnnotation updates the transparent-proxy-status annotation. We use it as a simple inicator of // CNI status on the pod. Failing is not fatal. -func (c *Command) updateTransparentProxyStatusAnnotation(pod *corev1.Pod, namespace, status string) bool { +func (c *Command) updateTransparentProxyStatusAnnotation(podName, namespace, status string) bool { + // Refresh the pod so that we can update it without problems + pod, err := c.client.CoreV1().Pods(namespace).Get(context.Background(), podName, metav1.GetOptions{}) + if err != nil { + return false + } pod.Annotations[keyTransparentProxyStatus] = status - _, err := c.client.CoreV1().Pods(namespace).Update(context.Background(), pod, metav1.UpdateOptions{}) + _, err = c.client.CoreV1().Pods(namespace).Update(context.Background(), pod, metav1.UpdateOptions{}) return err == nil }