From 4801e0f78127844acdca2a59a5c648f5d9e051a0 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sun, 26 Apr 2020 14:59:57 -0400 Subject: [PATCH] Update to go 1.13.10 Also required update to latest bazel rules-go, and uncovered a bug in flag processing in one of our tests (locking). --- WORKSPACE | 19 +++++++++++-------- pkg/locking/lock_test.go | 12 +++++++++--- test/integration/clusterformation_test.go | 10 +++++++--- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 8ba4f26a..d773c75e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,21 +1,21 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "io_bazel_rules_go", + sha256 = "7b9bbe3ea1fccb46dcfa6c3f3e29ba7ec740d8733370e21cdc8937467b4a4349", urls = [ - "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.2/rules_go-v0.20.2.tar.gz", - "https://github.com/bazelbuild/rules_go/releases/download/v0.20.2/rules_go-v0.20.2.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.22.4/rules_go-v0.22.4.tar.gz", + "https://github.com/bazelbuild/rules_go/releases/download/v0.22.4/rules_go-v0.22.4.tar.gz", ], - sha256 = "b9aa86ec08a292b97ec4591cf578e020b35f98e12173bbd4a921f84f583aebd9", ) http_archive( name = "bazel_gazelle", + sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10", urls = [ - "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz", - "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.19.1/bazel-gazelle-v0.19.1.tar.gz", + "https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz", ], - sha256 = "86c6d481b3f7aedc1d60c1c211c6f76da282ae197c3b3160f54bd3a8f847896f", ) load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") @@ -23,7 +23,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_to go_rules_dependencies() go_register_toolchains( - go_version = "1.13.4", + go_version = "1.13.10", ) load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") @@ -69,6 +69,9 @@ container_pull( #============================================================================= # etcd rules + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") + http_file( name = "etcd_2_2_1_tar", sha256 = "59f7985c81b6bc551246c165c2fd83e33a063875e4e0c61920b1d90a4910f462", diff --git a/pkg/locking/lock_test.go b/pkg/locking/lock_test.go index e5502740..aa5018a1 100644 --- a/pkg/locking/lock_test.go +++ b/pkg/locking/lock_test.go @@ -6,12 +6,18 @@ import ( "io/ioutil" "path/filepath" "testing" + + "k8s.io/klog" ) func init() { - flag.Set("logtostderr", "true") - flag.Set("v", "2") - flag.Parse() + logflags := flag.NewFlagSet("testing", flag.ExitOnError) + + klog.InitFlags(logflags) + + logflags.Set("logtostderr", "true") + logflags.Set("v", "2") + logflags.Parse([]string{}) } func checkLocks(t *testing.T, l1, l2 Lock) { diff --git a/test/integration/clusterformation_test.go b/test/integration/clusterformation_test.go index 76a4f33a..534fafa4 100644 --- a/test/integration/clusterformation_test.go +++ b/test/integration/clusterformation_test.go @@ -13,9 +13,13 @@ import ( ) func init() { - flag.Set("logtostderr", "true") - flag.Set("v", "2") - flag.Parse() + logflags := flag.NewFlagSet("testing", flag.ExitOnError) + + klog.InitFlags(logflags) + + logflags.Set("logtostderr", "true") + logflags.Set("v", "2") + logflags.Parse([]string{}) } func TestClusterWithOneMember(t *testing.T) {