Skip to content

Commit

Permalink
Merge pull request #288 from caseydavenport/casey-ff-master
Browse files Browse the repository at this point in the history
Pull in latest changes from master
  • Loading branch information
caseydavenport authored Aug 23, 2018
2 parents 7fff8e4 + 2cb0d61 commit 6080508
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,20 +317,17 @@ 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
# Check the reported version is correct for each release artifact.
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
Expand All @@ -343,7 +340,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 ""
Expand All @@ -362,7 +359,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:
Expand Down
17 changes: 11 additions & 6 deletions cmd/kube-controllers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/fv/fv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 6080508

Please sign in to comment.