From f7e9d1d652fce64f78b30b89c4a640b3ba146eb1 Mon Sep 17 00:00:00 2001 From: Tom Denham Date: Mon, 13 Aug 2018 14:45:00 -0700 Subject: [PATCH 1/3] Makefile: Update release to include all arches --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4dfee2e4..6b6768da 100644 --- a/Makefile +++ b/Makefile @@ -317,10 +317,10 @@ ifneq ($(VERSION), $(GIT_VERSION)) $(error Attempt to build $(VERSION) from $(GIT_VERSION)) endif - $(MAKE) image - $(MAKE) tag-images IMAGETAG=$(VERSION) + $(MAKE) image-all + $(MAKE) tag-images-all IMAGETAG=$(VERSION) # Generate the `latest` images. - $(MAKE) tag-images IMAGETAG=latest + $(MAKE) tag-images-all IMAGETAG=latest ## Verifies the release artifacts produces by `make release-build` are correct. release-verify: release-prereqs @@ -343,7 +343,7 @@ release-publish: release-prereqs git push origin $(VERSION) # Push images. - $(MAKE) push IMAGETAG=$(VERSION) ARCH=$(ARCH) + $(MAKE) push-all IMAGETAG=$(VERSION) @echo "Finalize the GitHub release based on the pushed tag." @echo "" @@ -362,7 +362,7 @@ release-publish-latest: release-prereqs if ! docker run $(CONTAINER_NAME):latest -v | grep '^$(VERSION)$$'; then echo "Reported version:" `docker run $(CONTAINER_NAME):latest -v` "\nExpected version: $(VERSION)"; false; else echo "\nVersion check passed\n"; fi if ! docker run quay.io/$(CONTAINER_NAME):latest -v | grep '^$(VERSION)$$'; then echo "Reported version:" `docker run quay.io/$(CONTAINER_NAME):latest -v` "\nExpected version: $(VERSION)"; false; else echo "\nVersion check passed\n"; fi - $(MAKE) push IMAGETAG=latest ARCH=$(ARCH) + $(MAKE) push-all IMAGETAG=latest # release-prereqs checks that the environment is configured properly to create a release. release-prereqs: From 2462665e54172b78b362bb27efc00a4101e1e134 Mon Sep 17 00:00:00 2001 From: Casey Davenport Date: Fri, 17 Aug 2018 14:31:21 -0700 Subject: [PATCH 2/3] Remove FVs from release process --- Makefile | 3 --- tests/fv/fv_test.go | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4dfee2e4..5a42e9e3 100644 --- a/Makefile +++ b/Makefile @@ -328,9 +328,6 @@ release-verify: release-prereqs if ! docker run $(CONTAINER_NAME):$(VERSION) -v | grep '^$(VERSION)$$'; then echo "Reported version:" `docker run $(CONTAINER_NAME):$(VERSION) -v` "\nExpected version: $(VERSION)"; false; else echo "\nVersion check passed\n"; fi if ! docker run quay.io/$(CONTAINER_NAME):$(VERSION) -v | grep '^$(VERSION)$$'; then echo "Reported version:" `docker run quay.io/$(CONTAINER_NAME):$(VERSION) -v` "\nExpected version: $(VERSION)"; false; else echo "\nVersion check passed\n"; fi - # Run FV tests against the produced image. We only run the subset tagged as release tests. - $(MAKE) CONTAINER_NAME=$(CONTAINER_NAME):$(VERSION) GINKGO_FOCUS="Release" fv - ## Generates release notes based on commits in this version. release-notes: release-prereqs mkdir -p dist diff --git a/tests/fv/fv_test.go b/tests/fv/fv_test.go index cf6a7f07..8c48ee10 100644 --- a/tests/fv/fv_test.go +++ b/tests/fv/fv_test.go @@ -164,7 +164,7 @@ var _ = Describe("kube-controllers FV tests", func() { }) Context("Node FV tests", func() { - It("should be removed in response to a k8s node delete [Release]", func() { + It("should be removed in response to a k8s node delete", func() { kn := &v1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: kNodeName, @@ -423,7 +423,7 @@ var _ = Describe("kube-controllers FV tests", func() { }, time.Second*15, 500*time.Millisecond).ShouldNot(HaveOccurred()) }) - It("should update existing profiles in etcd to match namespaces in k8s [Release]", func() { + It("should update existing profiles in etcd to match namespaces in k8s", func() { profile, err := calicoClient.Profiles().Get(context.Background(), profName, options.GetOptions{}) By("getting the profile", func() { Expect(err).ShouldNot(HaveOccurred()) @@ -565,7 +565,7 @@ var _ = Describe("kube-controllers FV tests", func() { }, time.Second*15, 500*time.Millisecond).ShouldNot(HaveOccurred()) }) - It("should re-program policies that have changed in etcd [Release]", func() { + It("should re-program policies that have changed in etcd", func() { p, err := calicoClient.NetworkPolicies().Get(context.Background(), policyNamespace, genPolicyName, options.GetOptions{}) By("getting the policy", func() { Expect(err).ShouldNot(HaveOccurred()) From aa495d4bca4ee8b7697eb1f8aec6dbded8008653 Mon Sep 17 00:00:00 2001 From: Casey Davenport Date: Fri, 17 Aug 2018 15:05:09 -0700 Subject: [PATCH 3/3] Retry etcd connection in compaction routine --- cmd/kube-controllers/main.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/kube-controllers/main.go b/cmd/kube-controllers/main.go index d3ad09b6..fd16dc51 100644 --- a/cmd/kube-controllers/main.go +++ b/cmd/kube-controllers/main.go @@ -147,7 +147,7 @@ func main() { } // If configured to do so, start an etcdv3 compaction. - startCompactor(ctx, config) + go startCompactor(ctx, config) // Run the health checks on a separate goroutine. if config.HealthEnabled { @@ -211,13 +211,18 @@ func startCompactor(ctx context.Context, config *config.Config) { return } - // Kick off a periodic compaction of etcd. - etcdClient, err := newEtcdV3Client() - if err != nil { - log.WithError(err).Error("Failed to start etcd compaction routine") - } else { + // Kick off a periodic compaction of etcd, retry until success. + for { + etcdClient, err := newEtcdV3Client() + if err != nil { + log.WithError(err).Error("Failed to start etcd compaction routine, retry in 1m") + time.Sleep(1 * time.Minute) + continue + } + log.WithField("period", interval).Info("Starting periodic etcdv3 compaction") etcd3.StartCompactor(ctx, etcdClient, interval) + break } }