From 55a9d7b6fc320870436704b81febf84e84578525 Mon Sep 17 00:00:00 2001 From: Enxebre Date: Tue, 12 Mar 2019 13:51:48 +0100 Subject: [PATCH] Revendor for openshift/cluster-api --- Gopkg.lock | 6 +- Gopkg.toml | 2 +- .../openshift/cluster-api/Gopkg.lock | 276 +++--------------- .../pkg/apis/machine/common/consts.go | 7 + .../pkg/controller/machine/BUILD.bazel | 5 + .../pkg/controller/machine/controller.go | 95 +++--- .../cluster-api/pkg/errors/machines.go | 7 + 7 files changed, 120 insertions(+), 278 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index d616a6cc2e..d078cc1f10 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -472,7 +472,7 @@ revision = "cec6269883be26556e63500b6df19a0b6691992e" [[projects]] - digest = "1:a6e8f781678c5936540153af83838657342f4a6d5478ad9c3f527ce864a8be0c" + digest = "1:b09422e6139c31a6e7561e143071fd330317125f53ab3fd0012e4706665cca68" name = "github.com/openshift/cluster-api" packages = [ "pkg/apis", @@ -492,7 +492,7 @@ "pkg/util", ] pruneopts = "T" - revision = "0c3e884db79556cf786aa8436f5be977ef10c211" + revision = "eaaebe5a6fdf7fa96203bbdb9e2cf1165dd6ac1f" [[projects]] branch = "master" @@ -1208,7 +1208,6 @@ "github.com/aws/aws-sdk-go/service/elbv2/elbv2iface", "github.com/emicklei/go-restful", "github.com/ghodss/yaml", - "github.com/go-log/log/info", "github.com/golang/glog", "github.com/golang/mock/gomock", "github.com/onsi/ginkgo", @@ -1228,7 +1227,6 @@ "github.com/openshift/cluster-api/pkg/controller/machine", "github.com/openshift/cluster-api/pkg/errors", "github.com/openshift/cluster-autoscaler-operator/pkg/apis", - "github.com/openshift/kubernetes-drain", "github.com/prometheus/common/log", "github.com/spf13/cobra", "github.com/spf13/pflag", diff --git a/Gopkg.toml b/Gopkg.toml index 31225db76c..fc4d63cd18 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -34,7 +34,7 @@ required = [ [[override]] name = "github.com/openshift/cluster-api" - revision = "0c3e884db79556cf786aa8436f5be977ef10c211" + revision = "eaaebe5a6fdf7fa96203bbdb9e2cf1165dd6ac1f" [[override]] name = "k8s.io/code-generator" diff --git a/vendor/github.com/openshift/cluster-api/Gopkg.lock b/vendor/github.com/openshift/cluster-api/Gopkg.lock index d4b85d1900..edbb2f3242 100644 --- a/vendor/github.com/openshift/cluster-api/Gopkg.lock +++ b/vendor/github.com/openshift/cluster-api/Gopkg.lock @@ -2,259 +2,211 @@ [[projects]] - digest = "1:5c3894b2aa4d6bead0ceeea6831b305d62879c871780e7b76296ded1b004bc57" name = "cloud.google.com/go" packages = ["compute/metadata"] - pruneopts = "UT" revision = "97efc2c9ffd9fe8ef47f7f3203dc60bbca547374" version = "v0.28.0" [[projects]] branch = "master" - digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" name = "github.com/beorn7/perks" packages = ["quantile"] - pruneopts = "UT" revision = "3a771d992973f24aa725d07868b467d1ddfceafb" [[projects]] - digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" name = "github.com/davecgh/go-spew" packages = ["spew"] - pruneopts = "UT" revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" version = "v1.1.1" [[projects]] - digest = "1:899234af23e5793c34e06fd397f86ba33af5307b959b6a7afd19b63db065a9d7" name = "github.com/emicklei/go-restful" packages = [ ".", - "log", + "log" ] - pruneopts = "UT" revision = "3eb9738c1697594ea6e71a7156a9bb32ed216cf0" version = "v2.8.0" [[projects]] - digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda" name = "github.com/ghodss/yaml" packages = ["."] - pruneopts = "UT" revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" version = "v1.0.0" [[projects]] branch = "master" - digest = "1:edd2fa4578eb086265db78a9201d15e76b298dfd0d5c379da83e9c61712cf6df" + name = "github.com/go-log/log" + packages = [ + ".", + "info" + ] + revision = "a514cf01a3eb56ec6aff9ae5663453d990e68ed3" + +[[projects]] + branch = "master" name = "github.com/go-logr/logr" packages = ["."] - pruneopts = "UT" revision = "9fb12b3b21c5415d16ac18dc5cd42c1cfdd40c4e" [[projects]] branch = "master" - digest = "1:ce43ad4015e7cdad3f0e8f2c8339439dd4470859a828d2a6988b0f713699e94a" name = "github.com/go-logr/zapr" packages = ["."] - pruneopts = "UT" revision = "7536572e8d55209135cd5e7ccf7fce43dca217ab" [[projects]] - digest = "1:38101365bdbea4ca2746cf7bac064b3f18d6a5561787d653a54f80c7afb4b513" name = "github.com/gobuffalo/envy" packages = ["."] - pruneopts = "UT" revision = "3c96536452167a705ca5a70b831d3810e1e10452" version = "v1.6.4" [[projects]] - digest = "1:34e709f36fd4f868fb00dbaf8a6cab4c1ae685832d392874ba9d7c5dec2429d1" name = "github.com/gogo/protobuf" packages = [ "proto", - "sortkeys", + "sortkeys" ] - pruneopts = "UT" revision = "636bf0302bc95575d69441b25a2603156ffdddf1" version = "v1.1.1" [[projects]] branch = "master" - digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" name = "github.com/golang/glog" packages = ["."] - pruneopts = "UT" revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" [[projects]] branch = "master" - digest = "1:3fb07f8e222402962fa190eb060608b34eddfb64562a18e2167df2de0ece85d8" name = "github.com/golang/groupcache" packages = ["lru"] - pruneopts = "UT" revision = "6f2cf27854a4a29e3811b0371547be335d411b8b" [[projects]] - digest = "1:4c0989ca0bcd10799064318923b9bc2db6b4d6338dd75f3f2d86c3511aaaf5cf" name = "github.com/golang/protobuf" packages = [ "proto", "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp", + "ptypes/timestamp" ] - pruneopts = "UT" revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5" version = "v1.2.0" [[projects]] branch = "master" - digest = "1:0bfbe13936953a98ae3cfe8ed6670d396ad81edf069a806d2f6515d7bb6950df" name = "github.com/google/btree" packages = ["."] - pruneopts = "UT" revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306" [[projects]] branch = "master" - digest = "1:3ee90c0d94da31b442dde97c99635aaafec68d0b8a3c12ee2075c6bdabeec6bb" name = "github.com/google/gofuzz" packages = ["."] - pruneopts = "UT" revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" [[projects]] - digest = "1:3a26588bc48b96825977c1b3df964f8fd842cd6860cc26370588d3563433cf11" name = "github.com/google/uuid" packages = ["."] - pruneopts = "UT" revision = "d460ce9f8df2e77fb1ba55ca87fafed96c607494" version = "v1.0.0" [[projects]] - digest = "1:65c4414eeb350c47b8de71110150d0ea8a281835b1f386eacaa3ad7325929c21" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions", + "extensions" ] - pruneopts = "UT" revision = "7c663266750e7d82587642f65e60bc4083f1f84e" version = "v0.2.0" [[projects]] branch = "master" - digest = "1:86c1210529e69d69860f2bb3ee9ccce0b595aa3f9165e7dd1388e5c612915888" name = "github.com/gregjones/httpcache" packages = [ ".", - "diskcache", + "diskcache" ] - pruneopts = "UT" revision = "9cad4c3443a7200dd6400aef47183728de563a38" [[projects]] - digest = "1:8ec8d88c248041a6df5f6574b87bc00e7e0b493881dad2e7ef47b11dc69093b5" name = "github.com/hashicorp/golang-lru" packages = [ ".", - "simplelru", + "simplelru" ] - pruneopts = "UT" revision = "20f1fb78b0740ba8c3cb143a61e86ba5c8669768" version = "v0.5.0" [[projects]] - digest = "1:a1038ef593beb4771c8f0f9c26e8b00410acd800af5c6864651d9bf160ea1813" name = "github.com/hpcloud/tail" packages = [ ".", "ratelimiter", "util", "watch", - "winfile", + "winfile" ] - pruneopts = "UT" revision = "a30252cb686a21eb2d0b98132633053ec2f7f1e5" version = "v1.0.0" [[projects]] - digest = "1:8eb1de8112c9924d59bf1d3e5c26f5eaa2bfc2a5fcbb92dc1c2e4546d695f277" name = "github.com/imdario/mergo" packages = ["."] - pruneopts = "UT" revision = "9f23e2d6bd2a77f959b2bf6acdbefd708a83a4a4" version = "v0.3.6" [[projects]] - digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] - pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] - digest = "1:ecd9aa82687cf31d1585d4ac61d0ba180e42e8a6182b85bd785fcca8dfeefc1b" name = "github.com/joho/godotenv" packages = ["."] - pruneopts = "UT" revision = "23d116af351c84513e1946b527c88823e476be13" version = "v1.3.0" [[projects]] - digest = "1:3e551bbb3a7c0ab2a2bf4660e7fcad16db089fdcfbb44b0199e62838038623ea" name = "github.com/json-iterator/go" packages = ["."] - pruneopts = "UT" revision = "1624edc4454b8682399def8740d46db5e4362ba4" version = "v1.1.5" [[projects]] - digest = "1:e60b8e2ad986a90b522fd74a87c4f5b3bb173c6a6bc5d88744d70cb0c760afdd" name = "github.com/markbates/inflect" packages = ["."] - pruneopts = "UT" revision = "dd7de90c06bca70f18136e59dec2270c19a401e7" version = "v1.0.0" [[projects]] branch = "master" - digest = "1:fc2b04b0069d6b10bdef96d278fe20c345794009685ed3c8c7f1a6dc023eefec" name = "github.com/mattbaird/jsonpatch" packages = ["."] - pruneopts = "UT" revision = "81af80346b1a01caae0cbc27fd3c1ba5b11e189f" [[projects]] - digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] - pruneopts = "UT" revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c" version = "v1.0.1" [[projects]] - digest = "1:33422d238f147d247752996a26574ac48dcf472976eda7f5134015f06bf16563" name = "github.com/modern-go/concurrent" packages = ["."] - pruneopts = "UT" revision = "bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94" version = "1.0.3" [[projects]] - digest = "1:e32bdbdb7c377a07a9a46378290059822efdce5c8d96fe71940d87cb4f918855" name = "github.com/modern-go/reflect2" packages = ["."] - pruneopts = "UT" revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" version = "1.0.1" [[projects]] - digest = "1:42e29deef12327a69123b9cb2cb45fee4af5c12c2a23c6e477338279a052703f" name = "github.com/onsi/ginkgo" packages = [ ".", @@ -274,14 +226,12 @@ "reporters/stenographer", "reporters/stenographer/support/go-colorable", "reporters/stenographer/support/go-isatty", - "types", + "types" ] - pruneopts = "UT" revision = "3774a09d95489ccaa16032e0770d08ea77ba6184" version = "v1.6.0" [[projects]] - digest = "1:d6d3014e71a3504f7fda993889cfdc09ef5b70b46b00dd6bd078943585944352" name = "github.com/onsi/gomega" packages = [ ".", @@ -297,142 +247,118 @@ "matchers/support/goraph/edge", "matchers/support/goraph/node", "matchers/support/goraph/util", - "types", + "types" ] - pruneopts = "UT" revision = "7615b9433f86a8bdf29709bf288bc4fd0636a369" version = "v1.4.2" [[projects]] - digest = "1:e5d0bd87abc2781d14e274807a470acd180f0499f8bf5bb18606e9ec22ad9de9" + branch = "master" + name = "github.com/openshift/kubernetes-drain" + packages = ["."] + revision = "c2e51be1758efa30d71a4d30dc4e2db86b70a4df" + +[[projects]] name = "github.com/pborman/uuid" packages = ["."] - pruneopts = "UT" revision = "adf5a7427709b9deb95d29d3fa8a2bf9cfd388f1" version = "v1.2" [[projects]] branch = "master" - digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2" name = "github.com/petar/GoLLRB" packages = ["llrb"] - pruneopts = "UT" revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" [[projects]] - digest = "1:0e7775ebbcf00d8dd28ac663614af924411c868dca3d5aa762af0fae3808d852" name = "github.com/peterbourgon/diskv" packages = ["."] - pruneopts = "UT" revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" version = "v2.0.1" [[projects]] - digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] - pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] - digest = "1:93a746f1060a8acbcf69344862b2ceced80f854170e1caae089b2834c5fbf7f4" name = "github.com/prometheus/client_golang" packages = [ "prometheus", "prometheus/internal", - "prometheus/promhttp", + "prometheus/promhttp" ] - pruneopts = "UT" revision = "505eaef017263e299324067d40ca2c48f6a2cf50" version = "v0.9.2" [[projects]] branch = "master" - digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4" name = "github.com/prometheus/client_model" packages = ["go"] - pruneopts = "UT" revision = "5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f" [[projects]] branch = "master" - digest = "1:db712fde5d12d6cdbdf14b777f0c230f4ff5ab0be8e35b239fc319953ed577a4" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model", + "model" ] - pruneopts = "UT" revision = "4724e9255275ce38f7179b2478abeae4e28c904f" [[projects]] branch = "master" - digest = "1:d39e7c7677b161c2dd4c635a2ac196460608c7d8ba5337cc8cae5825a2681f8f" name = "github.com/prometheus/procfs" packages = [ ".", "internal/util", "nfs", - "xfs", + "xfs" ] - pruneopts = "UT" revision = "1dc9a6cbc91aacc3e8b2d63db4d2e957a5394ac4" [[projects]] - digest = "1:d917313f309bda80d27274d53985bc65651f81a5b66b820749ac7f8ef061fd04" name = "github.com/sergi/go-diff" packages = ["diffmatchpatch"] - pruneopts = "UT" revision = "1744e2970ca51c86172c8190fadad617561ed6e7" version = "v1.0.0" [[projects]] - digest = "1:6a4a11ba764a56d2758899ec6f3848d24698d48442ebce85ee7a3f63284526cd" name = "github.com/spf13/afero" packages = [ ".", - "mem", + "mem" ] - pruneopts = "UT" revision = "d40851caa0d747393da1ffb28f7f9d8b4eeffebd" version = "v1.1.2" [[projects]] - digest = "1:645cabccbb4fa8aab25a956cbcbdf6a6845ca736b2c64e197ca7cbb9d210b939" name = "github.com/spf13/cobra" packages = ["."] - pruneopts = "UT" revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385" version = "v0.0.3" [[projects]] - digest = "1:dab83a1bbc7ad3d7a6ba1a1cc1760f25ac38cdf7d96a5cdd55cd915a4f5ceaf9" name = "github.com/spf13/pflag" packages = ["."] - pruneopts = "UT" revision = "9a97c102cda95a86cec2345a6f09f55a939babf5" version = "v1.0.2" [[projects]] - digest = "1:3c1a69cdae3501bf75e76d0d86dc6f2b0a7421bc205c0cb7b96b19eed464a34d" name = "go.uber.org/atomic" packages = ["."] - pruneopts = "UT" revision = "1ea20fb1cbb1cc08cbd0d913a96dead89aa18289" version = "v1.3.2" [[projects]] - digest = "1:60bf2a5e347af463c42ed31a493d817f8a72f102543060ed992754e689805d1a" name = "go.uber.org/multierr" packages = ["."] - pruneopts = "UT" revision = "3c4937480c32f4c13a875a1829af76c98ca3d40a" version = "v1.1.0" [[projects]] - digest = "1:c52caf7bd44f92e54627a31b85baf06a68333a196b3d8d241480a774733dcf8b" name = "go.uber.org/zap" packages = [ ".", @@ -440,23 +366,19 @@ "internal/bufferpool", "internal/color", "internal/exit", - "zapcore", + "zapcore" ] - pruneopts = "UT" revision = "ff33455a0e382e8a81d14dd7c922020b6b5e7982" version = "v1.9.1" [[projects]] branch = "master" - digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8" name = "golang.org/x/crypto" packages = ["ssh/terminal"] - pruneopts = "UT" revision = "0e37d006457bf46f9e6692014ba72ef82c33022c" [[projects]] branch = "master" - digest = "1:169b5e9a5bdb701a74d083ae0d836d3ee5038f036fb945bacc997b2777691d7b" name = "golang.org/x/net" packages = [ "context", @@ -467,38 +389,32 @@ "http/httpguts", "http2", "http2/hpack", - "idna", + "idna" ] - pruneopts = "UT" revision = "2f5d2388922f370f4355f327fcf4cfe9f5583908" [[projects]] branch = "master" - digest = "1:f645667d687fc8bf228865a2c5455824ef05bad08841e673673ef2bb89ac5b90" name = "golang.org/x/oauth2" packages = [ ".", "google", "internal", "jws", - "jwt", + "jwt" ] - pruneopts = "UT" revision = "d2e6202438beef2727060aa7cabdd924d92ebfd9" [[projects]] branch = "master" - digest = "1:75cb7164c3c9e028922e69b10842159549ab96ffc4800ea189c4a6865dc3bc08" name = "golang.org/x/sys" packages = [ "unix", - "windows", + "windows" ] - pruneopts = "UT" revision = "90868a75fefd03942536221d7c0e2f84ec62a668" [[projects]] - digest = "1:436b24586f8fee329e0dd65fd67c817681420cda1d7f934345c13fe78c212a73" name = "golang.org/x/text" packages = [ "collate", @@ -526,34 +442,28 @@ "unicode/bidi", "unicode/cldr", "unicode/norm", - "unicode/rangetable", + "unicode/rangetable" ] - pruneopts = "UT" revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" version = "v0.3.0" [[projects]] branch = "master" - digest = "1:c9e7a4b4d47c0ed205d257648b0e5b0440880cb728506e318f8ac7cd36270bc4" name = "golang.org/x/time" packages = ["rate"] - pruneopts = "UT" revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" [[projects]] branch = "master" - digest = "1:45751dc3302c90ea55913674261b2d74286b05cdd8e3ae9606e02e4e77f4353f" name = "golang.org/x/tools" packages = [ "go/ast/astutil", "imports", - "internal/fastwalk", + "internal/fastwalk" ] - pruneopts = "UT" revision = "e93be7f42f9fcac2c537bcd78bab08e6e63ed5bf" [[projects]] - digest = "1:193950893ea275f89ed92e5da11ed8fa1436872f755a9ea5d4afa83dc9d9c3a8" name = "google.golang.org/appengine" packages = [ ".", @@ -565,47 +475,37 @@ "internal/modules", "internal/remote_api", "internal/urlfetch", - "urlfetch", + "urlfetch" ] - pruneopts = "UT" revision = "ae0ab99deb4dc413a2b4bd6c8bdd0eb67f1e4d06" version = "v1.2.0" [[projects]] - digest = "1:abeb38ade3f32a92943e5be54f55ed6d6e3b6602761d74b4aab4c9dd45c18abd" name = "gopkg.in/fsnotify.v1" packages = ["."] - pruneopts = "UT" revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" source = "https://github.com/fsnotify/fsnotify.git" version = "v1.4.7" [[projects]] - digest = "1:2d1fbdc6777e5408cabeb02bf336305e724b925ff4546ded0fa8715a7267922a" name = "gopkg.in/inf.v0" packages = ["."] - pruneopts = "UT" revision = "d2d2541c53f18d2a059457998ce2876cc8e67cbf" version = "v0.9.1" [[projects]] branch = "v1" - digest = "1:0caa92e17bc0b65a98c63e5bc76a9e844cd5e56493f8fdbb28fad101a16254d9" name = "gopkg.in/tomb.v1" packages = ["."] - pruneopts = "UT" revision = "dd632973f1e7218eb1089048e0798ec9ae7dceb8" [[projects]] - digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202" name = "gopkg.in/yaml.v2" packages = ["."] - pruneopts = "UT" revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" version = "v2.2.1" [[projects]] - digest = "1:26a67eb988225c6a0600c1af0b35e795ac4d23a9c40a7aa178fa2adc0670f1f7" name = "k8s.io/api" packages = [ "admission/v1beta1", @@ -639,28 +539,24 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1", + "storage/v1beta1" ] - pruneopts = "UT" revision = "b503174bad5991eb66f18247f52e41c3258f6348" version = "kubernetes-1.12.3" [[projects]] - digest = "1:d9e9a6062217111c1b7c548a47bd67b2b518c8da05d124dbca74e246565c76a6" name = "k8s.io/apiextensions-apiserver" packages = [ "pkg/apis/apiextensions", "pkg/apis/apiextensions/v1beta1", "pkg/client/clientset/clientset", "pkg/client/clientset/clientset/scheme", - "pkg/client/clientset/clientset/typed/apiextensions/v1beta1", + "pkg/client/clientset/clientset/typed/apiextensions/v1beta1" ] - pruneopts = "UT" revision = "0cd23ebeb6882bd1cdc2cb15fc7b2d72e8a86a5b" version = "kubernetes-1.12.3" [[projects]] - digest = "1:37113933623d6702a851b11c9a7534adb99961c1bf3cc8bd3b354402fd7243fe" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", @@ -708,22 +604,18 @@ "pkg/version", "pkg/watch", "third_party/forked/golang/json", - "third_party/forked/golang/reflect", + "third_party/forked/golang/reflect" ] - pruneopts = "UT" revision = "eddba98df674a16931d2d4ba75edc3a389bf633a" version = "kubernetes-1.12.3" [[projects]] branch = "master" - digest = "1:f4399da66c191adee58287b4069dbd3f040c4b42c7050e426b9b906c263c65b6" name = "k8s.io/apiserver" packages = ["pkg/storage/names"] - pruneopts = "UT" revision = "cf5eff4f5e8f6019796cb18c69918b9f2f09e6db" [[projects]] - digest = "1:b2820d12e324fc54ce0a4f330719c6858a5dfafbe053f2cb48ff299aed4538d1" name = "k8s.io/client-go" packages = [ "discovery", @@ -794,15 +686,13 @@ "util/integer", "util/jsonpath", "util/retry", - "util/workqueue", + "util/workqueue" ] - pruneopts = "UT" revision = "d082d5923d3cc0bfbb066ee5fbdea3d0ca79acf8" version = "kubernetes-1.12.3" [[projects]] branch = "master" - digest = "1:aa0d5fbf4eb99ae4cfaf645d4ffdef921777a5b761a28ee0a2cd5e9754ba130e" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -821,14 +711,12 @@ "cmd/lister-gen", "cmd/lister-gen/args", "cmd/lister-gen/generators", - "pkg/util", + "pkg/util" ] - pruneopts = "UT" revision = "aae79feb89bdded3679da91fd8c19b6dfcbdb79a" [[projects]] branch = "master" - digest = "1:63d18b00923c8c3b9b230b752bf0ab6da6bfdd02ca029c49455bfda97f3e0c26" name = "k8s.io/gengo" packages = [ "args", @@ -837,29 +725,23 @@ "generator", "namer", "parser", - "types", + "types" ] - pruneopts = "UT" revision = "4242d8e6c5dba56827bb7bcf14ad11cda38f3991" [[projects]] - digest = "1:e2999bf1bb6eddc2a6aa03fe5e6629120a53088926520ca3b4765f77d7ff7eab" name = "k8s.io/klog" packages = ["."] - pruneopts = "UT" revision = "a5bc97fbc634d635061f3146511332c7e313a55a" version = "v0.1.0" [[projects]] branch = "master" - digest = "1:a2c842a1e0aed96fd732b535514556323a6f5edfded3b63e5e0ab1bce188aa54" name = "k8s.io/kube-openapi" packages = ["pkg/util/proto"] - pruneopts = "UT" revision = "e3762e86a74c878ffed47484592986685639c2cd" [[projects]] - digest = "1:734453bd0e3edfe11b06da2473ee42041f9f59c230d482fee90d7f877aed88b3" name = "sigs.k8s.io/controller-runtime" packages = [ "pkg/cache", @@ -896,14 +778,12 @@ "pkg/webhook/internal/cert/generator", "pkg/webhook/internal/cert/writer", "pkg/webhook/internal/cert/writer/atomic", - "pkg/webhook/types", + "pkg/webhook/types" ] - pruneopts = "UT" revision = "c63ebda0bf4be5f0a8abd4003e4ea546032545ba" version = "v0.1.8" [[projects]] - digest = "1:946a62b07e59b9abd1f475a5b5c8d590255c1d40627f386d34fd073d3de9ecb8" name = "sigs.k8s.io/controller-tools" packages = [ "cmd/controller-gen", @@ -915,95 +795,29 @@ "pkg/rbac", "pkg/util", "pkg/webhook", - "pkg/webhook/internal", + "pkg/webhook/internal" ] - pruneopts = "UT" revision = "950a0e88e4effb864253b3c7504b326cc83b9d11" version = "v0.1.8" [[projects]] branch = "master" - digest = "1:fcda4907e877328a34cafaa567073836809d79f43027d6ed9a036758affdcb6c" name = "sigs.k8s.io/testing_frameworks" packages = [ "integration", - "integration/internal", + "integration/internal" ] - pruneopts = "UT" revision = "5818a3a284a11812aaed11d5ca0bcadec2c50e83" [[projects]] - digest = "1:7719608fe0b52a4ece56c2dde37bedd95b938677d1ab0f84b8a7852e4c59f849" name = "sigs.k8s.io/yaml" packages = ["."] - pruneopts = "UT" revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480" version = "v1.1.0" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - input-imports = [ - "github.com/davecgh/go-spew/spew", - "github.com/emicklei/go-restful", - "github.com/pkg/errors", - "github.com/sergi/go-diff/diffmatchpatch", - "github.com/spf13/cobra", - "github.com/spf13/pflag", - "golang.org/x/net/context", - "k8s.io/api/core/v1", - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1", - "k8s.io/apimachinery/pkg/api/equality", - "k8s.io/apimachinery/pkg/api/errors", - "k8s.io/apimachinery/pkg/api/meta", - "k8s.io/apimachinery/pkg/apis/meta/v1", - "k8s.io/apimachinery/pkg/apis/meta/v1/validation", - "k8s.io/apimachinery/pkg/labels", - "k8s.io/apimachinery/pkg/runtime", - "k8s.io/apimachinery/pkg/runtime/schema", - "k8s.io/apimachinery/pkg/runtime/serializer", - "k8s.io/apimachinery/pkg/types", - "k8s.io/apimachinery/pkg/util/intstr", - "k8s.io/apimachinery/pkg/util/rand", - "k8s.io/apimachinery/pkg/util/runtime", - "k8s.io/apimachinery/pkg/util/validation/field", - "k8s.io/apimachinery/pkg/util/wait", - "k8s.io/apimachinery/pkg/watch", - "k8s.io/apiserver/pkg/storage/names", - "k8s.io/client-go/discovery", - "k8s.io/client-go/discovery/fake", - "k8s.io/client-go/kubernetes", - "k8s.io/client-go/kubernetes/scheme", - "k8s.io/client-go/kubernetes/typed/core/v1", - "k8s.io/client-go/plugin/pkg/client/auth/gcp", - "k8s.io/client-go/rest", - "k8s.io/client-go/testing", - "k8s.io/client-go/tools/cache", - "k8s.io/client-go/tools/clientcmd", - "k8s.io/client-go/tools/clientcmd/api", - "k8s.io/client-go/tools/leaderelection/resourcelock", - "k8s.io/client-go/util/flowcontrol", - "k8s.io/client-go/util/integer", - "k8s.io/client-go/util/retry", - "k8s.io/code-generator/cmd/client-gen", - "k8s.io/code-generator/cmd/deepcopy-gen", - "k8s.io/code-generator/cmd/informer-gen", - "k8s.io/code-generator/cmd/lister-gen", - "k8s.io/klog", - "sigs.k8s.io/controller-runtime/pkg/client", - "sigs.k8s.io/controller-runtime/pkg/client/config", - "sigs.k8s.io/controller-runtime/pkg/client/fake", - "sigs.k8s.io/controller-runtime/pkg/controller", - "sigs.k8s.io/controller-runtime/pkg/envtest", - "sigs.k8s.io/controller-runtime/pkg/handler", - "sigs.k8s.io/controller-runtime/pkg/manager", - "sigs.k8s.io/controller-runtime/pkg/reconcile", - "sigs.k8s.io/controller-runtime/pkg/runtime/scheme", - "sigs.k8s.io/controller-runtime/pkg/runtime/signals", - "sigs.k8s.io/controller-runtime/pkg/source", - "sigs.k8s.io/controller-tools/cmd/controller-gen", - "sigs.k8s.io/testing_frameworks/integration", - "sigs.k8s.io/yaml", - ] + inputs-digest = "0c298e803e627e180c68fd2075f77e032381dadc5244ba0a2aff6516378ad9f9" solver-name = "gps-cdcl" solver-version = 1 diff --git a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go index 287480250d..dfa87062d9 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go +++ b/vendor/github.com/openshift/cluster-api/pkg/apis/machine/common/consts.go @@ -51,6 +51,13 @@ const ( // Example: timeout trying to connect to GCE. CreateMachineError MachineStatusError = "CreateError" + // There was an error while trying to update a Node that this + // Machine represents. This may indicate a transient problem that will be + // fixed automatically with time, such as a service outage, + // + // Example: error updating load balancers + UpdateMachineError MachineStatusError = "UpdateError" + // An error was encountered while trying to delete the Node that this // Machine represents. This could be a transient or terminal error, but // will only be observable if the provider's Machine controller has diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel index b9297268fa..08de8cd8a4 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/BUILD.bazel @@ -13,10 +13,15 @@ go_library( "//pkg/apis/machine/v1beta1:go_default_library", "//pkg/controller/error:go_default_library", "//pkg/util:go_default_library", + "//vendor/github.com/go-log/log/info:go_default_library", + "//vendor/github.com/openshift/kubernetes-drain:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library", + "//vendor/k8s.io/client-go/kubernetes:go_default_library", + "//vendor/k8s.io/client-go/rest:go_default_library", + "//vendor/k8s.io/client-go/tools/record:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/client:go_default_library", "//vendor/sigs.k8s.io/controller-runtime/pkg/controller:go_default_library", diff --git a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go index c1ba21794c..3026db72d8 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go +++ b/vendor/github.com/openshift/cluster-api/pkg/controller/machine/controller.go @@ -36,7 +36,6 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" "k8s.io/klog" - "k8s.io/klog/glog" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -170,40 +169,7 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul // by cloud controller manager. In that case some machines would never get // deleted without a manual intervention. if _, exists := m.ObjectMeta.Annotations[ExcludeNodeDrainingAnnotation]; !exists && m.Status.NodeRef != nil { - if err := func() error { - kubeClient, err := kubernetes.NewForConfig(r.config) - if err != nil { - return fmt.Errorf("unable to build kube client: %v", err) - } - node, err := kubeClient.CoreV1().Nodes().Get(m.Status.NodeRef.Name, metav1.GetOptions{}) - if err != nil { - return fmt.Errorf("unable to get node %q: %v", m.Status.NodeRef.Name, err) - } - - if err := kubedrain.Drain( - kubeClient, - []*corev1.Node{node}, - &kubedrain.DrainOptions{ - Force: true, - IgnoreDaemonsets: true, - DeleteLocalData: true, - GracePeriodSeconds: -1, - Logger: info.New(glog.V(0)), - // If a pod is not evicted in 20 second, retry the eviction next time the - // machine gets reconciled again (to allow other machines to be reconciled) - Timeout: 20 * time.Second, - }, - ); err != nil { - // Machine still tries to terminate after drain failure - glog.Warningf("drain failed for machine %q: %v", m.Name, err) - return &controllerError.RequeueAfterError{RequeueAfter: 20 * time.Second} - } - - glog.Infof("drain successful for machine %q", m.Name) - r.eventRecorder.Eventf(m, corev1.EventTypeNormal, "Deleted", "Node %q drained", node.Name) - - return nil - }(); err != nil { + if err := r.drainNode(m); err != nil { return reconcile.Result{}, err } } @@ -218,13 +184,10 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul } if m.Status.NodeRef != nil { - klog.Infof("Deleting node %q", m.Status.NodeRef.Name) - var node corev1.Node - key := client.ObjectKey{Namespace: "", Name: m.Status.NodeRef.Name} - if err := r.Client.Get(ctx, key, &node); err != nil { - klog.Warningf("Failed to get node %q: %v", m.Status.NodeRef.Name, err) - } else if err := r.Client.Delete(ctx, &node); err != nil { - klog.Warningf("Failed to delete node %q: %v", m.Status.NodeRef.Name, err) + klog.Infof("Deleting node %q for machine %q", m.Status.NodeRef.Name, m.Name) + if err := r.deleteNode(ctx, m.Status.NodeRef.Name); err != nil { + klog.Errorf("Error deleting node %q for machine %q", name, err) + return reconcile.Result{}, err } } @@ -267,6 +230,41 @@ func (r *ReconcileMachine) Reconcile(request reconcile.Request) (reconcile.Resul return reconcile.Result{}, nil } +func (r *ReconcileMachine) drainNode(machine *machinev1.Machine) error { + kubeClient, err := kubernetes.NewForConfig(r.config) + if err != nil { + return fmt.Errorf("unable to build kube client: %v", err) + } + node, err := kubeClient.CoreV1().Nodes().Get(machine.Status.NodeRef.Name, metav1.GetOptions{}) + if err != nil { + return fmt.Errorf("unable to get node %q: %v", machine.Status.NodeRef.Name, err) + } + + if err := kubedrain.Drain( + kubeClient, + []*corev1.Node{node}, + &kubedrain.DrainOptions{ + Force: true, + IgnoreDaemonsets: true, + DeleteLocalData: true, + GracePeriodSeconds: -1, + Logger: info.New(klog.V(0)), + // If a pod is not evicted in 20 second, retry the eviction next time the + // machine gets reconciled again (to allow other machines to be reconciled) + Timeout: 20 * time.Second, + }, + ); err != nil { + // Machine still tries to terminate after drain failure + klog.Warningf("drain failed for machine %q: %v", machine.Name, err) + return &controllerError.RequeueAfterError{RequeueAfter: 20 * time.Second} + } + + klog.Infof("drain successful for machine %q", machine.Name) + r.eventRecorder.Eventf(machine, corev1.EventTypeNormal, "Deleted", "Node %q drained", node.Name) + + return nil +} + func (r *ReconcileMachine) getCluster(ctx context.Context, machine *machinev1.Machine) (*machinev1.Cluster, error) { clusterList := machinev1.ClusterList{} listOptions := &client.ListOptions{ @@ -312,3 +310,16 @@ func (r *ReconcileMachine) isDeleteAllowed(machine *machinev1.Machine) bool { // own machine. return node.UID != machine.Status.NodeRef.UID } + +func (r *ReconcileMachine) deleteNode(ctx context.Context, name string) error { + var node corev1.Node + if err := r.Client.Get(ctx, client.ObjectKey{Name: name}, &node); err != nil { + if apierrors.IsNotFound(err) { + klog.V(2).Infof("Node %q not found", name) + return nil + } + klog.Errorf("Failed to get node %q: %v", name, err) + return err + } + return r.Client.Delete(ctx, &node) +} diff --git a/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go b/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go index eaf8c0cc2f..3736afab6d 100644 --- a/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go +++ b/vendor/github.com/openshift/cluster-api/pkg/errors/machines.go @@ -53,6 +53,13 @@ func CreateMachine(msg string, args ...interface{}) *MachineError { } } +func UpdateMachine(msg string, args ...interface{}) *MachineError { + return &MachineError{ + Reason: commonerrors.UpdateMachineError, + Message: fmt.Sprintf(msg, args...), + } +} + func DeleteMachine(msg string, args ...interface{}) *MachineError { return &MachineError{ Reason: commonerrors.DeleteMachineError,