diff --git a/Gopkg.lock b/Gopkg.lock index 18c21c4830..7257e04b10 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,84 +3,111 @@ [[projects]] branch = "default" + digest = "1:24df057f15e7a09e75c1241cbe6f6590fd3eac9804f1110b02efade3214f042d" name = "bitbucket.org/ww/goautoneg" packages = ["."] + pruneopts = "UT" revision = "75cd24fc2f2c2a2088577d12123ddee5f54e0675" [[projects]] + digest = "1:aa65b4877ac225076b4362885e9122fdf6a8728f735749c24f1aeabcad9bdaba" name = "cloud.google.com/go" packages = [ "compute/metadata", - "internal" + "internal", ] + pruneopts = "UT" revision = "3b1ae45394a234c385be014e9a488f2bb6eef821" [[projects]] + digest = "1:42438de56663c9af79baacdcb986156b1820e0d2f030458040055c25d5c9ae01" name = "github.com/Azure/go-ansiterm" packages = [ ".", - "winterm" + "winterm", ] + pruneopts = "UT" revision = "19f72df4d05d31cbe1c56bfc8045c96babff6c7e" [[projects]] + digest = "1:0f3613c2aeecb6db9997b495d32dbc3821b5ed38a3daeb989b7b22715fe2b38f" name = "github.com/Azure/go-autorest" packages = [ "autorest", "autorest/adal", "autorest/azure", - "autorest/date" + "autorest/date", ] + pruneopts = "UT" revision = "d4e6b95c12a08b4de2d48b45d5b4d594e5d32fab" [[projects]] + digest = "1:51d5156c2de01719fdf90b21197b95bc7e8c9d43ca0d5c3f5c875b8b530077c8" name = "github.com/MakeNowJust/heredoc" packages = ["."] + pruneopts = "UT" revision = "bb23615498cded5e105af4ce27de75b089cbe851" [[projects]] + digest = "1:6e6779c1e7984081358a4aee6f944233c8cbabfb28ca9dc0e20af595d476ebf4" name = "github.com/Masterminds/semver" packages = ["."] + pruneopts = "UT" revision = "517734cc7d6470c0d07130e40fd40bdeb9bcd3fd" [[projects]] + digest = "1:b125ffa3363b22cec9699f14b6c926299240acd77267c08a4199e8a0cd5fed3d" name = "github.com/Masterminds/sprig" packages = ["."] + pruneopts = "UT" revision = "e039e20e500c2c025d9145be375e27cf42a94174" [[projects]] + digest = "1:20695cc3d37c69d8a95420452e9d1afd29cc67cf54934a5d5738404e0831aad8" name = "github.com/Microsoft/go-winio" packages = ["."] + pruneopts = "UT" revision = "78439966b38d69bf38227fbf57ac8a6fee70f69a" [[projects]] + digest = "1:002edd3097e9eb1ad56da7e29ed3bfdc8f85765d667a84246b38a7226c829ad2" name = "github.com/NYTimes/gziphandler" packages = ["."] + pruneopts = "UT" revision = "56545f4a5d46df9a6648819d1664c3a03a13ffdb" [[projects]] + digest = "1:792c6f8317411834d22db5be14276cd87d589cb0f8dcc51c042f0dddf67d60b1" name = "github.com/PuerkitoBio/purell" packages = ["."] + pruneopts = "UT" revision = "8a290539e2e8629dbc4e6bad948158f790ec31f4" [[projects]] + digest = "1:61e5d7b1fabd5b6734b2595912944dbd9f6e0eaa4adef25e5cbf98754fc91df1" name = "github.com/PuerkitoBio/urlesc" packages = ["."] + pruneopts = "UT" revision = "5bd2802263f21d8788851d5305584c82a5c75d7e" [[projects]] + digest = "1:8f5416c7f59da8600725ae1ff00a99af1da8b04c211ae6f3c8f8bcab0164f650" name = "github.com/aokoli/goutils" packages = ["."] + pruneopts = "UT" revision = "3391d3790d23d03408670993e957e8f408993c34" version = "v1.0.1" [[projects]] + digest = "1:320e7ead93de9fd2b0e59b50fd92a4d50c1f8ab455d96bc2eb083267453a9709" name = "github.com/asaskevich/govalidator" packages = ["."] + pruneopts = "UT" revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" version = "v9" [[projects]] + digest = "1:f2bce9137130ed14d0b50a8ba5cef3b9d8829c304c97d164eb35421644cc746e" name = "github.com/aws/aws-sdk-go" packages = [ "aws", @@ -131,12 +158,13 @@ "service/route53", "service/route53/route53iface", "service/s3", - "service/sts" + "service/sts", ] revision = "1825bc12edc3cd682594909d6386f7fcb957c99c" version = "v1.14.30" [[projects]] + digest = "1:ea54f769068039601b42373c98d6d07793dfdffc5baa52f1aaae3d6c86c71007" name = "github.com/bazelbuild/bazel-gazelle" packages = [ "cmd/gazelle", @@ -149,41 +177,51 @@ "internal/repos", "internal/resolve", "internal/version", - "internal/wspace" + "internal/wspace", ] + pruneopts = "UT" revision = "7f30ba724af9495b221e2df0f5ac58511179485f" version = "0.12.0" [[projects]] + digest = "1:331f668c3b6315145093a3b104c1da6be2835a3b1e7c873ad5fba82667330d44" name = "github.com/bazelbuild/buildtools" packages = [ "build", - "tables" + "tables", ] + pruneopts = "UT" revision = "a05406a1a855c6d8ebfc368555ace7638d83c0d9" version = "0.6.0" [[projects]] + digest = "1:2daf57e573d4174757646e9d416d25e4dbe4533237961a90b986091a2de12830" name = "github.com/beorn7/perks" packages = ["quantile"] + pruneopts = "UT" revision = "3ac7bf7a47d159a033b107610db8a1b6575507a4" [[projects]] + digest = "1:6f77df4efbb5c5395eb72fe762e8ccb094da7647dd25e5f35d229705086517d2" name = "github.com/blang/semver" packages = ["."] + pruneopts = "UT" revision = "b38d23b8782a487059e8fc8773e9a5b228a77cb6" [[projects]] + digest = "1:95e08278c876d185ba67533f045e9e63b3c9d02cbd60beb0f4dbaa2344a13ac2" name = "github.com/chai2010/gettext-go" packages = [ "gettext", "gettext/mo", "gettext/plural", - "gettext/po" + "gettext/po", ] + pruneopts = "UT" revision = "bf70f2a70fb1b1f36d90d671a72795984eab0fcb" [[projects]] + digest = "1:3814dc656fae3665c018c17165264b164ae7fb90255b48f12971b191fef27180" name = "github.com/coreos/etcd" packages = [ "auth/authpb", @@ -197,37 +235,49 @@ "pkg/tlsutil", "pkg/transport", "pkg/types", - "version" + "version", ] + pruneopts = "UT" revision = "95a726a27e09030f9ccbd9982a1508f5a6d25ada" [[projects]] + digest = "1:c298fe11665f7157328f2978bc60f761ffcc706b94bf077e661a59fe29b291a0" name = "github.com/coreos/go-semver" packages = ["semver"] + pruneopts = "UT" revision = "568e959cd89871e61434c1143528d9162da89ef2" [[projects]] + digest = "1:fa91847d50d3f656fc2d2d608b9749b97d77528e8988ad8001f957640545e91e" name = "github.com/coreos/go-systemd" packages = ["daemon"] + pruneopts = "UT" revision = "48702e0da86bd25e76cfef347e2adeb434a0d0a6" [[projects]] + digest = "1:cc832d4c674b57b5c67f683f75fba043dd3eec6fcd9b936f00cc8ddf439f2131" name = "github.com/cpuguy83/go-md2man" packages = ["md2man"] + pruneopts = "UT" revision = "71acacd42f85e5e82f70a55327789582a5200a90" [[projects]] + digest = "1:6b21090f60571b20b3ddc2c8e48547dffcf409498ed6002c2cada023725ed377" name = "github.com/davecgh/go-spew" packages = ["spew"] + pruneopts = "UT" revision = "782f4967f2dc4564575ca782fe2d04090b5faca8" [[projects]] + digest = "1:e0caf4c33e84cb58f7362b0bcc2f3049d9b3cc471cbab5f2273c8306f7b6bc92" name = "github.com/daviddengcn/go-colortext" packages = ["."] + pruneopts = "UT" revision = "511bcaf42ccd42c38aba7427b6673277bf19e2a1" [[projects]] branch = "master" + digest = "1:c208e46a2c410d62b3e5c97f1f1db797d8d0862307b7800c4783dac5be1c83fa" name = "github.com/denverdino/aliyungo" packages = [ "common", @@ -236,32 +286,40 @@ "oss", "ram", "slb", - "util" + "util", ] + pruneopts = "UT" revision = "2581e433b270014481c9ec66a91368661533febb" [[projects]] + digest = "1:dd39e40faa3d7a12ce2b930efbe954a45e8f91a87e2adf5d8654ccb6137c4ab2" name = "github.com/dgrijalva/jwt-go" packages = ["."] + pruneopts = "UT" revision = "01aeca54ebda6e0fbfafd0a524d234159c05ec20" [[projects]] + digest = "1:f1b23499a437050e7ceb7e3f5111ec8ead263161395c585c19721d59b1244da9" name = "github.com/digitalocean/godo" packages = [ ".", - "context" + "context", ] + pruneopts = "UT" revision = "34840385860db94c88d044571153b6a200ca40b2" [[projects]] + digest = "1:4189ee6a3844f555124d9d2656fe7af02fca961c2a9bad9074789df13a0c62e0" name = "github.com/docker/distribution" packages = [ "digestset", - "reference" + "reference", ] + pruneopts = "UT" revision = "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" [[projects]] + digest = "1:5eebe80a8c7778ba2ac8d0ce0debce3068d10a1e70891c2294d3521ae23865fc" name = "github.com/docker/docker" packages = [ "api/types", @@ -276,11 +334,13 @@ "api/types/swarm/runtime", "api/types/versions", "pkg/term", - "pkg/term/windows" + "pkg/term/windows", ] + pruneopts = "UT" revision = "4f3616fb1c112e206b88cb7a9922bf49067a7756" [[projects]] + digest = "1:344f93aea3423a982f0b82467672e699439fd2c3106a37738780bccf043e0646" name = "github.com/docker/engine-api" packages = [ "client", @@ -295,160 +355,212 @@ "types/registry", "types/strslice", "types/time", - "types/versions" + "types/versions", ] + pruneopts = "UT" revision = "dea108d3aa0c67d7162a3fd8aa65f38a430019fd" [[projects]] + digest = "1:b6b5c3e8da0fb8073cd2886ba249a40f4402b4391ca6eba905a142cceea97a12" name = "github.com/docker/go-connections" packages = [ "nat", "sockets", - "tlsconfig" + "tlsconfig", ] + pruneopts = "UT" revision = "3ede32e2033de7505e6500d6c868c2b9ed9f169d" [[projects]] + digest = "1:57d39983d01980c1317c2c5c6dd4b5b0c4a804ad2df800f2f6cbcd6a6d05f6ca" name = "github.com/docker/go-units" packages = ["."] + pruneopts = "UT" revision = "9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1" [[projects]] + digest = "1:58be7025fd84632dfbb8a398f931b5bdbbecc0390e4385df4ae56775487a0f87" name = "github.com/docker/spdystream" packages = [ ".", - "spdy" + "spdy", ] + pruneopts = "UT" revision = "449fdfce4d962303d702fec724ef0ad181c92528" [[projects]] + digest = "1:1f1d454098ba2f8e7b87f0166e30533a72dddb80bace79643a78933fa4889613" name = "github.com/elazarl/go-bindata-assetfs" packages = ["."] + pruneopts = "UT" revision = "3dcc96556217539f50599357fb481ac0dc7439b9" [[projects]] + digest = "1:87c056b4f0548034ade51456237b47f723b901f373d7c11295f80da5d3b91950" name = "github.com/emicklei/go-restful" packages = [ ".", - "log" + "log", ] + pruneopts = "UT" revision = "ff4f55a206334ef123e4f79bbf348980da81ca46" [[projects]] + digest = "1:ddab18e89cf46e40707b89dbe3835b4a591b0ea298e1035eefa84002aa9a4b4e" name = "github.com/emicklei/go-restful-swagger12" packages = ["."] + pruneopts = "UT" revision = "dcef7f55730566d41eae5db10e7d6981829720f6" [[projects]] branch = "master" + digest = "1:11e94345a96c7ffd792e2c6019b79fd9c51d9faf55201d23a96c38dc09533a01" name = "github.com/evanphx/json-patch" packages = ["."] + pruneopts = "UT" revision = "944e07253867aacae43c04b2e6a239005443f33a" [[projects]] branch = "master" + digest = "1:5e0da1aba1a7b125f46e6ddca43e98b40cf6eaea3322b016c331cf6afe53c30a" name = "github.com/exponent-io/jsonpath" packages = ["."] + pruneopts = "UT" revision = "d6023ce2651d8eafb5c75bb0c7167536102ec9f5" [[projects]] + digest = "1:e263726ba0d84e5ab1d9b96de99ab84249c83aea493c3dabfc652480189c8c7c" name = "github.com/fatih/camelcase" packages = ["."] + pruneopts = "UT" revision = "f6a740d52f961c60348ebb109adde9f4635d7540" [[projects]] + digest = "1:28c2511ad34394d299bca82becccc5dff425819faca8b9fbef0bcd5a88c87d29" name = "github.com/fsnotify/fsnotify" packages = ["."] + pruneopts = "UT" revision = "f12c6236fe7b5cf6bcf30e5935d08cb079d78334" [[projects]] branch = "master" + digest = "1:965ce99497c18d9e739e35ca3c2985f876bfbbcc36557fa8ce0927068edaea15" name = "github.com/fullsailor/pkcs7" packages = ["."] + pruneopts = "UT" revision = "ae226422660e5ca10db350d33f81c6608f3fbcdd" [[projects]] + digest = "1:c45cef8e0074ea2f8176a051df38553ba997a3616f1ec2d35222b1cf9864881e" name = "github.com/ghodss/yaml" packages = ["."] + pruneopts = "UT" revision = "73d445a93680fa1a78ae23a5839bad48f32ba1ee" [[projects]] + digest = "1:8e4f6662aa166f5690677c0c3540b241b01b327871bf53cd8f995efb655d4b14" name = "github.com/go-ini/ini" packages = ["."] + pruneopts = "UT" revision = "300e940a926eb277d3901b20bdfcc54928ad3642" version = "v1.25.4" [[projects]] branch = "master" + digest = "1:d0c5ea8e9e9a7940ee9f778f0ef255dc9ac83407ce8f3402ca00b7e45eaeff45" name = "github.com/go-openapi/analysis" packages = ["."] + pruneopts = "UT" revision = "863ac7f90e00e88e507095639a8457bbbf3c2ec9" [[projects]] branch = "master" + digest = "1:74ea4db5ab69cf8aea2b7eb4c539e3ae4c1d8e3c66e38a149ff47137b5a1ea99" name = "github.com/go-openapi/errors" packages = ["."] + pruneopts = "UT" revision = "7bcb96a367bac6b76e6e42fa84155bb5581dcff8" [[projects]] + digest = "1:172569c4bdc486213be0121e6039df4c272e9ff29397d9fd3716c31e4b37e15d" name = "github.com/go-openapi/jsonpointer" packages = ["."] + pruneopts = "UT" revision = "46af16f9f7b149af66e5d1bd010e3574dc06de98" [[projects]] + digest = "1:f30ccde775458301b306f4576e11de88d3ed0d91e68a5f3591c4ed8afbca76fa" name = "github.com/go-openapi/jsonreference" packages = ["."] + pruneopts = "UT" revision = "13c6e3589ad90f49bd3e3bbe2c2cb3d7a4142272" [[projects]] branch = "master" + digest = "1:ff04019588fc028ac28c3c565ce5316461a4641df197555041ee66cf45d213e3" name = "github.com/go-openapi/loads" packages = ["."] + pruneopts = "UT" revision = "2a2b323bab96e6b1fdee110e57d959322446e9c9" [[projects]] + digest = "1:ed3642d1497a543323f731039927aef565de45bafaffc97d138d7dc5bc14b5b5" name = "github.com/go-openapi/spec" packages = ["."] + pruneopts = "UT" revision = "1de3e0542de65ad8d75452a595886fdd0befb363" [[projects]] branch = "master" + digest = "1:21d5505516f3a00465014ca2aa3bf01ef633c6d6be9a008cbb545350408f1dff" name = "github.com/go-openapi/strfmt" packages = ["."] + pruneopts = "UT" revision = "481808443b00a14745fada967cb5eeff0f9b1df2" [[projects]] + digest = "1:3a42f9cbdeb4db3a14e0c3bb35852b7426b69f73386d52b606baf5d0fecfb4d7" name = "github.com/go-openapi/swag" packages = ["."] + pruneopts = "UT" revision = "f3f9494671f93fcff853e3c6e9e948b3eb71e590" [[projects]] + digest = "1:c64649af439e22d36d55b53927d1ca7db7c15428a29b1e155752e5cb7902fbbb" name = "github.com/gobuffalo/envy" packages = ["."] + pruneopts = "UT" revision = "ef60bfc50c8f92d1ee64674d8ce7a48f1f67625e" version = "v1.6.2" [[projects]] + digest = "1:aa01c876fb4c8fb74b7e37bcf23e5359b32335b24b7cad1d5a343d856c916305" name = "github.com/gogo/protobuf" packages = [ "gogoproto", "proto", "protoc-gen-gogo/descriptor", - "sortkeys" + "sortkeys", ] + pruneopts = "UT" revision = "c0656edd0d9eab7c66d1eb0c568f9039345796f7" [[projects]] + digest = "1:2edd2416f89b4e841df0e4a78802ce14d2bc7ad79eba1a45986e39f0f8cb7d87" name = "github.com/golang/glog" packages = ["."] + pruneopts = "UT" revision = "44145f04b68cf362d9c4df2182967c2275eaefed" [[projects]] + digest = "1:7672c206322f45b33fac1ae2cb899263533ce0adcc6481d207725560208ec84e" name = "github.com/golang/groupcache" packages = ["lru"] + pruneopts = "UT" revision = "02826c3e79038b59d737d3b1c0a1d937f71a4433" [[projects]] + digest = "1:b5a22bac9656361e084f5414d06228ca03efe6d9bcba93256c44a32584111805" name = "github.com/golang/protobuf" packages = [ "proto", @@ -456,47 +568,61 @@ "ptypes", "ptypes/any", "ptypes/duration", - "ptypes/timestamp" + "ptypes/timestamp", ] + pruneopts = "UT" revision = "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9" [[projects]] + digest = "1:62dfb39fe3bddeabb02cc001075ed9f951b044da2cd5b0f970ca798b1553bac3" name = "github.com/google/btree" packages = ["."] + pruneopts = "UT" revision = "7d79101e329e5a3adf994758c578dab82b90c017" [[projects]] + digest = "1:ef985937fb7a6a7cf752a0e84bd7b61dd337da7c15635f65bc05508209a50289" name = "github.com/google/cadvisor" packages = ["pages/static"] + pruneopts = "UT" revision = "2e02d28350c5fbbad9cfb7e5a1733468b75ab3f9" [[projects]] branch = "master" + digest = "1:a63cff6b5d8b95638bfe300385d93b2a6d9d687734b863da8e09dc834510a690" name = "github.com/google/go-querystring" packages = ["query"] + pruneopts = "UT" revision = "53e6ce116135b80d037921a7fdd5138cf32d7a8a" [[projects]] + digest = "1:41bfd4219241b7f7d6e6fdb13fc712576f1337e68e6b895136283b76928fdd66" name = "github.com/google/gofuzz" packages = ["."] + pruneopts = "UT" revision = "44d81051d367757e1c7c6a5a86423ece9afcf63c" [[projects]] + digest = "1:75eb87381d25cc75212f52358df9c3a2719584eaa9685cd510ce28699122f39d" name = "github.com/googleapis/gnostic" packages = [ "OpenAPIv2", "compiler", - "extensions" + "extensions", ] + pruneopts = "UT" revision = "0c5108395e2debce0d731cf0287ddf7242066aba" [[projects]] + digest = "1:dc8be055c0a43584d2b728953be6d507c8a48a9b6e055c2dffdb8d8414eb703b" name = "github.com/gophercloud/gophercloud" packages = [ ".", "openstack", "openstack/blockstorage/v2/volumes", "openstack/compute/v2/extensions/keypairs", + "openstack/compute/v2/extensions/schedulerhints", + "openstack/compute/v2/extensions/servergroups", "openstack/compute/v2/flavors", "openstack/compute/v2/images", "openstack/compute/v2/servers", @@ -513,39 +639,49 @@ "openstack/objectstorage/v1/containers", "openstack/objectstorage/v1/objects", "openstack/utils", - "pagination" + "pagination", ] - revision = "6da026c32e2d622cc242d32984259c77237aefe1" + pruneopts = "UT" + revision = "f29afc2cceca860199ee88cd355a4d0a37b3fad2" [[projects]] + digest = "1:c79fb010be38a59d657c48c6ba1d003a8aa651fa56b579d959d74573b7dff8e1" name = "github.com/gorilla/context" packages = ["."] + pruneopts = "UT" revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42" version = "v1.1.1" [[projects]] + digest = "1:e73f5b0152105f18bc131fba127d9949305c8693f8a762588a82a48f61756f5f" name = "github.com/gorilla/mux" packages = ["."] + pruneopts = "UT" revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf" version = "v1.6.2" [[projects]] + digest = "1:878f0defa9b853f9acfaf4a162ba450a89d0050eff084f9fe7f5bd15948f172a" name = "github.com/gregjones/httpcache" packages = [ ".", - "diskcache" + "diskcache", ] + pruneopts = "UT" revision = "787624de3eb7bd915c329cba748687a3b22666a6" [[projects]] + digest = "1:3f90d23757c18b1e07bf11494dbe737ee2c44d881c0f41e681611abdadad62fa" name = "github.com/hashicorp/golang-lru" packages = [ ".", - "simplelru" + "simplelru", ] + pruneopts = "UT" revision = "a0d98a5f288019575c6d1f4bb1573fef2d1fcdc4" [[projects]] + digest = "1:0292f7d08f3d0119b49ab0bd59719e25f263e8a9b3f82ce34cbf675ad48dbbd2" name = "github.com/hashicorp/hcl" packages = [ ".", @@ -557,73 +693,97 @@ "hcl/token", "json/parser", "json/scanner", - "json/token" + "json/token", ] + pruneopts = "UT" revision = "d8c773c4cba11b11539e3d45f93daeaa5dcf1fa1" [[projects]] branch = "master" + digest = "1:0778dc7fce1b4669a8bfa7ae506ec1f595b6ab0f8989c1c0d22a8ca1144e9972" name = "github.com/howeyc/gopass" packages = ["."] + pruneopts = "UT" revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8" [[projects]] + digest = "1:80544abec6a93301c477926d6ed12dffce5029ddb34101435d88277f98006844" name = "github.com/huandu/xstrings" packages = ["."] + pruneopts = "UT" revision = "3959339b333561bf62a38b424fd41517c2c90f40" [[projects]] + digest = "1:06ec9147400aabb0d6960dd8557638603b5f320cd4cb8a3eceaae407e782849a" name = "github.com/imdario/mergo" packages = ["."] + pruneopts = "UT" revision = "6633656539c1639d9d78127b7d47c622b5d7b6dc" [[projects]] + digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be" name = "github.com/inconshreveable/mousetrap" packages = ["."] + pruneopts = "UT" revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" [[projects]] + digest = "1:e22af8c7518e1eab6f2eab2b7d7558927f816262586cd6ed9f349c97a6c285c4" name = "github.com/jmespath/go-jmespath" packages = ["."] + pruneopts = "UT" revision = "0b12d6b521d83fc7f755e7cfc1b1fbdd35a01a74" [[projects]] + digest = "1:70e697d67ccaec45e16bac3a32380ebcd9e7e071079c60d0171d42cf1cf9748a" name = "github.com/joho/godotenv" packages = ["."] + pruneopts = "UT" revision = "a79fa1e548e2c689c241d10173efd51e5d689d5b" version = "v1.2.0" [[projects]] + digest = "1:e904ebe3c17ef07eb107df3f9453a2e678c289a5265d2c7314c6d5ba5ac3b085" name = "github.com/jonboulle/clockwork" packages = ["."] + pruneopts = "UT" revision = "72f9bd7c4e0c2a40055ab3d0f09654f730cce982" [[projects]] + digest = "1:b6bbd2f9e0724bd81890c8644259f920c6d61c08453978faff0bebd25f3e7d3e" name = "github.com/jpillora/backoff" packages = ["."] + pruneopts = "UT" revision = "8eab2debe79d12b7bd3d10653910df25fa9552ba" version = "1.0.0" [[projects]] + digest = "1:8f9110ae8a250da0af248c7d6f78d6244ac86e0afebf16ddd4e6849650bbf2a1" name = "github.com/json-iterator/go" packages = ["."] + pruneopts = "UT" revision = "13f86432b882000a51c6e610c620974462691a97" [[projects]] + digest = "1:68a21d98a9a22099581b3c76d5478d65c73dd58c7a32262636cb11deb99c02ec" name = "github.com/jteeuwen/go-bindata" packages = [ ".", - "go-bindata" + "go-bindata", ] + pruneopts = "UT" revision = "a0ff2567cfb70903282db057e799fd826784d41d" [[projects]] branch = "master" + digest = "1:81780a09277ee80f2bfbb90da6f51b5de95423db6cde8ff6d72cd20eba989bba" name = "github.com/kr/fs" packages = ["."] + pruneopts = "UT" revision = "2788f0dbd16903de03cb8186e5c7d97b69ad387b" [[projects]] + digest = "1:0be87127b6c732fce41682f21ec87fde73c7a388062d79ca99dd28bfa8cb4021" name = "github.com/kubernetes-incubator/apiserver-builder" packages = [ "cmd/apiregister-gen", @@ -635,242 +795,322 @@ "cmd/apiserver-boot/boot/run", "cmd/apiserver-boot/boot/update", "cmd/apiserver-boot/boot/util", - "cmd/apiserver-boot/boot/version" + "cmd/apiserver-boot/boot/version", ] + pruneopts = "UT" revision = "e809ac2f9f0c238f08d08a876f8b3f499604f941" [[projects]] + digest = "1:53baa5030380b1ea774231b7e1f4f1a1ee7958118fba826bc391a0c06a06df03" name = "github.com/kubernetes-incubator/reference-docs" packages = [ "gen-apidocs", "gen-apidocs/generators", - "gen-apidocs/generators/api" + "gen-apidocs/generators/api", ] + pruneopts = "UT" revision = "8fadf91876ccbcfec367b434706a3c449073b0b4" [[projects]] + digest = "1:4007d130ea960ece2c12269732e7d6002b8db1e1c5276be236e18440350e2e52" name = "github.com/magiconair/properties" packages = ["."] + pruneopts = "UT" revision = "61b492c03cf472e0c6419be5899b8e0dc28b1b88" [[projects]] + digest = "1:a867990aee2ebc1ac86614ed702bf1e63061a79eac12d4326203cb9084b61839" name = "github.com/mailru/easyjson" packages = [ "buffer", "jlexer", - "jwriter" + "jwriter", ] + pruneopts = "UT" revision = "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" [[projects]] branch = "master" + digest = "1:91ba3351f61d305d760dbc04084e17ef013ba45cdc7675a2f8ce6028d5f59430" name = "github.com/markbates/inflect" packages = ["."] + pruneopts = "UT" revision = "fbc6b23ce49e2578f572d2e72bb72fa03c7145de" [[projects]] + digest = "1:f1bb94f5fab2a670687ec7a30a9160b0193d147ae82d5650231c01b2b3a8d0db" name = "github.com/matttproud/golang_protobuf_extensions" packages = ["pbutil"] + pruneopts = "UT" revision = "fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a" [[projects]] + digest = "1:54ba55da3020def54720e6cfc21a76bdaf67d5bdc06752b2789e73fcebd866fc" name = "github.com/miekg/coredns" packages = ["middleware/etcd/msg"] + pruneopts = "UT" revision = "20e25559d5eada5a68a0720816a6e947b94860ce" [[projects]] + digest = "1:7e6d99ab68191943e11e8a3711bad7424803c94c7d91fb834d4bb79ccb1e3a19" name = "github.com/miekg/dns" packages = ["."] + pruneopts = "UT" revision = "5d001d020961ae1c184f9f8152fdc73810481677" [[projects]] branch = "master" + digest = "1:e68cd472b96cdf7c9f6971ac41bcc1d4d3b23d67c2a31d2399446e295bc88ae9" name = "github.com/mitchellh/go-wordwrap" packages = ["."] + pruneopts = "UT" revision = "ad45545899c7b13c020ea92b2072220eefad42b8" [[projects]] + digest = "1:3bf49f179b730bede84bcec58587f33af244353cc7029283c82de81729e75fae" name = "github.com/mitchellh/mapstructure" packages = ["."] + pruneopts = "UT" revision = "53818660ed4955e899c0bcafa97299a388bd7c8e" [[projects]] branch = "master" + digest = "1:a6156889b651cc0bf3d9bef82b6ba8fbb9eb19aefd7bc5718357c38b67297cbc" name = "github.com/mxk/go-flowrate" packages = ["flowrate"] + pruneopts = "UT" revision = "cca7078d478f8520f85629ad7c68962d31ed7682" [[projects]] + digest = "1:37423212694a4316f48e0bbac8e4f1fd366a384a286fbaa7d80baf99d86f0416" name = "github.com/opencontainers/go-digest" packages = ["."] + pruneopts = "UT" revision = "a6d0ee40d4207ea02364bd3b9e8e77b9159ba1eb" [[projects]] + digest = "1:8e1d3df780654a0c2227b1a4d6f11bfb46d386237f31cc8b5ae8dfa13b55b4ee" name = "github.com/opencontainers/image-spec" packages = [ "specs-go", - "specs-go/v1" + "specs-go/v1", ] + pruneopts = "UT" revision = "372ad780f63454fbbbbcc7cf80e5b90245c13e13" [[projects]] + digest = "1:9072181164e616e422cbfbe48ca9ac249a4d76301ca0876c9f56b937cf214a2f" name = "github.com/pborman/uuid" packages = ["."] + pruneopts = "UT" revision = "ca53cad383cad2479bbba7f7a1a05797ec1386e4" [[projects]] + digest = "1:342c898ef85c5032840d1518520957db169673495e4e1455f3f1f0eaca9a4994" name = "github.com/pelletier/go-toml" packages = ["."] + pruneopts = "UT" revision = "16398bac157da96aa88f98a2df640c7f32af1da2" [[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" [[projects]] + digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" name = "github.com/pkg/errors" packages = ["."] + pruneopts = "UT" revision = "645ef00459ed84a119197bfb8d8205042c6df63d" [[projects]] + digest = "1:8c2de3d113427f30484c85b8fdb3286a567e2af8e60b379f8d85e3af90e20089" name = "github.com/pkg/sftp" packages = ["."] + pruneopts = "UT" revision = "4d0e916071f68db74f8a73926335f809396d6b42" [[projects]] + digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" name = "github.com/pmezard/go-difflib" packages = ["difflib"] + pruneopts = "UT" revision = "792786c7400a136282c1664665ae0a8db921c6c2" version = "v1.0.0" [[projects]] + digest = "1:5ea1368c1be4bf21c05cffe69e2341c0ee354ce5c7ed45291d8abd6ceea1ddeb" name = "github.com/prometheus/client_golang" packages = [ "prometheus", - "prometheus/promhttp" + "prometheus/promhttp", ] + pruneopts = "UT" revision = "e7e903064f5e9eb5da98208bae10b475d4db0f8c" [[projects]] + digest = "1:9fe8945a11a9f588a9d306b4741cad634da9015a704271b9506810e2cc77fa17" name = "github.com/prometheus/client_model" packages = ["go"] + pruneopts = "UT" revision = "fa8ad6fec33561be4280a8f0514318c79d7f6cb6" [[projects]] + digest = "1:0d5f8e2195ad2beef202367f3217c4a7981582d96ccf4876b9aa2c5c9c9b3510" name = "github.com/prometheus/common" packages = [ "expfmt", "internal/bitbucket.org/ww/goautoneg", - "model" + "model", ] + pruneopts = "UT" revision = "13ba4ddd0caa9c28ca7b7bffe1dfa9ed8d5ef207" [[projects]] + digest = "1:c78edab144d03422b52cd34d5fa4ffc9a59fef90b3afdcf2efc4dd333479f243" name = "github.com/prometheus/procfs" packages = [ ".", - "xfs" + "xfs", ] + pruneopts = "UT" revision = "65c1f6f8f0fc1e2185eb9863a3bc751496404259" [[projects]] + digest = "1:35805e88a1ce71dfafdeb54d6b075b668f7b559c1dd9071024c960bb65c2f2cf" name = "github.com/renstrom/dedent" packages = ["."] + pruneopts = "UT" revision = "020d11c3b9c0c7a3c2efcc8e5cf5b9ef7bcea21f" [[projects]] + digest = "1:f78dee1142c1e43c9288534cadfa82f21dfd9a1163b06fa0fdf872f8020f2a53" name = "github.com/russross/blackfriday" packages = ["."] + pruneopts = "UT" revision = "300106c228d52c8941d4b3de6054a6062a86dda3" [[projects]] + digest = "1:e589afe1921e2b183b1cc58a06d7b36ee703a1fdb3cfc41370903c75a5d00b2a" name = "github.com/satori/go.uuid" packages = ["."] + pruneopts = "UT" revision = "5bf94b69c6b68ee1b541973bb8e1144db23a194b" [[projects]] + digest = "1:8f9dbaa6f7247268be0b1248eeb7b2a4216a3de96b97d9ce1924842a8c3af28e" name = "github.com/sergi/go-diff" packages = ["diffmatchpatch"] + pruneopts = "UT" revision = "552b4e9bbdca9e5adafd95ee98c822fdd11b330b" [[projects]] + digest = "1:166006f557f8035424fad136d1806d5c73229e82c670500dcbfba1a1160f5ddb" name = "github.com/shurcooL/sanitized_anchor_name" packages = ["."] + pruneopts = "UT" revision = "10ef21a441db47d8b13ebcc5fd2310f636973c77" [[projects]] + digest = "1:fb011abd58a582cf867409273f372fc6437eda670ff02055c47e6203e90466d7" name = "github.com/sirupsen/logrus" packages = ["."] + pruneopts = "UT" revision = "89742aefa4b206dcf400792f3bd35b542998eb3b" [[projects]] + digest = "1:c10331981912057a246099d926a3f9513cbac59c17c4a05919b7177edb1bed46" name = "github.com/spf13/afero" packages = [ ".", "mem", - "sftp" + "sftp", ] + pruneopts = "UT" revision = "b28a7effac979219c2a2ed6205a4d70e4b1bcd02" [[projects]] + digest = "1:0795f190d861516d86f1ce7bfedf33f60034b0607984df43cd63b6f2b9730442" name = "github.com/spf13/cast" packages = ["."] + pruneopts = "UT" revision = "e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63" [[projects]] + digest = "1:6608ba6ada1ed3da6140612a1092ea85efa4493784120bf9ab1e19f45822d660" name = "github.com/spf13/cobra" packages = [ ".", - "doc" + "doc", ] + pruneopts = "UT" revision = "6644d46b81fa1831979c4cded0106e774e0ef0ab" [[projects]] + digest = "1:16c1437fdd40ea6e3419868c7ee065376bb36c660c63d86dc858bdf05d20033d" name = "github.com/spf13/jwalterweatherman" packages = ["."] + pruneopts = "UT" revision = "33c24e77fb80341fe7130ee7c594256ff08ccc46" [[projects]] + digest = "1:772bf4d1907ccb275aaa532ec6cb0d85fc61bd05648af28551590af3ea4e2d53" name = "github.com/spf13/pflag" packages = ["."] + pruneopts = "UT" revision = "4c012f6dcd9546820e378d0bdda4d8fc772cdfea" [[projects]] + digest = "1:46d7c8b4e894a52c758de95a458a0d832b82e7f6c741e952d91d22d5a998a878" name = "github.com/spf13/viper" packages = ["."] + pruneopts = "UT" revision = "7fb2782df3d83e0036cc89f461ed0422628776f4" [[projects]] + digest = "1:18752d0b95816a1b777505a97f71c7467a8445b8ffb55631a7bf779f6ba4fa83" name = "github.com/stretchr/testify" packages = ["assert"] + pruneopts = "UT" revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" version = "v1.2.2" [[projects]] branch = "master" + digest = "1:595e123593925253dd02152777ddb8cd42300c4f61e783e163b053802547c47c" name = "github.com/tent/http-link-go" packages = ["."] + pruneopts = "UT" revision = "ac974c61c2f990f4115b119354b5e0b47550e888" [[projects]] + digest = "1:a02bd33c56ab567d53246eeb40c76810c339af9fff7e43b5dd266f7d58d7ca4a" name = "github.com/ugorji/go" packages = ["codec"] + pruneopts = "UT" revision = "ded73eae5db7e7a0ef6f55aace87a2873c5d2b74" [[projects]] + digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" name = "github.com/urfave/cli" packages = ["."] + pruneopts = "UT" revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" version = "v1.20.0" [[projects]] + digest = "1:95bac5c45fe9ce7c48860b7c7b0f8bbd5fc83ab04fe64d05e25af43a1e328125" name = "github.com/vmware/govmomi" packages = [ ".", @@ -888,28 +1128,36 @@ "vim25/progress", "vim25/soap", "vim25/types", - "vim25/xml" + "vim25/xml", ] + pruneopts = "UT" revision = "0f82f03a2bbf14037d2331cf02f1d4157bbef6cc" [[projects]] + digest = "1:6c433fd8510cfde877f6599a7284246ee11829e6250205a29c86f6a8e1976829" name = "github.com/weaveworks/mesh" packages = ["."] + pruneopts = "UT" revision = "1f158d31de55abf9f97bbaa0a260e2b8023a3785" [[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:9580b1b079114140ade8cec957685344d14f00119e0241f6b369633cb346eeb3" name = "go.uber.org/zap" packages = [ ".", @@ -917,12 +1165,14 @@ "internal/bufferpool", "internal/color", "internal/exit", - "zapcore" + "zapcore", ] + pruneopts = "UT" revision = "eeedf312bc6c57391d84767a4cd413f02a917974" version = "v1.8.0" [[projects]] + digest = "1:bfbae90c318bcef3bb308779a591d3efce2b5bad37f4259595e69d530810d06f" name = "golang.org/x/crypto" packages = [ "curve25519", @@ -935,11 +1185,13 @@ "salsa20/salsa", "scrypt", "ssh", - "ssh/terminal" + "ssh/terminal", ] + pruneopts = "UT" revision = "81e90905daefcd6fd217b62423c0908922eadb30" [[projects]] + digest = "1:b2f8f3034a6ed8b65e948001480ac2154b1a3deaaca596302d242b100eabd1dd" name = "golang.org/x/net" packages = [ "context", @@ -953,30 +1205,36 @@ "lex/httplex", "proxy", "trace", - "websocket" + "websocket", ] + pruneopts = "UT" revision = "1c05540f6879653db88113bc4a2b70aec4bd491f" [[projects]] + digest = "1:ad764db92ed977f803ff0f59a7a957bf65cc4e8ae9dfd08228e1f54ea40392e0" name = "golang.org/x/oauth2" packages = [ ".", "google", "internal", "jws", - "jwt" + "jwt", ] + pruneopts = "UT" revision = "a6bd8cefa1811bd24b86f8902872e4e8225f74c4" [[projects]] + digest = "1:e1a85d3648114c446b2874647bf30f646a8594e7e4e45db87fe962aba60e51f5" name = "golang.org/x/sys" packages = [ "unix", - "windows" + "windows", ] + pruneopts = "UT" revision = "95c6576299259db960f6c5b9b69ea52422860fce" [[projects]] + digest = "1:16cd7c873369dc2c42155cad1bc9ea83409e52e3b68f185a3084fb6b84007465" name = "golang.org/x/text" packages = [ "cases", @@ -999,25 +1257,31 @@ "unicode/cldr", "unicode/norm", "unicode/rangetable", - "width" + "width", ] + pruneopts = "UT" revision = "b19bf474d317b857955b12035d2c5acb57ce8b01" [[projects]] + digest = "1:c9e7a4b4d47c0ed205d257648b0e5b0440880cb728506e318f8ac7cd36270bc4" name = "golang.org/x/time" packages = ["rate"] + pruneopts = "UT" revision = "fbb02b2291d28baffd63558aa44b4b56f178d650" [[projects]] + digest = "1:3dd8cbd912666a80bce62b0b6e2e6c664cd8e56935c5498997000042961a6e6f" name = "golang.org/x/tools" packages = [ "go/ast/astutil", "go/vcs", - "imports" + "imports", ] + pruneopts = "UT" revision = "2382e3994d48b1d22acc2c86bcad0a2aff028e32" [[projects]] + digest = "1:8e47de3520b837dee07c5a3b500140e3ba49a5181e3b0ba5aa18aa7335babddd" name = "google.golang.org/api" packages = [ "compute/v0.alpha", @@ -1031,11 +1295,13 @@ "iam/v1", "oauth2/v2", "storage/v1", - "tpu/v1alpha1" + "tpu/v1alpha1", ] + pruneopts = "UT" revision = "7f657476956314fee258816aaf81c0ff65cf8bee" [[projects]] + digest = "1:a48f97fb737d5d61cf13e81cfef040942d217d086766b823757d39d4f6a4c547" name = "google.golang.org/appengine" packages = [ ".", @@ -1047,20 +1313,24 @@ "internal/modules", "internal/remote_api", "internal/urlfetch", - "urlfetch" + "urlfetch", ] + pruneopts = "UT" revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a" version = "v1.0.0" [[projects]] + digest = "1:0efcfe82e59b828eb6f4115bba88ff45c0898c38e823fbe7f450bdffed9e739b" name = "google.golang.org/genproto" packages = [ "googleapis/api/annotations", - "googleapis/rpc/status" + "googleapis/rpc/status", ] + pruneopts = "UT" revision = "09f6ed296fc66555a25fe4ce95173148778dfa85" [[projects]] + digest = "1:45101b53b1b93d50e2464e3b164bfa72cc77229fb998cfcd029987006488c641" name = "google.golang.org/grpc" packages = [ ".", @@ -1080,60 +1350,76 @@ "stats", "status", "tap", - "transport" + "transport", ] + pruneopts = "UT" revision = "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" [[projects]] + digest = "1:81e285039f8cfb5660c3a07858b40884f80df28486953e6bf845405b306f2487" name = "gopkg.in/gcfg.v1" packages = [ ".", "scanner", "token", - "types" + "types", ] + pruneopts = "UT" revision = "27e4946190b4a327b539185f2b5b1f7c84730728" [[projects]] + digest = "1:ef72505cf098abdd34efeea032103377bec06abb61d8a06f002d5d296a4b1185" name = "gopkg.in/inf.v0" packages = ["."] + pruneopts = "UT" revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" [[projects]] branch = "v2" + digest = "1:9e8ac8aa4f4c5557ba0b03a55d407b07b7030ed552b437a9dc7e5ec90f16ab39" name = "gopkg.in/mgo.v2" packages = [ "bson", - "internal/json" + "internal/json", ] + pruneopts = "UT" revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655" [[projects]] + digest = "1:74075f052f91808a4299b45b231aa5f7e2ccd3bac4ec4a5f832468485d91b9d3" name = "gopkg.in/natefinch/lumberjack.v2" packages = ["."] + pruneopts = "UT" revision = "20b71e5b60d756d3d2f80def009790325acc2b23" [[projects]] + digest = "1:8e25bcc2396ea16e2ffe92b0e0919d5ff7fb1d6870ef084009a0ce273b31f5d2" name = "gopkg.in/square/go-jose.v2" packages = [ ".", "cipher", "json", - "jwt" + "jwt", ] + pruneopts = "UT" revision = "76dd09796242edb5b897103a75df2645c028c960" [[projects]] + digest = "1:9df3443440bf95dc72f21ffc33300eca3975edf4b899af969a577879afe551de" name = "gopkg.in/warnings.v0" packages = ["."] + pruneopts = "UT" revision = "8a331561fe74dadba6edfc59f3be66c22c3b065d" [[projects]] + digest = "1:fa62cd569ff15e4dba6dfc6d826e97a7913ef299eccd5804c9d614a84863e485" name = "gopkg.in/yaml.v2" packages = ["."] + pruneopts = "UT" revision = "670d4cfef0544295bc27a114dbac37980d83185a" [[projects]] + digest = "1:204e72d9b0878322f1ab82e5a6a613bfde2bbbe2e501e0683fbf65209326a4b2" name = "k8s.io/api" packages = [ "admission/v1beta1", @@ -1165,18 +1451,22 @@ "settings/v1alpha1", "storage/v1", "storage/v1alpha1", - "storage/v1beta1" + "storage/v1beta1", ] + pruneopts = "UT" revision = "73d903622b7391f3312dcbac6483fed484e185f8" - version = "kubernetes-1.10.0" + version = "kubernetes-1.10.1" [[projects]] + digest = "1:148201ffd91a8adab27a1fdb9c8988238e4c3f587558f08adb53d8e2aab09629" name = "k8s.io/apiextensions-apiserver" packages = ["pkg/features"] + pruneopts = "UT" revision = "4347b330d0ff094db860f2f75fa725b4f4b53618" version = "kubernetes-1.10.1" [[projects]] + digest = "1:d4e17699250f8cb1d6120a527a33c54c197a54cfa6394f764be5eeddcef7e781" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", @@ -1236,12 +1526,14 @@ "pkg/watch", "third_party/forked/golang/json", "third_party/forked/golang/netutil", - "third_party/forked/golang/reflect" + "third_party/forked/golang/reflect", ] + pruneopts = "UT" revision = "302974c03f7e50f16561ba237db776ab93594ef6" - version = "kubernetes-1.10.0" + version = "kubernetes-1.10.1" [[projects]] + digest = "1:88fb3e20e1243e97a0c17a3960647e251fecee83d702aa278564b6af659829ff" name = "k8s.io/apiserver" packages = [ "pkg/admission", @@ -1330,12 +1622,14 @@ "plugin/pkg/audit/log", "plugin/pkg/audit/webhook", "plugin/pkg/authenticator/token/webhook", - "plugin/pkg/authorizer/webhook" + "plugin/pkg/authorizer/webhook", ] + pruneopts = "UT" revision = "06e4be4fafa2c9356e02424aac4e714e2ebeff60" version = "kubernetes-1.10.1" [[projects]] + digest = "1:ac2b77e5b528a1a035455afc6095b88b987b622c7912f4148d52f470311e98e5" name = "k8s.io/client-go" packages = [ "discovery", @@ -1507,11 +1801,13 @@ "util/integer", "util/jsonpath", "util/retry", - "util/workqueue" + "util/workqueue", ] + pruneopts = "UT" revision = "23781f4d6632d88e869066eaebb743857aa1ef9b" [[projects]] + digest = "1:b6d40560bfc8ef1300dbec6fae898810b59f26b1fd62d16692ab9befe8694dfc" name = "k8s.io/code-generator" packages = [ "cmd/client-gen", @@ -1531,12 +1827,14 @@ "cmd/defaulter-gen/args", "cmd/openapi-gen", "cmd/openapi-gen/args", - "pkg/util" + "pkg/util", ] + pruneopts = "T" revision = "7ead8f38b01cf8653249f5af80ce7b2c8aba12e2" - version = "kubernetes-1.10.0" + version = "kubernetes-1.10.1" [[projects]] + digest = "1:53e84052118027b435227562394fce46d0aad0071ecbe62f8a7a6290b83f104b" name = "k8s.io/gengo" packages = [ "args", @@ -1546,17 +1844,21 @@ "generator", "namer", "parser", - "types" + "types", ] + pruneopts = "UT" revision = "01a732e01d00cb9a81bb0ca050d3e6d2b947927b" [[projects]] + digest = "1:2578ea84d8555a62f49e5f750848ec5d3bad2e5ba9e3977186e407c7501d3b95" name = "k8s.io/helm" packages = ["pkg/strvals"] + pruneopts = "UT" revision = "f6025bb9ee7daf9fee0026541c90a6f557a3e0bc" version = "v2.9.0" [[projects]] + digest = "1:19d1096c4026b46447eef210d141c62d2fa4982f5b622bc583c997c608a8b085" name = "k8s.io/kube-openapi" packages = [ "pkg/builder", @@ -1565,11 +1867,13 @@ "pkg/handler", "pkg/util", "pkg/util/proto", - "pkg/util/proto/validation" + "pkg/util/proto/validation", ] + pruneopts = "UT" revision = "f442ecb314a3679150c272e2b9713d8deed5955d" [[projects]] + digest = "1:f6aae537480b951f2f79ea592d320215068dd7832c5efeec5705b79e2a448067" name = "k8s.io/kubernetes" packages = [ "pkg/api/events", @@ -1761,12 +2065,14 @@ "pkg/volume/util", "pkg/volume/util/fs", "pkg/volume/util/recyclerclient", - "pkg/volume/util/types" + "pkg/volume/util/types", ] + pruneopts = "UT" revision = "d4ab47518836c750f9949b9e0d387f20fb92260b" version = "v1.10.1" [[projects]] + digest = "1:aaa6698d86f29b0730337f1f93fdcf609368ee43d45ef21a97f17edbcf6b879e" name = "k8s.io/metrics" packages = [ "pkg/apis/metrics", @@ -1775,24 +2081,206 @@ "pkg/client/clientset_generated/clientset", "pkg/client/clientset_generated/clientset/scheme", "pkg/client/clientset_generated/clientset/typed/metrics/v1alpha1", - "pkg/client/clientset_generated/clientset/typed/metrics/v1beta1" + "pkg/client/clientset_generated/clientset/typed/metrics/v1beta1", ] + pruneopts = "UT" revision = "1d3591006285def21d4916b30baa731dcccc6570" version = "kubernetes-1.10.1" [[projects]] + digest = "1:867d98a27033c52150eb4c01ca0f9be938d3010e9a4909ea3a881a83c3ac1b3f" name = "k8s.io/utils" packages = ["exec"] + pruneopts = "UT" revision = "258e2a2fa64568210fbd6267cf1d8fd87c3cb86e" [[projects]] + digest = "1:96f9b7c99c55e6063371088376d57d398f42888dedd08ab5d35065aba11e3965" name = "vbom.ml/util" packages = ["sortorder"] + pruneopts = "UT" revision = "db5cfe13f5cc80a4990d98e2e1b0707a4d1a5394" [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "beec19a74f2c84d0145bc939f8ba818026636435f1407cfac67dcda528df9f96" + input-imports = [ + "cloud.google.com/go/compute/metadata", + "github.com/MakeNowJust/heredoc", + "github.com/Masterminds/sprig", + "github.com/aws/aws-sdk-go/aws", + "github.com/aws/aws-sdk-go/aws/awserr", + "github.com/aws/aws-sdk-go/aws/client", + "github.com/aws/aws-sdk-go/aws/credentials", + "github.com/aws/aws-sdk-go/aws/ec2metadata", + "github.com/aws/aws-sdk-go/aws/endpoints", + "github.com/aws/aws-sdk-go/aws/request", + "github.com/aws/aws-sdk-go/aws/session", + "github.com/aws/aws-sdk-go/service/autoscaling", + "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface", + "github.com/aws/aws-sdk-go/service/cloudformation", + "github.com/aws/aws-sdk-go/service/ec2", + "github.com/aws/aws-sdk-go/service/ec2/ec2iface", + "github.com/aws/aws-sdk-go/service/elb", + "github.com/aws/aws-sdk-go/service/elb/elbiface", + "github.com/aws/aws-sdk-go/service/iam", + "github.com/aws/aws-sdk-go/service/iam/iamiface", + "github.com/aws/aws-sdk-go/service/route53", + "github.com/aws/aws-sdk-go/service/route53/route53iface", + "github.com/aws/aws-sdk-go/service/s3", + "github.com/bazelbuild/bazel-gazelle/cmd/gazelle", + "github.com/blang/semver", + "github.com/coreos/etcd/client", + "github.com/denverdino/aliyungo/common", + "github.com/denverdino/aliyungo/ecs", + "github.com/denverdino/aliyungo/ess", + "github.com/denverdino/aliyungo/oss", + "github.com/denverdino/aliyungo/ram", + "github.com/denverdino/aliyungo/slb", + "github.com/digitalocean/godo", + "github.com/digitalocean/godo/context", + "github.com/docker/engine-api/client", + "github.com/docker/engine-api/types", + "github.com/fullsailor/pkcs7", + "github.com/ghodss/yaml", + "github.com/go-ini/ini", + "github.com/go-openapi/spec", + "github.com/gogo/protobuf/gogoproto", + "github.com/gogo/protobuf/proto", + "github.com/gogo/protobuf/sortkeys", + "github.com/golang/glog", + "github.com/golang/protobuf/proto", + "github.com/google/cadvisor/pages/static", + "github.com/gophercloud/gophercloud", + "github.com/gophercloud/gophercloud/openstack", + "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes", + "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs", + "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints", + "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups", + "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers", + "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups", + "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules", + "github.com/gophercloud/gophercloud/openstack/networking/v2/networks", + "github.com/gophercloud/gophercloud/openstack/networking/v2/ports", + "github.com/gophercloud/gophercloud/openstack/networking/v2/subnets", + "github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers", + "github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects", + "github.com/gophercloud/gophercloud/pagination", + "github.com/gorilla/mux", + "github.com/hashicorp/hcl/hcl/ast", + "github.com/hashicorp/hcl/hcl/printer", + "github.com/hashicorp/hcl/json/parser", + "github.com/jpillora/backoff", + "github.com/jteeuwen/go-bindata/go-bindata", + "github.com/kubernetes-incubator/apiserver-builder/cmd/apiregister-gen", + "github.com/kubernetes-incubator/apiserver-builder/cmd/apiserver-boot", + "github.com/kubernetes-incubator/reference-docs/gen-apidocs", + "github.com/miekg/coredns/middleware/etcd/msg", + "github.com/miekg/dns", + "github.com/pborman/uuid", + "github.com/pkg/errors", + "github.com/pkg/sftp", + "github.com/prometheus/client_golang/prometheus", + "github.com/prometheus/client_golang/prometheus/promhttp", + "github.com/sergi/go-diff/diffmatchpatch", + "github.com/spf13/cobra", + "github.com/spf13/cobra/doc", + "github.com/spf13/pflag", + "github.com/spf13/viper", + "github.com/stretchr/testify/assert", + "github.com/urfave/cli", + "github.com/vmware/govmomi", + "github.com/vmware/govmomi/find", + "github.com/vmware/govmomi/object", + "github.com/vmware/govmomi/property", + "github.com/vmware/govmomi/vim25", + "github.com/vmware/govmomi/vim25/mo", + "github.com/vmware/govmomi/vim25/soap", + "github.com/vmware/govmomi/vim25/types", + "github.com/weaveworks/mesh", + "go.uber.org/zap", + "golang.org/x/crypto/ssh", + "golang.org/x/net/context", + "golang.org/x/oauth2", + "golang.org/x/oauth2/google", + "google.golang.org/api/compute/v0.beta", + "google.golang.org/api/compute/v1", + "google.golang.org/api/dns/v1", + "google.golang.org/api/googleapi", + "google.golang.org/api/iam/v1", + "google.golang.org/api/oauth2/v2", + "google.golang.org/api/storage/v1", + "gopkg.in/gcfg.v1", + "gopkg.in/yaml.v2", + "k8s.io/api/core/v1", + "k8s.io/api/extensions/v1beta1", + "k8s.io/api/rbac/v1beta1", + "k8s.io/apimachinery/pkg/api/errors", + "k8s.io/apimachinery/pkg/api/meta", + "k8s.io/apimachinery/pkg/api/resource", + "k8s.io/apimachinery/pkg/api/validation", + "k8s.io/apimachinery/pkg/apimachinery/announced", + "k8s.io/apimachinery/pkg/apimachinery/registered", + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/conversion", + "k8s.io/apimachinery/pkg/fields", + "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/errors", + "k8s.io/apimachinery/pkg/util/intstr", + "k8s.io/apimachinery/pkg/util/net", + "k8s.io/apimachinery/pkg/util/sets", + "k8s.io/apimachinery/pkg/util/uuid", + "k8s.io/apimachinery/pkg/util/validation", + "k8s.io/apimachinery/pkg/util/validation/field", + "k8s.io/apimachinery/pkg/util/wait", + "k8s.io/apimachinery/pkg/version", + "k8s.io/apimachinery/pkg/watch", + "k8s.io/apiserver/pkg/authentication/user", + "k8s.io/apiserver/pkg/endpoints/request", + "k8s.io/apiserver/pkg/registry/generic", + "k8s.io/apiserver/pkg/registry/generic/registry", + "k8s.io/apiserver/pkg/registry/rest", + "k8s.io/apiserver/pkg/server", + "k8s.io/apiserver/pkg/server/options", + "k8s.io/apiserver/pkg/storage", + "k8s.io/apiserver/pkg/storage/names", + "k8s.io/apiserver/pkg/storage/storagebackend", + "k8s.io/apiserver/pkg/util/logs", + "k8s.io/client-go/discovery", + "k8s.io/client-go/discovery/fake", + "k8s.io/client-go/kubernetes", + "k8s.io/client-go/kubernetes/fake", + "k8s.io/client-go/plugin/pkg/client/auth", + "k8s.io/client-go/rest", + "k8s.io/client-go/testing", + "k8s.io/client-go/tools/clientcmd", + "k8s.io/client-go/tools/clientcmd/api", + "k8s.io/client-go/tools/clientcmd/api/v1", + "k8s.io/client-go/util/flowcontrol", + "k8s.io/client-go/util/homedir", + "k8s.io/code-generator/cmd/client-gen", + "k8s.io/code-generator/cmd/conversion-gen", + "k8s.io/code-generator/cmd/deepcopy-gen", + "k8s.io/code-generator/cmd/defaulter-gen", + "k8s.io/code-generator/cmd/openapi-gen", + "k8s.io/helm/pkg/strvals", + "k8s.io/kube-openapi/pkg/common", + "k8s.io/kubernetes/pkg/client/metrics/prometheus", + "k8s.io/kubernetes/pkg/cloudprovider/providers/aws", + "k8s.io/kubernetes/pkg/cloudprovider/providers/gce", + "k8s.io/kubernetes/pkg/kubectl/cmd", + "k8s.io/kubernetes/pkg/kubectl/cmd/templates", + "k8s.io/kubernetes/pkg/kubectl/cmd/util", + "k8s.io/kubernetes/pkg/kubectl/cmd/util/editor", + "k8s.io/kubernetes/pkg/kubectl/resource", + "k8s.io/kubernetes/pkg/kubectl/util/i18n", + "k8s.io/kubernetes/pkg/util/mount", + "k8s.io/utils/exec", + ] solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 7c6f4d7369..1c7c1041c9 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -133,7 +133,7 @@ required = [ revision = "020d11c3b9c0c7a3c2efcc8e5cf5b9ef7bcea21f" [[override]] name = "github.com/gophercloud/gophercloud" - revision = "6da026c32e2d622cc242d32984259c77237aefe1" + revision = "f29afc2cceca860199ee88cd355a4d0a37b3fad2" [[override]] name = "gopkg.in/warnings.v0" revision = "8a331561fe74dadba6edfc59f3be66c22c3b065d" diff --git a/Makefile b/Makefile index d5745d847c..191149319a 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ TESTABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/vendor" hack/.packages) GOVETABLE_PACKAGES:=$(shell egrep -v "k8s.io/kops/cloudmock|k8s.io/kops/vendor|clientset/fake" hack/.packages) BAZEL_OPTIONS?= API_OPTIONS?= +GCFLAGS?= # See http://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile MAKEDIR:=$(strip $(shell dirname "$(realpath $(lastword $(MAKEFILE_LIST)))")) @@ -53,7 +54,7 @@ unexport KOPS_BASE_URL KOPS_CLUSTER_NAME KOPS_RUN_OBSOLETE_VERSION KOPS_STATE_ST unexport SKIP_REGION_CHECK S3_ACCESS_KEY_ID S3_ENDPOINT S3_REGION S3_SECRET_ACCESS_KEY VSPHERE_USERNAME VSPHERE_PASSWORD # Keep in sync with upup/models/cloudup/resources/addons/dns-controller/ -DNS_CONTROLLER_TAG=1.10.0-beta.1 +DNS_CONTROLLER_TAG=1.10.0 # Keep in sync with logic in get_workspace_status # TODO: just invoke tools/get_workspace_status.sh? @@ -121,9 +122,14 @@ ifndef SHASUMCMD $(error "Neither sha1sum nor shasum command is available") endif +# Set compiler flags to allow binary debugging +ifdef DEBUGGABLE + GCFLAGS=-gcflags "all=-N -l" +endif + .PHONY: kops-install # Install kops to local $GOPATH/bin kops-install: gobindata-tool ${BINDATA_TARGETS} - go install ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/ + go install ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" k8s.io/kops/cmd/kops/ .PHONY: channels-install # Install channels to local $GOPATH/bin channels-install: ${CHANNELS} @@ -174,11 +180,11 @@ kops: ${KOPS} .PHONY: ${KOPS} ${KOPS}: ${BINDATA_TARGETS} - go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/cmd/kops/ + go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA} ${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/cmd/kops/ ${GOBINDATA}: mkdir -p ${LOCAL} - go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata + go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS}" -o $@ k8s.io/kops/vendor/github.com/jteeuwen/go-bindata/go-bindata .PHONY: gobindata-tool gobindata-tool: ${GOBINDATA} @@ -209,13 +215,13 @@ check-builds-in-go110: .PHONY: codegen codegen: kops-gobindata go install k8s.io/kops/upup/tools/generators/... - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/awstasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/gcetasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/dotasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/openstacktasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/cloudup/alitasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/assettasks - PATH=${GOPATH_1ST}/bin:${PATH} go generate k8s.io/kops/upup/pkg/fi/fitasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/awstasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/gcetasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/dotasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/openstacktasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/alitasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/assettasks + PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/fitasks .PHONY: protobuf protobuf: @@ -232,7 +238,7 @@ test: ${BINDATA_TARGETS} # Run tests locally .PHONY: ${DIST}/linux/amd64/nodeup ${DIST}/linux/amd64/nodeup: ${BINDATA_TARGETS} mkdir -p ${DIST} - GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup + GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/nodeup .PHONY: crossbuild-nodeup crossbuild-nodeup: ${DIST}/linux/amd64/nodeup @@ -246,17 +252,17 @@ crossbuild-nodeup-in-docker: .PHONY: ${DIST}/darwin/amd64/kops ${DIST}/darwin/amd64/kops: ${BINDATA_TARGETS} mkdir -p ${DIST} - GOOS=darwin GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops + GOOS=darwin GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops .PHONY: ${DIST}/linux/amd64/kops ${DIST}/linux/amd64/kops: ${BINDATA_TARGETS} mkdir -p ${DIST} - GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops + GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops .PHONY: ${DIST}/windows/amd64/kops.exe ${DIST}/windows/amd64/kops.exe: ${BINDATA_TARGETS} mkdir -p ${DIST} - GOOS=windows GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops + GOOS=windows GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops .PHONY: crossbuild @@ -376,7 +382,7 @@ push-aws-run: push .PHONY: ${PROTOKUBE} ${PROTOKUBE}: - go build -o $@ -tags 'peer_name_alternative peer_name_hash' k8s.io/kops/protokube/cmd/protokube + go build ${GCFLAGS} -o $@ -tags 'peer_name_alternative peer_name_hash' k8s.io/kops/protokube/cmd/protokube .PHONY: protokube protokube: ${PROTOKUBE} @@ -412,7 +418,7 @@ nodeup: ${NODEUP} .PHONY: ${NODEUP} ${NODEUP}: ${BINDATA_TARGETS} - go build ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" -o $@ k8s.io/kops/cmd/nodeup + go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops.Version=${VERSION} -X k8s.io/kops.GitVersion=${GITSHA}" -o $@ k8s.io/kops/cmd/nodeup .PHONY: nodeup-dist nodeup-dist: @@ -426,7 +432,7 @@ nodeup-dist: .PHONY: dns-controller-gocode dns-controller-gocode: - go install -tags 'peer_name_alternative peer_name_hash' ${LDFLAGS}"${EXTRA_LDFLAGS} -X main.BuildVersion=${DNS_CONTROLLER_TAG}" k8s.io/kops/dns-controller/cmd/dns-controller + go install ${GCFLAGS} -tags 'peer_name_alternative peer_name_hash' ${LDFLAGS}"${EXTRA_LDFLAGS} -X main.BuildVersion=${DNS_CONTROLLER_TAG}" k8s.io/kops/dns-controller/cmd/dns-controller .PHONY: dns-controller-builder-image dns-controller-builder-image: @@ -459,14 +465,21 @@ utils-dist: .PHONY: dep-prereqs dep-prereqs: (which hg > /dev/null) || (echo "dep requires that mercurial is installed"; exit 1) + (which dep > /dev/null) || (echo "dep-ensure requires that dep is installed"; exit 1) + (which bazel > /dev/null) || (echo "dep-ensure requires that bazel is installed"; exit 1) .PHONY: dep-ensure dep-ensure: dep-prereqs dep ensure -v + # Switch weavemesh to use peer_name_hash - bazel rule-go doesn't support build tags yet + rm vendor/github.com/weaveworks/mesh/peer_name_mac.go + sed -i -e 's/peer_name_hash/!peer_name_mac/g' vendor/github.com/weaveworks/mesh/peer_name_hash.go + # Remove all bazel build files that were vendored and regenerate (we assume they are go-gettable) find vendor/ -name "BUILD" -delete find vendor/ -name "BUILD.bazel" -delete bazel run //:gazelle -- -proto disable + .PHONY: gofmt gofmt: gofmt -w -s channels/ @@ -511,12 +524,16 @@ verify-gofmt: verify-packages: ${BINDATA_TARGETS} hack/verify-packages.sh +# find release notes, remove PR titles and output the rest to .build, then run misspell on all files .PHONY: verify-misspelling verify-misspelling: @which misspell 2>/dev/null ; if [ $$? -eq 1 ]; then \ go get -u github.com/client9/misspell/cmd/misspell; \ fi - @find . -type f \( -name "*.go*" -o -name "*.md*" \) -a \( -not -path "./vendor/*" -not -path "./_vendor/*" \) | \ + @mkdir -p .build/docs + @find . -type f \( -name "*.go*" -o -name "*.md*" \) -a -path "./docs/releases/*" -exec basename {} \; | \ + xargs -I{} sh -c 'sed -e "/^\* .*github.com\/kubernetes\/kops\/pull/d" docs/releases/{} > .build/docs/$(basename {})' + @find . -type f \( -name "*.go*" -o -name "*.md*" \) -a \( -not -path "./vendor/*" -not -path "./_vendor/*" -not -path "./docs/releases/*" \) | \ sed -e /README-ES.md/d -e /node_modules/d | \ xargs misspell -error @@ -556,7 +573,7 @@ channels: ${CHANNELS} .PHONY: ${CHANNELS} ${CHANNELS}: - go build ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} ${EXTRA_LDFLAGS}" k8s.io/kops/channels/cmd/channels + go build ${GCFLAGS} ${EXTRA_BUILDFLAGS} -o $@ ${LDFLAGS}"-X k8s.io/kops.Version=${VERSION} ${EXTRA_LDFLAGS}" k8s.io/kops/channels/cmd/channels # -------------------------------------------------- # release tasks @@ -615,7 +632,7 @@ verify-apimachinery: .PHONY: kops-server-docker-compile kops-server-docker-compile: - GOOS=linux GOARCH=amd64 go build -a ${EXTRA_BUILDFLAGS} -o ${DIST}/linux/amd64/kops-server ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops-server.Version=${VERSION} -X k8s.io/kops-server.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops-server + GOOS=linux GOARCH=amd64 go build ${GCFLAGS} -a ${EXTRA_BUILDFLAGS} -o ${DIST}/linux/amd64/kops-server ${LDFLAGS}"${EXTRA_LDFLAGS} -X k8s.io/kops-server.Version=${VERSION} -X k8s.io/kops-server.GitVersion=${GITSHA}" k8s.io/kops/cmd/kops-server .PHONY: kops-server-build kops-server-build: diff --git a/OWNERS b/OWNERS index da3b4938f6..c213872dce 100644 --- a/OWNERS +++ b/OWNERS @@ -8,3 +8,4 @@ approvers: - mikesplain reviewers: - robinpercy + - chrisz100 diff --git a/README.md b/README.md index 02f6d57c9d..430b2917c7 100644 --- a/README.md +++ b/README.md @@ -84,12 +84,13 @@ Kubernetes version. #### Compatibility Matrix -| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x | k8s 1.9.x | -|--------------|-----------|-----------|-----------|-----------|-----------| -| 1.9.x | Y | Y | Y | Y | Y | -| 1.8.x | Y | Y | Y | Y | N | -| 1.7.x | Y | Y | Y | N | N | -| 1.6.x | Y | Y | N | N | N | +| kops version | k8s 1.5.x | k8s 1.6.x | k8s 1.7.x | k8s 1.8.x | k8s 1.9.x | k8s 1.10.x | +|--------------|-----------|-----------|-----------|-----------|-----------|------------| +| 1.10.x | Y | Y | Y | Y | Y | Y | +| 1.9.x | Y | Y | Y | Y | Y | N | +| 1.8.x | Y | Y | Y | Y | N | N | +| 1.7.x | Y | Y | Y | N | N | N | +| 1.6.x | Y | Y | N | N | N | N | Use the latest version of kops for all releases of Kubernetes, with the caveat that higher versions of Kubernetes are not _officially_ supported by kops. diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS index 4ba6942522..0aa93f80de 100644 --- a/SECURITY_CONTACTS +++ b/SECURITY_CONTACTS @@ -12,3 +12,4 @@ justinsb chrislovecnm +geojaz \ No newline at end of file diff --git a/addons/cluster-autoscaler/cluster-autoscaler.sh b/addons/cluster-autoscaler/cluster-autoscaler.sh index 0f944ae8c9..9b021bb6df 100755 --- a/addons/cluster-autoscaler/cluster-autoscaler.sh +++ b/addons/cluster-autoscaler/cluster-autoscaler.sh @@ -73,14 +73,14 @@ EOF ASG_POLICY_NAME=aws-cluster-autoscaler unset TESTOUTPUT -TESTOUTPUT=$(aws iam list-policies | jq -r '.Policies[] | select(.PolicyName == "aws-cluster-autoscaler") | .Arn') +TESTOUTPUT=$(aws iam list-policies --output json | jq -r '.Policies[] | select(.PolicyName == "aws-cluster-autoscaler") | .Arn') if [[ $? -eq 0 && -n "$TESTOUTPUT" ]] then printf " ✅ Policy already exists\n" ASG_POLICY_ARN=$TESTOUTPUT else printf " ✅ Policy does not yet exist, creating now.\n" - ASG_POLICY=$(aws iam create-policy --policy-name $ASG_POLICY_NAME --policy-document file://asg-policy.json) + ASG_POLICY=$(aws iam create-policy --policy-name $ASG_POLICY_NAME --policy-document file://asg-policy.json --output json) ASG_POLICY_ARN=$(echo $ASG_POLICY | jq -r '.Policy.Arn') printf " ✅ \n" fi diff --git a/addons/ingress-nginx/README.md b/addons/ingress-nginx/README.md index 3b1f37a2f0..42816bcd0b 100644 --- a/addons/ingress-nginx/README.md +++ b/addons/ingress-nginx/README.md @@ -1,4 +1,14 @@ +## Deployment +### AWS +``` +kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-nginx/v1.6.0.yaml +``` + +### GCE +``` +kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons/ingress-nginx/v1.6.0-gce.yaml +``` ## Creating a simple ingress diff --git a/addons/ingress-nginx/v1.6.0-gce.yaml b/addons/ingress-nginx/v1.6.0-gce.yaml index 21dd39b4f6..5fc6de1b63 100644 --- a/addons/ingress-nginx/v1.6.0-gce.yaml +++ b/addons/ingress-nginx/v1.6.0-gce.yaml @@ -194,7 +194,7 @@ spec: terminationGracePeriodSeconds: 60 containers: - name: default-http-backend - image: k8s.gcr.io/defaultbackend:1.3 + image: k8s.gcr.io/defaultbackend:1.4 livenessProbe: httpGet: path: /healthz @@ -236,6 +236,8 @@ metadata: labels: k8s-addon: ingress-nginx.addons.k8s.io spec: + # Forces nodes without Service endpoints to remove themselves from the list of nodes eligible. See https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-loadbalancer + externalTrafficPolicy: Local type: LoadBalancer selector: app: ingress-nginx @@ -272,7 +274,7 @@ spec: terminationGracePeriodSeconds: 60 serviceAccountName: nginx-ingress-controller containers: - - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0 + - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0 name: nginx-ingress-controller imagePullPolicy: Always ports: diff --git a/addons/ingress-nginx/v1.6.0.yaml b/addons/ingress-nginx/v1.6.0.yaml index fa8d73f62a..47d7a0c403 100644 --- a/addons/ingress-nginx/v1.6.0.yaml +++ b/addons/ingress-nginx/v1.6.0.yaml @@ -194,7 +194,7 @@ spec: terminationGracePeriodSeconds: 60 containers: - name: default-http-backend - image: k8s.gcr.io/defaultbackend:1.3 + image: k8s.gcr.io/defaultbackend:1.4 livenessProbe: httpGet: path: /healthz @@ -236,7 +236,10 @@ metadata: labels: k8s-addon: ingress-nginx.addons.k8s.io annotations: + # Enable PROXY protocol service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*' + # Increase the ELB idle timeout to avoid issues with WebSockets or Server-Sent Events. + service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600' spec: type: LoadBalancer selector: @@ -274,7 +277,7 @@ spec: terminationGracePeriodSeconds: 60 serviceAccountName: nginx-ingress-controller containers: - - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0 + - image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.18.0 name: nginx-ingress-controller imagePullPolicy: Always ports: diff --git a/addons/kube-ingress-aws-controller/README.md b/addons/kube-ingress-aws-controller/README.md index a182e3c1ea..0bf172ebe9 100644 --- a/addons/kube-ingress-aws-controller/README.md +++ b/addons/kube-ingress-aws-controller/README.md @@ -3,7 +3,7 @@ [Kube AWS Ingress Controller](https://github.com/zalando-incubator/kubernetes-on-aws) creates AWS Application Load Balancer (ALB) that is used to terminate TLS connections and use [AWS Certificate Manager (ACM)](https://aws.amazon.com/certificate-manager/) or -[AWS Identity and Access Management (IAM)](http://docs.aws.amazon.com/IAM/latest/APIReference/Welcome.html) +[AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/APIReference/Welcome.html) certificates. ALBs are used to route traffic to an Ingress http router for example [skipper](https://github.com/zalando/skipper/), which routes traffic to Kubernetes services and implements diff --git a/addons/kubernetes-dashboard/addon.yaml b/addons/kubernetes-dashboard/addon.yaml index 1cf7f71753..e3a40e48f5 100644 --- a/addons/kubernetes-dashboard/addon.yaml +++ b/addons/kubernetes-dashboard/addon.yaml @@ -45,4 +45,9 @@ spec: kubernetesVersion: ">=1.8.0" selector: k8s-addon: kubernetes-dashboard.addons.k8s.io - manifest: v1.8.3.yaml \ No newline at end of file + manifest: v1.8.3.yaml + - version: 1.10.0 + kubernetesVersion: ">=1.10.0" + selector: + k8s-addon: kubernetes-dashboard.addons.k8s.io + manifest: v1.10.0.yaml diff --git a/addons/kubernetes-dashboard/v1.10.0.yaml b/addons/kubernetes-dashboard/v1.10.0.yaml new file mode 100644 index 0000000000..f79097b855 --- /dev/null +++ b/addons/kubernetes-dashboard/v1.10.0.yaml @@ -0,0 +1,167 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Configuration to deploy release version of the Dashboard UI compatible with +# Kubernetes 1.10. +# +# Example usage: kubectl create -f + +# ------------------- Dashboard Secret ------------------- # + +apiVersion: v1 +kind: Secret +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard-certs + namespace: kube-system +type: Opaque + +--- +# ------------------- Dashboard Service Account ------------------- # + +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kube-system + +--- +# ------------------- Dashboard Role & Role Binding ------------------- # + +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: kubernetes-dashboard-minimal + namespace: kube-system +rules: + # Allow Dashboard to create 'kubernetes-dashboard-key-holder' secret. +- apiGroups: [""] + resources: ["secrets"] + verbs: ["create"] + # Allow Dashboard to create 'kubernetes-dashboard-settings' config map. +- apiGroups: [""] + resources: ["configmaps"] + verbs: ["create"] + # Allow Dashboard to get, update and delete Dashboard exclusive secrets. +- apiGroups: [""] + resources: ["secrets"] + resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs"] + verbs: ["get", "update", "delete"] + # Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map. +- apiGroups: [""] + resources: ["configmaps"] + resourceNames: ["kubernetes-dashboard-settings"] + verbs: ["get", "update"] + # Allow Dashboard to get metrics from heapster. +- apiGroups: [""] + resources: ["services"] + resourceNames: ["heapster"] + verbs: ["proxy"] +- apiGroups: [""] + resources: ["services/proxy"] + resourceNames: ["heapster", "http:heapster:", "https:heapster:"] + verbs: ["get"] + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: kubernetes-dashboard-minimal + namespace: kube-system +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: kubernetes-dashboard-minimal +subjects: +- kind: ServiceAccount + name: kubernetes-dashboard + namespace: kube-system + +--- +# ------------------- Dashboard Deployment ------------------- # + +kind: Deployment +apiVersion: apps/v1beta2 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kube-system +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + k8s-app: kubernetes-dashboard + template: + metadata: + labels: + k8s-app: kubernetes-dashboard + spec: + containers: + - name: kubernetes-dashboard + image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0 + ports: + - containerPort: 8443 + protocol: TCP + args: + - --auto-generate-certificates + # Uncomment the following line to manually specify Kubernetes API server Host + # If not specified, Dashboard will attempt to auto discover the API server and connect + # to it. Uncomment only if the default does not work. + # - --apiserver-host=http://my-address:port + volumeMounts: + - name: kubernetes-dashboard-certs + mountPath: /certs + # Create on-disk volume to store exec logs + - mountPath: /tmp + name: tmp-volume + livenessProbe: + httpGet: + scheme: HTTPS + path: / + port: 8443 + initialDelaySeconds: 30 + timeoutSeconds: 30 + volumes: + - name: kubernetes-dashboard-certs + secret: + secretName: kubernetes-dashboard-certs + - name: tmp-volume + emptyDir: {} + serviceAccountName: kubernetes-dashboard + # Comment the following tolerations if Dashboard must not be deployed on master + tolerations: + - key: node-role.kubernetes.io/master + effect: NoSchedule + +--- +# ------------------- Dashboard Service ------------------- # + +kind: Service +apiVersion: v1 +metadata: + labels: + k8s-app: kubernetes-dashboard + name: kubernetes-dashboard + namespace: kube-system +spec: + ports: + - port: 443 + targetPort: 8443 + selector: + k8s-app: kubernetes-dashboard diff --git a/addons/prometheus-operator/README.md b/addons/prometheus-operator/README.md index 38af5a0d12..2aa6f7ecfa 100644 --- a/addons/prometheus-operator/README.md +++ b/addons/prometheus-operator/README.md @@ -11,8 +11,8 @@ kubectl apply -f https://raw.githubusercontent.com/kubernetes/kops/master/addons ``` ### Updating the addon -Run the script bellow. +Run the script below. ```console addons/prometheus-operator/sync-repo.sh "v0.19.0" -``` \ No newline at end of file +``` diff --git a/channels/alpha b/channels/alpha index b1639ad13d..0a989f2d99 100644 --- a/channels/alpha +++ b/channels/alpha @@ -4,41 +4,44 @@ spec: - name: kope.io/k8s-1.4-debian-jessie-amd64-hvm-ebs-2017-07-28 providerID: aws kubernetesVersion: ">=1.4.0 <1.5.0" - - name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.5-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.5.0 <1.6.0" - - name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.6.0 <1.7.0" - - name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.7-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.7.0 <1.8.0" - - name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.8-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.8.0 <1.9.0" - - name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.9.0 <1.10.0" # Need stretch as default in 1.10 (for nvme) # BUT... this is causing the submit queue to block, so back to jessie temporarily: https://github.com/kubernetes/kubernetes/issues/56763 - - name: kope.io/k8s-1.10-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.10-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.10.0 <1.11.0" - - name: kope.io/k8s-1.11-debian-jessie-amd64-hvm-ebs-2018-05-27 + - name: kope.io/k8s-1.11-debian-jessie-amd64-hvm-ebs-2018-08-17 providerID: aws kubernetesVersion: ">=1.11.0" - providerID: gce - name: "cos-cloud/cos-stable-60-9592-90-0" + name: "cos-cloud/cos-stable-65-10323-99-0" cluster: kubernetesVersion: v1.5.8 networking: kubenet: {} kubernetesVersions: + - range: ">=1.11.0" + recommendedVersion: 1.11.2 + requiredVersion: 1.11.0 - range: ">=1.10.0" - recommendedVersion: 1.10.5 + recommendedVersion: 1.10.6 requiredVersion: 1.10.0 - range: ">=1.9.0" - recommendedVersion: 1.9.9 + recommendedVersion: 1.9.10 requiredVersion: 1.9.0 - range: ">=1.8.0" recommendedVersion: 1.8.15 @@ -56,18 +59,22 @@ spec: recommendedVersion: 1.4.12 requiredVersion: 1.4.2 kopsVersions: - - range: ">=1.10.0-alpha.1" - recommendedVersion: "1.10.0-beta.1" + - range: ">=1.11.0-alpha.1" + #recommendedVersion: "1.10.0" #requiredVersion: 1.10.0 - kubernetesVersion: 1.10.3 + kubernetesVersion: 1.11.2 + - range: ">=1.10.0-alpha.1" + recommendedVersion: "1.10.0" + #requiredVersion: 1.10.0 + kubernetesVersion: 1.10.6 - range: ">=1.9.0-alpha.1" recommendedVersion: 1.9.2 #requiredVersion: 1.9.0 - kubernetesVersion: 1.9.8 + kubernetesVersion: 1.9.10 - range: ">=1.8.0-alpha.1" recommendedVersion: 1.8.1 requiredVersion: 1.7.1 - kubernetesVersion: 1.8.13 + kubernetesVersion: 1.8.15 - range: ">=1.7.0-alpha.1" recommendedVersion: 1.8.1 requiredVersion: 1.7.1 diff --git a/channels/stable b/channels/stable index 083d7610cd..c16cda097d 100644 --- a/channels/stable +++ b/channels/stable @@ -32,13 +32,13 @@ spec: kubenet: {} kubernetesVersions: - range: ">=1.10.0" - recommendedVersion: 1.10.3 + recommendedVersion: 1.10.5 requiredVersion: 1.10.0 - range: ">=1.9.0" - recommendedVersion: 1.9.8 + recommendedVersion: 1.9.9 requiredVersion: 1.9.0 - range: ">=1.8.0" - recommendedVersion: 1.8.13 + recommendedVersion: 1.8.15 requiredVersion: 1.8.0 - range: ">=1.7.0" recommendedVersion: 1.7.16 @@ -54,11 +54,11 @@ spec: requiredVersion: 1.4.2 kopsVersions: - range: ">=1.10.0-alpha.1" - recommendedVersion: "1.10.0-beta.1" + recommendedVersion: "1.10.0" #requiredVersion: 1.10.0 kubernetesVersion: 1.10.3 - range: ">=1.9.0-alpha.1" - recommendedVersion: 1.9.0 + recommendedVersion: 1.9.2 #requiredVersion: 1.9.0 kubernetesVersion: 1.9.8 - range: ">=1.8.0-alpha.1" diff --git a/cmd/kops/lifecycle_integration_test.go b/cmd/kops/lifecycle_integration_test.go index 2041c8630e..efa7db25bc 100644 --- a/cmd/kops/lifecycle_integration_test.go +++ b/cmd/kops/lifecycle_integration_test.go @@ -108,6 +108,8 @@ func TestLifecyclePrivateSharedSubnet(t *testing.T) { func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptions, cloud *awsup.MockAWSCloud) { t := o.t + t.Logf("running lifecycle test for cluster %s", o.ClusterName) + var stdout bytes.Buffer inputYAML := "in-" + o.Version + ".yaml" @@ -217,6 +219,9 @@ func runLifecycleTest(h *testutils.IntegrationTestHarness, o *LifecycleTestOptio if ownership != expect { t.Errorf("unexpected kubernetes.io/cluster/ tag on %q: actual=%q expected=%q", id, ownership, expect) } + if legacy != "" { + t.Errorf("added (legacy) KubernetesCluster tag on %q, but it is shared", id) + } } else { switch resource { case "ami": diff --git a/dns-controller/cmd/dns-controller/main.go b/dns-controller/cmd/dns-controller/main.go index a60be447ed..49caa4403d 100644 --- a/dns-controller/cmd/dns-controller/main.go +++ b/dns-controller/cmd/dns-controller/main.go @@ -181,7 +181,7 @@ func main() { // initializeWatchers is responsible for creating the watchers func initializeWatchers(client kubernetes.Interface, dnsctl *dns.DNSController, namespace string, watchIngress bool) error { - glog.V(1).Info("initializing the watch controllers, namespace: %q", namespace) + glog.V(1).Infof("initializing the watch controllers, namespace: %q", namespace) nodeController, err := watchers.NewNodeController(client, dnsctl) if err != nil { diff --git a/dns-controller/pkg/dns/dnscontroller.go b/dns-controller/pkg/dns/dnscontroller.go index 96ba1fca7b..1246272c3a 100644 --- a/dns-controller/pkg/dns/dnscontroller.go +++ b/dns-controller/pkg/dns/dnscontroller.go @@ -600,7 +600,7 @@ func (s *DNSControllerScope) Replace(recordName string, records []Record) { delete(s.Records, recordName) } else { if recordsSliceEquals(existing, records) { - glog.V(6).Infof("skipping spurious update of record %s/%s=%s", s.ScopeName, recordName, records) + glog.V(6).Infof("skipping spurious update of record %s/%s=%+v", s.ScopeName, recordName, records) return } diff --git a/dnsprovider/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go b/dnsprovider/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go index b09155a6da..f7a75ed092 100644 --- a/dnsprovider/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go +++ b/dnsprovider/pkg/dnsprovider/providers/aws/route53/stubs/route53api.go @@ -37,7 +37,7 @@ type Route53API interface { } // Route53APIStub is a minimal implementation of Route53API, used primarily for unit testing. -// See http://http://docs.aws.amazon.com/sdk-for-go/api/service/route53.html for descriptions +// See https://docs.aws.amazon.com/sdk-for-go/api/service/route53/ // of all of its methods. type Route53APIStub struct { zones map[string]*route53.HostedZone diff --git a/docs/apireference/build/node_modules/node-static/README.md b/docs/apireference/build/node_modules/node-static/README.md index 70eec00c9e..bf490c80f5 100644 --- a/docs/apireference/build/node_modules/node-static/README.md +++ b/docs/apireference/build/node_modules/node-static/README.md @@ -95,7 +95,7 @@ require('http').createServer(function (request, response) { }).listen(8080); ``` -More on intercepting errors bellow. +More on intercepting errors below. ### Intercepting errors & Listening # diff --git a/docs/cluster_spec.md b/docs/cluster_spec.md index 43a9887211..6054b47a6b 100644 --- a/docs/cluster_spec.md +++ b/docs/cluster_spec.md @@ -76,6 +76,22 @@ etcdClusters: > __Note:__ The images for etcd that kops uses are from the Google Cloud Repository. Google doesn't release every version of etcd to the gcr. Check that the version of etcd you want to use is available [at the gcr](https://console.cloud.google.com/gcr/images/google-containers/GLOBAL/etcd?gcrImageListsize=50) before using it in your cluster spec. +By default, the Volumes created for the etcd clusters are 20GB each. They can be adjusted via the `volumeSize` parameter. + +```yaml +etcdClusters: +- etcdMembers: + - instanceGroup: master-us-east-1a + name: a + volumeSize: 5 + name: main +- etcdMembers: + - instanceGroup: master-us-east-1a + name: a + volumeSize: 5 + name: events +``` + ### sshAccess This array configures the CIDRs that are able to ssh into nodes. On AWS this is manifested as inbound security group rules on the `nodes` and `master` security groups. @@ -464,13 +480,13 @@ spec: ### fileAssets -FileAssets is an alpha feature which permits you to place inline file content into the cluster and instanceGroup specification. It's desiginated as alpha as you can probably do this via kubernetes daemonsets as an alternative. +FileAssets is an alpha feature which permits you to place inline file content into the cluster and instanceGroup specification. It's designated as alpha as you can probably do this via kubernetes daemonsets as an alternative. ```yaml spec: fileAssets: - name: iptable-restore - # Note if not path is specificied the default path it /srv/kubernetes/assets/ + # Note if not path is specified the default path it /srv/kubernetes/assets/ path: /var/lib/iptables/rules-save roles: [Master,Node,Bastion] # a list of roles to apply the asset to, zero defaults to all content: | diff --git a/docs/development/building.md b/docs/development/building.md index a9474e6dc4..19a55b4e94 100644 --- a/docs/development/building.md +++ b/docs/development/building.md @@ -27,6 +27,22 @@ make Cross compiling for things like `nodeup` are now done automatically via `make nodeup`. `make push-aws-run TARGET=admin@$TARGET` will automatically choose the linux amd64 build from your `.build` directory. +## Debugging + +To enable interactive debugging, the kops binary needs to be specially compiled to include debugging symbols. +Add `DEBUGGING=true` to the `make` invocation to set the compile flags appropriately. + +For example, `DEBUGGING=true make` will produce a kops binary that can be interactively debugged. + +### Interactive debugging with Delve + +[Delve](https://github.com/derekparker/delve) can be used to interactively debug the kops binary. +After installing Delve, you can use it directly, or run it in headless mode for use with an +Interactive Development Environment (IDE). + +For example, run `dlv --listen=:2345 --headless=true --api-version=2 exec ${GOPATH}/bin/kops -- `, +and then configure your IDE to connect its debugger to port 2345 on localhost. + ## Troubleshooting - Make sure `$GOPATH` is set, and your [workspace](https://golang.org/doc/code.html#Workspaces) is configured. diff --git a/docs/development/vendoring.md b/docs/development/vendoring.md new file mode 100644 index 0000000000..360fc194f8 --- /dev/null +++ b/docs/development/vendoring.md @@ -0,0 +1,27 @@ +# Vendoring Go dependencies + +kops uses [dep](https://github.com/golang/dep) to manage vendored +dependencies. + +## Prerequisites + +The following software must be installed prior to running the +update commands: + +* [bazel](https://github.com/bazelbuild/bazel) +* [dep](https://github.com/golang/dep) +* [hg](https://www.mercurial-scm.org/wiki/Download) + +## Adding a dependency to the vendor directory + +The `dep` tool will manage required dependencies based on the imports +found in the source code. Follow these steps to run the update process: + +1. Add the desired import to a `.go` file. +1. Run `make dep-ensure` to start the update process. If this step is +successful, the imported dependency will be added to the `vendor` +subdirectory. +1. Commit any changes, including changes to the `vendor` directory, +`Gopkg.lock` and `Gopkg.toml`. +1. Open a pull request with these changes separately from other work +so that it is easier to review. diff --git a/docs/experimental.md b/docs/experimental.md index 5bc3901209..e5d539e4f5 100644 --- a/docs/experimental.md +++ b/docs/experimental.md @@ -13,3 +13,4 @@ The following experimental features are currently available: * `+EnableExternalCloudController` - Enables the use of cloud-controller-manager introduced in v1.7. * `+EnableSeparateConfigBase` - Allow a config-base that is different from the state store. * `+SpecOverrideFlag` - Allow setting spec values on `kops create`. +* `+ExperimentalClusterDNS` - Turns off validation of the kubelet cluster dns flag. diff --git a/docs/instance_groups.md b/docs/instance_groups.md index 5e125e803b..b11b126c6d 100644 --- a/docs/instance_groups.md +++ b/docs/instance_groups.md @@ -131,7 +131,7 @@ So the procedure is: ## Moving from one instance group spanning multiple AZs to one instance group per AZ -It may be beneficial to have one IG per AZ rather than one IG spanning multiple AZs. One common example is, when you have a persistent volume claim bound to an AWS EBS Volume this volume is bound to the AZ it has been created in so any resource (e.g. a StatefulSet) depending on that volume is bound to that same AZ. In this case you have to ensure that there is at least one node running in that same AZ, which is not guaruanteed by one IG. This however can be guarantueed by one IG per AZ. +It may be beneficial to have one IG per AZ rather than one IG spanning multiple AZs. One common example is, when you have a persistent volume claim bound to an AWS EBS Volume this volume is bound to the AZ it has been created in so any resource (e.g. a StatefulSet) depending on that volume is bound to that same AZ. In this case you have to ensure that there is at least one node running in that same AZ, which is not guaranteed by one IG. This however can be guaranteed by one IG per AZ. So the procedure is: @@ -242,7 +242,7 @@ spec: ## Additional user-data for cloud-init -Kops utilizes cloud-init to initialize and setup a host at boot time. However in certain cases you may already be leaveraging certain features of cloud-init in your infrastructure and would like to continue doing so. More information on cloud-init can be found [here](http://cloudinit.readthedocs.io/en/latest/) +Kops utilizes cloud-init to initialize and setup a host at boot time. However in certain cases you may already be leveraging certain features of cloud-init in your infrastructure and would like to continue doing so. More information on cloud-init can be found [here](http://cloudinit.readthedocs.io/en/latest/) Additional user-user data can be passed to the host provisioning by setting the `AdditionalUserData` field. A list of valid user-data content-types can be found [here](http://cloudinit.readthedocs.io/en/latest/topics/format.html#mime-multi-part-archive) diff --git a/docs/manifests_and_customizing_via_api.md b/docs/manifests_and_customizing_via_api.md index 98a3299906..255656e15c 100644 --- a/docs/manifests_and_customizing_via_api.md +++ b/docs/manifests_and_customizing_via_api.md @@ -305,7 +305,7 @@ The `ClusterSpec` allows a user to set configurations for such values as Docker More information about some of the elements in the `ClusterSpec` is available in the following: - Cluster Spec [document](cluster_spec.md) which outlines some of the values in the Cluster Specification. -- [Ectd Encryption](etcd_backup.md) +- [Etcd Encryption](etcd_backup.md) - [GPU](gpu.md) setup - [IAM Roles](iam_roles.md) - adding additional IAM roles. - [Labels](labels.md) diff --git a/docs/networking.md b/docs/networking.md index 363ab6e750..7f67ca2d68 100644 --- a/docs/networking.md +++ b/docs/networking.md @@ -252,7 +252,7 @@ For support with Flannel you can submit an issue on Github: ### Kube-router example for CNI, IPVS based service proxy and Network Policy enforcer -[Kube-router](https://github.com/cloudnativelabs/kube-router) is project that provides one cohesive soltion that provides CNI networking for pods, an IPVS based network service proxy and iptables based network policy enforcement. +[Kube-router](https://github.com/cloudnativelabs/kube-router) is project that provides one cohesive solution that provides CNI networking for pods, an IPVS based network service proxy and iptables based network policy enforcement. #### Installing kube-router on a new Cluster diff --git a/docs/node_authorization.md b/docs/node_authorization.md index cdaf69059b..3b5c7dd321 100644 --- a/docs/node_authorization.md +++ b/docs/node_authorization.md @@ -11,7 +11,7 @@ The [node authorization service] is an experimental service which in the absence #### **Integretion with Kops** -The node authorization service is run on the master as a daemonset, by default dns is _node-authorizer-interanl.dns_zone_:10443 and added via same mechanism at the internal kube-apiserver i.e. annotations on the kube-apiserver pods which is picked up the dns-controller and added to the dns zone. +The node authorization service is run on the master as a daemonset, by default dns is _node-authorizer-internal.dns_zone_:10443 and added via same mechanism at the internal kube-apiserver i.e. annotations on the kube-apiserver pods which is picked up the dns-controller and added to the dns zone. When the node authorization service is enabled a systemd _(node-authorizer.service)_ unit is added on the worker nodes. This runs the node-authorizer in client mode and connects to the authorization service requesting a bootstrap token. @@ -29,7 +29,7 @@ The node authorizer currently supports two authorizers; aws and alwaysallow. The - we check the ip address of the client requesting the document is the same the instance document. - we check that the node has not already registered. -Assuming all the conditions are met a secret token is generated and returned to the client to continue the provising of the worker node. +Assuming all the conditions are met a secret token is generated and returned to the client to continue the providing of the worker node. #### **Enabling the Node Authorization Service** diff --git a/docs/releases.md b/docs/releases.md index 2c7bd7a4f8..d2f97d5a73 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -5,7 +5,7 @@ * A majority of maintainers must agree on a single commit SHA for the release. The agreement should be documented in the release notes. * The maintainers will match the commit SHA to the release `major.minor.patch` in the release notes * The maintainers will agree on a changelog proposal that MUST be in a PR prior to the release. -* The main `REAMDE.md` must also reflect the new release. Ideally this should be in the same PR. +* The main `README.md` must also reflect the new release. Ideally this should be in the same PR. #### 2. Merge the release notes diff --git a/docs/releases/1.10-NOTES.md b/docs/releases/1.10-NOTES.md index 14425c142b..1029709133 100644 --- a/docs/releases/1.10-NOTES.md +++ b/docs/releases/1.10-NOTES.md @@ -10,9 +10,284 @@ None known at this time # Highlighted changes -(to follow) +(coming soon) -# Full change list +# Full change list since 1.9.0 release -(to follow) +## 1.9.0 - 1.10.0 +* Update alpha channel with latest k8s releases [@justinsb](https://github.com/justinsb) [#4965](https://github.com/kubernetes/kops/pull/4965) +* 1.9.0 release notes [@justinsb](https://github.com/justinsb) [#4964](https://github.com/kubernetes/kops/pull/4964) +* digitalocean tutorial [@andrewsykim](https://github.com/andrewsykim) [#4976](https://github.com/kubernetes/kops/pull/4976) +* Update roadmap [@justinsb](https://github.com/justinsb) [#4966](https://github.com/kubernetes/kops/pull/4966) +* digitalocean: use new droplet sizes providing the same resources at cheaper prices [@andrewsykim](https://github.com/andrewsykim) [#5005](https://github.com/kubernetes/kops/pull/5005) +* Set AWS_REGION into bootstrapscript [@justinsb](https://github.com/justinsb) [#4982](https://github.com/kubernetes/kops/pull/4982) +* digitalocean: only delete A DNS records [@andrewsykim](https://github.com/andrewsykim) [#5006](https://github.com/kubernetes/kops/pull/5006) +* AWS: validate region against aws-sdk [@justinsb](https://github.com/justinsb) [#4983](https://github.com/kubernetes/kops/pull/4983) +* Treat Amazon Linux 2 as CentOS 7 [@sonaltr](https://github.com/sonaltr) [#5028](https://github.com/kubernetes/kops/pull/5028) +* Update bazel [@mikesplain](https://github.com/mikesplain) [#5032](https://github.com/kubernetes/kops/pull/5032) +* Add missing google cloud zones [@povilasv](https://github.com/povilasv) [#5022](https://github.com/kubernetes/kops/pull/5022) +* Update generated docs for 1.10 [@justinsb](https://github.com/justinsb) [#5034](https://github.com/kubernetes/kops/pull/5034) +* gazelle: use separate gazelle [@justinsb](https://github.com/justinsb) [#5036](https://github.com/kubernetes/kops/pull/5036) +* Bump recommended version for kops 1.9.0 [@mikesplain](https://github.com/mikesplain) [#5041](https://github.com/kubernetes/kops/pull/5041) +* fix IAM role for current versions of the kube-ingress-aws-controller [@szuecs](https://github.com/szuecs) [#5014](https://github.com/kubernetes/kops/pull/5014) +* Add docker 17.09.0 version for Debian 9 [@Cryptophobia](https://github.com/Cryptophobia) [#5042](https://github.com/kubernetes/kops/pull/5042) +* Fixes environment variable export. [@Raffo](https://github.com/Raffo) [#5016](https://github.com/kubernetes/kops/pull/5016) +* fix :"rbac" should be "RBAC" [@yulng](https://github.com/yulng) [#4993](https://github.com/kubernetes/kops/pull/4993) +* upgrade kube-dns to 1.14.10, fixes #4986 [@jjo](https://github.com/jjo) [#5026](https://github.com/kubernetes/kops/pull/5026) +* makefile: fix bazel-push [@justinsb](https://github.com/justinsb) [#5053](https://github.com/kubernetes/kops/pull/5053) +* Typo fix aditional->additional [@AdamDang](https://github.com/AdamDang) [#5058](https://github.com/kubernetes/kops/pull/5058) +* Add Replace and delete for SSH Secret YAML [@mikesplain](https://github.com/mikesplain) [#5050](https://github.com/kubernetes/kops/pull/5050) +* Typo fix in addons.md [@AdamDang](https://github.com/AdamDang) [#5069](https://github.com/kubernetes/kops/pull/5069) +* Update readme for 1.9 [@mikesplain](https://github.com/mikesplain) [#4963](https://github.com/kubernetes/kops/pull/4963) +* Make LogSeveritySys configurable for Canal Networking [@KashifSaadat](https://github.com/KashifSaadat) [#5068](https://github.com/kubernetes/kops/pull/5068) +* Typo fix in 1.9-NOTES.md: compatability->compatibility [@AdamDang](https://github.com/AdamDang) [#5073](https://github.com/kubernetes/kops/pull/5073) +* Typo fix: Kuberenetes->Kubernetes [@AdamDang](https://github.com/AdamDang) [#5079](https://github.com/kubernetes/kops/pull/5079) +* Typo fix: seet->set [@AdamDang](https://github.com/AdamDang) [#5080](https://github.com/kubernetes/kops/pull/5080) +* Typo fix in vsphere-development-status.md: secrete->secret [@AdamDang](https://github.com/AdamDang) [#5084](https://github.com/kubernetes/kops/pull/5084) +* Perform deep merge for template values [@gwkunze](https://github.com/gwkunze) [#4668](https://github.com/kubernetes/kops/pull/4668) +* Note that `kops rolling-update` is required after tf apply [@fgrehm](https://github.com/fgrehm) [#5081](https://github.com/kubernetes/kops/pull/5081) +* Typo fix: wil->will [@AdamDang](https://github.com/AdamDang) [#5091](https://github.com/kubernetes/kops/pull/5091) +* Add SubnetType tags to run_in_existing_vpc docs [@tsupertramp](https://github.com/tsupertramp) [#5094](https://github.com/kubernetes/kops/pull/5094) +* Typo fix: acutally->actually/overide->override/to to->to [@AdamDang](https://github.com/AdamDang) [#5099](https://github.com/kubernetes/kops/pull/5099) +* Typo fix detaults->defaults [@AdamDang](https://github.com/AdamDang) [#5067](https://github.com/kubernetes/kops/pull/5067) +* Update upgrade_from_kops_1.6_to_1.7_calico_cidr_migration.md [@AdamDang](https://github.com/AdamDang) [#5107](https://github.com/kubernetes/kops/pull/5107) +* Typo fix: healthly->healthy [@AdamDang](https://github.com/AdamDang) [#5125](https://github.com/kubernetes/kops/pull/5125) +* Remove custom Statement IDs from IAM Policy Statements [@KashifSaadat](https://github.com/KashifSaadat) [#4958](https://github.com/kubernetes/kops/pull/4958) +* Adds new kops logo [@iMartyn](https://github.com/iMartyn) [#5113](https://github.com/kubernetes/kops/pull/5113) +* Update rules go to support go 1.10.2 and 1.9.6 [@mikesplain](https://github.com/mikesplain) [#5100](https://github.com/kubernetes/kops/pull/5100) +* Typo fix in returned message: formated->formatted [@AdamDang](https://github.com/AdamDang) [#5112](https://github.com/kubernetes/kops/pull/5112) +* Fix for validating kubeconfig's hosts [@0mok](https://github.com/0mok) [#5096](https://github.com/kubernetes/kops/pull/5096) +* Add ability to use ec2 nat instance as egress [@relu](https://github.com/relu) [#5133](https://github.com/kubernetes/kops/pull/5133) +* Added tls certificate and private key path flags to kubelet config [@chrisz100](https://github.com/chrisz100) [#5088](https://github.com/kubernetes/kops/pull/5088) +* kublet: expose --experimental-allowed-unsafe-sysctls [@smcquay](https://github.com/smcquay) [#5104](https://github.com/kubernetes/kops/pull/5104) +* Update docker image versions [@justinsb](https://github.com/justinsb) [#5057](https://github.com/kubernetes/kops/pull/5057) +* CoreDNS in Kops as an addon [@rajansandeep](https://github.com/rajansandeep) [#4041](https://github.com/kubernetes/kops/pull/4041) +* Implement network task for AlibabaCloud [@LilyFaFa](https://github.com/LilyFaFa),[@xh4n3](https://github.com/xh4n3) [#4991](https://github.com/kubernetes/kops/pull/4991) +* Allow rolling-update to filter on roles [@justinsb](https://github.com/justinsb) [#5122](https://github.com/kubernetes/kops/pull/5122) +* Remove stub tests [@justinsb](https://github.com/justinsb) [#5117](https://github.com/kubernetes/kops/pull/5117) +* Don't tag shared instances at all [@justinsb](https://github.com/justinsb) [#5138](https://github.com/kubernetes/kops/pull/5138) +* fix:please N/A should be " Not Applicable" [@yulng](https://github.com/yulng) [#4994](https://github.com/kubernetes/kops/pull/4994) +* Re-enable validation of DNS ServerIP [@justinsb](https://github.com/justinsb) [#5142](https://github.com/kubernetes/kops/pull/5142) +* digitalocean: don't set --cloud-provider=external on control plane starting v1.10 [@andrewsykim](https://github.com/andrewsykim) [#4990](https://github.com/kubernetes/kops/pull/4990) +* [instance_groups.md] typo: recieve->receive [@AdamDang](https://github.com/AdamDang) [#5152](https://github.com/kubernetes/kops/pull/5152) +* Update docs regarding shared NAT Instances setup [@relu](https://github.com/relu) [#5151](https://github.com/kubernetes/kops/pull/5151) +* Update office hours time to account for DST [@mikesplain](https://github.com/mikesplain) [#5148](https://github.com/kubernetes/kops/pull/5148) +* set default GracePeriodSeconds to -1 when draining nodes [@rajatjindal](https://github.com/rajatjindal) [#5143](https://github.com/kubernetes/kops/pull/5143) +* implement disk task for ALICloud and fix typos [@LilyFaFa](https://github.com/LilyFaFa) [#5158](https://github.com/kubernetes/kops/pull/5158) +* Unify create-create overrides and set-cluster fields [@justinsb](https://github.com/justinsb) [#5123](https://github.com/kubernetes/kops/pull/5123) +* Typo fix in the returned message: runnning->running [@AdamDang](https://github.com/AdamDang) [#5186](https://github.com/kubernetes/kops/pull/5186) +* Documentation - networking Amazon VPC backend [@recollir](https://github.com/recollir) [#5180](https://github.com/kubernetes/kops/pull/5180) +* added i3.metal AWS instance type [@DavidXArnold](https://github.com/DavidXArnold) [#5189](https://github.com/kubernetes/kops/pull/5189) +* Documentation - cloudProvider required in kubelet spec with Amazon VPC backend [@recollir](https://github.com/recollir) [#5181](https://github.com/kubernetes/kops/pull/5181) +* 1.8 release notes correctly note `replace --force` [@wendorf](https://github.com/wendorf) [#5182](https://github.com/kubernetes/kops/pull/5182) +* CA Key File Permissions [@gambol99](https://github.com/gambol99) [#5196](https://github.com/kubernetes/kops/pull/5196) +* Expose streaming connection idle timeout [@aleerizw](https://github.com/aleerizw) [#5155](https://github.com/kubernetes/kops/pull/5155) +* implement SSHKey task for ALICloud [@LilyFaFa](https://github.com/LilyFaFa) [#5184](https://github.com/kubernetes/kops/pull/5184) +* Documentation - updated example for dashboard installation to 1.8.3 [@recollir](https://github.com/recollir) [#5198](https://github.com/kubernetes/kops/pull/5198) +* Update CoreDNS manifest [@rajansandeep](https://github.com/rajansandeep) [#5203](https://github.com/kubernetes/kops/pull/5203) +* Create initial docs for etcd-manager [@justinsb](https://github.com/justinsb) [#5210](https://github.com/kubernetes/kops/pull/5210) +* Support (optional) etcd-manager [@justinsb](https://github.com/justinsb) [#5126](https://github.com/kubernetes/kops/pull/5126) +* Create override for etcd-manager image [@justinsb](https://github.com/justinsb) [#5136](https://github.com/kubernetes/kops/pull/5136) +* Typo fix: attatch->attach [@AdamDang](https://github.com/AdamDang) [#5160](https://github.com/kubernetes/kops/pull/5160) +* Add a FIXME and don't log about insecure ports [@dims](https://github.com/dims) [#5178](https://github.com/kubernetes/kops/pull/5178) +* Add support for C5D instance family on AWS [@ripta](https://github.com/ripta) [#5179](https://github.com/kubernetes/kops/pull/5179) +* Add stdin support for create -f and replace -f [@ihoegen](https://github.com/ihoegen) [#5150](https://github.com/kubernetes/kops/pull/5150) +* Update AWS AMI for kubernetes >=1.9.0 <1.10.0 [@AmazingDreams](https://github.com/AmazingDreams) [#5173](https://github.com/kubernetes/kops/pull/5173) +* Kuberenets 1.11 has deprecated ExternalID this replaces it with Provi… [@zachaller](https://github.com/zachaller) [#5167](https://github.com/kubernetes/kops/pull/5167) +* Update alpha channel with latest k8s versions [@justinsb](https://github.com/justinsb) [#5217](https://github.com/kubernetes/kops/pull/5217) +* Update alpha channel with latest images [@justinsb](https://github.com/justinsb) [#5222](https://github.com/kubernetes/kops/pull/5222) +* Recommend kops 1.9.1 in alpha channel [@justinsb](https://github.com/justinsb) [#5218](https://github.com/kubernetes/kops/pull/5218) +* PSP Updates, new apiGroup for k8s v1.10 [@KashifSaadat](https://github.com/KashifSaadat) [#5225](https://github.com/kubernetes/kops/pull/5225) +* Create addon for prometheus-operator [@gianrubio](https://github.com/gianrubio) [#5140](https://github.com/kubernetes/kops/pull/5140) +* Fixing name of cert file [#5220](https://github.com/kubernetes/kops/pull/5220) +* Promote alpha channel to stable [@justinsb](https://github.com/justinsb) [#5216](https://github.com/kubernetes/kops/pull/5216) +* Add --enable-admission-plugins API server flag for k8s 1.10 [@ripta](https://github.com/ripta) [#5221](https://github.com/kubernetes/kops/pull/5221) +* Fix typo: "to user" -> "to use" [@justinsb](https://github.com/justinsb) [#5232](https://github.com/kubernetes/kops/pull/5232) +* Bump Cilium version to released [@nebril](https://github.com/nebril) [#5208](https://github.com/kubernetes/kops/pull/5208) +* Typo fix: are be->are [@AdamDang](https://github.com/AdamDang) [#5237](https://github.com/kubernetes/kops/pull/5237) +* Add proper autoloading for kops autocomplete [@ihoegen](https://github.com/ihoegen) [#5230](https://github.com/kubernetes/kops/pull/5230) +* Fix typo: adddresses -> addresses [@justinsb](https://github.com/justinsb) [#5235](https://github.com/kubernetes/kops/pull/5235) +* Replace deprecated flags: address -> insecure-bind-address [@justinsb](https://github.com/justinsb) [#5234](https://github.com/kubernetes/kops/pull/5234) +* Add AuthenticationTokenWebhook flag [@ihoegen](https://github.com/ihoegen) [#5231](https://github.com/kubernetes/kops/pull/5231) +* Setup heptio authenticator [@rdrgmnzs](https://github.com/rdrgmnzs) [#5197](https://github.com/kubernetes/kops/pull/5197) +* File Permissions Private Key [@gambol99](https://github.com/gambol99) [#5241](https://github.com/kubernetes/kops/pull/5241) +* Correct PSP RoleBinding with namespace for kube-system [@KashifSaadat](https://github.com/KashifSaadat) [#5244](https://github.com/kubernetes/kops/pull/5244) +* Fix an error. [@mahuihuang](https://github.com/mahuihuang) [#4942](https://github.com/kubernetes/kops/pull/4942) +* Upgrade to flannel v0.10.0 and explicitly specify amd64 arch [@martinhoefling](https://github.com/martinhoefling) [#5095](https://github.com/kubernetes/kops/pull/5095) +* hacks for tests on windows [@sroylance](https://github.com/sroylance) [#4723](https://github.com/kubernetes/kops/pull/4723) +* Admission Controller Fix [@gambol99](https://github.com/gambol99) [#5248](https://github.com/kubernetes/kops/pull/5248) +* Use HomeDir from client-go to get home directory [@justinsb](https://github.com/justinsb) [#5249](https://github.com/kubernetes/kops/pull/5249) +* Add public ssh keys for GCE [@povilasv](https://github.com/povilasv) [#5056](https://github.com/kubernetes/kops/pull/5056) +* Release windows build in alpha [@chrislovecnm](https://github.com/chrislovecnm) [#4524](https://github.com/kubernetes/kops/pull/4524) +* some typo fix [@liwjGhostcloud](https://github.com/liwjGhostcloud) [#4937](https://github.com/kubernetes/kops/pull/4937) +* docker: Set TasksMax to infinity [@justinsb](https://github.com/justinsb) [#5259](https://github.com/kubernetes/kops/pull/5259) +* Update aws-sdk-go to v1.13.60 [@justinsb](https://github.com/justinsb) [#5261](https://github.com/kubernetes/kops/pull/5261) +* Put verify-apimachinery into ci makefile target [@justinsb](https://github.com/justinsb) [#5262](https://github.com/kubernetes/kops/pull/5262) +* Perf fix for makefile [@justinsb](https://github.com/justinsb) [#5255](https://github.com/kubernetes/kops/pull/5255) +* Use STABLE_ prefixes for bazel workspace vars [@justinsb](https://github.com/justinsb) [#5257](https://github.com/kubernetes/kops/pull/5257) +* bazel: add notes that tasks do not work [@justinsb](https://github.com/justinsb) [#5263](https://github.com/kubernetes/kops/pull/5263) +* vendor gazelle [@justinsb](https://github.com/justinsb) [#4564](https://github.com/kubernetes/kops/pull/4564) +* Clean up variable naming in integration test [@justinsb](https://github.com/justinsb) [#5264](https://github.com/kubernetes/kops/pull/5264) +* Allow integration tests to update expected TF output [@justinsb](https://github.com/justinsb) [#5265](https://github.com/kubernetes/kops/pull/5265) +* Validate FileAssets [@gambol99](https://github.com/gambol99) [#5272](https://github.com/kubernetes/kops/pull/5272) +* Validate InstanceGroup Hooks [@gambol99](https://github.com/gambol99) [#5271](https://github.com/kubernetes/kops/pull/5271) +* Update bazel gazelle [@mikesplain](https://github.com/mikesplain) [#5274](https://github.com/kubernetes/kops/pull/5274) +* Fix go version hack to be more generic. [@mikesplain](https://github.com/mikesplain) [#5267](https://github.com/kubernetes/kops/pull/5267) +* CoreDNS pull image from gcr.io [@rajansandeep](https://github.com/rajansandeep) [#5268](https://github.com/kubernetes/kops/pull/5268) +* Clarify the usage of the --state flag. [@rdrgmnzs](https://github.com/rdrgmnzs) [#5275](https://github.com/kubernetes/kops/pull/5275) +* Implement AdditionalCIDR configuration. [@rdrgmnzs](https://github.com/rdrgmnzs) [#5270](https://github.com/kubernetes/kops/pull/5270) +* Update heptio authenticator to 0.3.0 [@rdrgmnzs](https://github.com/rdrgmnzs) [#5276](https://github.com/kubernetes/kops/pull/5276) +* Update elasticsearch logging to 5.6.4 [@frankh](https://github.com/frankh) [#5137](https://github.com/kubernetes/kops/pull/5137) +* Fix: Update heptio authenticator to 0.3.0 #5276 [@rdrgmnzs](https://github.com/rdrgmnzs) [#5278](https://github.com/kubernetes/kops/pull/5278) +* Create a SECURITY_CONTACTS file. #5205 [@rdrgmnzs](https://github.com/rdrgmnzs) [#5279](https://github.com/kubernetes/kops/pull/5279) +* Verify Spelling [@gambol99](https://github.com/gambol99) [#5277](https://github.com/kubernetes/kops/pull/5277) +* Fix some typos [@mirake](https://github.com/mirake) [#5282](https://github.com/kubernetes/kops/pull/5282) +* Update kops_edit_instancegroup.go and kops_edit_instancegroup.md [@noinarisak](https://github.com/noinarisak) [#5284](https://github.com/kubernetes/kops/pull/5284) +* Override hostname with 'aws' only if hostname override is not specified. [@tvi](https://github.com/tvi) [#5285](https://github.com/kubernetes/kops/pull/5285) +* Enable override bind address for kube-proxy. [@tvi](https://github.com/tvi) [#5286](https://github.com/kubernetes/kops/pull/5286) +* Add support for M5D instance family on AWS [@ripta](https://github.com/ripta) [#5287](https://github.com/kubernetes/kops/pull/5287) +* Support overlay2 in docker [@justinsb](https://github.com/justinsb) [#5258](https://github.com/kubernetes/kops/pull/5258) +* Rename to kops [@justinsb](https://github.com/justinsb) [#1](https://github.com/kubernetes/kops/pull/1) +* Destinctive names for ClusterRoleBindings in prometheus-operator addon [@moritzheiber](https://github.com/moritzheiber) [#5294](https://github.com/kubernetes/kops/pull/5294) +* Revert "digitalocean: don't set --cloud-provider=external on control plane starting v1.10" [@andrewsykim](https://github.com/andrewsykim) [#5297](https://github.com/kubernetes/kops/pull/5297) +* Fix typo [@xianlubird](https://github.com/xianlubird) [#4985](https://github.com/kubernetes/kops/pull/4985) +* Fix issue where we assumed that private zone were in order [@justinsb](https://github.com/justinsb) [#5139](https://github.com/kubernetes/kops/pull/5139) +* Add support for external IAM Instance Profiles [@chrislovecnm](https://github.com/chrislovecnm),[@rifelpet](https://github.com/rifelpet) [#4171](https://github.com/kubernetes/kops/pull/4171) +* Feature/s3 bucket encryption - Implements PR #4235 [@gekart](https://github.com/gekart),[@chrisz100](https://github.com/chrisz100) [#5194](https://github.com/kubernetes/kops/pull/5194) +* Customize KubeDNS [@gambol99](https://github.com/gambol99) [#4724](https://github.com/kubernetes/kops/pull/4724) +* Add hooks example for cachefiled [@bhack](https://github.com/bhack) [#5072](https://github.com/kubernetes/kops/pull/5072) +* implement LoadBalancer task for ALICloud [@LilyFaFa](https://github.com/LilyFaFa) [#5207](https://github.com/kubernetes/kops/pull/5207) +* Admission Controller Validation [@gambol99](https://github.com/gambol99) [#5250](https://github.com/kubernetes/kops/pull/5250) +* Amazon VPC CNI: Upgrade to v1.0 and Allow Custom Images [@ripta](https://github.com/ripta) [#5119](https://github.com/kubernetes/kops/pull/5119) +* ListKeypairs: don't print 'keyset.yaml' as the key id [@justinsb](https://github.com/justinsb) [#5254](https://github.com/kubernetes/kops/pull/5254) +* Fix alitasks loadbalancer typo causing test failures [@KashifSaadat](https://github.com/KashifSaadat) [#5301](https://github.com/kubernetes/kops/pull/5301) +* fix broken link to example policy file in the cluster_spec docs [@kaspernissen](https://github.com/kaspernissen) [#5146](https://github.com/kubernetes/kops/pull/5146) +* Export outputs to aid with VPC peering in Terraform [@chrissnell](https://github.com/chrissnell),[@justinsb](https://github.com/justinsb) [#5030](https://github.com/kubernetes/kops/pull/5030) +* implement router interface task for OpenStack platform [@zengchen1024](https://github.com/zengchen1024) [#4977](https://github.com/kubernetes/kops/pull/4977) +* Update expected TF output for latest master [@justinsb](https://github.com/justinsb) [#5303](https://github.com/kubernetes/kops/pull/5303) +* implement keypair task for OpenStack platform [@zetaab](https://github.com/zetaab),[@justinsb](https://github.com/justinsb) [#5110](https://github.com/kubernetes/kops/pull/5110) +* Fixup bazel [@justinsb](https://github.com/justinsb) [#5304](https://github.com/kubernetes/kops/pull/5304) +* Fix gofmt [@justinsb](https://github.com/justinsb) [#5305](https://github.com/kubernetes/kops/pull/5305) +* Add feature with s3 state store from configfile [@jsenon](https://github.com/jsenon),[@justinsb](https://github.com/justinsb) [#4737](https://github.com/kubernetes/kops/pull/4737) +* Node Bootstrap Tokens [@gambol99](https://github.com/gambol99) [#5253](https://github.com/kubernetes/kops/pull/5253) +* Add prometheus scrape to kube-dns [@mikesplain](https://github.com/mikesplain) [#5308](https://github.com/kubernetes/kops/pull/5308) +* Fix typo: HONE -> HOME [@justinsb](https://github.com/justinsb) [#5306](https://github.com/kubernetes/kops/pull/5306) +* Node Bootstrap Fix Ups [@gambol99](https://github.com/gambol99) [#5309](https://github.com/kubernetes/kops/pull/5309) +* Fix Admission Controller Validation [@gambol99](https://github.com/gambol99) [#5313](https://github.com/kubernetes/kops/pull/5313) +* Added comment for 404 on healthcheck for non-standard vpc-cidr [@aberfeldy](https://github.com/aberfeldy) [#5312](https://github.com/kubernetes/kops/pull/5312) +* Correct deployment yaml of CoreDNS [@rajansandeep](https://github.com/rajansandeep) [#5315](https://github.com/kubernetes/kops/pull/5315) +* implement Ram task for ALICloud [@LilyFaFa](https://github.com/LilyFaFa) [#5316](https://github.com/kubernetes/kops/pull/5316) +* Avoid changing IAM policy for users [@justinsb](https://github.com/justinsb) [#5307](https://github.com/kubernetes/kops/pull/5307) +* File Path Fixes [@gambol99](https://github.com/gambol99) [#5311](https://github.com/kubernetes/kops/pull/5311) +* Communicate before long waits [@eherot](https://github.com/eherot) [#5322](https://github.com/kubernetes/kops/pull/5322) +* kops set cluster: honor --name flag [@justinsb](https://github.com/justinsb) [#5325](https://github.com/kubernetes/kops/pull/5325) +* Don't always print state store path [@justinsb](https://github.com/justinsb) [#5323](https://github.com/kubernetes/kops/pull/5323) +* protokube: only specify etcd flags when managing etcd [@justinsb](https://github.com/justinsb) [#5334](https://github.com/kubernetes/kops/pull/5334) +* Use less viper discovery [@justinsb](https://github.com/justinsb) [#5324](https://github.com/kubernetes/kops/pull/5324) +* GCE: Set network tier, to avoid spurious changes [@justinsb](https://github.com/justinsb) [#5330](https://github.com/kubernetes/kops/pull/5330) +* Set log-verbosity for etcd-manager [@justinsb](https://github.com/justinsb) [#5333](https://github.com/kubernetes/kops/pull/5333) +* More configuration options for cilium [@nebril](https://github.com/nebril) [#5320](https://github.com/kubernetes/kops/pull/5320) +* gossip: create zone in protokube [@justinsb](https://github.com/justinsb) [#5332](https://github.com/kubernetes/kops/pull/5332) +* implement SecurityGroup task for ALICloud [@LilyFaFa](https://github.com/LilyFaFa) [#5328](https://github.com/kubernetes/kops/pull/5328) +* Add missing nodes/stats resource to the system:metrics-server Cluster… [@azman0101](https://github.com/azman0101) [#5331](https://github.com/kubernetes/kops/pull/5331) +* Don't autoload SSH key on GCE [@justinsb](https://github.com/justinsb) [#5256](https://github.com/kubernetes/kops/pull/5256) +* add SSHKey model for AliCloud [@LilyFaFa](https://github.com/LilyFaFa) [#5340](https://github.com/kubernetes/kops/pull/5340) +* implement scalingGroup tasks for AliCloud [@LilyFaFa](https://github.com/LilyFaFa) [#5341](https://github.com/kubernetes/kops/pull/5341) +* Typo fix [@jonyhy96](https://github.com/jonyhy96) [#5344](https://github.com/kubernetes/kops/pull/5344) +* Code Clean [@gambol99](https://github.com/gambol99) [#5350](https://github.com/kubernetes/kops/pull/5350) +* add firewallModel for ALIcloud [@LilyFaFa](https://github.com/LilyFaFa) [#5343](https://github.com/kubernetes/kops/pull/5343) +* Aggregator Routing Option [@gambol99](https://github.com/gambol99) [#5349](https://github.com/kubernetes/kops/pull/5349) +* Removing Duplication [@gambol99](https://github.com/gambol99) [#5351](https://github.com/kubernetes/kops/pull/5351) +* Git Ignore - Merge Conflict Files [@gambol99](https://github.com/gambol99) [#5354](https://github.com/kubernetes/kops/pull/5354) +* etcd-manager: GCE support [@justinsb](https://github.com/justinsb) [#5335](https://github.com/kubernetes/kops/pull/5335) +* AWS: Delete old LaunchConfigurations [@justinsb](https://github.com/justinsb) [#5245](https://github.com/kubernetes/kops/pull/5245) +* GCE: Handle storage flag on COS more carefully [@justinsb](https://github.com/justinsb) [#5362](https://github.com/kubernetes/kops/pull/5362) +* Revert COS in stable/alpha channel [@justinsb](https://github.com/justinsb) [#5359](https://github.com/kubernetes/kops/pull/5359) +* Fix containerRegistry for Kubernetes < 1.10 [@kampka](https://github.com/kampka) [#5353](https://github.com/kubernetes/kops/pull/5353) +* add RAM model for ALIcloud [@LilyFaFa](https://github.com/LilyFaFa) [#5356](https://github.com/kubernetes/kops/pull/5356) +* Add etcd TLS support for Cilium [@nebril](https://github.com/nebril) [#5240](https://github.com/kubernetes/kops/pull/5240) +* Nodeup clean [@gambol99](https://github.com/gambol99) [#5352](https://github.com/kubernetes/kops/pull/5352) +* add ScalingGroup model for AliCloud [@LilyFaFa](https://github.com/LilyFaFa) [#5364](https://github.com/kubernetes/kops/pull/5364) +* Typo fix in documentation.md [@AdamDang](https://github.com/AdamDang) [#5348](https://github.com/kubernetes/kops/pull/5348) +* Mark 1.10.0-alpha.1 [@justinsb](https://github.com/justinsb) [#5367](https://github.com/kubernetes/kops/pull/5367) +* Add 1.10-alpha.1 to stable & alpha channels [@justinsb](https://github.com/justinsb) [#5369](https://github.com/kubernetes/kops/pull/5369) +* Go versions: don't block on 1.8 [@justinsb](https://github.com/justinsb) [#5366](https://github.com/kubernetes/kops/pull/5366) +* Docker Userspace Remapping Options [@gambol99](https://github.com/gambol99) [#5357](https://github.com/kubernetes/kops/pull/5357) +* Fix minor typo in DO tutorial [@andrewlouis93](https://github.com/andrewlouis93) [#5377](https://github.com/kubernetes/kops/pull/5377) +* Installation of AWS CLI tools [@the-lost-explorer](https://github.com/the-lost-explorer) [#5379](https://github.com/kubernetes/kops/pull/5379) +* Switch bucket encryption policy warning to debug [@mikesplain](https://github.com/mikesplain) [#5376](https://github.com/kubernetes/kops/pull/5376) +* Update rolling update ig roles flag to be case insensitive [@KashifSaadat](https://github.com/KashifSaadat) [#5386](https://github.com/kubernetes/kops/pull/5386) +* add Volume model for aliCloud [@LilyFaFa](https://github.com/LilyFaFa) [#5374](https://github.com/kubernetes/kops/pull/5374) +* fix broken compute resource reservation docs for storage in cluster_spec [@kimxogus](https://github.com/kimxogus) [#5401](https://github.com/kubernetes/kops/pull/5401) +* Add Cilium documentation to networking.md [@nebril](https://github.com/nebril) [#5388](https://github.com/kubernetes/kops/pull/5388) +* delete cluster resources for ALicloud [@LilyFaFa](https://github.com/LilyFaFa) [#5395](https://github.com/kubernetes/kops/pull/5395) +* Add dockerDisableSharedPID to kubelet config [@ripta](https://github.com/ripta) [#5403](https://github.com/kubernetes/kops/pull/5403) +* Add IAM ec2:ModifyVolume permission to allow EBS volume resize [@KashifSaadat](https://github.com/KashifSaadat) [#5416](https://github.com/kubernetes/kops/pull/5416) +* Remap initContainers as well as containers in PodSpec [@coreypobrien](https://github.com/coreypobrien) [#5427](https://github.com/kubernetes/kops/pull/5427) +* Rename hept.io authenticator to aws authenticator [@rdrgmnzs](https://github.com/rdrgmnzs) [#5421](https://github.com/kubernetes/kops/pull/5421) +* Use /bin/bash in kubelet manifest ExecStartPre [@coreypobrien](https://github.com/coreypobrien) [#5428](https://github.com/kubernetes/kops/pull/5428) +* Fix the issue described in #5412 where the authenticator is no longer… [@rdrgmnzs](https://github.com/rdrgmnzs) [#5424](https://github.com/kubernetes/kops/pull/5424) +* Allow setting MTU for calico networking. [@shrinandj](https://github.com/shrinandj) [#5380](https://github.com/kubernetes/kops/pull/5380) +* Add prometheus scrape port to CoreDNS service [@rajansandeep](https://github.com/rajansandeep) [#5392](https://github.com/kubernetes/kops/pull/5392) +* Added metrics port and health check to kube-router [@aleerizw](https://github.com/aleerizw) [#5426](https://github.com/kubernetes/kops/pull/5426) +* Initial Ubuntu Bionic Support [@mikesplain](https://github.com/mikesplain) [#5394](https://github.com/kubernetes/kops/pull/5394) +* Fail cluster validation for rolling-update if a failure occurs [@dzoeteman](https://github.com/dzoeteman) [#5445](https://github.com/kubernetes/kops/pull/5445) +* Update Audit file example [@jsenon](https://github.com/jsenon) [#5432](https://github.com/kubernetes/kops/pull/5432) +* Add data-root and exec-root attributes to the docker config spec [@ripta](https://github.com/ripta) [#5431](https://github.com/kubernetes/kops/pull/5431) +* Add minRequestTimeout flag in kube-APIServer [@Sturgelose](https://github.com/Sturgelose) [#5438](https://github.com/kubernetes/kops/pull/5438) +* Fixes issue when setting docker version [@mikesplain](https://github.com/mikesplain) [#5417](https://github.com/kubernetes/kops/pull/5417) +* support edit cluster and rolling-update cluster for AliCloud [@LilyFaFa](https://github.com/LilyFaFa) [#5419](https://github.com/kubernetes/kops/pull/5419) +* docs for different VPC in the Security Group of kube-ingress-aws-controller [@kanolato](https://github.com/kanolato) [#5418](https://github.com/kubernetes/kops/pull/5418) +* Don't mount volume for auditLog when STDOUT is configured as path [@kampka](https://github.com/kampka) [#5448](https://github.com/kubernetes/kops/pull/5448) +* Adding a disclaimer for instanceGroups in docs [@Cryptophobia](https://github.com/Cryptophobia) [#3445](https://github.com/kubernetes/kops/pull/3445) +* add cluster-autoscaler.sh [@sdarwin](https://github.com/sdarwin) [#5433](https://github.com/kubernetes/kops/pull/5433) +* Add weave network encryption secret [@kampka](https://github.com/kampka) [#5441](https://github.com/kubernetes/kops/pull/5441) +* skipper selector changed [@kanolato](https://github.com/kanolato) [#5430](https://github.com/kubernetes/kops/pull/5430) +* Generate locals for terraform target [@kampka](https://github.com/kampka) [#5443](https://github.com/kubernetes/kops/pull/5443) +* Correct all the word "cluster" to be in lowercase [@AdamDang](https://github.com/AdamDang) [#5153](https://github.com/kubernetes/kops/pull/5153) +* Stop rolling update if bastions or masters failed to update [@dzoeteman](https://github.com/dzoeteman) [#5446](https://github.com/kubernetes/kops/pull/5446) +* Generate random weave password it none is supplied [@kampka](https://github.com/kampka) [#5457](https://github.com/kubernetes/kops/pull/5457) +* Node Authorization Service [@gambol99](https://github.com/gambol99) [#5317](https://github.com/kubernetes/kops/pull/5317) +* [WIP] Initial implementation of ACM certificate for API server ELB [@Raffo](https://github.com/Raffo) [#5414](https://github.com/kubernetes/kops/pull/5414) +* More autofix of expected test output [@justinsb](https://github.com/justinsb) [#5466](https://github.com/kubernetes/kops/pull/5466) +* Add configurable conntrack settings [@mikesplain](https://github.com/mikesplain) [#5456](https://github.com/kubernetes/kops/pull/5456) +* Add pull-through proxy cache for asset docker images [@kampka](https://github.com/kampka) [#5390](https://github.com/kubernetes/kops/pull/5390) +* Don't repeatedly download nodeup [@justinsb](https://github.com/justinsb) [#5462](https://github.com/kubernetes/kops/pull/5462) +* Adds ability to set template context values on command line [@gwkunze](https://github.com/gwkunze) [#5108](https://github.com/kubernetes/kops/pull/5108) +* Allow users to set the kubelets root dir. [@rdrgmnzs](https://github.com/rdrgmnzs) [#5467](https://github.com/kubernetes/kops/pull/5467) +* Update docs for config file [@justinsb](https://github.com/justinsb) [#5469](https://github.com/kubernetes/kops/pull/5469) +* Correct the `maxSize` in the cluster template example [@dcherman](https://github.com/dcherman) [#5455](https://github.com/kubernetes/kops/pull/5455) +* Add the ability to specify external loadbalancers for instancegroups [@gwkunze](https://github.com/gwkunze) [#4677](https://github.com/kubernetes/kops/pull/4677) +* Fix tests that crossed during PR merges [@justinsb](https://github.com/justinsb) [#5470](https://github.com/kubernetes/kops/pull/5470) +* change gossip dns conn limit by ENV [@yancl](https://github.com/yancl) [#5077](https://github.com/kubernetes/kops/pull/5077) +* Introduce a global backoff to rate limit failed image downloads [@justinsb](https://github.com/justinsb) [#5464](https://github.com/kubernetes/kops/pull/5464) +* Add mikesplain to approvers [@justinsb](https://github.com/justinsb) [#5480](https://github.com/kubernetes/kops/pull/5480) +* have travis fail when verify-apimachinery.sh fails and fix incompatible apimachinery [@chrisz100](https://github.com/chrisz100) [#5477](https://github.com/kubernetes/kops/pull/5477) +* Use portable shebang for hack scripts [@kampka](https://github.com/kampka) [#5478](https://github.com/kubernetes/kops/pull/5478) +* Add autoscaling group ids to terraform module output [@kampka](https://github.com/kampka) [#5472](https://github.com/kubernetes/kops/pull/5472) +* Allow kubelet to bind the hosts primary IP [@rdrgmnzs](https://github.com/rdrgmnzs) [#5460](https://github.com/kubernetes/kops/pull/5460) +* ContainerRegistry remapping should be atomic [@kampka](https://github.com/kampka) [#5479](https://github.com/kubernetes/kops/pull/5479) +* [GPU] Updated Kops GPU Setup Hook [@dcwangmit01](https://github.com/dcwangmit01) [#4971](https://github.com/kubernetes/kops/pull/4971) +* Only use SSL for ELB if certificate configured [@justinsb](https://github.com/justinsb) [#5485](https://github.com/kubernetes/kops/pull/5485) +* Simplify logic around master rolling-update [@justinsb](https://github.com/justinsb) [#5488](https://github.com/kubernetes/kops/pull/5488) +* Update Issue templates and add PR template [@mikesplain](https://github.com/mikesplain) [#5487](https://github.com/kubernetes/kops/pull/5487) +* Force-load br_netfilter in nodeup [@justinsb](https://github.com/justinsb) [#5490](https://github.com/kubernetes/kops/pull/5490) +* Remove gossip connection limit entirely [@justinsb](https://github.com/justinsb) [#5486](https://github.com/kubernetes/kops/pull/5486) +* Fix GCE instance lookup during validation [@justinsb](https://github.com/justinsb) [#5491](https://github.com/kubernetes/kops/pull/5491) +* Only manage internal DNS zone if configuration has been specified [@mellowplace](https://github.com/mellowplace) [#5375](https://github.com/kubernetes/kops/pull/5375) +* Add portmap CNI plugin for k8s >= 1.9 [@justinsb](https://github.com/justinsb) [#5494](https://github.com/kubernetes/kops/pull/5494) +* Add new instance types r5, r5d, z1d [@rekcah78](https://github.com/rekcah78) [#5529](https://github.com/kubernetes/kops/pull/5529) +* Remove GetAsgForInstance IAM permission [@justinsb](https://github.com/justinsb) [#5566](https://github.com/kubernetes/kops/pull/5566) +* Check errors when parsing JSON on IAM policies [@justinsb](https://github.com/justinsb) [#5533](https://github.com/kubernetes/kops/pull/5533) +* Add authentication-token-webhook-cache-ttl flag to kubelet config [@ihoegen](https://github.com/ihoegen) [#5508](https://github.com/kubernetes/kops/pull/5508) +* Add AWS IAM permission to check for volume resize [@KashifSaadat](https://github.com/KashifSaadat) [#5597](https://github.com/kubernetes/kops/pull/5597) +* Enable weave network encryption for k8s 1.6 [@Andrey9kin](https://github.com/Andrey9kin) [#5595](https://github.com/kubernetes/kops/pull/5595) +* Add ssh user to kops toolbox dump [@justinsb](https://github.com/justinsb) [#5511](https://github.com/kubernetes/kops/pull/5511) +* Add amazon.com image owner alias and Amazon Linux 2 documentation [@Pharb](https://github.com/Pharb) [#5577](https://github.com/kubernetes/kops/pull/5577) +* Bump Weave Net to v2.4.0 [@brb](https://github.com/brb) [#5552](https://github.com/kubernetes/kops/pull/5552) +* Create ExperimentalClusterDNS feature flag [@justinsb](https://github.com/justinsb) [#5610](https://github.com/kubernetes/kops/pull/5610) +* Validate that require-kubeconfig is not passed after 1.10 [@justinsb](https://github.com/justinsb) [#5621](https://github.com/kubernetes/kops/pull/5621) +* Don't assume that we only have one subnet per AZ [@justinsb](https://github.com/justinsb) [#5601](https://github.com/kubernetes/kops/pull/5601) +* DigitalOcean: don't try to set SSE [@justinsb](https://github.com/justinsb) [#5625](https://github.com/kubernetes/kops/pull/5625) +* weave: bump version for 2.3.0 [@justinsb](https://github.com/justinsb) [#5618](https://github.com/kubernetes/kops/pull/5618) diff --git a/docs/single-to-multi-master.md b/docs/single-to-multi-master.md index 71a06a31f4..0c7add57b8 100644 --- a/docs/single-to-multi-master.md +++ b/docs/single-to-multi-master.md @@ -286,3 +286,43 @@ While optional, this last step allows you to be sure that your masters are fully configured by Kops and that there is no residual manual configuration. If there is any configuration problem, they will be detected during this step and not during a future upgrade or, worse, during a master failure. + + +## 6 - Restore (if migration to multi-master failed) + +In case you failed to upgrade to multi-master you will need to restore from the backup you have taken previously. + +Take extra care becase kops will not start etcd and etcd-events with the same ID on an/or for example but will mix them (ex: etcd-b and etcd-events-c on & etcd-c and etcd-events-b on ); this can be double checked in Route53 where kops will create DNS records for your services. + +If your 2nd spinned master failed and cluster becomes inconsistent edit the corresponding kops master instancegroup and switch ``MinSize`` and ``MaxSize`` to "0" and run an update on your cluster. + +Next ssh into your primary master: + +``systemctl stop kubelet`` +``systemctl stop protokube`` + +Reinitialize the etcd instances: +* In both ``/etc/kubernetes/manifests/etcd-events.manifest`` and +``/etc/kubernetes/manifests/etcd.manifest``, add the +``ETCD_FORCE_NEW_CLUSTER`` variable with value ``1``. +* Delete the containers and the data directories while restoring also from previous backup: + +```bash +root@ip-172-20-116-230:~# docker stop $(docker ps | grep "gcr.io/google_containers/etcd" | awk '{print $1}') +root@ip-172-20-116-230:~# rm -r /mnt/master-vol-03b97b1249caf379a/var/etcd/data-events/member/ +root@ip-172-20-116-230:~# rm -r /mnt/master-vol-0dbfd1f3c60b8c509/var/etcd/data/member/ +root@ip-172-20-116-230:~# cp -R /mnt/master-vol-03b97b1249caf379a/var/etcd/data-events/backup/member /mnt/master-vol-03b97b1249caf379a/var/etcd/data-events/ +root@ip-172-20-116-230:~# cp -R /mnt/master-vol-0dbfd1f3c60b8c509/var/etcd/data/backup/member /mnt/master-vol-0dbfd1f3c60b8c509/var/etcd/data/ +``` + +Now start back the services and watch for the logs: + +``systemctl start kubelet`` +``tail -f /var/log/etcd*`` # for errors, if no errors encountered re-start also protokube +``systemctl start protokube`` + +Test if your master is reboot-proof: + +Go to EC2 and ``Terminate`` the instance and check if your cluster recovers (needed to discard any manual configurations and check that kops handles everything the right way). + +Note! Would recommend also to use Amazon Lambda to take daily Snapshots of all your persistent volume so you can have from what to recover in case of failures. diff --git a/docs/state.md b/docs/state.md index c2b8c44098..e582fc2de3 100644 --- a/docs/state.md +++ b/docs/state.md @@ -56,3 +56,31 @@ There are a few ways to configure your state store. In priority order: ``` kops_state_store: s3://yourstatestore ``` + +## Cross Account State-store (AWS) + +There are situations in which the entity executing kops to create the cluster is not in the same account as the owner of the state store bucket. In this case, you must explicitly grant the permission: `s3:getBucketLocation` to the ARN that is running kops. + +You can use the following policy to guide your implementation: + +``` +{ + "Id": "123", + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "123", + "Action": [ + "s3:GetBucketLocation" + ], + "Effect": "Allow", + "Resource": "arn:aws:s3:::state-store-bucket", + "Principal": { + "AWS": [ + "arn:aws:iam::123456789:user/kopsuser" + ] + } + } + ] +} +``` \ No newline at end of file diff --git a/docs/tutorial/openstack.md b/docs/tutorial/openstack.md new file mode 100644 index 0000000000..1e83fae53c --- /dev/null +++ b/docs/tutorial/openstack.md @@ -0,0 +1,63 @@ +# Getting Started with kops on OpenStack + +**WARNING**: OpenStack support on kops is currently **alpha** meaning it is in the early stages of development and subject to change, please use with caution. + +## Create config file +The config file contains the OpenStack credentials required to create a cluster. The config file has the following format: +```ini +[Default] +identity= +user=mk8s= +password= +domain_name= +tenant_id= + +[Swift] +service_type=object-store +region= + +[Cinder] +service_type=volumev3 +region= + +[Neutron] +service_type=network +region= + +[Nova] +service_type=compute +region= +``` + +## Environment Variables + +It is important to set the following environment variables: +```bash +export OPENSTACK_CREDENTIAL_FILE= # where is the path of the config file +export KOPS_STATE_STORE=swift:// # where is the name of the Swift container to use for kops state + +# TODO(lmb): Add a feature gate for OpenStack +# this is required since OpenStack support is currently in alpha so it is feature gated +# export KOPS_FEATURE_FLAGS="AlphaAllowOpenStack" +``` + +## Creating a Cluster + +```bash +# coreos (the default) + flannel overlay cluster in Default +kops create cluster --cloud=openstack --name=my-cluster.k8s.local --networking=flannel --zones=Default --network-cidr=192.168.0.0/16 +# Not implemented yet... +# kops update cluster my-cluster.k8s.local --yes + +# to delete a cluster +# Not implemented yet... +# kops delete cluster my-cluster.k8s.local --yes +``` + +## Features Still in Development + +kops for OpenStack currently does not support these features: +* cluster create (servers, servergroups, load balancers, and DNS are not implemented yet) +* cluster delete +* state delete (fails due to unimplemented methods) + diff --git a/hack/.packages b/hack/.packages index 3a43b21ea8..220e9ceab2 100644 --- a/hack/.packages +++ b/hack/.packages @@ -117,6 +117,7 @@ k8s.io/kops/pkg/resources/aws k8s.io/kops/pkg/resources/digitalocean k8s.io/kops/pkg/resources/digitalocean/dns k8s.io/kops/pkg/resources/gce +k8s.io/kops/pkg/resources/openstack k8s.io/kops/pkg/resources/ops k8s.io/kops/pkg/sshcredentials k8s.io/kops/pkg/systemd @@ -179,6 +180,7 @@ k8s.io/kops/upup/tools/generators/fitask k8s.io/kops/upup/tools/generators/pkg/codegen k8s.io/kops/util/pkg/exec k8s.io/kops/util/pkg/hashing +k8s.io/kops/util/pkg/reflectutils k8s.io/kops/util/pkg/slice k8s.io/kops/util/pkg/tables k8s.io/kops/util/pkg/ui diff --git a/nodeup/pkg/model/BUILD.bazel b/nodeup/pkg/model/BUILD.bazel index e41e6c3ac0..a4166177c7 100644 --- a/nodeup/pkg/model/BUILD.bazel +++ b/nodeup/pkg/model/BUILD.bazel @@ -52,8 +52,8 @@ go_library( "//pkg/try:go_default_library", "//upup/pkg/fi:go_default_library", "//upup/pkg/fi/nodeup/nodetasks:go_default_library", - "//upup/pkg/fi/utils:go_default_library", "//util/pkg/exec:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//util/pkg/vfs:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/ec2metadata:go_default_library", "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", diff --git a/nodeup/pkg/model/context.go b/nodeup/pkg/model/context.go index a53fd7ec4c..2d80c0cabf 100644 --- a/nodeup/pkg/model/context.go +++ b/nodeup/pkg/model/context.go @@ -42,11 +42,13 @@ type NodeupModelContext struct { Cluster *kops.Cluster Distribution distros.Distribution InstanceGroup *kops.InstanceGroup - IsMaster bool KeyStore fi.CAStore NodeupConfig *nodeup.Config SecretStore fi.SecretStore + // IsMaster is true if the InstanceGroup has a role of master (populated by Init) + IsMaster bool + kubernetesVersion semver.Version } @@ -58,6 +60,12 @@ func (c *NodeupModelContext) Init() error { } c.kubernetesVersion = *k8sVersion + if c.InstanceGroup == nil { + glog.Warningf("cannot determine role, InstanceGroup not set") + } else if c.InstanceGroup.Spec.Role == kops.InstanceGroupRoleMaster { + c.IsMaster = true + } + return nil } diff --git a/nodeup/pkg/model/kubelet.go b/nodeup/pkg/model/kubelet.go index c5c0544e69..ef8867fac7 100644 --- a/nodeup/pkg/model/kubelet.go +++ b/nodeup/pkg/model/kubelet.go @@ -24,6 +24,13 @@ import ( "path/filepath" "time" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/golang/glog" + + "k8s.io/api/core/v1" + "k8s.io/apiserver/pkg/authentication/user" + "k8s.io/kops/nodeup/pkg/distros" "k8s.io/kops/pkg/apis/kops" "k8s.io/kops/pkg/flagbuilder" @@ -31,13 +38,7 @@ import ( "k8s.io/kops/pkg/systemd" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/upup/pkg/fi/nodeup/nodetasks" - "k8s.io/kops/upup/pkg/fi/utils" - - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/golang/glog" - "k8s.io/api/core/v1" - "k8s.io/apiserver/pkg/authentication/user" + "k8s.io/kops/util/pkg/reflectutils" ) const ( @@ -423,9 +424,9 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro // Merge KubeletConfig for NodeLabels c := &kops.KubeletConfigSpec{} if b.InstanceGroup.Spec.Role == kops.InstanceGroupRoleMaster { - utils.JsonMergeStruct(c, b.Cluster.Spec.MasterKubelet) + reflectutils.JsonMergeStruct(c, b.Cluster.Spec.MasterKubelet) } else { - utils.JsonMergeStruct(c, b.Cluster.Spec.Kubelet) + reflectutils.JsonMergeStruct(c, b.Cluster.Spec.Kubelet) } // @check if we are using secure kubelet <-> api settings @@ -439,7 +440,7 @@ func (b *KubeletBuilder) buildKubeletConfigSpec() (*kops.KubeletConfigSpec, erro } if b.InstanceGroup.Spec.Kubelet != nil { - utils.JsonMergeStruct(c, b.InstanceGroup.Spec.Kubelet) + reflectutils.JsonMergeStruct(c, b.InstanceGroup.Spec.Kubelet) } if b.InstanceGroup.Spec.Role == kops.InstanceGroupRoleMaster { diff --git a/pkg/acls/s3/storage.go b/pkg/acls/s3/storage.go index f86984e244..62883199e0 100644 --- a/pkg/acls/s3/storage.go +++ b/pkg/acls/s3/storage.go @@ -59,7 +59,7 @@ func (s *s3PublicAclStrategy) GetACL(p vfs.Path, cluster *kops.Cluster) (vfs.ACL // We are checking that the file repository url is in S3 _, err = vfs.VFSPath(fileRepository) if err != nil { - glog.V(8).Infof("path %q is not inside of a s3 bucket", u.String) + glog.V(8).Infof("path %q is not inside of a s3 bucket", u.String()) return nil, nil } diff --git a/pkg/apis/kops/validation/BUILD.bazel b/pkg/apis/kops/validation/BUILD.bazel index 086f9b8698..4f5ca49393 100644 --- a/pkg/apis/kops/validation/BUILD.bazel +++ b/pkg/apis/kops/validation/BUILD.bazel @@ -22,6 +22,7 @@ go_library( "//upup/pkg/fi:go_default_library", "//upup/pkg/fi/cloudup/awsup:go_default_library", "//vendor/github.com/blang/semver:go_default_library", + "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/validation:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/net:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", diff --git a/pkg/apis/kops/validation/aws.go b/pkg/apis/kops/validation/aws.go index 90eb38f6f5..e34558b8b5 100644 --- a/pkg/apis/kops/validation/aws.go +++ b/pkg/apis/kops/validation/aws.go @@ -19,6 +19,8 @@ package validation import ( "strings" + "fmt" + "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/kops/pkg/apis/kops" @@ -44,6 +46,8 @@ func awsValidateInstanceGroup(ig *kops.InstanceGroup) field.ErrorList { allErrs = append(allErrs, awsValidateMachineType(field.NewPath(ig.GetName(), "spec", "machineType"), ig.Spec.MachineType)...) + allErrs = append(allErrs, awsValidateAMIforNVMe(field.NewPath(ig.GetName(), "spec", "machineType"), ig)...) + return allErrs } @@ -79,3 +83,24 @@ func awsValidateMachineType(fieldPath *field.Path, machineType string) field.Err return allErrs } + +// TODO: make image validation smarter? graduate from jessie to stretch? This is quick and dirty because we keep getting reports +func awsValidateAMIforNVMe(fieldPath *field.Path, ig *kops.InstanceGroup) field.ErrorList { + // TODO: how can we put this list somewhere better? + NVMe_INSTANCE_PREFIXES := []string{"P3", "C5", "M5", "H1", "I3"} + + allErrs := field.ErrorList{} + + for _, prefix := range NVMe_INSTANCE_PREFIXES { + if strings.Contains(strings.ToUpper(ig.Spec.MachineType), strings.ToUpper(prefix)) { + glog.V(2).Infof("machineType %s requires an image based on stretch to operate. Trying to check compatibility", ig.Spec.MachineType) + if strings.Contains(ig.Spec.Image, "jessie") { + errString := fmt.Sprintf("%s cannot use machineType %s with image based on Debian jessie.", ig.Name, ig.Spec.MachineType) + allErrs = append(allErrs, field.Forbidden(fieldPath, errString)) + continue + } + } + + } + return allErrs +} diff --git a/pkg/apis/kops/validation/aws_test.go b/pkg/apis/kops/validation/aws_test.go index 4315fcd133..1bd9314062 100644 --- a/pkg/apis/kops/validation/aws_test.go +++ b/pkg/apis/kops/validation/aws_test.go @@ -70,6 +70,38 @@ func TestValidateInstanceGroupSpec(t *testing.T) { }, ExpectedErrors: []string{"Invalid value::test-nodes.spec.machineType"}, }, + { + Input: kops.InstanceGroupSpec{ + MachineType: "m5.large", + Image: "k8s-1.9-debian-stretch-amd64-hvm-ebs-2018-03-11", + }, + ExpectedErrors: []string{}, + }, + { + Input: kops.InstanceGroupSpec{ + MachineType: "m5.large", + Image: "k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-03-11", + }, + ExpectedErrors: []string{ + "Forbidden::test-nodes.spec.machineType", + }, + }, + { + Input: kops.InstanceGroupSpec{ + MachineType: "c5.large", + Image: "k8s-1.9-debian-stretch-amd64-hvm-ebs-2018-03-11", + }, + ExpectedErrors: []string{}, + }, + { + Input: kops.InstanceGroupSpec{ + MachineType: "c5.large", + Image: "k8s-1.9-debian-jessie-amd64-hvm-ebs-2018-03-11", + }, + ExpectedErrors: []string{ + "Forbidden::test-nodes.spec.machineType", + }, + }, } for _, g := range grid { ig := &kops.InstanceGroup{ diff --git a/pkg/apis/kops/validation/legacy.go b/pkg/apis/kops/validation/legacy.go index a97d3cdaf4..d4f3e6ca96 100644 --- a/pkg/apis/kops/validation/legacy.go +++ b/pkg/apis/kops/validation/legacy.go @@ -283,11 +283,13 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error { if !serviceClusterIPRange.Contains(ip) { return field.Invalid(fieldSpec.Child("kubeDNS", "serverIP"), address, fmt.Sprintf("ServiceClusterIPRange %q must contain the DNS Server IP %q", c.Spec.ServiceClusterIPRange, address)) } - if c.Spec.Kubelet != nil && c.Spec.Kubelet.ClusterDNS != c.Spec.KubeDNS.ServerIP { - return field.Invalid(fieldSpec.Child("kubeDNS", "serverIP"), address, "Kubelet ClusterDNS did not match cluster kubeDNS.serverIP") - } - if c.Spec.MasterKubelet != nil && c.Spec.MasterKubelet.ClusterDNS != c.Spec.KubeDNS.ServerIP { - return field.Invalid(fieldSpec.Child("kubeDNS", "serverIP"), address, "MasterKubelet ClusterDNS did not match cluster kubeDNS.serverIP") + if !featureflag.ExperimentalClusterDNS.Enabled() { + if c.Spec.Kubelet != nil && c.Spec.Kubelet.ClusterDNS != c.Spec.KubeDNS.ServerIP { + return field.Invalid(fieldSpec.Child("kubeDNS", "serverIP"), address, "Kubelet ClusterDNS did not match cluster kubeDNS.serverIP") + } + if c.Spec.MasterKubelet != nil && c.Spec.MasterKubelet.ClusterDNS != c.Spec.KubeDNS.ServerIP { + return field.Invalid(fieldSpec.Child("kubeDNS", "serverIP"), address, "MasterKubelet ClusterDNS did not match cluster kubeDNS.serverIP") + } } } @@ -470,6 +472,16 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error { } } + if kubernetesRelease.GTE(semver.MustParse("1.10.0")) { + // Flag removed in 1.10 + if c.Spec.Kubelet.RequireKubeconfig != nil { + return field.Invalid( + kubeletPath.Child("requireKubeconfig"), + *c.Spec.Kubelet.RequireKubeconfig, + "require-kubeconfig flag was removed in 1.10. (Please be sure you are not using a cluster config from `kops get cluster --full`)") + } + } + if c.Spec.Kubelet.BootstrapKubeconfig != "" { if c.Spec.KubeAPIServer == nil { return field.Required(fieldSpec.Child("KubeAPIServer"), "bootstrap token require the NodeRestriction admissions controller") @@ -499,6 +511,16 @@ func ValidateCluster(c *kops.Cluster, strict bool) *field.Error { } } + if kubernetesRelease.GTE(semver.MustParse("1.10.0")) { + // Flag removed in 1.10 + if c.Spec.MasterKubelet.RequireKubeconfig != nil { + return field.Invalid( + masterKubeletPath.Child("requireKubeconfig"), + *c.Spec.MasterKubelet.RequireKubeconfig, + "require-kubeconfig flag was removed in 1.10. (Please be sure you are not using a cluster config from `kops get cluster --full`)") + } + } + if c.Spec.MasterKubelet.APIServers != "" && !isValidAPIServersURL(c.Spec.MasterKubelet.APIServers) { return field.Invalid(masterKubeletPath.Child("APIServers"), c.Spec.MasterKubelet.APIServers, "Not a valid APIServer URL") } diff --git a/pkg/apis/kops/validation/validation_test.go b/pkg/apis/kops/validation/validation_test.go index 24c264ee82..83dafb04ed 100644 --- a/pkg/apis/kops/validation/validation_test.go +++ b/pkg/apis/kops/validation/validation_test.go @@ -196,7 +196,7 @@ func Test_Validate_DockerConfig_Storage(t *testing.T) { config := &kops.DockerConfig{Storage: &name} errs := ValidateDockerConfig(config, field.NewPath("docker")) if len(errs) != 1 { - t.Fatalf("Expected errors validating DockerConfig %q", config) + t.Fatalf("Expected errors validating DockerConfig %+v", config) } if errs[0].Field != "docker.storage" || errs[0].Type != field.ErrorTypeNotSupported { t.Fatalf("Not the expected error validating DockerConfig %q", errs) diff --git a/pkg/featureflag/featureflag.go b/pkg/featureflag/featureflag.go index d533a25af5..4acb614644 100644 --- a/pkg/featureflag/featureflag.go +++ b/pkg/featureflag/featureflag.go @@ -37,6 +37,10 @@ func Bool(b bool) *bool { return &b } +// ExperimentalClusterDNS allows for setting the kubelet dns flag to experimental values. +// It allows for experiments with alternative DNS configurations - in particular local proxies. +var ExperimentalClusterDNS = New("ExperimentalClusterDNS", Bool(false)) + // KeepLaunchConfigurations can be set to prevent garbage collection of old launch configurations var KeepLaunchConfigurations = New("KeepLaunchConfigurations", Bool(false)) diff --git a/pkg/flagbuilder/BUILD.bazel b/pkg/flagbuilder/BUILD.bazel index ba95b8b4a3..4eb0cfb342 100644 --- a/pkg/flagbuilder/BUILD.bazel +++ b/pkg/flagbuilder/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "k8s.io/kops/pkg/flagbuilder", visibility = ["//visibility:public"], deps = [ - "//upup/pkg/fi/utils:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", ], diff --git a/pkg/flagbuilder/build_flags.go b/pkg/flagbuilder/build_flags.go index 60d9097cba..48d06f64d7 100644 --- a/pkg/flagbuilder/build_flags.go +++ b/pkg/flagbuilder/build_flags.go @@ -24,9 +24,10 @@ import ( "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/kops/upup/pkg/fi/utils" "github.com/golang/glog" + + "k8s.io/kops/util/pkg/reflectutils" ) // BuildFlags returns a space separated list arguments @@ -57,7 +58,7 @@ func BuildFlagsList(options interface{}) ([]string, error) { } if tag == "-" { glog.V(4).Infof("skipping field with %q flag tag: %s", tag, path) - return utils.SkipReflection + return reflectutils.SkipReflection } // If we specify the repeat option, we will repeat the flag rather than joining it with commas @@ -109,7 +110,7 @@ func BuildFlagsList(options interface{}) ([]string, error) { flag := fmt.Sprintf("--%s=%s", flagName, strings.Join(args, ",")) flags = append(flags, flag) } - return utils.SkipReflection + return reflectutils.SkipReflection } return fmt.Errorf("BuildFlags of value type not handled: %T %s=%v", val.Interface(), path, val.Interface()) @@ -132,7 +133,7 @@ func BuildFlagsList(options interface{}) ([]string, error) { flags = append(flags, flag) } } - return utils.SkipReflection + return reflectutils.SkipReflection } return fmt.Errorf("BuildFlags of value type not handled: %T %s=%v", val.Interface(), path, val.Interface()) @@ -188,9 +189,9 @@ func BuildFlagsList(options interface{}) ([]string, error) { flags = append(flags, flag) } - return utils.SkipReflection + return reflectutils.SkipReflection } - err := utils.ReflectRecursive(reflect.ValueOf(options), walker) + err := reflectutils.ReflectRecursive(reflect.ValueOf(options), walker) if err != nil { return nil, fmt.Errorf("BuildFlagsList to reflect value: %s", err) } diff --git a/pkg/kubemanifest/visitor.go b/pkg/kubemanifest/visitor.go index 94de412461..cee4cf8a58 100644 --- a/pkg/kubemanifest/visitor.go +++ b/pkg/kubemanifest/visitor.go @@ -32,12 +32,12 @@ func (m *visitorBase) VisitString(path []string, v string, mutator func(string)) } func (m *visitorBase) VisitBool(path []string, v bool, mutator func(bool)) error { - glog.V(10).Infof("string value at %s: %s", strings.Join(path, "."), v) + glog.V(10).Infof("string value at %s: %v", strings.Join(path, "."), v) return nil } func (m *visitorBase) VisitFloat64(path []string, v float64, mutator func(float64)) error { - glog.V(10).Infof("float64 value at %s: %s", strings.Join(path, "."), v) + glog.V(10).Infof("float64 value at %s: %f", strings.Join(path, "."), v) return nil } diff --git a/pkg/model/awsmodel/autoscalinggroup.go b/pkg/model/awsmodel/autoscalinggroup.go index d7a364a2dc..4e07bbaf6e 100644 --- a/pkg/model/awsmodel/autoscalinggroup.go +++ b/pkg/model/awsmodel/autoscalinggroup.go @@ -230,11 +230,11 @@ func (b *AutoscalingGroupModelBuilder) Build(c *fi.ModelBuilderContext) error { } t.Tags = tags - if ig.Spec.SuspendProcesses != nil { - for _, p := range ig.Spec.SuspendProcesses { - t.SuspendProcesses = append(t.SuspendProcesses, p) - } + processes := []string{} + for _, p := range ig.Spec.SuspendProcesses { + processes = append(processes, p) } + t.SuspendProcesses = &processes c.AddTask(t) } diff --git a/pkg/model/bootstrapscript.go b/pkg/model/bootstrapscript.go index b763d139d6..e99f528045 100644 --- a/pkg/model/bootstrapscript.go +++ b/pkg/model/bootstrapscript.go @@ -191,7 +191,6 @@ func (b *BootstrapScript) ResourceNodeUp(ig *kops.InstanceGroup, cluster *kops.C spec["kubelet"] = ig.Spec.Kubelet spec["nodeLabels"] = ig.Spec.NodeLabels spec["taints"] = ig.Spec.Taints - spec["suspendProcesses"] = ig.Spec.SuspendProcesses hooks, err := b.getRelevantHooks(ig.Spec.Hooks, ig.Spec.Role) if err != nil { diff --git a/pkg/model/components/kubelet.go b/pkg/model/components/kubelet.go index 24e6ed9a87..3d263e97b1 100644 --- a/pkg/model/components/kubelet.go +++ b/pkg/model/components/kubelet.go @@ -48,11 +48,6 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error { clusterSpec.MasterKubelet = &kops.KubeletConfigSpec{} } - ip, err := WellKnownServiceIP(clusterSpec, 10) - if err != nil { - return err - } - if clusterSpec.KubeAPIServer != nil && clusterSpec.KubeAPIServer.EnableBootstrapAuthToken != nil { if *clusterSpec.KubeAPIServer.EnableBootstrapAuthToken { if clusterSpec.Kubelet.BootstrapKubeconfig == "" { @@ -66,10 +61,17 @@ func (b *KubeletOptionsBuilder) BuildOptions(o interface{}) error { clusterSpec.Kubelet.PodManifestPath = "/etc/kubernetes/manifests" clusterSpec.Kubelet.AllowPrivileged = fi.Bool(true) clusterSpec.Kubelet.LogLevel = fi.Int32(2) - clusterSpec.Kubelet.ClusterDNS = ip.String() clusterSpec.Kubelet.ClusterDomain = clusterSpec.ClusterDNSDomain clusterSpec.Kubelet.NonMasqueradeCIDR = clusterSpec.NonMasqueradeCIDR + if clusterSpec.Kubelet.ClusterDNS == "" { + ip, err := WellKnownServiceIP(clusterSpec, 10) + if err != nil { + return err + } + clusterSpec.Kubelet.ClusterDNS = ip.String() + } + if b.Context.IsKubernetesLT("1.7") { // babysit-daemons removed in 1.7 clusterSpec.Kubelet.BabysitDaemons = fi.Bool(true) diff --git a/pkg/model/components/kubeproxy.go b/pkg/model/components/kubeproxy.go index 56357e67e7..978969fb05 100644 --- a/pkg/model/components/kubeproxy.go +++ b/pkg/model/components/kubeproxy.go @@ -82,5 +82,11 @@ func (b *KubeProxyOptionsBuilder) BuildOptions(o interface{}) error { } } + if cloudProvider == kops.CloudProviderDO { + if config.HostnameOverride == "" { + config.HostnameOverride = "@digitalocean" + } + } + return nil } diff --git a/pkg/model/iam/iam_builder.go b/pkg/model/iam/iam_builder.go index ae0ebde9bb..5c5c4407e3 100644 --- a/pkg/model/iam/iam_builder.go +++ b/pkg/model/iam/iam_builder.go @@ -704,6 +704,7 @@ func addMasterELBPolicies(p *Policy, resource stringorslice.StringOrSlice, legac "elasticloadbalancing:CreateTargetGroup", // aws_loadbalancer.go "elasticloadbalancing:DeleteListener", // aws_loadbalancer.go "elasticloadbalancing:DeleteTargetGroup", // aws_loadbalancer.go + "elasticloadbalancing:DeregisterTargets", // aws_loadbalancer.go "elasticloadbalancing:DescribeListeners", // aws_loadbalancer.go "elasticloadbalancing:DescribeLoadBalancerPolicies", // aws_loadbalancer.go "elasticloadbalancing:DescribeTargetGroups", // aws_loadbalancer.go diff --git a/pkg/model/iam/tests/iam_builder_master_strict.json b/pkg/model/iam/tests/iam_builder_master_strict.json index 4817ba5cb0..f5f595b4bf 100644 --- a/pkg/model/iam/tests/iam_builder_master_strict.json +++ b/pkg/model/iam/tests/iam_builder_master_strict.json @@ -110,6 +110,7 @@ "elasticloadbalancing:CreateTargetGroup", "elasticloadbalancing:DeleteListener", "elasticloadbalancing:DeleteTargetGroup", + "elasticloadbalancing:DeregisterTargets", "elasticloadbalancing:DescribeListeners", "elasticloadbalancing:DescribeLoadBalancerPolicies", "elasticloadbalancing:DescribeTargetGroups", diff --git a/pkg/model/iam/tests/iam_builder_master_strict_ecr.json b/pkg/model/iam/tests/iam_builder_master_strict_ecr.json index 11170f5c71..0ebd445901 100644 --- a/pkg/model/iam/tests/iam_builder_master_strict_ecr.json +++ b/pkg/model/iam/tests/iam_builder_master_strict_ecr.json @@ -110,6 +110,7 @@ "elasticloadbalancing:CreateTargetGroup", "elasticloadbalancing:DeleteListener", "elasticloadbalancing:DeleteTargetGroup", + "elasticloadbalancing:DeregisterTargets", "elasticloadbalancing:DescribeListeners", "elasticloadbalancing:DescribeLoadBalancerPolicies", "elasticloadbalancing:DescribeTargetGroups", diff --git a/pkg/model/tests/data/bootstrapscript_0.txt b/pkg/model/tests/data/bootstrapscript_0.txt index 4819e5f5bc..3b2e752f95 100644 --- a/pkg/model/tests/data/bootstrapscript_0.txt +++ b/pkg/model/tests/data/bootstrapscript_0.txt @@ -200,8 +200,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/model/tests/data/bootstrapscript_1.txt b/pkg/model/tests/data/bootstrapscript_1.txt index 3c3cd423df..f2dd03fe2c 100644 --- a/pkg/model/tests/data/bootstrapscript_1.txt +++ b/pkg/model/tests/data/bootstrapscript_1.txt @@ -217,8 +217,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/model/tests/data/bootstrapscript_2.txt b/pkg/model/tests/data/bootstrapscript_2.txt index 3c3cd423df..f2dd03fe2c 100644 --- a/pkg/model/tests/data/bootstrapscript_2.txt +++ b/pkg/model/tests/data/bootstrapscript_2.txt @@ -217,8 +217,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/model/tests/data/bootstrapscript_3.txt b/pkg/model/tests/data/bootstrapscript_3.txt index b77d064ec5..c8640ee297 100644 --- a/pkg/model/tests/data/bootstrapscript_3.txt +++ b/pkg/model/tests/data/bootstrapscript_3.txt @@ -185,8 +185,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/model/tests/data/bootstrapscript_4.txt b/pkg/model/tests/data/bootstrapscript_4.txt index 6dbda1be3b..510266aac5 100644 --- a/pkg/model/tests/data/bootstrapscript_4.txt +++ b/pkg/model/tests/data/bootstrapscript_4.txt @@ -202,8 +202,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/model/tests/data/bootstrapscript_5.txt b/pkg/model/tests/data/bootstrapscript_5.txt index 6dbda1be3b..510266aac5 100644 --- a/pkg/model/tests/data/bootstrapscript_5.txt +++ b/pkg/model/tests/data/bootstrapscript_5.txt @@ -202,8 +202,6 @@ kubelet: nodeLabels: label2: value2 labelname: labelvalue -suspendProcesses: -- AZRebalance taints: - key1=value1:NoSchedule - key2=value2:NoExecute diff --git a/pkg/resources/aws/aws.go b/pkg/resources/aws/aws.go index 66a0cff045..4820afcb6a 100644 --- a/pkg/resources/aws/aws.go +++ b/pkg/resources/aws/aws.go @@ -1325,14 +1325,14 @@ func extractClusterName(userData string) string { line = strings.TrimSpace(line) line = strings.Trim(line, "'\"") if clusterName != "" && clusterName != line { - glog.Warning("cannot uniquely determine cluster-name, found %q and %q", line, clusterName) + glog.Warningf("cannot uniquely determine cluster-name, found %q and %q", line, clusterName) return "" } clusterName = line } if err := scanner.Err(); err != nil { - glog.Warning("error scanning UserData: %v", err) + glog.Warningf("error scanning UserData: %v", err) return "" } diff --git a/pkg/resources/openstack/BUILD.bazel b/pkg/resources/openstack/BUILD.bazel new file mode 100644 index 0000000000..7dee9eff7e --- /dev/null +++ b/pkg/resources/openstack/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = ["resources.go"], + importpath = "k8s.io/kops/pkg/resources/openstack", + visibility = ["//visibility:public"], + deps = [ + "//pkg/resources:go_default_library", + "//upup/pkg/fi/cloudup/openstack:go_default_library", + ], +) diff --git a/pkg/resources/openstack/resources.go b/pkg/resources/openstack/resources.go new file mode 100644 index 0000000000..bbc13a5aa5 --- /dev/null +++ b/pkg/resources/openstack/resources.go @@ -0,0 +1,32 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package openstack + +import ( + "k8s.io/kops/pkg/resources" + "k8s.io/kops/upup/pkg/fi/cloudup/openstack" +) + +type listFn func(openstack.OpenstackCloud, string) ([]*resources.Resource, error) + +func ListResources(cloud openstack.OpenstackCloud, clusterName string) (map[string]*resources.Resource, error) { + resourceTrackers := make(map[string]*resources.Resource) + + // TODO(lmb): Implement resource list + + return resourceTrackers, nil +} diff --git a/pkg/resources/ops/BUILD.bazel b/pkg/resources/ops/BUILD.bazel index 0f1202baaf..b1d6b00a2b 100644 --- a/pkg/resources/ops/BUILD.bazel +++ b/pkg/resources/ops/BUILD.bazel @@ -14,9 +14,11 @@ go_library( "//pkg/resources/aws:go_default_library", "//pkg/resources/digitalocean:go_default_library", "//pkg/resources/gce:go_default_library", + "//pkg/resources/openstack:go_default_library", "//upup/pkg/fi:go_default_library", "//upup/pkg/fi/cloudup/awsup:go_default_library", "//upup/pkg/fi/cloudup/gce:go_default_library", + "//upup/pkg/fi/cloudup/openstack:go_default_library", "//upup/pkg/fi/cloudup/vsphere:go_default_library", "//vendor/github.com/golang/glog:go_default_library", ], diff --git a/pkg/resources/ops/collector.go b/pkg/resources/ops/collector.go index ed2418128c..0e5698461d 100644 --- a/pkg/resources/ops/collector.go +++ b/pkg/resources/ops/collector.go @@ -24,9 +24,11 @@ import ( "k8s.io/kops/pkg/resources/aws" "k8s.io/kops/pkg/resources/digitalocean" "k8s.io/kops/pkg/resources/gce" + "k8s.io/kops/pkg/resources/openstack" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/upup/pkg/fi/cloudup/awsup" cloudgce "k8s.io/kops/upup/pkg/fi/cloudup/gce" + cloudopenstack "k8s.io/kops/upup/pkg/fi/cloudup/openstack" "k8s.io/kops/upup/pkg/fi/cloudup/vsphere" ) @@ -39,6 +41,8 @@ func ListResources(cloud fi.Cloud, clusterName string, region string) (map[strin return digitalocean.ListResources(cloud.(*digitalocean.Cloud), clusterName) case kops.CloudProviderGCE: return gce.ListResourcesGCE(cloud.(cloudgce.GCECloud), clusterName, region) + case kops.CloudProviderOpenstack: + return openstack.ListResources(cloud.(cloudopenstack.OpenstackCloud), clusterName) case kops.CloudProviderVSphere: return resources.ListResourcesVSphere(cloud.(*vsphere.VSphereCloud), clusterName) default: diff --git a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml index d2b3837398..39ee6b8cb5 100644 --- a/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_cidr/cloudformation.json.extracted.yaml @@ -247,7 +247,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersadditionalcidrex cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC @@ -264,7 +263,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1bmastersadditionalcidrex Tags: - _automatic_upgrades - _aws - - _kubernetes_master channels: - memfs://clusters.example.com/additionalcidr.example.com/addons/bootstrap-channel.yaml protokubeImage: @@ -456,7 +454,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionalcidrexamplecom.Propert cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC diff --git a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml index 6213d23dec..f3a7ca2a82 100644 --- a/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/additional_user-data/cloudformation.json.extracted.yaml @@ -256,7 +256,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC @@ -273,7 +272,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersadditionaluserda Tags: - _automatic_upgrades - _aws - - _kubernetes_master channels: - memfs://clusters.example.com/additionaluserdata.example.com/addons/bootstrap-channel.yaml protokubeImage: @@ -486,7 +484,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesadditionaluserdataexamplecom.Pro cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC diff --git a/tests/integration/update_cluster/complex/kubernetes.tf b/tests/integration/update_cluster/complex/kubernetes.tf index 51e87c74c7..0a2b134482 100644 --- a/tests/integration/update_cluster/complex/kubernetes.tf +++ b/tests/integration/update_cluster/complex/kubernetes.tf @@ -228,6 +228,8 @@ resource "aws_elb" "api-complex-example-com" { tags = { KubernetesCluster = "complex.example.com" Name = "api.complex.example.com" + Owner = "John Doe" + "foo/bar" = "fib+baz" } } diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml index a9af2afe75..13de0995e4 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/existing_iam_cloudformation/cloudformation.json.extracted.yaml @@ -247,7 +247,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC @@ -264,7 +263,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco Tags: - _automatic_upgrades - _aws - - _kubernetes_master channels: - memfs://clusters.example.com/minimal.example.com/addons/bootstrap-channel.yaml protokubeImage: @@ -456,7 +454,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC diff --git a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data index 92d7d3a558..070f6cdfe3 100644 --- a/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data +++ b/tests/integration/update_cluster/existing_iam_cloudformation/data/aws_launch_configuration_master-us-west-2a.masters.k8s-iam.us-west-2.td.priv_user_data @@ -281,7 +281,6 @@ InstanceGroupName: master-us-west-2a Tags: - _automatic_upgrades - _aws -- _kubernetes_master - _networking_cni channels: - s3://tune-k8s-kops-test/k8s-iam.us-west-2.td.priv/addons/bootstrap-channel.yaml diff --git a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml index 62498349e6..e43a863c2e 100644 --- a/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/externallb/cloudformation.json.extracted.yaml @@ -267,7 +267,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC @@ -284,7 +283,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersexternallbexampl Tags: - _automatic_upgrades - _aws - - _kubernetes_master channels: - memfs://clusters.example.com/externallb.example.com/addons/bootstrap-channel.yaml protokubeImage: @@ -481,7 +479,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesexternallbexamplecom.Properties. cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC diff --git a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml index a9af2afe75..13de0995e4 100644 --- a/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml +++ b/tests/integration/update_cluster/minimal-cloudformation/cloudformation.json.extracted.yaml @@ -247,7 +247,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC @@ -264,7 +263,6 @@ Resources.AWSAutoScalingLaunchConfigurationmasterustest1amastersminimalexampleco Tags: - _automatic_upgrades - _aws - - _kubernetes_master channels: - memfs://clusters.example.com/minimal.example.com/addons/bootstrap-channel.yaml protokubeImage: @@ -456,7 +454,6 @@ Resources.AWSAutoScalingLaunchConfigurationnodesminimalexamplecom.Properties.Use cat > ig_spec.yaml << '__EOF_IG_SPEC' kubelet: null nodeLabels: null - suspendProcesses: null taints: null __EOF_IG_SPEC diff --git a/tests/integration/update_cluster/shared_subnet/in-v1alpha2.yaml b/tests/integration/update_cluster/shared_subnet/in-v1alpha2.yaml index f707ccefb3..e477883ed2 100644 --- a/tests/integration/update_cluster/shared_subnet/in-v1alpha2.yaml +++ b/tests/integration/update_cluster/shared_subnet/in-v1alpha2.yaml @@ -18,7 +18,7 @@ spec: - instanceGroup: master-us-test-1a name: us-test-1a name: events - kubernetesVersion: v1.4.12 + kubernetesVersion: v1.8.6 masterInternalName: api.internal.sharedsubnet.example.com masterPublicName: api.sharedsubnet.example.com networkCIDR: 172.20.0.0/16 diff --git a/upup/models/cloudup/resources/addons/coredns.addons.k8s.io/k8s-1.6.yaml.template b/upup/models/cloudup/resources/addons/coredns.addons.k8s.io/k8s-1.6.yaml.template index 24f20ec2e7..c3a7fea17e 100644 --- a/upup/models/cloudup/resources/addons/coredns.addons.k8s.io/k8s-1.6.yaml.template +++ b/upup/models/cloudup/resources/addons/coredns.addons.k8s.io/k8s-1.6.yaml.template @@ -64,7 +64,9 @@ data: } prometheus :9153 proxy . /etc/resolv.conf + loop cache 30 + loadbalance reload } --- @@ -99,7 +101,7 @@ spec: operator: "Exists" containers: - name: coredns - image: k8s.gcr.io/coredns:1.1.3 + image: k8s.gcr.io/coredns:1.2.2 imagePullPolicy: IfNotPresent resources: limits: @@ -111,6 +113,7 @@ spec: volumeMounts: - name: config-volume mountPath: /etc/coredns + readOnly: true ports: - containerPort: 53 name: dns @@ -121,6 +124,14 @@ spec: - containerPort: 9153 name: metrics protocol: TCP + securityContext: + allowPrivilegeEscalation: false + capabilities: + add: + - NET_BIND_SERVICE + drop: + - all + readOnlyRootFilesystem: true livenessProbe: httpGet: path: /health diff --git a/upup/models/cloudup/resources/addons/digitalocean-cloud-controller.addons.k8s.io/k8s-1.8.yaml.template b/upup/models/cloudup/resources/addons/digitalocean-cloud-controller.addons.k8s.io/k8s-1.8.yaml.template index 7c56c633ae..4f17e98b93 100644 --- a/upup/models/cloudup/resources/addons/digitalocean-cloud-controller.addons.k8s.io/k8s-1.8.yaml.template +++ b/upup/models/cloudup/resources/addons/digitalocean-cloud-controller.addons.k8s.io/k8s-1.8.yaml.template @@ -47,7 +47,7 @@ spec: operator: Exists tolerationSeconds: 300 containers: - - image: digitalocean/digitalocean-cloud-controller-manager:v0.1.3 + - image: digitalocean/digitalocean-cloud-controller-manager:v0.1.7 name: digitalocean-cloud-controller-manager command: - "/bin/digitalocean-cloud-controller-manager" diff --git a/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/k8s-1.6.yaml.template b/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/k8s-1.6.yaml.template index 5733b25c27..fe7272a032 100644 --- a/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/k8s-1.6.yaml.template +++ b/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/k8s-1.6.yaml.template @@ -6,7 +6,7 @@ metadata: labels: k8s-addon: dns-controller.addons.k8s.io k8s-app: dns-controller - version: v1.10.0-beta.1 + version: v1.10.0 spec: replicas: 1 selector: @@ -17,7 +17,7 @@ spec: labels: k8s-addon: dns-controller.addons.k8s.io k8s-app: dns-controller - version: v1.10.0-beta.1 + version: v1.10.0 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' # For 1.6, we keep the old tolerations in case of a downgrade to 1.5 @@ -33,7 +33,7 @@ spec: serviceAccount: dns-controller containers: - name: dns-controller - image: kope/dns-controller:1.10.0-beta.1 + image: kope/dns-controller:1.10.0 command: {{ range $arg := DnsControllerArgv }} - "{{ $arg }}" diff --git a/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/pre-k8s-1.6.yaml.template b/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/pre-k8s-1.6.yaml.template index c28e642618..db0748ad2e 100644 --- a/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/pre-k8s-1.6.yaml.template +++ b/upup/models/cloudup/resources/addons/dns-controller.addons.k8s.io/pre-k8s-1.6.yaml.template @@ -6,7 +6,7 @@ metadata: labels: k8s-addon: dns-controller.addons.k8s.io k8s-app: dns-controller - version: v1.10.0-beta.1 + version: v1.10.0 spec: replicas: 1 selector: @@ -17,7 +17,7 @@ spec: labels: k8s-addon: dns-controller.addons.k8s.io k8s-app: dns-controller - version: v1.10.0-beta.1 + version: v1.10.0 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' scheduler.alpha.kubernetes.io/tolerations: '[{"key": "dedicated", "value": "master"}]' @@ -28,7 +28,7 @@ spec: hostNetwork: true containers: - name: dns-controller - image: kope/dns-controller:1.10.0-beta.1 + image: kope/dns-controller:1.10.0 command: {{ range $arg := DnsControllerArgv }} - "{{ $arg }}" diff --git a/upup/models/cloudup/resources/addons/networking.amazon-vpc-routed-eni/k8s-1.7.yaml.template b/upup/models/cloudup/resources/addons/networking.amazon-vpc-routed-eni/k8s-1.7.yaml.template index 9c1bebae4f..c2f0179b9e 100644 --- a/upup/models/cloudup/resources/addons/networking.amazon-vpc-routed-eni/k8s-1.7.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.amazon-vpc-routed-eni/k8s-1.7.yaml.template @@ -62,8 +62,8 @@ spec: serviceAccountName: aws-node hostNetwork: true tolerations: - - key: node-role.kubernetes.io/master - effect: NoSchedule + - effect: NoSchedule + operator: Exists - key: CriticalAddonsOnly operator: Exists containers: diff --git a/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.7.yaml.template b/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.7.yaml.template index bae49bbf03..9af6738bf0 100644 --- a/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.7.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.projectcalico.org/k8s-1.7.yaml.template @@ -519,7 +519,7 @@ spec: operator: Exists serviceAccountName: k8s-ec2-srcdst containers: - - image: ottoyiu/k8s-ec2-srcdst:v0.2.1 + - image: ottoyiu/k8s-ec2-srcdst:v0.2.2 name: k8s-ec2-srcdst resources: requests: diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.6.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.6.yaml.template index cccad7ac43..f4eb4f4a69 100644 --- a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.6.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.6.yaml.template @@ -1,3 +1,13 @@ +{{- if WeaveSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: weave-net + namespace: kube-system +stringData: + network-password: {{ WeaveSecret }} +--- +{{- end }} apiVersion: v1 kind: ServiceAccount metadata: @@ -128,6 +138,13 @@ spec: - name: CONN_LIMIT value: "{{ .Networking.Weave.ConnLimit }}" {{- end }} + {{- if WeaveSecret }} + - name: WEAVE_PASSWORD + valueFrom: + secretKeyRef: + name: weave-net + key: network-password + {{- end }} image: 'weaveworks/weave-kube:2.3.0' livenessProbe: httpGet: diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template index 9a2335fd19..a10a626901 100644 --- a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.7.yaml.template @@ -44,6 +44,13 @@ rules: - get - list - watch + - apiGroups: + - '' + resources: + - nodes/status + verbs: + - patch + - update --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding @@ -148,7 +155,7 @@ spec: name: weave-net key: network-password {{- end }} - image: 'weaveworks/weave-kube:2.3.0' + image: 'weaveworks/weave-kube:2.4.0' livenessProbe: httpGet: host: 127.0.0.1 @@ -186,7 +193,7 @@ spec: fieldRef: apiVersion: v1 fieldPath: spec.nodeName - image: 'weaveworks/weave-npc:2.3.0' + image: 'weaveworks/weave-npc:2.4.0' resources: requests: cpu: 50m diff --git a/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template new file mode 100644 index 0000000000..8ca86307ea --- /dev/null +++ b/upup/models/cloudup/resources/addons/networking.weave/k8s-1.8.yaml.template @@ -0,0 +1,243 @@ +{{- if WeaveSecret }} +apiVersion: v1 +kind: Secret +metadata: + name: weave-net + namespace: kube-system +stringData: + network-password: {{ WeaveSecret }} +--- +{{- end }} + +apiVersion: v1 +kind: ServiceAccount +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net + role.kubernetes.io/networking: "1" +rules: + - apiGroups: + - '' + resources: + - pods + - namespaces + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - 'networking.k8s.io' + resources: + - networkpolicies + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - nodes/status + verbs: + - patch + - update +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net + role.kubernetes.io/networking: "1" +roleRef: + kind: ClusterRole + name: weave-net + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: weave-net + namespace: kube-system +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net +rules: + - apiGroups: + - '' + resources: + - configmaps + resourceNames: + - weave-net + verbs: + - get + - update + - apiGroups: + - '' + resources: + - configmaps + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: RoleBinding +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net +roleRef: + kind: Role + name: weave-net + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: weave-net + namespace: kube-system +--- +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: weave-net + namespace: kube-system + labels: + name: weave-net + role.kubernetes.io/networking: "1" +spec: + # Wait 5 seconds to let pod connect before rolling next pod + minReadySeconds: 5 + template: + metadata: + labels: + name: weave-net + role.kubernetes.io/networking: "1" + annotations: + scheduler.alpha.kubernetes.io/critical-pod: '' + spec: + containers: + - name: weave + command: + - /home/weave/launch.sh + env: + - name: HOSTNAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: IPALLOC_RANGE + value: {{ .KubeControllerManager.ClusterCIDR }} + {{- if .Networking.Weave.MTU }} + - name: WEAVE_MTU + value: "{{ .Networking.Weave.MTU }}" + {{- end }} + {{- if .Networking.Weave.ConnLimit }} + - name: CONN_LIMIT + value: "{{ .Networking.Weave.ConnLimit }}" + {{- end }} + {{- if WeaveSecret }} + - name: WEAVE_PASSWORD + valueFrom: + secretKeyRef: + name: weave-net + key: network-password + {{- end }} + image: 'weaveworks/weave-kube:2.4.0' + livenessProbe: + httpGet: + host: 127.0.0.1 + path: /status + port: 6784 + initialDelaySeconds: 30 + resources: + requests: + cpu: 50m + memory: 200Mi + limits: + memory: 200Mi + securityContext: + privileged: true + volumeMounts: + - name: weavedb + mountPath: /weavedb + - name: cni-bin + mountPath: /host/opt + - name: cni-bin2 + mountPath: /host/home + - name: cni-conf + mountPath: /host/etc + - name: dbus + mountPath: /host/var/lib/dbus + - name: lib-modules + mountPath: /lib/modules + - name: xtables-lock + mountPath: /run/xtables.lock + - name: weave-npc + args: [] + env: + - name: HOSTNAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: 'weaveworks/weave-npc:2.4.0' + resources: + requests: + cpu: 50m + memory: 200Mi + limits: + memory: 200Mi + securityContext: + privileged: true + volumeMounts: + - name: xtables-lock + mountPath: /run/xtables.lock + hostNetwork: true + hostPID: true + restartPolicy: Always + securityContext: + seLinuxOptions: {} + serviceAccountName: weave-net + tolerations: + - effect: NoSchedule + operator: Exists + - key: CriticalAddonsOnly + operator: Exists + volumes: + - name: weavedb + hostPath: + path: /var/lib/weave + - name: cni-bin + hostPath: + path: /opt + - name: cni-bin2 + hostPath: + path: /home + - name: cni-conf + hostPath: + path: /etc + - name: dbus + hostPath: + path: /var/lib/dbus + - name: lib-modules + hostPath: + path: /lib/modules + - name: xtables-lock + hostPath: + path: /run/xtables.lock + type: FileOrCreate + updateStrategy: + type: RollingUpdate diff --git a/upup/pkg/fi/BUILD.bazel b/upup/pkg/fi/BUILD.bazel index 1bceefe000..f2c69e045d 100644 --- a/upup/pkg/fi/BUILD.bazel +++ b/upup/pkg/fi/BUILD.bazel @@ -21,6 +21,7 @@ go_library( "http.go", "lifecycle.go", "named.go", + "printers.go", "resources.go", "secrets.go", "target.go", @@ -45,8 +46,10 @@ go_library( "//pkg/kopscodecs:go_default_library", "//pkg/pki:go_default_library", "//pkg/sshcredentials:go_default_library", + "//pkg/values:go_default_library", "//upup/pkg/fi/utils:go_default_library", "//util/pkg/hashing:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//util/pkg/vfs:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/golang.org/x/crypto/ssh:go_default_library", diff --git a/upup/pkg/fi/assettasks/copydockerimage_fitask.go b/upup/pkg/fi/assettasks/copydockerimage_fitask.go index 7bdecfe24c..ac10207cfd 100644 --- a/upup/pkg/fi/assettasks/copydockerimage_fitask.go +++ b/upup/pkg/fi/assettasks/copydockerimage_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realCopyDockerImage CopyDockerImage -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *CopyDockerImage) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/assettasks/copyfile_fitask.go b/upup/pkg/fi/assettasks/copyfile_fitask.go index 53a0e3437d..b4bc6e1747 100644 --- a/upup/pkg/fi/assettasks/copyfile_fitask.go +++ b/upup/pkg/fi/assettasks/copyfile_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realCopyFile CopyFile -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *CopyFile) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/BUILD.bazel b/upup/pkg/fi/cloudup/BUILD.bazel index ae2f1e04e4..5699f2b8f7 100644 --- a/upup/pkg/fi/cloudup/BUILD.bazel +++ b/upup/pkg/fi/cloudup/BUILD.bazel @@ -73,6 +73,7 @@ go_library( "//upup/pkg/fi/loader:go_default_library", "//upup/pkg/fi/utils:go_default_library", "//util/pkg/hashing:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//util/pkg/vfs:go_default_library", "//vendor/github.com/blang/semver:go_default_library", "//vendor/github.com/golang/glog:go_default_library", diff --git a/upup/pkg/fi/cloudup/alitasks/disk.go b/upup/pkg/fi/cloudup/alitasks/disk.go index 23565f1544..399d73dfee 100644 --- a/upup/pkg/fi/cloudup/alitasks/disk.go +++ b/upup/pkg/fi/cloudup/alitasks/disk.go @@ -73,7 +73,7 @@ func (d *Disk) Find(c *fi.Context) (*Disk, error) { return nil, nil } if len(responseDisks) > 1 { - glog.V(4).Info("The number of specified disk with the same name and ClusterTags exceeds 1, diskName:%q", *d.Name) + glog.V(4).Infof("The number of specified disk with the same name and ClusterTags exceeds 1, diskName:%q", *d.Name) } glog.V(2).Infof("found matching Disk with name: %q", *d.Name) @@ -88,7 +88,7 @@ func (d *Disk) Find(c *fi.Context) (*Disk, error) { tags, err := cloud.GetTags(fi.StringValue(actual.DiskId), DiskResource) if err != nil { - glog.V(4).Info("Error getting tags on resourceId:%q", *actual.DiskId) + glog.V(4).Infof("Error getting tags on resourceId:%q", *actual.DiskId) } actual.Tags = tags diff --git a/upup/pkg/fi/cloudup/alitasks/disk_fitask.go b/upup/pkg/fi/cloudup/alitasks/disk_fitask.go index 52ee25a74c..48efc49a10 100644 --- a/upup/pkg/fi/cloudup/alitasks/disk_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/disk_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDisk Disk -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Disk) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go b/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go index 6ac792a374..aef675a8c9 100644 --- a/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go +++ b/upup/pkg/fi/cloudup/alitasks/launchconfiguration.go @@ -86,7 +86,7 @@ func (l *LaunchConfiguration) Find(c *fi.Context) (*LaunchConfiguration, error) return nil, nil } if len(configList) > 1 { - glog.V(4).Info("The number of specified ScalingConfigurations with the same name and ScalingGroupId exceeds 1, diskName:%q", *l.Name) + glog.V(4).Infof("The number of specified ScalingConfigurations with the same name and ScalingGroupId exceeds 1, diskName:%q", *l.Name) } glog.V(2).Infof("found matching LaunchConfiguration: %q", *l.Name) diff --git a/upup/pkg/fi/cloudup/alitasks/launchconfiguration_fitask.go b/upup/pkg/fi/cloudup/alitasks/launchconfiguration_fitask.go index 22c1b328d7..a3f4bf0920 100644 --- a/upup/pkg/fi/cloudup/alitasks/launchconfiguration_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/launchconfiguration_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLaunchConfiguration LaunchConfiguration -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LaunchConfiguration) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go index 218d4ad010..b3ac7fe5e6 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancer.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancer.go @@ -68,7 +68,7 @@ func (l *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } glog.V(2).Infof("found matching LoadBalancer: %q", *l.Name) @@ -122,7 +122,7 @@ func (l *LoadBalancer) FindIPAddress(context *fi.Context) (*string, error) { return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", *l.Name) } address := responseLoadBalancers[0].Address diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancer_fitask.go b/upup/pkg/fi/cloudup/alitasks/loadbalancer_fitask.go index 53c719969a..3bdb277e63 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancer_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancer_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLoadBalancer LoadBalancer -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LoadBalancer) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancerlistener_fitask.go b/upup/pkg/fi/cloudup/alitasks/loadbalancerlistener_fitask.go index 0a8dce6d39..7b1f8207e1 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancerlistener_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancerlistener_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLoadBalancerListener LoadBalancerListener -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LoadBalancerListener) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go b/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go index 3c637f87c0..07c26633a3 100644 --- a/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/loadbalancerwhitelist_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLoadBalancerWhiteList LoadBalancerWhiteList -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LoadBalancerWhiteList) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/rampolicy_fitask.go b/upup/pkg/fi/cloudup/alitasks/rampolicy_fitask.go index 3778032b26..f2bd9e41b0 100644 --- a/upup/pkg/fi/cloudup/alitasks/rampolicy_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/rampolicy_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRAMPolicy RAMPolicy -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *RAMPolicy) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/ramrole_fitask.go b/upup/pkg/fi/cloudup/alitasks/ramrole_fitask.go index 87fba176a4..a37d11042f 100644 --- a/upup/pkg/fi/cloudup/alitasks/ramrole_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/ramrole_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRAMRole RAMRole -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *RAMRole) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/scalinggroup.go b/upup/pkg/fi/cloudup/alitasks/scalinggroup.go index 5641bbb9af..828c9f933b 100644 --- a/upup/pkg/fi/cloudup/alitasks/scalinggroup.go +++ b/upup/pkg/fi/cloudup/alitasks/scalinggroup.go @@ -68,7 +68,7 @@ func (s *ScalingGroup) Find(c *fi.Context) (*ScalingGroup, error) { } if len(groupList) > 1 { - glog.V(4).Info("The number of specified scalingGroup with the same name and ClusterTags exceeds 1, diskName:%q", *s.Name) + glog.V(4).Infof("The number of specified scalingGroup with the same name and ClusterTags exceeds 1, diskName:%q", *s.Name) } glog.V(2).Infof("found matching ScalingGroup with Name: %q", *s.Name) diff --git a/upup/pkg/fi/cloudup/alitasks/scalinggroup_fitask.go b/upup/pkg/fi/cloudup/alitasks/scalinggroup_fitask.go index 231c795748..d631af5c45 100644 --- a/upup/pkg/fi/cloudup/alitasks/scalinggroup_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/scalinggroup_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realScalingGroup ScalingGroup -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ScalingGroup) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/securitygroup_fitask.go b/upup/pkg/fi/cloudup/alitasks/securitygroup_fitask.go index efcf585349..f86355da06 100644 --- a/upup/pkg/fi/cloudup/alitasks/securitygroup_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/securitygroup_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecurityGroup SecurityGroup -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SecurityGroup) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/securitygrouprule_fitask.go b/upup/pkg/fi/cloudup/alitasks/securitygrouprule_fitask.go index b2dce57af5..a647588e64 100644 --- a/upup/pkg/fi/cloudup/alitasks/securitygrouprule_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/securitygrouprule_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecurityGroupRule SecurityGroupRule -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SecurityGroupRule) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/sshkey_fitask.go b/upup/pkg/fi/cloudup/alitasks/sshkey_fitask.go index fe7e467275..a689198d84 100644 --- a/upup/pkg/fi/cloudup/alitasks/sshkey_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/sshkey_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSSHKey SSHKey -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SSHKey) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/vpc_fitask.go b/upup/pkg/fi/cloudup/alitasks/vpc_fitask.go index 9d85ba87b7..b568a5e4a3 100644 --- a/upup/pkg/fi/cloudup/alitasks/vpc_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/vpc_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVPC VPC -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *VPC) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/alitasks/vswitch_fitask.go b/upup/pkg/fi/cloudup/alitasks/vswitch_fitask.go index e9e581da89..40b74451a4 100644 --- a/upup/pkg/fi/cloudup/alitasks/vswitch_fitask.go +++ b/upup/pkg/fi/cloudup/alitasks/vswitch_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVSwitch VSwitch -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *VSwitch) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/aliup/ali_cloud.go b/upup/pkg/fi/cloudup/aliup/ali_cloud.go index 79b0da1304..9e9352d82f 100644 --- a/upup/pkg/fi/cloudup/aliup/ali_cloud.go +++ b/upup/pkg/fi/cloudup/aliup/ali_cloud.go @@ -215,7 +215,7 @@ func (c *aliCloudImplementation) CreateTags(resourceId string, resourceType stri if len(tags) == 0 { return nil } else if len(tags) > 10 { - glog.V(4).Info("The number of specified resource's tags exceeds 10, resourceId:%q", resourceId) + glog.V(4).Infof("The number of specified resource's tags exceeds 10, resourceId:%q", resourceId) } if resourceId == "" { return errors.New("resourceId not provided to CreateTags") @@ -287,7 +287,7 @@ func (c *aliCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]k return nil, nil } if len(responseLoadBalancers) > 1 { - glog.V(4).Info("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", name) + glog.V(4).Infof("The number of specified loadbalancer with the same name exceeds 1, loadbalancerName:%q", name) } address := responseLoadBalancers[0].Address diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go index dbb418e2fe..accb7ac52c 100644 --- a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go @@ -49,7 +49,7 @@ type AutoscalingGroup struct { LaunchConfiguration *LaunchConfiguration - SuspendProcesses []string + SuspendProcesses *[]string } var _ fi.CompareWithID = &AutoscalingGroup{} @@ -146,6 +146,13 @@ func (e *AutoscalingGroup) Find(c *fi.Context) (*AutoscalingGroup, error) { actual.Subnets = e.Subnets } + processes := []string{} + for _, p := range g.SuspendedProcesses { + processes = append(processes, *p.ProcessName) + } + + actual.SuspendProcesses = &processes + // Avoid spurious changes actual.Lifecycle = e.Lifecycle @@ -227,6 +234,21 @@ func (_ *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos return fmt.Errorf("error enabling metrics collection for AutoscalingGroup: %v", err) } + if len(*e.SuspendProcesses) > 0 { + toSuspend := []*string{} + for _, p := range *e.SuspendProcesses { + toSuspend = append(toSuspend, &p) + } + + processQuery := &autoscaling.ScalingProcessQuery{} + processQuery.AutoScalingGroupName = e.Name + processQuery.ScalingProcesses = toSuspend + + _, err := t.Cloud.Autoscaling().SuspendProcesses(processQuery) + if err != nil { + return fmt.Errorf("error suspending processes: %v", err) + } + } } else { request := &autoscaling.UpdateAutoScalingGroupInput{ AutoScalingGroupName: e.Name, @@ -282,6 +304,33 @@ func (_ *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos } } + if changes.SuspendProcesses != nil { + toSuspend := processCompare(e.SuspendProcesses, a.SuspendProcesses) + toResume := processCompare(a.SuspendProcesses, e.SuspendProcesses) + + if len(toSuspend) > 0 { + suspendProcessQuery := &autoscaling.ScalingProcessQuery{} + suspendProcessQuery.AutoScalingGroupName = e.Name + suspendProcessQuery.ScalingProcesses = toSuspend + + _, err := t.Cloud.Autoscaling().SuspendProcesses(suspendProcessQuery) + if err != nil { + return fmt.Errorf("error suspending processes: %v", err) + } + } + if len(toResume) > 0 { + resumeProcessQuery := &autoscaling.ScalingProcessQuery{} + resumeProcessQuery.AutoScalingGroupName = e.Name + resumeProcessQuery.ScalingProcesses = toResume + + _, err := t.Cloud.Autoscaling().ResumeProcesses(resumeProcessQuery) + if err != nil { + return fmt.Errorf("error resuming processes: %v", err) + } + } + changes.SuspendProcesses = nil + } + empty := &AutoscalingGroup{} if !reflect.DeepEqual(empty, changes) { glog.Warningf("cannot apply changes to AutoScalingGroup: %v", changes) @@ -306,26 +355,30 @@ func (_ *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos } } - if e.SuspendProcesses != nil { - processQuery := &autoscaling.ScalingProcessQuery{} - processQuery.AutoScalingGroupName = e.Name - processQuery.ScalingProcesses = []*string{} - - for _, p := range e.SuspendProcesses { - processQuery.ScalingProcesses = append(processQuery.ScalingProcesses, &p) - } - - _, err := t.Cloud.Autoscaling().SuspendProcesses(processQuery) - if err != nil { - return fmt.Errorf("error suspending processes: %v", err) - } - } - // TODO: Use PropagateAtLaunch = false for tagging? return nil // We have } +// processCompare returns processes that exist in a but not in b +func processCompare(a *[]string, b *[]string) []*string { + notInB := []*string{} + for _, ap := range *a { + found := false + for _, bp := range *b { + if ap == bp { + found = true + break + } + } + if !found { + notFound := ap + notInB = append(notInB, ¬Found) + } + } + return notInB +} + // getASGTagsToDelete loops through the currently set tags and builds a list of // tags to be deleted from the Autoscaling Group func (e *AutoscalingGroup) getASGTagsToDelete(currentTags map[string]string) []*autoscaling.Tag { @@ -429,7 +482,7 @@ func (_ *AutoscalingGroup) RenderTerraform(t *terraform.TerraformTarget, a, e, c var processes []*string if e.SuspendProcesses != nil { - for _, p := range e.SuspendProcesses { + for _, p := range *e.SuspendProcesses { processes = append(processes, fi.String(p)) } } diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_fitask.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_fitask.go index a71a0c5661..e89c4a6d88 100644 --- a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realAutoscalingGroup AutoscalingGroup -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *AutoscalingGroup) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_test.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_test.go index 9ac01b1bde..d8bfcda966 100644 --- a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_test.go +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup_test.go @@ -127,3 +127,72 @@ func TestGetASGTagsToDelete(t *testing.T) { } } } + +func TestProcessCompare(t *testing.T) { + rebalance := "AZRebalance" + healthcheck := "HealthCheck" + + a := []string{} + b := []string{ + rebalance, + } + c := []string{ + rebalance, + healthcheck, + } + + cases := []struct { + A *[]string + B *[]string + ExpectedProcesses []*string + }{ + { + A: &a, + B: &b, + ExpectedProcesses: []*string{}, + }, + { + A: &b, + B: &a, + ExpectedProcesses: []*string{ + &rebalance, + }, + }, + { + A: &c, + B: &b, + ExpectedProcesses: []*string{ + &healthcheck, + }, + }, + { + A: &c, + B: &a, + ExpectedProcesses: []*string{ + &rebalance, + &healthcheck, + }, + }, + } + + for i, x := range cases { + result := processCompare(x.A, x.B) + + expected, err := yaml.Marshal(x.ExpectedProcesses) + if err != nil { + t.Errorf("case %d, unexpected error converting expected processes to yaml: %v", i, err) + } + + actual, err := yaml.Marshal(result) + if err != nil { + t.Errorf("case %d, unexpected error converting actual result to yaml: %v", i, err) + } + + if string(expected) != string(actual) { + diffString := diff.FormatDiff(string(expected), string(actual)) + t.Errorf("case %d failed, actual output differed from expected.", i) + t.Logf("diff:\n%s\n", diffString) + + } + } +} diff --git a/upup/pkg/fi/cloudup/awstasks/dhcpoptions_fitask.go b/upup/pkg/fi/cloudup/awstasks/dhcpoptions_fitask.go index 04f2b49cc8..22de0c9f91 100644 --- a/upup/pkg/fi/cloudup/awstasks/dhcpoptions_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/dhcpoptions_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDHCPOptions DHCPOptions -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *DHCPOptions) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/dnsname_fitask.go b/upup/pkg/fi/cloudup/awstasks/dnsname_fitask.go index 9733dc545a..0ee0353634 100644 --- a/upup/pkg/fi/cloudup/awstasks/dnsname_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/dnsname_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDNSName DNSName -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *DNSName) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/dnszone_fitask.go b/upup/pkg/fi/cloudup/awstasks/dnszone_fitask.go index baf2a3564a..445937d3ec 100644 --- a/upup/pkg/fi/cloudup/awstasks/dnszone_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/dnszone_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDNSZone DNSZone -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *DNSZone) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/ebsvolume_fitask.go b/upup/pkg/fi/cloudup/awstasks/ebsvolume_fitask.go index 84b1bdfd2d..0885ac36d5 100644 --- a/upup/pkg/fi/cloudup/awstasks/ebsvolume_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/ebsvolume_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realEBSVolume EBSVolume -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *EBSVolume) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/elasticip_fitask.go b/upup/pkg/fi/cloudup/awstasks/elasticip_fitask.go index de9db63b31..170478a107 100644 --- a/upup/pkg/fi/cloudup/awstasks/elasticip_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/elasticip_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realElasticIP ElasticIP -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ElasticIP) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/externalloadbalancerattachment_fitask.go b/upup/pkg/fi/cloudup/awstasks/externalloadbalancerattachment_fitask.go index 2ca63d710e..e0dc6a6ff1 100644 --- a/upup/pkg/fi/cloudup/awstasks/externalloadbalancerattachment_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/externalloadbalancerattachment_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realExternalLoadBalancerAttachment ExternalLoadBalancerAttachment -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ExternalLoadBalancerAttachment) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/externaltargetgroupattachment_fitask.go b/upup/pkg/fi/cloudup/awstasks/externaltargetgroupattachment_fitask.go index 4c59fde3e4..dd39f42191 100644 --- a/upup/pkg/fi/cloudup/awstasks/externaltargetgroupattachment_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/externaltargetgroupattachment_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realExternalTargetGroupAttachment ExternalTargetGroupAttachment -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ExternalTargetGroupAttachment) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/iaminstanceprofile_fitask.go b/upup/pkg/fi/cloudup/awstasks/iaminstanceprofile_fitask.go index ecb8afaae3..b2fe2c775d 100644 --- a/upup/pkg/fi/cloudup/awstasks/iaminstanceprofile_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/iaminstanceprofile_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realIAMInstanceProfile IAMInstanceProfile -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *IAMInstanceProfile) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/iaminstanceprofilerole_fitask.go b/upup/pkg/fi/cloudup/awstasks/iaminstanceprofilerole_fitask.go index 896b3dc9e7..8833dd25d5 100644 --- a/upup/pkg/fi/cloudup/awstasks/iaminstanceprofilerole_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/iaminstanceprofilerole_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realIAMInstanceProfileRole IAMInstanceProfileRole -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *IAMInstanceProfileRole) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/iamrole.go b/upup/pkg/fi/cloudup/awstasks/iamrole.go index d634694071..4ea466d281 100644 --- a/upup/pkg/fi/cloudup/awstasks/iamrole.go +++ b/upup/pkg/fi/cloudup/awstasks/iamrole.go @@ -77,7 +77,7 @@ func (e *IAMRole) Find(c *fi.Context) (*IAMRole, error) { actualPolicy := *r.AssumeRolePolicyDocument actualPolicy, err = url.QueryUnescape(actualPolicy) if err != nil { - return nil, fmt.Errorf("error parsing AssumeRolePolicyDocument for IAMRole %q: %v", e.Name, err) + return nil, fmt.Errorf("error parsing AssumeRolePolicyDocument for IAMRole %s: %v", *e.Name, err) } // The RolePolicyDocument is reformatted by AWS @@ -85,17 +85,17 @@ func (e *IAMRole) Find(c *fi.Context) (*IAMRole, error) { if e.RolePolicyDocument != nil { expectedPolicy, err := e.RolePolicyDocument.AsString() if err != nil { - return nil, fmt.Errorf("error reading expected RolePolicyDocument for IAMRole %q: %v", e.Name, err) + return nil, fmt.Errorf("error reading expected RolePolicyDocument for IAMRole %q: %v", aws.StringValue(e.Name), err) } expectedJson := make(map[string]interface{}) err = json.Unmarshal([]byte(expectedPolicy), &expectedJson) if err != nil { - return nil, fmt.Errorf("error parsing expected RolePolicyDocument for IAMRole %q: %v", e.Name, err) + return nil, fmt.Errorf("error parsing expected RolePolicyDocument for IAMRole %q: %v", aws.StringValue(e.Name), err) } actualJson := make(map[string]interface{}) err = json.Unmarshal([]byte(actualPolicy), &actualJson) if err != nil { - return nil, fmt.Errorf("error parsing actual RolePolicyDocument for IAMRole %q: %v", e.Name, err) + return nil, fmt.Errorf("error parsing actual RolePolicyDocument for IAMRole %q: %v", aws.StringValue(e.Name), err) } if reflect.DeepEqual(actualJson, expectedJson) { diff --git a/upup/pkg/fi/cloudup/awstasks/iamrole_fitask.go b/upup/pkg/fi/cloudup/awstasks/iamrole_fitask.go index 8f112a3a34..e0c159a156 100644 --- a/upup/pkg/fi/cloudup/awstasks/iamrole_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/iamrole_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realIAMRole IAMRole -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *IAMRole) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/iamrolepolicy.go b/upup/pkg/fi/cloudup/awstasks/iamrolepolicy.go index c5772b0d0a..16ba402126 100644 --- a/upup/pkg/fi/cloudup/awstasks/iamrolepolicy.go +++ b/upup/pkg/fi/cloudup/awstasks/iamrolepolicy.go @@ -75,7 +75,7 @@ func (e *IAMRolePolicy) Find(c *fi.Context) (*IAMRolePolicy, error) { policy := *p.PolicyDocument policy, err = url.QueryUnescape(policy) if err != nil { - return nil, fmt.Errorf("error parsing PolicyDocument for IAMRolePolicy %q: %v", e.Name, err) + return nil, fmt.Errorf("error parsing PolicyDocument for IAMRolePolicy %q: %v", aws.StringValue(e.Name), err) } actual.PolicyDocument = fi.WrapResource(fi.NewStringResource(policy)) } diff --git a/upup/pkg/fi/cloudup/awstasks/iamrolepolicy_fitask.go b/upup/pkg/fi/cloudup/awstasks/iamrolepolicy_fitask.go index acb3918643..86592398b3 100644 --- a/upup/pkg/fi/cloudup/awstasks/iamrolepolicy_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/iamrolepolicy_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realIAMRolePolicy IAMRolePolicy -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *IAMRolePolicy) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/internetgateway_fitask.go b/upup/pkg/fi/cloudup/awstasks/internetgateway_fitask.go index f4eaa12f27..9c422f2c1d 100644 --- a/upup/pkg/fi/cloudup/awstasks/internetgateway_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/internetgateway_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realInternetGateway InternetGateway -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *InternetGateway) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/launchconfiguration_fitask.go b/upup/pkg/fi/cloudup/awstasks/launchconfiguration_fitask.go index b1c4e677aa..3f417d94f9 100644 --- a/upup/pkg/fi/cloudup/awstasks/launchconfiguration_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/launchconfiguration_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLaunchConfiguration LaunchConfiguration -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LaunchConfiguration) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/load_balancer.go b/upup/pkg/fi/cloudup/awstasks/load_balancer.go index e0200c7613..2ae3b30d07 100644 --- a/upup/pkg/fi/cloudup/awstasks/load_balancer.go +++ b/upup/pkg/fi/cloudup/awstasks/load_balancer.go @@ -112,7 +112,7 @@ func findLoadBalancerByLoadBalancerName(cloud awsup.AWSCloud, loadBalancerName s return true } - glog.Warningf("Got ELB with unexpected name: %q", lb.LoadBalancerName) + glog.Warningf("Got ELB with unexpected name: %q", aws.StringValue(lb.LoadBalancerName)) return false }) @@ -325,7 +325,7 @@ func (e *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) { if err != nil { return nil, err } - glog.V(4).Info("ELB attributes: %+v", lbAttributes) + glog.V(4).Infof("ELB attributes: %+v", lbAttributes) if lbAttributes != nil { actual.AccessLog = &LoadBalancerAccessLog{} @@ -379,7 +379,7 @@ func (e *LoadBalancer) Find(c *fi.Context) (*LoadBalancer, error) { // 1. We don't want to force a rename of the ELB, because that is a destructive operation // 2. We were creating ELBs with insufficiently qualified names previously if fi.StringValue(e.LoadBalancerName) != fi.StringValue(actual.LoadBalancerName) { - glog.V(2).Infof("Reusing existing load balancer with name: %q", actual.LoadBalancerName) + glog.V(2).Infof("Reusing existing load balancer with name: %q", aws.StringValue(actual.LoadBalancerName)) e.LoadBalancerName = actual.LoadBalancerName } diff --git a/upup/pkg/fi/cloudup/awstasks/loadbalancer_fitask.go b/upup/pkg/fi/cloudup/awstasks/loadbalancer_fitask.go index 4335601116..36282d7c4b 100644 --- a/upup/pkg/fi/cloudup/awstasks/loadbalancer_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/loadbalancer_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLoadBalancer LoadBalancer -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LoadBalancer) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/loadbalancerattachment_fitask.go b/upup/pkg/fi/cloudup/awstasks/loadbalancerattachment_fitask.go index 1618f903fc..1a492ddd91 100644 --- a/upup/pkg/fi/cloudup/awstasks/loadbalancerattachment_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/loadbalancerattachment_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realLoadBalancerAttachment LoadBalancerAttachment -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *LoadBalancerAttachment) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/natgateway.go b/upup/pkg/fi/cloudup/awstasks/natgateway.go index d577f877f4..243e78b409 100644 --- a/upup/pkg/fi/cloudup/awstasks/natgateway.go +++ b/upup/pkg/fi/cloudup/awstasks/natgateway.go @@ -186,15 +186,15 @@ func findNatGatewayById(cloud awsup.AWSCloud, id *string) (*ec2.NatGateway, erro request.NatGatewayIds = []*string{id} response, err := cloud.EC2().DescribeNatGateways(request) if err != nil { - return nil, fmt.Errorf("error listing NatGateway %q: %v", id, err) + return nil, fmt.Errorf("error listing NatGateway %q: %v", aws.StringValue(id), err) } if response == nil || len(response.NatGateways) == 0 { - glog.V(2).Infof("Unable to find NatGateway %q", id) + glog.V(2).Infof("Unable to find NatGateway %q", aws.StringValue(id)) return nil, nil } if len(response.NatGateways) != 1 { - return nil, fmt.Errorf("found multiple NatGateways with id %q", id) + return nil, fmt.Errorf("found multiple NatGateways with id %q", aws.StringValue(id)) } return response.NatGateways[0], nil } @@ -280,7 +280,7 @@ func (e *NatGateway) waitAvailable(cloud awsup.AWSCloud) error { id := aws.StringValue(e.ID) if id == "" { - return fmt.Errorf("NAT Gateway %q did not have ID", e.Name) + return fmt.Errorf("NAT Gateway %q did not have ID", aws.StringValue(e.Name)) } glog.Infof("Waiting for NAT Gateway %q to be available (this often takes about 5 minutes)", id) diff --git a/upup/pkg/fi/cloudup/awstasks/natgateway_fitask.go b/upup/pkg/fi/cloudup/awstasks/natgateway_fitask.go index bf93d83239..2961af1686 100644 --- a/upup/pkg/fi/cloudup/awstasks/natgateway_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/natgateway_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realNatGateway NatGateway -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *NatGateway) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/route_fitask.go b/upup/pkg/fi/cloudup/awstasks/route_fitask.go index 2592fa82e9..cc145b402a 100644 --- a/upup/pkg/fi/cloudup/awstasks/route_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/route_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRoute Route -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Route) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/routetable_fitask.go b/upup/pkg/fi/cloudup/awstasks/routetable_fitask.go index a00626edc9..93f7367d5d 100644 --- a/upup/pkg/fi/cloudup/awstasks/routetable_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/routetable_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRouteTable RouteTable -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *RouteTable) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/routetableassociation_fitask.go b/upup/pkg/fi/cloudup/awstasks/routetableassociation_fitask.go index e91913350c..a1860f8ee4 100644 --- a/upup/pkg/fi/cloudup/awstasks/routetableassociation_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/routetableassociation_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRouteTableAssociation RouteTableAssociation -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *RouteTableAssociation) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/securitygroup_fitask.go b/upup/pkg/fi/cloudup/awstasks/securitygroup_fitask.go index 4a1c10170b..ec9d67511d 100644 --- a/upup/pkg/fi/cloudup/awstasks/securitygroup_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/securitygroup_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecurityGroup SecurityGroup -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SecurityGroup) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/securitygrouprule_fitask.go b/upup/pkg/fi/cloudup/awstasks/securitygrouprule_fitask.go index 2eb759716a..fef7d11f08 100644 --- a/upup/pkg/fi/cloudup/awstasks/securitygrouprule_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/securitygrouprule_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecurityGroupRule SecurityGroupRule -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SecurityGroupRule) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/sshkey_fitask.go b/upup/pkg/fi/cloudup/awstasks/sshkey_fitask.go index 0bd4ebf6aa..697419ec63 100644 --- a/upup/pkg/fi/cloudup/awstasks/sshkey_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/sshkey_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSSHKey SSHKey -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SSHKey) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/subnet_fitask.go b/upup/pkg/fi/cloudup/awstasks/subnet_fitask.go index e48027a232..bebb9d6200 100644 --- a/upup/pkg/fi/cloudup/awstasks/subnet_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/subnet_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSubnet Subnet -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Subnet) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/vpc_fitask.go b/upup/pkg/fi/cloudup/awstasks/vpc_fitask.go index 34730aa7e4..48a42586cb 100644 --- a/upup/pkg/fi/cloudup/awstasks/vpc_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/vpc_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVPC VPC -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *VPC) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/vpccidrblock.go b/upup/pkg/fi/cloudup/awstasks/vpccidrblock.go index ef68fb9f92..60a40e9312 100644 --- a/upup/pkg/fi/cloudup/awstasks/vpccidrblock.go +++ b/upup/pkg/fi/cloudup/awstasks/vpccidrblock.go @@ -121,7 +121,7 @@ func (_ *VPCCIDRBlock) RenderTerraform(t *terraform.TerraformTarget, a, e, chang // https://github.com/terraform-providers/terraform-provider-aws/issues/3403 return fmt.Errorf("terraform does not support AdditionalCIDRs on VPCs") - // The code bellow is based on https://github.com/terraform-providers/terraform-provider-aws/pull/1568 + // The code below is based on https://github.com/terraform-providers/terraform-provider-aws/pull/1568 // and can be un-comented once it is landed. // When this has been enabled please fix test TestAdditionalCIDR in integration_test.go to run runTestAWS. // tf := &terraformVPCCIDRBlock{ diff --git a/upup/pkg/fi/cloudup/awstasks/vpccidrblock_fitask.go b/upup/pkg/fi/cloudup/awstasks/vpccidrblock_fitask.go index 1aa841ce3a..f9a17cd232 100644 --- a/upup/pkg/fi/cloudup/awstasks/vpccidrblock_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/vpccidrblock_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVPCCIDRBlock VPCCIDRBlock -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *VPCCIDRBlock) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awstasks/vpcdhcpoptionsassociation_fitask.go b/upup/pkg/fi/cloudup/awstasks/vpcdhcpoptionsassociation_fitask.go index d1bcaa7fcd..adf3af149a 100644 --- a/upup/pkg/fi/cloudup/awstasks/vpcdhcpoptionsassociation_fitask.go +++ b/upup/pkg/fi/cloudup/awstasks/vpcdhcpoptionsassociation_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVPCDHCPOptionsAssociation VPCDHCPOptionsAssociation -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *VPCDHCPOptionsAssociation) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/awsup/aws_cloud.go b/upup/pkg/fi/cloudup/awsup/aws_cloud.go index bb90495863..6749f8e6c0 100644 --- a/upup/pkg/fi/cloudup/awsup/aws_cloud.go +++ b/upup/pkg/fi/cloudup/awsup/aws_cloud.go @@ -1092,11 +1092,11 @@ func ValidateZones(zones []string, cloud AWSCloud) error { } for _, message := range z.Messages { - glog.Warningf("Zone %q has message: %q", aws.StringValue(message.Message)) + glog.Warningf("Zone %q has message: %q", zone, aws.StringValue(message.Message)) } if aws.StringValue(z.State) != "available" { - glog.Warningf("Zone %q has state %q", aws.StringValue(z.State)) + glog.Warningf("Zone %q has state %q", zone, aws.StringValue(z.State)) } } diff --git a/upup/pkg/fi/cloudup/awsup/machine_types.go b/upup/pkg/fi/cloudup/awsup/machine_types.go index 442b89deff..d2e6ba8ca0 100644 --- a/upup/pkg/fi/cloudup/awsup/machine_types.go +++ b/upup/pkg/fi/cloudup/awsup/machine_types.go @@ -132,6 +132,64 @@ var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{ Burstable: true, }, + // t3 family + { + Name: "t3.nano", + MemoryGB: 0.5, + ECU: 6 * BurstableCreditsToECUS, + Cores: 2, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.micro", + MemoryGB: 1, + ECU: 12 * BurstableCreditsToECUS, + Cores: 2, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.small", + MemoryGB: 2, + ECU: 24 * BurstableCreditsToECUS, + Cores: 2, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.medium", + MemoryGB: 4, + ECU: 24 * BurstableCreditsToECUS, + Cores: 2, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.large", + MemoryGB: 8, + ECU: 36 * BurstableCreditsToECUS, + Cores: 2, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.xlarge", + MemoryGB: 16, + ECU: 96 * BurstableCreditsToECUS, + Cores: 4, + EphemeralDisks: nil, + Burstable: true, + }, + { + Name: "t3.2xlarge", + MemoryGB: 32, + ECU: 192 * BurstableCreditsToECUS, + Cores: 8, + EphemeralDisks: nil, + Burstable: true, + }, + // m3 family { Name: "m3.medium", diff --git a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go index cb14300409..9f5232c7fc 100644 --- a/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go +++ b/upup/pkg/fi/cloudup/bootstrapchannelbuilder.go @@ -211,7 +211,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri if kubeDNS.Provider == "CoreDNS" { { key := "coredns.addons.k8s.io" - version := "1.1.3" + version := "1.2.2-kops.1" { location := key + "/k8s-1.6.yaml" @@ -269,7 +269,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri if externalDNS == nil || !externalDNS.Disable { { key := "dns-controller.addons.k8s.io" - version := "1.10.0-beta.1" + version := "1.10.0" { location := key + "/pre-k8s-1.6.yaml" @@ -486,8 +486,12 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri if b.cluster.Spec.Networking.Weave != nil { key := "networking.weave" - // 2.3.0-kops.1 = 2.3.0, kops packaging version 1. - version := "2.3.0-kops.1" + versions := map[string]string{ + "pre-k8s-1.6": "2.3.0-kops.2", + "k8s-1.6": "2.3.0-kops.2", + "k8s-1.7": "2.4.0-kops.1", + "k8s-1.8": "2.4.0-kops.1", + } { location := key + "/pre-k8s-1.6.yaml" @@ -495,7 +499,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ Name: fi.String(key), - Version: fi.String(version), + Version: fi.String(versions[id]), Selector: networkingSelector, Manifest: fi.String(location), KubernetesVersion: "<1.6.0", @@ -510,7 +514,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ Name: fi.String(key), - Version: fi.String(version), + Version: fi.String(versions[id]), Selector: networkingSelector, Manifest: fi.String(location), KubernetesVersion: ">=1.6.0 <1.7.0", @@ -525,10 +529,25 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ Name: fi.String(key), - Version: fi.String(version), + Version: fi.String(versions[id]), Selector: networkingSelector, Manifest: fi.String(location), - KubernetesVersion: ">=1.7.0", + KubernetesVersion: ">=1.7.0 <1.8.0", + Id: id, + }) + manifests[key+"-"+id] = "addons/" + location + } + + { + location := key + "/k8s-1.8.yaml" + id := "k8s-1.8" + + addons.Spec.Addons = append(addons.Spec.Addons, &channelsapi.AddonSpec{ + Name: fi.String(key), + Version: fi.String(versions[id]), + Selector: networkingSelector, + Manifest: fi.String(location), + KubernetesVersion: ">=1.8.0", Id: id, }) manifests[key+"-"+id] = "addons/" + location @@ -575,7 +594,7 @@ func (b *BootstrapChannelBuilder) buildManifest() (*channelsapi.Addons, map[stri versions := map[string]string{ "pre-k8s-1.6": "2.4.2-kops.1", "k8s-1.6": "2.6.7-kops.2", - "k8s-1.7": "2.6.7-kops.2", + "k8s-1.7": "2.6.7-kops.3", } { diff --git a/upup/pkg/fi/cloudup/dotasks/droplet_fitask.go b/upup/pkg/fi/cloudup/dotasks/droplet_fitask.go index 6aadbf1c62..f125a4dbb0 100644 --- a/upup/pkg/fi/cloudup/dotasks/droplet_fitask.go +++ b/upup/pkg/fi/cloudup/dotasks/droplet_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDroplet Droplet -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Droplet) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/dotasks/volume_fitask.go b/upup/pkg/fi/cloudup/dotasks/volume_fitask.go index 2189b27964..ba5544c751 100644 --- a/upup/pkg/fi/cloudup/dotasks/volume_fitask.go +++ b/upup/pkg/fi/cloudup/dotasks/volume_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVolume Volume -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Volume) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/address_fitask.go b/upup/pkg/fi/cloudup/gcetasks/address_fitask.go index 5a7bba7458..9c9b7ad262 100644 --- a/upup/pkg/fi/cloudup/gcetasks/address_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/address_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realAddress Address -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Address) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/disk_fitask.go b/upup/pkg/fi/cloudup/gcetasks/disk_fitask.go index 9981adf3b0..fc1991c9ad 100644 --- a/upup/pkg/fi/cloudup/gcetasks/disk_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/disk_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realDisk Disk -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Disk) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/firewallrule_fitask.go b/upup/pkg/fi/cloudup/gcetasks/firewallrule_fitask.go index 81fee91ffc..f8422a10d4 100644 --- a/upup/pkg/fi/cloudup/gcetasks/firewallrule_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/firewallrule_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realFirewallRule FirewallRule -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *FirewallRule) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/forwardingrule_fitask.go b/upup/pkg/fi/cloudup/gcetasks/forwardingrule_fitask.go index 548fd22242..1bf02d342f 100644 --- a/upup/pkg/fi/cloudup/gcetasks/forwardingrule_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/forwardingrule_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realForwardingRule ForwardingRule -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ForwardingRule) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/instance_fitask.go b/upup/pkg/fi/cloudup/gcetasks/instance_fitask.go index 4166e36fad..48c3723f7a 100644 --- a/upup/pkg/fi/cloudup/gcetasks/instance_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/instance_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realInstance Instance -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Instance) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager_fitask.go b/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager_fitask.go index ed43eb6402..ff07ee8210 100644 --- a/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/instancegroupmanager_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realInstanceGroupManager InstanceGroupManager -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *InstanceGroupManager) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/instancetemplate_fitask.go b/upup/pkg/fi/cloudup/gcetasks/instancetemplate_fitask.go index a5acce3adf..baff6cc049 100644 --- a/upup/pkg/fi/cloudup/gcetasks/instancetemplate_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/instancetemplate_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realInstanceTemplate InstanceTemplate -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *InstanceTemplate) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/network_fitask.go b/upup/pkg/fi/cloudup/gcetasks/network_fitask.go index 7b7d4eae3f..65daa9093e 100644 --- a/upup/pkg/fi/cloudup/gcetasks/network_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/network_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realNetwork Network -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Network) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/storagebucketacl_fitask.go b/upup/pkg/fi/cloudup/gcetasks/storagebucketacl_fitask.go index 8c971f0196..5d45c38271 100644 --- a/upup/pkg/fi/cloudup/gcetasks/storagebucketacl_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/storagebucketacl_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realStorageBucketAcl StorageBucketAcl -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *StorageBucketAcl) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/storagebucketiam_fitask.go b/upup/pkg/fi/cloudup/gcetasks/storagebucketiam_fitask.go index 6f09fa6060..6ce28d8174 100644 --- a/upup/pkg/fi/cloudup/gcetasks/storagebucketiam_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/storagebucketiam_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realStorageBucketIam StorageBucketIam -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *StorageBucketIam) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/storageobjectacl_fitask.go b/upup/pkg/fi/cloudup/gcetasks/storageobjectacl_fitask.go index 278d41f240..77256881a6 100644 --- a/upup/pkg/fi/cloudup/gcetasks/storageobjectacl_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/storageobjectacl_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realStorageObjectAcl StorageObjectAcl -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *StorageObjectAcl) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/subnet_fitask.go b/upup/pkg/fi/cloudup/gcetasks/subnet_fitask.go index 71ae2efe64..661b7fcc33 100644 --- a/upup/pkg/fi/cloudup/gcetasks/subnet_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/subnet_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSubnet Subnet -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Subnet) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/gcetasks/targetpool_fitask.go b/upup/pkg/fi/cloudup/gcetasks/targetpool_fitask.go index 763da63909..ac73ed948d 100644 --- a/upup/pkg/fi/cloudup/gcetasks/targetpool_fitask.go +++ b/upup/pkg/fi/cloudup/gcetasks/targetpool_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realTargetPool TargetPool -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *TargetPool) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/loader.go b/upup/pkg/fi/cloudup/loader.go index 7e097c2eea..3bccd262a1 100644 --- a/upup/pkg/fi/cloudup/loader.go +++ b/upup/pkg/fi/cloudup/loader.go @@ -34,6 +34,7 @@ import ( "k8s.io/kops/upup/pkg/fi/assettasks" "k8s.io/kops/upup/pkg/fi/loader" "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" "k8s.io/kops/util/pkg/vfs" ) @@ -260,8 +261,8 @@ func (l *Loader) processDeferrals() error { for taskKey, task := range l.tasks { taskValue := reflect.ValueOf(task) - err := utils.ReflectRecursive(taskValue, func(path string, f *reflect.StructField, v reflect.Value) error { - if utils.IsPrimitiveValue(v) { + err := reflectutils.ReflectRecursive(taskValue, func(path string, f *reflect.StructField, v reflect.Value) error { + if reflectutils.IsPrimitiveValue(v) { return nil } @@ -299,7 +300,7 @@ func (l *Loader) processDeferrals() error { glog.V(11).Infof("Replacing task %q at %s:%s", *name, taskKey, path) v.Set(reflect.ValueOf(primary)) } - return utils.SkipReflection + return reflectutils.SkipReflection } else if rh, ok := intf.(*fi.ResourceHolder); ok { if rh.Resource == nil { //Resources can contain template 'arguments', separated by spaces @@ -324,7 +325,7 @@ func (l *Loader) processDeferrals() error { return fmt.Errorf("error setting resource value: %v", err) } } - return utils.SkipReflection + return reflectutils.SkipReflection } } } diff --git a/upup/pkg/fi/cloudup/openstack/BUILD.bazel b/upup/pkg/fi/cloudup/openstack/BUILD.bazel index 8e18101a7d..2efc6ab62d 100644 --- a/upup/pkg/fi/cloudup/openstack/BUILD.bazel +++ b/upup/pkg/fi/cloudup/openstack/BUILD.bazel @@ -19,6 +19,7 @@ go_library( "//vendor/github.com/gophercloud/gophercloud/openstack:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library", + "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules:go_default_library", diff --git a/upup/pkg/fi/cloudup/openstack/cloud.go b/upup/pkg/fi/cloudup/openstack/cloud.go index 859ea62599..044496e9a8 100644 --- a/upup/pkg/fi/cloudup/openstack/cloud.go +++ b/upup/pkg/fi/cloudup/openstack/cloud.go @@ -25,6 +25,7 @@ import ( os "github.com/gophercloud/gophercloud/openstack" cinder "github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes" "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs" + "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups" "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers" sg "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups" sgr "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules" @@ -122,6 +123,9 @@ type OpenstackCloud interface { //CreateRouterInterface will create a new Neutron router interface CreateRouterInterface(routerID string, opt routers.AddInterfaceOptsBuilder) (*routers.InterfaceInfo, error) + + // CreateServerGroup will create a new server group. + CreateServerGroup(opt servergroups.CreateOpts) (*servergroups.ServerGroup, error) } type openstackCloud struct { @@ -599,3 +603,7 @@ func (c *openstackCloud) CreateRouterInterface(routerID string, opt routers.AddI return i, wait.ErrWaitTimeout } } + +func (c *openstackCloud) CreateServerGroup(opt servergroups.CreateOpts) (*servergroups.ServerGroup, error) { + return nil, fmt.Errorf("openstackCloud::CreateServerGroup not implemented") +} diff --git a/upup/pkg/fi/cloudup/openstacktasks/BUILD.bazel b/upup/pkg/fi/cloudup/openstacktasks/BUILD.bazel index f1ee10b059..5362530e73 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/BUILD.bazel +++ b/upup/pkg/fi/cloudup/openstacktasks/BUILD.bazel @@ -3,6 +3,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ + "instance.go", "network.go", "network_fitask.go", "router.go", @@ -28,6 +29,7 @@ go_library( "//vendor/github.com/gophercloud/gophercloud:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs:go_default_library", + "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups:go_default_library", "//vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules:go_default_library", diff --git a/upup/pkg/fi/cloudup/openstacktasks/instance.go b/upup/pkg/fi/cloudup/openstacktasks/instance.go new file mode 100644 index 0000000000..a7cceee686 --- /dev/null +++ b/upup/pkg/fi/cloudup/openstacktasks/instance.go @@ -0,0 +1,22 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package openstacktasks + +import "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints" + +// TODO(lmb): Remove after implementing. Using this to pull in the vendor dep. +var _ schedulerhints.SchedulerHints diff --git a/upup/pkg/fi/cloudup/openstacktasks/network_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/network_fitask.go index 7deeb197ad..32602db751 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/network_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/network_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realNetwork Network -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Network) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/router_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/router_fitask.go index 009a86dd6e..017ef521b7 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/router_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/router_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRouter Router -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Router) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/routerinterface_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/routerinterface_fitask.go index 28da9f293c..cabd31f698 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/routerinterface_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/routerinterface_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realRouterInterface RouterInterface -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *RouterInterface) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/securitygroup_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/securitygroup_fitask.go index 1606a4321e..56664355be 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/securitygroup_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/securitygroup_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecurityGroup SecurityGroup -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SecurityGroup) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/sshkey_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/sshkey_fitask.go index 7218cf86cf..505315176c 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/sshkey_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/sshkey_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSSHKey SSHKey -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *SSHKey) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/subnet_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/subnet_fitask.go index d257d10151..e108f30085 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/subnet_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/subnet_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSubnet Subnet -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Subnet) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/openstacktasks/volume_fitask.go b/upup/pkg/fi/cloudup/openstacktasks/volume_fitask.go index 935bfb2513..118240fb88 100644 --- a/upup/pkg/fi/cloudup/openstacktasks/volume_fitask.go +++ b/upup/pkg/fi/cloudup/openstacktasks/volume_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realVolume Volume -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Volume) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/cloudup/populate_cluster_spec.go b/upup/pkg/fi/cloudup/populate_cluster_spec.go index 7b6dcf4d94..24f8249aa9 100644 --- a/upup/pkg/fi/cloudup/populate_cluster_spec.go +++ b/upup/pkg/fi/cloudup/populate_cluster_spec.go @@ -38,7 +38,7 @@ import ( "k8s.io/kops/upup/models" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/upup/pkg/fi/loader" - "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" "k8s.io/kops/util/pkg/vfs" ) @@ -94,7 +94,7 @@ func (c *populateClusterSpec) run(clientset simple.Clientset) error { // Copy cluster & instance groups, so we can modify them freely cluster := &api.Cluster{} - utils.JsonMergeStruct(cluster, c.InputCluster) + reflectutils.JsonMergeStruct(cluster, c.InputCluster) err := c.assignSubnets(cluster) if err != nil { diff --git a/upup/pkg/fi/cloudup/populate_instancegroup_spec.go b/upup/pkg/fi/cloudup/populate_instancegroup_spec.go index 811635af1a..18321090e1 100644 --- a/upup/pkg/fi/cloudup/populate_instancegroup_spec.go +++ b/upup/pkg/fi/cloudup/populate_instancegroup_spec.go @@ -26,7 +26,7 @@ import ( "k8s.io/kops/pkg/apis/kops/validation" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/upup/pkg/fi/cloudup/awsup" - "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" ) // Default Machine types for various types of instance group machine @@ -64,7 +64,7 @@ func PopulateInstanceGroupSpec(cluster *kops.Cluster, input *kops.InstanceGroup, } ig := &kops.InstanceGroup{} - utils.JsonMergeStruct(ig, input) + reflectutils.JsonMergeStruct(ig, input) // TODO: Clean up if ig.IsMaster() { diff --git a/upup/pkg/fi/cloudup/spec_builder.go b/upup/pkg/fi/cloudup/spec_builder.go index 07d9236b80..3b4284a9ae 100644 --- a/upup/pkg/fi/cloudup/spec_builder.go +++ b/upup/pkg/fi/cloudup/spec_builder.go @@ -22,7 +22,7 @@ import ( api "k8s.io/kops/pkg/apis/kops" "k8s.io/kops/upup/pkg/fi" "k8s.io/kops/upup/pkg/fi/loader" - "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" ) type SpecBuilder struct { @@ -42,8 +42,8 @@ func (l *SpecBuilder) BuildCompleteSpec(clusterSpec *api.ClusterSpec) (*api.Clus // Master kubelet config = (base kubelet config + master kubelet config) masterKubelet := &api.KubeletConfigSpec{} - utils.JsonMergeStruct(masterKubelet, completed.Kubelet) - utils.JsonMergeStruct(masterKubelet, completed.MasterKubelet) + reflectutils.JsonMergeStruct(masterKubelet, completed.Kubelet) + reflectutils.JsonMergeStruct(masterKubelet, completed.MasterKubelet) completed.MasterKubelet = masterKubelet glog.V(1).Infof("options: %s", fi.DebugAsJsonStringIndent(completed)) diff --git a/upup/pkg/fi/cloudup/tagbuilder.go b/upup/pkg/fi/cloudup/tagbuilder.go index b419741d61..d5b745801a 100644 --- a/upup/pkg/fi/cloudup/tagbuilder.go +++ b/upup/pkg/fi/cloudup/tagbuilder.go @@ -96,20 +96,6 @@ func buildCloudupTags(cluster *api.Cluster) (sets.String, error) { func buildNodeupTags(role api.InstanceGroupRole, cluster *api.Cluster, clusterTags sets.String) (sets.String, error) { tags := sets.NewString() - switch role { - case api.InstanceGroupRoleNode: - // No tags - - case api.InstanceGroupRoleMaster: - tags.Insert("_kubernetes_master") - - case api.InstanceGroupRoleBastion: - // No tags - - default: - return nil, fmt.Errorf("Unrecognized role: %v", role) - } - switch fi.StringValue(cluster.Spec.UpdatePolicy) { case "": // default tags.Insert("_automatic_upgrades") diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml index 02f8d6e9bd..7bb0d7b526 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/cilium/manifest.yaml @@ -41,14 +41,14 @@ spec: name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: k8s-1.6 kubernetesVersion: '>=1.6.0' manifest: dns-controller.addons.k8s.io/k8s-1.6.yaml name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: v1.7.0 kubernetesVersion: '>=1.7.0' manifest: storage-aws.addons.k8s.io/v1.7.0.yaml diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/kopeio-vxlan/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/kopeio-vxlan/manifest.yaml index df5808ef55..ffed8ffd3b 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/kopeio-vxlan/manifest.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/kopeio-vxlan/manifest.yaml @@ -41,14 +41,14 @@ spec: name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: k8s-1.6 kubernetesVersion: '>=1.6.0' manifest: dns-controller.addons.k8s.io/k8s-1.6.yaml name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: v1.7.0 kubernetesVersion: '>=1.7.0' manifest: storage-aws.addons.k8s.io/v1.7.0.yaml diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/manifest.yaml index 37a3205e09..9fae210ac8 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/manifest.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/simple/manifest.yaml @@ -41,14 +41,14 @@ spec: name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: k8s-1.6 kubernetesVersion: '>=1.6.0' manifest: dns-controller.addons.k8s.io/k8s-1.6.yaml name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: v1.7.0 kubernetesVersion: '>=1.7.0' manifest: storage-aws.addons.k8s.io/v1.7.0.yaml diff --git a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml index 84d300b29c..e199604d70 100644 --- a/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml +++ b/upup/pkg/fi/cloudup/tests/bootstrapchannelbuilder/weave/manifest.yaml @@ -41,14 +41,14 @@ spec: name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: k8s-1.6 kubernetesVersion: '>=1.6.0' manifest: dns-controller.addons.k8s.io/k8s-1.6.yaml name: dns-controller.addons.k8s.io selector: k8s-addon: dns-controller.addons.k8s.io - version: 1.10.0-beta.1 + version: 1.10.0 - id: v1.7.0 kubernetesVersion: '>=1.7.0' manifest: storage-aws.addons.k8s.io/v1.7.0.yaml @@ -69,18 +69,25 @@ spec: name: networking.weave selector: role.kubernetes.io/networking: "1" - version: 2.3.0-kops.1 + version: 2.3.0-kops.2 - id: k8s-1.6 kubernetesVersion: '>=1.6.0 <1.7.0' manifest: networking.weave/k8s-1.6.yaml name: networking.weave selector: role.kubernetes.io/networking: "1" - version: 2.3.0-kops.1 + version: 2.3.0-kops.2 - id: k8s-1.7 - kubernetesVersion: '>=1.7.0' + kubernetesVersion: '>=1.7.0 <1.8.0' manifest: networking.weave/k8s-1.7.yaml name: networking.weave selector: role.kubernetes.io/networking: "1" - version: 2.3.0-kops.1 + version: 2.4.0-kops.1 + - id: k8s-1.8 + kubernetesVersion: '>=1.8.0' + manifest: networking.weave/k8s-1.8.yaml + name: networking.weave + selector: + role.kubernetes.io/networking: "1" + version: 2.4.0-kops.1 diff --git a/upup/pkg/fi/cloudup/utils.go b/upup/pkg/fi/cloudup/utils.go index 80cf8dc856..728d4c340c 100644 --- a/upup/pkg/fi/cloudup/utils.go +++ b/upup/pkg/fi/cloudup/utils.go @@ -80,6 +80,9 @@ func BuildCloud(cluster *kops.Cluster) (fi.Cloud, error) { } cloudTags := map[string]string{awsup.TagClusterName: cluster.ObjectMeta.Name} + for k, v := range cluster.Spec.CloudLabels { + cloudTags[k] = v + } awsCloud, err := awsup.NewAWSCloud(region, cloudTags) if err != nil { diff --git a/upup/pkg/fi/default_methods.go b/upup/pkg/fi/default_methods.go index b516c87aa1..64dbb9930e 100644 --- a/upup/pkg/fi/default_methods.go +++ b/upup/pkg/fi/default_methods.go @@ -20,7 +20,7 @@ import ( "fmt" "reflect" - "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" ) // DefaultDeltaRunMethod implements the standard change-based run procedure: @@ -108,7 +108,7 @@ func DefaultDeltaRunMethod(e Task, c *Context) error { // invokeCheckChanges calls the checkChanges method by reflection func invokeCheckChanges(a, e, changes Task) error { - rv, err := utils.InvokeMethod(e, "CheckChanges", a, e, changes) + rv, err := reflectutils.InvokeMethod(e, "CheckChanges", a, e, changes) if err != nil { return err } @@ -120,7 +120,7 @@ func invokeCheckChanges(a, e, changes Task) error { // invokeFind calls the find method by reflection func invokeFind(e Task, c *Context) (Task, error) { - rv, err := utils.InvokeMethod(e, "Find", c) + rv, err := reflectutils.InvokeMethod(e, "Find", c) if err != nil { return nil, err } @@ -136,9 +136,9 @@ func invokeFind(e Task, c *Context) (Task, error) { // invokeShouldCreate calls the ShouldCreate method by reflection, if it exists func invokeShouldCreate(a, e, changes Task) (bool, error) { - rv, err := utils.InvokeMethod(e, "ShouldCreate", a, e, changes) + rv, err := reflectutils.InvokeMethod(e, "ShouldCreate", a, e, changes) if err != nil { - if utils.IsMethodNotFound(err) { + if reflectutils.IsMethodNotFound(err) { return true, nil } return false, err diff --git a/upup/pkg/fi/dryrun_target.go b/upup/pkg/fi/dryrun_target.go index 73a7cd838f..33baa76c15 100644 --- a/upup/pkg/fi/dryrun_target.go +++ b/upup/pkg/fi/dryrun_target.go @@ -28,7 +28,7 @@ import ( "github.com/golang/glog" "k8s.io/kops/pkg/assets" "k8s.io/kops/pkg/diff" - "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" ) // DryRunTarget is a special Target that does not execute anything, but instead tracks all changes. @@ -167,7 +167,7 @@ func (t *DryRunTarget) PrintReport(taskMap map[string]Task, out io.Writer) error continue } - fieldValue := ValueAsString(field) + fieldValue := reflectutils.ValueAsString(field) shouldPrint := true if fieldName == "Name" { @@ -338,7 +338,7 @@ func buildChangeList(a, e, changes Task) ([]change, error) { } if !ignored && description == "" { - description = fmt.Sprintf(" %v -> %v", ValueAsString(fieldValA), ValueAsString(fieldValE)) + description = fmt.Sprintf(" %v -> %v", reflectutils.ValueAsString(fieldValA), reflectutils.ValueAsString(fieldValE)) } } if ignored { @@ -398,104 +398,6 @@ func getTaskName(t Task) string { return s } -// ValueAsString returns a human-readable string representation of the passed value -func ValueAsString(value reflect.Value) string { - b := &bytes.Buffer{} - - walker := func(path string, field *reflect.StructField, v reflect.Value) error { - if utils.IsPrimitiveValue(v) || v.Kind() == reflect.String { - fmt.Fprintf(b, "%v", v.Interface()) - return utils.SkipReflection - } - - switch v.Kind() { - case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map: - if v.IsNil() { - fmt.Fprintf(b, "") - return utils.SkipReflection - } - } - - switch v.Kind() { - case reflect.Ptr, reflect.Interface: - return nil // descend into value - - case reflect.Slice: - len := v.Len() - fmt.Fprintf(b, "[") - for i := 0; i < len; i++ { - av := v.Index(i) - - if i != 0 { - fmt.Fprintf(b, ", ") - } - fmt.Fprintf(b, "%s", ValueAsString(av)) - } - fmt.Fprintf(b, "]") - return utils.SkipReflection - - case reflect.Map: - keys := v.MapKeys() - fmt.Fprintf(b, "{") - for i, key := range keys { - mv := v.MapIndex(key) - - if i != 0 { - fmt.Fprintf(b, ", ") - } - fmt.Fprintf(b, "%s: %s", ValueAsString(key), ValueAsString(mv)) - } - fmt.Fprintf(b, "}") - return utils.SkipReflection - - case reflect.Struct: - intf := v.Addr().Interface() - if _, ok := intf.(Resource); ok { - fmt.Fprintf(b, "") - } else if _, ok := intf.(*ResourceHolder); ok { - fmt.Fprintf(b, "") - } else if compareWithID, ok := intf.(CompareWithID); ok { - id := compareWithID.CompareWithID() - name := "" - hasName, ok := intf.(HasName) - if ok { - name = StringValue(hasName.GetName()) - } - if id == nil { - // Uninformative, but we can often print the name instead - if name != "" { - fmt.Fprintf(b, "name:%s", name) - } else { - fmt.Fprintf(b, "id:") - } - } else { - // Uninformative, but we can often print the name instead - if name != "" { - fmt.Fprintf(b, "name:%s id:%s", name, *id) - } else { - fmt.Fprintf(b, "id:%s", *id) - } - - } - } else { - glog.V(4).Infof("Unhandled kind in asString for %q: %T", path, v.Interface()) - fmt.Fprint(b, DebugAsJsonString(intf)) - } - return utils.SkipReflection - - default: - glog.Infof("Unhandled kind in asString for %q: %T", path, v.Interface()) - return fmt.Errorf("Unhandled kind for %q: %v", path, v.Kind()) - } - } - - err := utils.ReflectRecursive(value, walker) - if err != nil { - glog.Fatalf("unexpected error during reflective walk: %v", err) - } - return b.String() -} - // Finish is called at the end of a run, and prints a list of changes to the configured Writer func (t *DryRunTarget) Finish(taskMap map[string]Task) error { return t.PrintReport(taskMap, t.out) diff --git a/upup/pkg/fi/errors.go b/upup/pkg/fi/errors.go index ce5257cc9f..b224be45f1 100644 --- a/upup/pkg/fi/errors.go +++ b/upup/pkg/fi/errors.go @@ -21,7 +21,8 @@ import ( "k8s.io/apimachinery/pkg/api/validation" "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/kops/upup/pkg/fi/utils" + + "k8s.io/kops/util/pkg/reflectutils" ) func RequiredField(key string) error { @@ -33,6 +34,6 @@ func CannotChangeField(key string) error { } func FieldIsImmutable(newVal, oldVal interface{}, fldPath *field.Path) *field.Error { - details := fmt.Sprintf("%s: old=%v new=%v", validation.FieldImmutableErrorMsg, utils.FormatValue(oldVal), utils.FormatValue(newVal)) + details := fmt.Sprintf("%s: old=%v new=%v", validation.FieldImmutableErrorMsg, reflectutils.FormatValue(oldVal), reflectutils.FormatValue(newVal)) return field.Invalid(fldPath, newVal, details) } diff --git a/upup/pkg/fi/files_owner.go b/upup/pkg/fi/files_owner.go index 677b190779..f9cb97ce80 100644 --- a/upup/pkg/fi/files_owner.go +++ b/upup/pkg/fi/files_owner.go @@ -53,7 +53,7 @@ func EnsureFileOwner(destPath string, owner string, groupName string) (bool, err return changed, nil } - glog.Infof("Changing file owner/group for %q to %s:%s", destPath, owner, group) + glog.Infof("Changing file owner/group for %q to %s:%+v", destPath, owner, group) err = os.Lchown(destPath, user.Uid, group.Gid) if err != nil { return changed, fmt.Errorf("error setting file owner/group for %q: %v", destPath, err) diff --git a/upup/pkg/fi/fitasks/keypair.go b/upup/pkg/fi/fitasks/keypair.go index 4868ee553d..c44a75dc9d 100644 --- a/upup/pkg/fi/fitasks/keypair.go +++ b/upup/pkg/fi/fitasks/keypair.go @@ -263,7 +263,7 @@ func (e *Keypair) BuildCertificateTemplate() (*x509.Certificate, error) { } if len(subjectPkix.ToRDNSequence()) == 0 { - return nil, fmt.Errorf("Subject name was empty for SSL keypair %q", e.Name) + return nil, fmt.Errorf("Subject name was empty for SSL keypair %q", *e.Name) } template.Subject = *subjectPkix diff --git a/upup/pkg/fi/fitasks/keypair_fitask.go b/upup/pkg/fi/fitasks/keypair_fitask.go index 98e54bbdef..13177800e1 100644 --- a/upup/pkg/fi/fitasks/keypair_fitask.go +++ b/upup/pkg/fi/fitasks/keypair_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realKeypair Keypair -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Keypair) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/fitasks/managedfile_fitask.go b/upup/pkg/fi/fitasks/managedfile_fitask.go index 66d95a6dd4..f2a06318ee 100644 --- a/upup/pkg/fi/fitasks/managedfile_fitask.go +++ b/upup/pkg/fi/fitasks/managedfile_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realManagedFile ManagedFile -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *ManagedFile) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/fitasks/mirrorkeystore_fitask.go b/upup/pkg/fi/fitasks/mirrorkeystore_fitask.go index 8bdf6269d4..bff169e92d 100644 --- a/upup/pkg/fi/fitasks/mirrorkeystore_fitask.go +++ b/upup/pkg/fi/fitasks/mirrorkeystore_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realMirrorKeystore MirrorKeystore -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *MirrorKeystore) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/fitasks/mirrorsecrets_fitask.go b/upup/pkg/fi/fitasks/mirrorsecrets_fitask.go index 91721df193..1174e58fd6 100644 --- a/upup/pkg/fi/fitasks/mirrorsecrets_fitask.go +++ b/upup/pkg/fi/fitasks/mirrorsecrets_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realMirrorSecrets MirrorSecrets -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *MirrorSecrets) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/fitasks/secret_fitask.go b/upup/pkg/fi/fitasks/secret_fitask.go index e766e54df9..a8de0aef95 100644 --- a/upup/pkg/fi/fitasks/secret_fitask.go +++ b/upup/pkg/fi/fitasks/secret_fitask.go @@ -29,7 +29,7 @@ import ( // JSON marshalling boilerplate type realSecret Secret -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *Secret) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/pkg/fi/loader/BUILD.bazel b/upup/pkg/fi/loader/BUILD.bazel index c8060e5962..9bb95a99b9 100644 --- a/upup/pkg/fi/loader/BUILD.bazel +++ b/upup/pkg/fi/loader/BUILD.bazel @@ -10,6 +10,7 @@ go_library( visibility = ["//visibility:public"], deps = [ "//upup/pkg/fi/utils:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//util/pkg/vfs:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", diff --git a/upup/pkg/fi/loader/options_loader.go b/upup/pkg/fi/loader/options_loader.go index c41b3520e2..90ee20dd52 100644 --- a/upup/pkg/fi/loader/options_loader.go +++ b/upup/pkg/fi/loader/options_loader.go @@ -28,6 +28,7 @@ import ( "github.com/golang/glog" "k8s.io/kops/upup/pkg/fi/utils" + "k8s.io/kops/util/pkg/reflectutils" ) const maxIterations = 10 @@ -96,7 +97,7 @@ func (l *OptionsLoader) iterate(userConfig interface{}, current interface{}) (in next := reflect.New(t).Interface() // Copy the current state before applying rules; they act as defaults - utils.JsonMergeStruct(next, current) + reflectutils.JsonMergeStruct(next, current) for _, t := range l.templates { glog.V(2).Infof("executing template %s (tags=%s)", t.Name, t.Tags) @@ -135,7 +136,7 @@ func (l *OptionsLoader) iterate(userConfig interface{}, current interface{}) (in } // Also copy the user-provided values after applying rules; they act as overrides now - utils.JsonMergeStruct(next, userConfig) + reflectutils.JsonMergeStruct(next, userConfig) return next, nil } diff --git a/upup/pkg/fi/nodeup/command.go b/upup/pkg/fi/nodeup/command.go index dcfc583d57..d3ecc2ab26 100644 --- a/upup/pkg/fi/nodeup/command.go +++ b/upup/pkg/fi/nodeup/command.go @@ -48,8 +48,6 @@ import ( // MaxTaskDuration is the amount of time to keep trying for; we retry for a long time - there is not really any great fallback const MaxTaskDuration = 365 * 24 * time.Hour -const TagMaster = "_kubernetes_master" - // NodeUpCommand the configiruation for nodeup type NodeUpCommand struct { CacheDir string @@ -183,7 +181,6 @@ func (c *NodeUpCommand) Run(out io.Writer) error { Cluster: c.cluster, Distribution: distribution, InstanceGroup: c.instanceGroup, - IsMaster: nodeTags.Has(TagMaster), NodeupConfig: c.config, } diff --git a/upup/pkg/fi/nodeup/nodetasks/file.go b/upup/pkg/fi/nodeup/nodetasks/file.go index fee47d8b07..1f4df09169 100644 --- a/upup/pkg/fi/nodeup/nodetasks/file.go +++ b/upup/pkg/fi/nodeup/nodetasks/file.go @@ -310,7 +310,7 @@ func (_ *File) RenderCloudInit(t *cloudinit.CloudInitTarget, a, e, changes *File dirMode := os.FileMode(0755) fileMode, err := fi.ParseFileMode(fi.StringValue(e.Mode), 0644) if err != nil { - return fmt.Errorf("invalid file mode for %q: %q", e.Path, e.Mode) + return fmt.Errorf("invalid file mode for %s: %q", e.Path, *e.Mode) } if e.Type == FileType_Symlink { diff --git a/upup/pkg/fi/printers.go b/upup/pkg/fi/printers.go new file mode 100644 index 0000000000..1cd7729282 --- /dev/null +++ b/upup/pkg/fi/printers.go @@ -0,0 +1,75 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fi + +import ( + "fmt" + + "k8s.io/kops/pkg/values" + "k8s.io/kops/util/pkg/reflectutils" +) + +func init() { + // Register our custom printer functions + reflectutils.RegisterPrinter(PrintResource) + reflectutils.RegisterPrinter(PrintResourceHolder) + reflectutils.RegisterPrinter(PrintCompareWithID) +} + +func PrintResource(o interface{}) (string, bool) { + if _, ok := o.(Resource); !ok { + return "", false + } + return "", true +} + +func PrintResourceHolder(o interface{}) (string, bool) { + if _, ok := o.(*ResourceHolder); !ok { + return "", false + } + return "", true +} + +func PrintCompareWithID(o interface{}) (string, bool) { + compareWithID, ok := o.(CompareWithID) + if !ok { + return "", false + } + + id := compareWithID.CompareWithID() + name := "" + hasName, ok := o.(HasName) + if ok { + name = values.StringValue(hasName.GetName()) + } + if id == nil { + // Uninformative, but we can often print the name instead + if name != "" { + return fmt.Sprintf("name:%s", name), true + } else { + return "id:", true + } + } else { + // Uninformative, but we can often print the name instead + if name != "" { + return fmt.Sprintf("name:%s id:%s", name, *id), true + } else { + return fmt.Sprintf("id:%s", *id), true + } + + } +} diff --git a/upup/pkg/fi/topological_sort.go b/upup/pkg/fi/topological_sort.go index 2dca686941..f3c489a3f1 100644 --- a/upup/pkg/fi/topological_sort.go +++ b/upup/pkg/fi/topological_sort.go @@ -22,7 +22,8 @@ import ( "reflect" "github.com/golang/glog" - "k8s.io/kops/upup/pkg/fi/utils" + + "k8s.io/kops/util/pkg/reflectutils" ) type HasDependencies interface { @@ -76,8 +77,8 @@ func reflectForDependencies(tasks map[string]Task, task Task) []Task { func getDependencies(tasks map[string]Task, v reflect.Value) []Task { var dependencies []Task - err := utils.ReflectRecursive(v, func(path string, f *reflect.StructField, v reflect.Value) error { - if utils.IsPrimitiveValue(v) { + err := reflectutils.ReflectRecursive(v, func(path string, f *reflect.StructField, v reflect.Value) error { + if reflectutils.IsPrimitiveValue(v) { return nil } @@ -111,7 +112,7 @@ func getDependencies(tasks map[string]Task, v reflect.Value) []Task { } else { return fmt.Errorf("Unhandled type for %q: %T", path, v.Interface()) } - return utils.SkipReflection + return reflectutils.SkipReflection default: glog.Infof("Unhandled kind for %q: %T", path, v.Interface()) diff --git a/upup/pkg/fi/users.go b/upup/pkg/fi/users.go index f02c0e81d7..bdc6c8ae34 100644 --- a/upup/pkg/fi/users.go +++ b/upup/pkg/fi/users.go @@ -54,18 +54,18 @@ func parseUsers() (map[string]*User, error) { tokens := strings.Split(line, ":") if len(tokens) < 7 { - glog.Warning("Ignoring malformed /etc/passwd line (too few tokens): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (too few tokens): %q\n", line) continue } uid, err := strconv.Atoi(tokens[2]) if err != nil { - glog.Warning("Ignoring malformed /etc/passwd line (bad uid): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (bad uid): %q", line) continue } gid, err := strconv.Atoi(tokens[3]) if err != nil { - glog.Warning("Ignoring malformed /etc/passwd line (bad gid): %q", line) + glog.Warningf("Ignoring malformed /etc/passwd line (bad gid): %q", line) continue } @@ -126,13 +126,13 @@ func parseGroups() (map[string]*Group, error) { tokens := strings.Split(line, ":") if len(tokens) < 4 { - glog.Warning("Ignoring malformed /etc/group line (too few tokens): %q", line) + glog.Warningf("Ignoring malformed /etc/group line (too few tokens): %q", line) continue } gid, err := strconv.Atoi(tokens[2]) if err != nil { - glog.Warning("Ignoring malformed /etc/group line (bad gid): %q", line) + glog.Warningf("Ignoring malformed /etc/group line (bad gid): %q", line) continue } diff --git a/upup/pkg/fi/utils/BUILD.bazel b/upup/pkg/fi/utils/BUILD.bazel index ad570a7a3a..17bcf9af4d 100644 --- a/upup/pkg/fi/utils/BUILD.bazel +++ b/upup/pkg/fi/utils/BUILD.bazel @@ -4,7 +4,6 @@ go_library( name = "go_default_library", srcs = [ "equals.go", - "reflect.go", "sanitize.go", "yaml.go", ], @@ -12,7 +11,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//vendor/github.com/ghodss/yaml:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/client-go/util/homedir:go_default_library", ], ) diff --git a/upup/tools/generators/fitask/generator.go b/upup/tools/generators/fitask/generator.go index 7eb65296ff..74be15f37d 100644 --- a/upup/tools/generators/fitask/generator.go +++ b/upup/tools/generators/fitask/generator.go @@ -63,7 +63,7 @@ const perTypeDef = ` // JSON marshalling boilerplate type real{{.Name}} {{.Name}} -// UnmarshalJSON implements conversion to JSON, supporitng an alternate specification of the object as a string +// UnmarshalJSON implements conversion to JSON, supporting an alternate specification of the object as a string func (o *{{.Name}}) UnmarshalJSON(data []byte) error { var jsonName string if err := json.Unmarshal(data, &jsonName); err == nil { diff --git a/upup/tools/generators/pkg/codegen/parse.go b/upup/tools/generators/pkg/codegen/parse.go index 8e87fcf5a6..14eaeab895 100644 --- a/upup/tools/generators/pkg/codegen/parse.go +++ b/upup/tools/generators/pkg/codegen/parse.go @@ -110,7 +110,7 @@ func (g *GoParser) parsePackage(directory string, names []string, text interface // check type-checks the package. The package must be OK to proceed. func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) { pkg.defs = make(map[*ast.Ident]types.Object) - config := types.Config{Importer: importer.Default(), FakeImportC: true} + config := types.Config{Importer: importer.For("source", nil), FakeImportC: true} info := &types.Info{ Defs: pkg.defs, } diff --git a/util/pkg/reflectutils/BUILD.bazel b/util/pkg/reflectutils/BUILD.bazel new file mode 100644 index 0000000000..c500369335 --- /dev/null +++ b/util/pkg/reflectutils/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "print.go", + "walk.go", + ], + importpath = "k8s.io/kops/util/pkg/reflectutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/values:go_default_library", + "//vendor/github.com/golang/glog:go_default_library", + ], +) diff --git a/util/pkg/reflectutils/print.go b/util/pkg/reflectutils/print.go new file mode 100644 index 0000000000..263cf28151 --- /dev/null +++ b/util/pkg/reflectutils/print.go @@ -0,0 +1,121 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package reflectutils + +import ( + "bytes" + "fmt" + "reflect" + + "github.com/golang/glog" + + "k8s.io/kops/pkg/values" +) + +// Printer is a custom printer function, so we can add special display for objects +// (without introducing a package dependency) +type Printer func(o interface{}) (string, bool) + +var printers []Printer + +// RegisterPrinter adds a custom printer function +func RegisterPrinter(p Printer) { + printers = append(printers, p) +} + +// ValueAsString returns a human-readable string representation of the passed value +func ValueAsString(value reflect.Value) string { + b := &bytes.Buffer{} + + walker := func(path string, field *reflect.StructField, v reflect.Value) error { + if IsPrimitiveValue(v) || v.Kind() == reflect.String { + fmt.Fprintf(b, "%v", v.Interface()) + return SkipReflection + } + + switch v.Kind() { + case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map: + if v.IsNil() { + fmt.Fprintf(b, "") + return SkipReflection + } + } + + switch v.Kind() { + case reflect.Ptr, reflect.Interface: + return nil // descend into value + + case reflect.Slice: + len := v.Len() + fmt.Fprintf(b, "[") + for i := 0; i < len; i++ { + av := v.Index(i) + + if i != 0 { + fmt.Fprintf(b, ", ") + } + fmt.Fprintf(b, "%s", ValueAsString(av)) + } + fmt.Fprintf(b, "]") + return SkipReflection + + case reflect.Map: + keys := v.MapKeys() + fmt.Fprintf(b, "{") + for i, key := range keys { + mv := v.MapIndex(key) + + if i != 0 { + fmt.Fprintf(b, ", ") + } + fmt.Fprintf(b, "%s: %s", ValueAsString(key), ValueAsString(mv)) + } + fmt.Fprintf(b, "}") + return SkipReflection + + case reflect.Struct: + intf := v.Addr().Interface() + + done := false + for _, p := range printers { + s, ok := p(intf) + if ok { + fmt.Fprintf(b, s) + done = true + break + } + } + + if !done { + glog.V(4).Infof("Unhandled kind in asString for %q: %T", path, v.Interface()) + fmt.Fprint(b, values.DebugAsJsonString(intf)) + } + + return SkipReflection + + default: + glog.Infof("Unhandled kind in asString for %q: %T", path, v.Interface()) + return fmt.Errorf("Unhandled kind for %q: %v", path, v.Kind()) + } + } + + err := ReflectRecursive(value, walker) + if err != nil { + glog.Fatalf("unexpected error during reflective walk: %v", err) + } + return b.String() +} diff --git a/upup/pkg/fi/utils/reflect.go b/util/pkg/reflectutils/walk.go similarity index 99% rename from upup/pkg/fi/utils/reflect.go rename to util/pkg/reflectutils/walk.go index a753ac00fd..f656bfa5d8 100644 --- a/upup/pkg/fi/utils/reflect.go +++ b/util/pkg/reflectutils/walk.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package utils +package reflectutils import ( "encoding/json" diff --git a/util/pkg/tables/BUILD.bazel b/util/pkg/tables/BUILD.bazel index 7f2621fc8e..d3e4bdedcd 100644 --- a/util/pkg/tables/BUILD.bazel +++ b/util/pkg/tables/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "k8s.io/kops/util/pkg/tables", visibility = ["//visibility:public"], deps = [ - "//upup/pkg/fi:go_default_library", + "//util/pkg/reflectutils:go_default_library", "//vendor/github.com/golang/glog:go_default_library", ], ) diff --git a/util/pkg/tables/format.go b/util/pkg/tables/format.go index e800c87f19..614c790ba4 100644 --- a/util/pkg/tables/format.go +++ b/util/pkg/tables/format.go @@ -25,7 +25,8 @@ import ( "text/tabwriter" "github.com/golang/glog" - "k8s.io/kops/upup/pkg/fi" + + "k8s.io/kops/util/pkg/reflectutils" ) // Table renders tables to stdout @@ -44,7 +45,7 @@ func (c *TableColumn) getFromValue(v reflect.Value) string { fvs := c.Getter.Call(args) fv := fvs[0] - return fi.ValueAsString(fv) + return reflectutils.ValueAsString(fv) } type getterFunction func(interface{}) string diff --git a/util/pkg/vfs/s3fs.go b/util/pkg/vfs/s3fs.go index d55334f335..2c9f54d3dc 100644 --- a/util/pkg/vfs/s3fs.go +++ b/util/pkg/vfs/s3fs.go @@ -127,23 +127,30 @@ func (p *S3Path) WriteFile(data io.ReadSeeker, aclObj ACL) error { glog.V(4).Infof("Writing file %q", p) - // We always use server-side-encryption; it doesn't really cost us anything - sse := "AES256" - request := &s3.PutObjectInput{} request.Body = data request.Bucket = aws.String(p.bucket) request.Key = aws.String(p.key) - // only support SSE if a custom endpoint is not provided - if !p.bucketDetails.defaultEncryption { - request.ServerSideEncryption = aws.String(sse) + // If we are on an S3 implementation that supports SSE (i.e. not + // DO), we use server-side-encryption, it doesn't really cost us + // anything. But if the bucket has a defaultEncryption policy + // instead, we honor that - it is likely to be a higher encryption + // standard. + sseLog := "-" + if p.sse { + if p.bucketDetails.defaultEncryption { + sseLog = "DefaultBucketEncryption" + } else { + sseLog = "AES256" + request.ServerSideEncryption = aws.String("AES256") + } } acl := os.Getenv("KOPS_STATE_S3_ACL") acl = strings.TrimSpace(acl) if acl != "" { - glog.Infof("Using KOPS_STATE_S3_ACL=%s", acl) + glog.V(8).Infof("Using KOPS_STATE_S3_ACL=%s", acl) request.ACL = aws.String(acl) } else if aclObj != nil { s3Acl, ok := aclObj.(*S3Acl) @@ -155,11 +162,7 @@ func (p *S3Path) WriteFile(data io.ReadSeeker, aclObj ACL) error { // We don't need Content-MD5: https://github.com/aws/aws-sdk-go/issues/208 - if p.bucketDetails.defaultEncryption { - glog.V(8).Infof("Calling S3 PutObject Bucket=%q Key=%q ACL=%q with DefaultBucketEncryption", p.bucket, p.key, acl) - } else { - glog.V(8).Infof("Calling S3 PutObject Bucket=%q Key=%q SSE=%q ACL=%q", p.bucket, p.key, sse, acl) - } + glog.V(8).Infof("Calling S3 PutObject Bucket=%q Key=%q SSE=%q ACL=%q", p.bucket, p.key, sseLog, acl) _, err = client.PutObject(request) if err != nil { diff --git a/util/pkg/vfs/swiftfs.go b/util/pkg/vfs/swiftfs.go index c8666ae471..f347efb203 100644 --- a/util/pkg/vfs/swiftfs.go +++ b/util/pkg/vfs/swiftfs.go @@ -304,7 +304,7 @@ func (p *SwiftPath) CreateFile(data io.ReadSeeker, acl ACL) error { func (p *SwiftPath) createBucket() error { done, err := RetryWithBackoff(swiftWriteBackoff, func() (bool, error) { - _, err := swiftcontainer.Get(p.client, p.bucket).Extract() + _, err := swiftcontainer.Get(p.client, p.bucket, swiftcontainer.GetOpts{}).Extract() if err == nil { return true, nil } diff --git a/vendor/github.com/gophercloud/gophercloud/.gitignore b/vendor/github.com/gophercloud/gophercloud/.gitignore index df9048a010..dd91ed2055 100644 --- a/vendor/github.com/gophercloud/gophercloud/.gitignore +++ b/vendor/github.com/gophercloud/gophercloud/.gitignore @@ -1,2 +1,3 @@ **/*.swp .idea +.vscode diff --git a/vendor/github.com/gophercloud/gophercloud/.travis.yml b/vendor/github.com/gophercloud/gophercloud/.travis.yml index 59c4194952..02728f4968 100644 --- a/vendor/github.com/gophercloud/gophercloud/.travis.yml +++ b/vendor/github.com/gophercloud/gophercloud/.travis.yml @@ -7,8 +7,8 @@ install: - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/goimports go: -- 1.8 -- tip +- "1.10" +- "tip" env: global: - secure: "xSQsAG5wlL9emjbCdxzz/hYQsSpJ/bABO1kkbwMSISVcJ3Nk0u4ywF+LS4bgeOnwPfmFvNTOqVDu3RwEvMeWXSI76t1piCPcObutb2faKLVD/hLoAS76gYX+Z8yGWGHrSB7Do5vTPj1ERe2UljdrnsSeOXzoDwFxYRaZLX4bBOB4AyoGvRniil5QXPATiA1tsWX1VMicj8a4F8X+xeESzjt1Q5Iy31e7vkptu71bhvXCaoo5QhYwT+pLR9dN0S1b7Ro0KVvkRefmr1lUOSYd2e74h6Lc34tC1h3uYZCS4h47t7v5cOXvMNxinEj2C51RvbjvZI1RLVdkuAEJD1Iz4+Ote46nXbZ//6XRZMZz/YxQ13l7ux1PFjgEB6HAapmF5Xd8PRsgeTU9LRJxpiTJ3P5QJ3leS1va8qnziM5kYipj/Rn+V8g2ad/rgkRox9LSiR9VYZD2Pe45YCb1mTKSl2aIJnV7nkOqsShY5LNB4JZSg7xIffA+9YVDktw8dJlATjZqt7WvJJ49g6A61mIUV4C15q2JPGKTkZzDiG81NtmS7hFa7k0yaE2ELgYocbcuyUcAahhxntYTC0i23nJmEHVNiZmBO3u7EgpWe4KGVfumU+lt12tIn5b3dZRBBUk3QakKKozSK1QPHGpk/AZGrhu7H6l8to6IICKWtDcyMPQ=" diff --git a/vendor/github.com/gophercloud/gophercloud/.zuul.yaml b/vendor/github.com/gophercloud/gophercloud/.zuul.yaml index c259d03e18..92fd9d4826 100644 --- a/vendor/github.com/gophercloud/gophercloud/.zuul.yaml +++ b/vendor/github.com/gophercloud/gophercloud/.zuul.yaml @@ -1,3 +1,64 @@ +- job: + name: gophercloud-unittest + parent: golang-test + description: | + Run gophercloud unit test + run: .zuul/playbooks/gophercloud-unittest/run.yaml + nodeset: ubuntu-xenial-ut + +- job: + name: gophercloud-acceptance-test + parent: golang-test + description: | + Run gophercloud acceptance test on master branch + run: .zuul/playbooks/gophercloud-acceptance-test/run.yaml + +- job: + name: gophercloud-acceptance-test-queens + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on queens branch + vars: + global_env: + OS_BRANCH: stable/queens + +- job: + name: gophercloud-acceptance-test-pike + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on pike branch + vars: + global_env: + OS_BRANCH: stable/pike + +- job: + name: gophercloud-acceptance-test-ocata + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on ocata branch + vars: + global_env: + OS_BRANCH: stable/ocata + +- job: + name: gophercloud-acceptance-test-newton + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on newton branch + vars: + global_env: + OS_BRANCH: stable/newton + +- job: + name: gophercloud-acceptance-test-mitaka + parent: gophercloud-acceptance-test + description: | + Run gophercloud acceptance test on mitaka branch + vars: + global_env: + OS_BRANCH: stable/mitaka + nodeset: ubuntu-trusty + - project: name: gophercloud/gophercloud check: @@ -7,6 +68,19 @@ recheck-mitaka: jobs: - gophercloud-acceptance-test-mitaka + recheck-newton: + jobs: + - gophercloud-acceptance-test-newton + recheck-ocata: + jobs: + - gophercloud-acceptance-test-ocata recheck-pike: jobs: - gophercloud-acceptance-test-pike + recheck-queens: + jobs: + - gophercloud-acceptance-test-queens + periodic: + jobs: + - gophercloud-unittest + - gophercloud-acceptance-test diff --git a/vendor/github.com/gophercloud/gophercloud/FAQ.md b/vendor/github.com/gophercloud/gophercloud/FAQ.md deleted file mode 100644 index 88a366a288..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/FAQ.md +++ /dev/null @@ -1,148 +0,0 @@ -# Tips - -## Implementing default logging and re-authentication attempts - -You can implement custom logging and/or limit re-auth attempts by creating a custom HTTP client -like the following and setting it as the provider client's HTTP Client (via the -`gophercloud.ProviderClient.HTTPClient` field): - -```go -//... - -// LogRoundTripper satisfies the http.RoundTripper interface and is used to -// customize the default Gophercloud RoundTripper to allow for logging. -type LogRoundTripper struct { - rt http.RoundTripper - numReauthAttempts int -} - -// newHTTPClient return a custom HTTP client that allows for logging relevant -// information before and after the HTTP request. -func newHTTPClient() http.Client { - return http.Client{ - Transport: &LogRoundTripper{ - rt: http.DefaultTransport, - }, - } -} - -// RoundTrip performs a round-trip HTTP request and logs relevant information about it. -func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error) { - glog.Infof("Request URL: %s\n", request.URL) - - response, err := lrt.rt.RoundTrip(request) - if response == nil { - return nil, err - } - - if response.StatusCode == http.StatusUnauthorized { - if lrt.numReauthAttempts == 3 { - return response, fmt.Errorf("Tried to re-authenticate 3 times with no success.") - } - lrt.numReauthAttempts++ - } - - glog.Debugf("Response Status: %s\n", response.Status) - - return response, nil -} - -endpoint := "https://127.0.0.1/auth" -pc := openstack.NewClient(endpoint) -pc.HTTPClient = newHTTPClient() - -//... -``` - - -## Implementing custom objects - -OpenStack request/response objects may differ among variable names or types. - -### Custom request objects - -To pass custom options to a request, implement the desired `OptsBuilder` interface. For -example, to pass in - -```go -type MyCreateServerOpts struct { - Name string - Size int -} -``` - -to `servers.Create`, simply implement the `servers.CreateOptsBuilder` interface: - -```go -func (o MyCreateServeropts) ToServerCreateMap() (map[string]interface{}, error) { - return map[string]interface{}{ - "name": o.Name, - "size": o.Size, - }, nil -} -``` - -create an instance of your custom options object, and pass it to `servers.Create`: - -```go -// ... -myOpts := MyCreateServerOpts{ - Name: "s1", - Size: "100", -} -server, err := servers.Create(computeClient, myOpts).Extract() -// ... -``` - -### Custom response objects - -Some OpenStack services have extensions. Extensions that are supported in Gophercloud can be -combined to create a custom object: - -```go -// ... -type MyVolume struct { - volumes.Volume - tenantattr.VolumeExt -} - -var v struct { - MyVolume `json:"volume"` -} - -err := volumes.Get(client, volID).ExtractInto(&v) -// ... -``` - -## Overriding default `UnmarshalJSON` method - -For some response objects, a field may be a custom type or may be allowed to take on -different types. In these cases, overriding the default `UnmarshalJSON` method may be -necessary. To do this, declare the JSON `struct` field tag as "-" and create an `UnmarshalJSON` -method on the type: - -```go -// ... -type MyVolume struct { - ID string `json: "id"` - TimeCreated time.Time `json: "-"` -} - -func (r *MyVolume) UnmarshalJSON(b []byte) error { - type tmp MyVolume - var s struct { - tmp - TimeCreated gophercloud.JSONRFC3339MilliNoZ `json:"created_at"` - } - err := json.Unmarshal(b, &s) - if err != nil { - return err - } - *r = Volume(s.tmp) - - r.TimeCreated = time.Time(s.CreatedAt) - - return err -} -// ... -``` diff --git a/vendor/github.com/gophercloud/gophercloud/MIGRATING.md b/vendor/github.com/gophercloud/gophercloud/MIGRATING.md deleted file mode 100644 index aa383c9cc9..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/MIGRATING.md +++ /dev/null @@ -1,32 +0,0 @@ -# Compute - -## Floating IPs - -* `github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingip` is now `github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips` -* `floatingips.Associate` and `floatingips.Disassociate` have been removed. -* `floatingips.DisassociateOpts` is now required to disassociate a Floating IP. - -## Security Groups - -* `secgroups.AddServerToGroup` is now `secgroups.AddServer`. -* `secgroups.RemoveServerFromGroup` is now `secgroups.RemoveServer`. - -## Servers - -* `servers.Reboot` now requires a `servers.RebootOpts` struct: - - ```golang - rebootOpts := &servers.RebootOpts{ - Type: servers.SoftReboot, - } - res := servers.Reboot(client, server.ID, rebootOpts) - ``` - -# Identity - -## V3 - -### Tokens - -* `Token.ExpiresAt` is now of type `gophercloud.JSONRFC3339Milli` instead of - `time.Time` diff --git a/vendor/github.com/gophercloud/gophercloud/README.md b/vendor/github.com/gophercloud/gophercloud/README.md index bb218c3fe9..ad29041d9b 100644 --- a/vendor/github.com/gophercloud/gophercloud/README.md +++ b/vendor/github.com/gophercloud/gophercloud/README.md @@ -127,7 +127,7 @@ new resource in the `server` variable (a ## Advanced Usage -Have a look at the [FAQ](./FAQ.md) for some tips on customizing the way Gophercloud works. +Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gophercloud works. ## Backwards-Compatibility Guarantees @@ -140,7 +140,7 @@ See the [contributing guide](./.github/CONTRIBUTING.md). ## Help and feedback If you're struggling with something or have spotted a potential bug, feel free -to submit an issue to our [bug tracker](/issues). +to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues). ## Thank You @@ -148,12 +148,12 @@ We'd like to extend special thanks and appreciation to the following: ### OpenLab - + OpenLab is providing a full CI environment to test each PR and merge for a variety of OpenStack releases. ### VEXXHOST - + VEXXHOST is providing their services to assist with the development and testing of Gophercloud. diff --git a/vendor/github.com/gophercloud/gophercloud/STYLEGUIDE.md b/vendor/github.com/gophercloud/gophercloud/STYLEGUIDE.md deleted file mode 100644 index 22a2900941..0000000000 --- a/vendor/github.com/gophercloud/gophercloud/STYLEGUIDE.md +++ /dev/null @@ -1,79 +0,0 @@ - -## On Pull Requests - -- Please make sure to read our [contributing guide](/.github/CONTRIBUTING.md). - -- Before you start a PR there needs to be a Github issue and a discussion about it - on that issue with a core contributor, even if it's just a 'SGTM'. - -- A PR's description must reference the issue it closes with a `For ` (e.g. For #293). - -- A PR's description must contain link(s) to the line(s) in the OpenStack - source code (on Github) that prove(s) the PR code to be valid. Links to documentation - are not good enough. The link(s) should be to a non-`master` branch. For example, - a pull request implementing the creation of a Neutron v2 subnet might put the - following link in the description: - - https://github.com/openstack/neutron/blob/stable/mitaka/neutron/api/v2/attributes.py#L749 - - From that link, a reviewer (or user) can verify the fields in the request/response - objects in the PR. - -- A PR that is in-progress should have `[wip]` in front of the PR's title. When - ready for review, remove the `[wip]` and ping a core contributor with an `@`. - -- Forcing PRs to be small can have the effect of users submitting PRs in a hierarchical chain, with - one depending on the next. If a PR depends on another one, it should have a [Pending #PRNUM] - prefix in the PR title. In addition, it will be the PR submitter's responsibility to remove the - [Pending #PRNUM] tag once the PR has been updated with the merged, dependent PR. That will - let reviewers know it is ready to review. - -- A PR should be small. Even if you intend on implementing an entire - service, a PR should only be one route of that service - (e.g. create server or get server, but not both). - -- Unless explicitly asked, do not squash commits in the middle of a review; only - append. It makes it difficult for the reviewer to see what's changed from one - review to the next. - -- See [#583](https://github.com/gophercloud/gophercloud/issues/583) as an example of a - well-formatted issue which contains all relevant information we need to review and approve. - -## On Code - -- In re design: follow as closely as is reasonable the code already in the library. - Most operations (e.g. create, delete) admit the same design. - -- Unit tests and acceptance (integration) tests must be written to cover each PR. - Tests for operations with several options (e.g. list, create) should include all - the options in the tests. This will allow users to verify an operation on their - own infrastructure and see an example of usage. - -- If in doubt, ask in-line on the PR. - -### File Structure - -- The following should be used in most cases: - - - `requests.go`: contains all the functions that make HTTP requests and the - types associated with the HTTP request (parameters for URL, body, etc) - - `results.go`: contains all the response objects and their methods - - `urls.go`: contains the endpoints to which the requests are made - -### Naming - -- For methods on a type in `results.go`, the receiver should be named `r` and the - variable into which it will be unmarshalled `s`. - -- Functions in `requests.go`, with the exception of functions that return a - `pagination.Pager`, should be named returns of the name `r`. - -- Functions in `requests.go` that accept request bodies should accept as their - last parameter an `interface` named `OptsBuilder` (eg `CreateOptsBuilder`). - This `interface` should have at the least a method named `ToMap` - (eg `ToPortCreateMap`). - -- Functions in `requests.go` that accept query strings should accept as their - last parameter an `interface` named `OptsBuilder` (eg `ListOptsBuilder`). - This `interface` should have at the least a method named `ToQuery` - (eg `ToServerListQuery`). diff --git a/vendor/github.com/gophercloud/gophercloud/auth_options.go b/vendor/github.com/gophercloud/gophercloud/auth_options.go index 4211470020..5e693585c2 100644 --- a/vendor/github.com/gophercloud/gophercloud/auth_options.go +++ b/vendor/github.com/gophercloud/gophercloud/auth_options.go @@ -81,6 +81,17 @@ type AuthOptions struct { // TokenID allows users to authenticate (possibly as another user) with an // authentication token ID. TokenID string `json:"-"` + + // Scope determines the scoping of the authentication request. + Scope *AuthScope `json:"-"` +} + +// AuthScope allows a created token to be limited to a specific domain or project. +type AuthScope struct { + ProjectID string + ProjectName string + DomainID string + DomainName string } // ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder @@ -263,85 +274,83 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s } func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { - - var scope struct { - ProjectID string - ProjectName string - DomainID string - DomainName string - } - - if opts.TenantID != "" { - scope.ProjectID = opts.TenantID - } else { - if opts.TenantName != "" { - scope.ProjectName = opts.TenantName - scope.DomainID = opts.DomainID - scope.DomainName = opts.DomainName + // For backwards compatibility. + // If AuthOptions.Scope was not set, try to determine it. + // This works well for common scenarios. + if opts.Scope == nil { + opts.Scope = new(AuthScope) + if opts.TenantID != "" { + opts.Scope.ProjectID = opts.TenantID + } else { + if opts.TenantName != "" { + opts.Scope.ProjectName = opts.TenantName + opts.Scope.DomainID = opts.DomainID + opts.Scope.DomainName = opts.DomainName + } } } - if scope.ProjectName != "" { + if opts.Scope.ProjectName != "" { // ProjectName provided: either DomainID or DomainName must also be supplied. // ProjectID may not be supplied. - if scope.DomainID == "" && scope.DomainName == "" { + if opts.Scope.DomainID == "" && opts.Scope.DomainName == "" { return nil, ErrScopeDomainIDOrDomainName{} } - if scope.ProjectID != "" { + if opts.Scope.ProjectID != "" { return nil, ErrScopeProjectIDOrProjectName{} } - if scope.DomainID != "" { + if opts.Scope.DomainID != "" { // ProjectName + DomainID return map[string]interface{}{ "project": map[string]interface{}{ - "name": &scope.ProjectName, - "domain": map[string]interface{}{"id": &scope.DomainID}, + "name": &opts.Scope.ProjectName, + "domain": map[string]interface{}{"id": &opts.Scope.DomainID}, }, }, nil } - if scope.DomainName != "" { + if opts.Scope.DomainName != "" { // ProjectName + DomainName return map[string]interface{}{ "project": map[string]interface{}{ - "name": &scope.ProjectName, - "domain": map[string]interface{}{"name": &scope.DomainName}, + "name": &opts.Scope.ProjectName, + "domain": map[string]interface{}{"name": &opts.Scope.DomainName}, }, }, nil } - } else if scope.ProjectID != "" { + } else if opts.Scope.ProjectID != "" { // ProjectID provided. ProjectName, DomainID, and DomainName may not be provided. - if scope.DomainID != "" { + if opts.Scope.DomainID != "" { return nil, ErrScopeProjectIDAlone{} } - if scope.DomainName != "" { + if opts.Scope.DomainName != "" { return nil, ErrScopeProjectIDAlone{} } // ProjectID return map[string]interface{}{ "project": map[string]interface{}{ - "id": &scope.ProjectID, + "id": &opts.Scope.ProjectID, }, }, nil - } else if scope.DomainID != "" { + } else if opts.Scope.DomainID != "" { // DomainID provided. ProjectID, ProjectName, and DomainName may not be provided. - if scope.DomainName != "" { + if opts.Scope.DomainName != "" { return nil, ErrScopeDomainIDOrDomainName{} } // DomainID return map[string]interface{}{ "domain": map[string]interface{}{ - "id": &scope.DomainID, + "id": &opts.Scope.DomainID, }, }, nil - } else if scope.DomainName != "" { + } else if opts.Scope.DomainName != "" { // DomainName return map[string]interface{}{ "domain": map[string]interface{}{ - "name": &scope.DomainName, + "name": &opts.Scope.DomainName, }, }, nil } diff --git a/vendor/github.com/gophercloud/gophercloud/errors.go b/vendor/github.com/gophercloud/gophercloud/errors.go index 88fd2ac676..a5fa68d6d5 100644 --- a/vendor/github.com/gophercloud/gophercloud/errors.go +++ b/vendor/github.com/gophercloud/gophercloud/errors.go @@ -1,6 +1,9 @@ package gophercloud -import "fmt" +import ( + "fmt" + "strings" +) // BaseError is an error type that all other error types embed. type BaseError struct { @@ -43,6 +46,33 @@ func (e ErrInvalidInput) Error() string { return e.choseErrString() } +// ErrMissingEnvironmentVariable is the error when environment variable is required +// in a particular situation but not provided by the user +type ErrMissingEnvironmentVariable struct { + BaseError + EnvironmentVariable string +} + +func (e ErrMissingEnvironmentVariable) Error() string { + e.DefaultErrString = fmt.Sprintf("Missing environment variable [%s]", e.EnvironmentVariable) + return e.choseErrString() +} + +// ErrMissingAnyoneOfEnvironmentVariables is the error when anyone of the environment variables +// is required in a particular situation but not provided by the user +type ErrMissingAnyoneOfEnvironmentVariables struct { + BaseError + EnvironmentVariables []string +} + +func (e ErrMissingAnyoneOfEnvironmentVariables) Error() string { + e.DefaultErrString = fmt.Sprintf( + "Missing one of the following environment variables [%s]", + strings.Join(e.EnvironmentVariables, ", "), + ) + return e.choseErrString() +} + // ErrUnexpectedResponseCode is returned by the Request method when a response code other than // those listed in OkCodes is encountered. type ErrUnexpectedResponseCode struct { @@ -72,6 +102,11 @@ type ErrDefault401 struct { ErrUnexpectedResponseCode } +// ErrDefault403 is the default error type returned on a 403 HTTP response code. +type ErrDefault403 struct { + ErrUnexpectedResponseCode +} + // ErrDefault404 is the default error type returned on a 404 HTTP response code. type ErrDefault404 struct { ErrUnexpectedResponseCode @@ -103,11 +138,22 @@ type ErrDefault503 struct { } func (e ErrDefault400) Error() string { - return "Invalid request due to incorrect syntax or missing required parameters." + e.DefaultErrString = fmt.Sprintf( + "Bad request with: [%s %s], error message: %s", + e.Method, e.URL, e.Body, + ) + return e.choseErrString() } func (e ErrDefault401) Error() string { return "Authentication failed" } +func (e ErrDefault403) Error() string { + e.DefaultErrString = fmt.Sprintf( + "Request forbidden: [%s %s], error message: %s", + e.Method, e.URL, e.Body, + ) + return e.choseErrString() +} func (e ErrDefault404) Error() string { return "Resource not found" } @@ -141,6 +187,12 @@ type Err401er interface { Error401(ErrUnexpectedResponseCode) error } +// Err403er is the interface resource error types implement to override the error message +// from a 403 error. +type Err403er interface { + Error403(ErrUnexpectedResponseCode) error +} + // Err404er is the interface resource error types implement to override the error message // from a 404 error. type Err404er interface { diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go b/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go index b5482ba8c9..994b5550c9 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go @@ -50,17 +50,23 @@ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { } if authURL == "" { - err := gophercloud.ErrMissingInput{Argument: "authURL"} + err := gophercloud.ErrMissingEnvironmentVariable{ + EnvironmentVariable: "OS_AUTH_URL", + } return nilOptions, err } if username == "" && userID == "" { - err := gophercloud.ErrMissingInput{Argument: "username"} + err := gophercloud.ErrMissingAnyoneOfEnvironmentVariables{ + EnvironmentVariables: []string{"OS_USERNAME", "OS_USERID"}, + } return nilOptions, err } if password == "" { - err := gophercloud.ErrMissingInput{Argument: "password"} + err := gophercloud.ErrMissingEnvironmentVariable{ + EnvironmentVariable: "OS_PASSWORD", + } return nilOptions, err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/requests.go index 2ec10ad55e..b7977cbc8f 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/requests.go @@ -98,6 +98,19 @@ type ListOpts struct { // TenantID will filter by a specific tenant/project ID. // Setting AllTenants is required for this. TenantID string `q:"project_id"` + + // Comma-separated list of sort keys and optional sort directions in the + // form of [:]. + Sort string `q:"sort"` + + // Requests a page size of items. + Limit int `q:"limit"` + + // Used in conjunction with limit to return a slice of items. + Offset int `q:"offset"` + + // The ID of the last-seen item. + Marker string `q:"marker"` } // ToVolumeListQuery formats a ListOpts into a query string. @@ -118,7 +131,7 @@ func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pa } return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page { - return VolumePage{pagination.SinglePageBase(r)} + return VolumePage{pagination.LinkedPageBase{PageResult: r}} }) } @@ -161,7 +174,12 @@ func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - pages, err := List(client, nil).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + pages, err := List(client, listOpts).AllPages() if err != nil { return "", err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/results.go index 674ec34686..96572b01b4 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/v2/volumes/results.go @@ -98,7 +98,7 @@ func (r *Volume) UnmarshalJSON(b []byte) error { // VolumePage is a pagination.pager that is returned from a call to the List function. type VolumePage struct { - pagination.SinglePageBase + pagination.LinkedPageBase } // IsEmpty returns true if a ListResult contains no Volumes. @@ -107,6 +107,19 @@ func (r VolumePage) IsEmpty() (bool, error) { return len(volumes) == 0, err } +// NextPageURL uses the response's embedded link reference to navigate to the +// next page of results. +func (r VolumePage) NextPageURL() (string, error) { + var s struct { + Links []gophercloud.Link `json:"volumes_links"` + } + err := r.ExtractInto(&s) + if err != nil { + return "", err + } + return gophercloud.ExtractNextURL(s.Links) +} + // ExtractVolumes extracts and returns Volumes. It is used while iterating over a volumes.List call. func ExtractVolumes(r pagination.Page) ([]Volume, error) { var s []Volume diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/client.go b/vendor/github.com/gophercloud/gophercloud/openstack/client.go index 5a52e57914..0859d9cb75 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/client.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/client.go @@ -2,10 +2,7 @@ package openstack import ( "fmt" - "net/url" "reflect" - "regexp" - "strings" "github.com/gophercloud/gophercloud" tokens2 "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens" @@ -38,21 +35,11 @@ A basic example of using this would be: client, err := openstack.NewIdentityV3(provider, gophercloud.EndpointOpts{}) */ func NewClient(endpoint string) (*gophercloud.ProviderClient, error) { - u, err := url.Parse(endpoint) + base, err := utils.BaseEndpoint(endpoint) if err != nil { return nil, err } - u.RawQuery, u.Fragment = "", "" - - var base string - versionRe := regexp.MustCompile("v[0-9.]+/?") - if version := versionRe.FindString(u.Path); version != "" { - base = strings.Replace(u.String(), version, "", -1) - } else { - base = u.String() - } - endpoint = gophercloud.NormalizeURL(endpoint) base = gophercloud.NormalizeURL(base) @@ -287,11 +274,17 @@ func NewIdentityV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOp // Ensure endpoint still has a suffix of v3. // This is because EndpointLocator might have found a versionless - // endpoint and requests will fail unless targeted at /v3. - if !strings.HasSuffix(endpoint, "v3/") { - endpoint = endpoint + "v3/" + // endpoint or the published endpoint is still /v2.0. In both + // cases, we need to fix the endpoint to point to /v3. + base, err := utils.BaseEndpoint(endpoint) + if err != nil { + return nil, err } + base = gophercloud.NormalizeURL(base) + + endpoint = base + "v3/" + return &gophercloud.ServiceClient{ ProviderClient: client, Endpoint: endpoint, @@ -394,3 +387,36 @@ func NewLoadBalancerV2(client *gophercloud.ProviderClient, eo gophercloud.Endpoi sc.ResourceBase = sc.Endpoint + "v2.0/" return sc, err } + +// NewClusteringV1 creates a ServiceClient that may be used with the v1 clustering +// package. +func NewClusteringV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { + return initClientOpts(client, eo, "clustering") +} + +// NewMessagingV2 creates a ServiceClient that may be used with the v2 messaging +// service. +func NewMessagingV2(client *gophercloud.ProviderClient, clientID string, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { + sc, err := initClientOpts(client, eo, "messaging") + sc.MoreHeaders = map[string]string{"Client-ID": clientID} + return sc, err +} + +// NewContainerV1 creates a ServiceClient that may be used with v1 container package +func NewContainerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { + return initClientOpts(client, eo, "container") +} + +// NewKeyManagerV1 creates a ServiceClient that may be used with the v1 key +// manager service. +func NewKeyManagerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { + sc, err := initClientOpts(client, eo, "key-manager") + sc.ResourceBase = sc.Endpoint + "v1/" + return sc, err +} + +// NewContainerInfraV1 creates a ServiceClient that may be used with the v1 container infra management +// package. +func NewContainerInfraV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { + return initClientOpts(client, eo, "container-infra") +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go index dc7b65fda1..24c4607722 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs/doc.go @@ -58,7 +58,7 @@ Example to Create a Server With a Key Pair FlavorRef: "flavor-uuid", } - createOpts := keypairs.CreateOpts{ + createOpts := keypairs.CreateOptsExt{ CreateOptsBuilder: serverCreateOpts, KeyName: "keypair-name", } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/BUILD.bazel b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/BUILD.bazel new file mode 100644 index 0000000000..b73ee52209 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "requests.go", + ], + importmap = "vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints", + importpath = "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gophercloud/gophercloud:go_default_library", + "//vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers:go_default_library", + ], +) diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go new file mode 100644 index 0000000000..2d9d3acdec --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/doc.go @@ -0,0 +1,76 @@ +/* +Package schedulerhints extends the server create request with the ability to +specify additional parameters which determine where the server will be +created in the OpenStack cloud. + +Example to Add a Server to a Server Group + + schedulerHints := schedulerhints.SchedulerHints{ + Group: "servergroup-uuid", + } + + serverCreateOpts := servers.CreateOpts{ + Name: "server_name", + ImageRef: "image-uuid", + FlavorRef: "flavor-uuid", + } + + createOpts := schedulerhints.CreateOptsExt{ + CreateOptsBuilder: serverCreateOpts, + SchedulerHints: schedulerHints, + } + + server, err := servers.Create(computeClient, createOpts).Extract() + if err != nil { + panic(err) + } + +Example to Place Server B on a Different Host than Server A + + schedulerHints := schedulerhints.SchedulerHints{ + DifferentHost: []string{ + "server-a-uuid", + } + } + + serverCreateOpts := servers.CreateOpts{ + Name: "server_b", + ImageRef: "image-uuid", + FlavorRef: "flavor-uuid", + } + + createOpts := schedulerhints.CreateOptsExt{ + CreateOptsBuilder: serverCreateOpts, + SchedulerHints: schedulerHints, + } + + server, err := servers.Create(computeClient, createOpts).Extract() + if err != nil { + panic(err) + } + +Example to Place Server B on the Same Host as Server A + + schedulerHints := schedulerhints.SchedulerHints{ + SameHost: []string{ + "server-a-uuid", + } + } + + serverCreateOpts := servers.CreateOpts{ + Name: "server_b", + ImageRef: "image-uuid", + FlavorRef: "flavor-uuid", + } + + createOpts := schedulerhints.CreateOptsExt{ + CreateOptsBuilder: serverCreateOpts, + SchedulerHints: schedulerHints, + } + + server, err := servers.Create(computeClient, createOpts).Extract() + if err != nil { + panic(err) + } +*/ +package schedulerhints diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go new file mode 100644 index 0000000000..3fabeddef3 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/schedulerhints/requests.go @@ -0,0 +1,164 @@ +package schedulerhints + +import ( + "net" + "regexp" + "strings" + + "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" +) + +// SchedulerHints represents a set of scheduling hints that are passed to the +// OpenStack scheduler. +type SchedulerHints struct { + // Group specifies a Server Group to place the instance in. + Group string + + // DifferentHost will place the instance on a compute node that does not + // host the given instances. + DifferentHost []string + + // SameHost will place the instance on a compute node that hosts the given + // instances. + SameHost []string + + // Query is a conditional statement that results in compute nodes able to + // host the instance. + Query []interface{} + + // TargetCell specifies a cell name where the instance will be placed. + TargetCell string `json:"target_cell,omitempty"` + + // BuildNearHostIP specifies a subnet of compute nodes to host the instance. + BuildNearHostIP string + + // AdditionalProperies are arbitrary key/values that are not validated by nova. + AdditionalProperties map[string]interface{} +} + +// CreateOptsBuilder builds the scheduler hints into a serializable format. +type CreateOptsBuilder interface { + ToServerSchedulerHintsCreateMap() (map[string]interface{}, error) +} + +// ToServerSchedulerHintsMap builds the scheduler hints into a serializable format. +func (opts SchedulerHints) ToServerSchedulerHintsCreateMap() (map[string]interface{}, error) { + sh := make(map[string]interface{}) + + uuidRegex, _ := regexp.Compile("^[a-z0-9]{8}-[a-z0-9]{4}-[1-5][a-z0-9]{3}-[a-z0-9]{4}-[a-z0-9]{12}$") + + if opts.Group != "" { + if !uuidRegex.MatchString(opts.Group) { + err := gophercloud.ErrInvalidInput{} + err.Argument = "schedulerhints.SchedulerHints.Group" + err.Value = opts.Group + err.Info = "Group must be a UUID" + return nil, err + } + sh["group"] = opts.Group + } + + if len(opts.DifferentHost) > 0 { + for _, diffHost := range opts.DifferentHost { + if !uuidRegex.MatchString(diffHost) { + err := gophercloud.ErrInvalidInput{} + err.Argument = "schedulerhints.SchedulerHints.DifferentHost" + err.Value = opts.DifferentHost + err.Info = "The hosts must be in UUID format." + return nil, err + } + } + sh["different_host"] = opts.DifferentHost + } + + if len(opts.SameHost) > 0 { + for _, sameHost := range opts.SameHost { + if !uuidRegex.MatchString(sameHost) { + err := gophercloud.ErrInvalidInput{} + err.Argument = "schedulerhints.SchedulerHints.SameHost" + err.Value = opts.SameHost + err.Info = "The hosts must be in UUID format." + return nil, err + } + } + sh["same_host"] = opts.SameHost + } + + /* + Query can be something simple like: + [">=", "$free_ram_mb", 1024] + + Or more complex like: + ['and', + ['>=', '$free_ram_mb', 1024], + ['>=', '$free_disk_mb', 200 * 1024] + ] + + Because of the possible complexity, just make sure the length is a minimum of 3. + */ + if len(opts.Query) > 0 { + if len(opts.Query) < 3 { + err := gophercloud.ErrInvalidInput{} + err.Argument = "schedulerhints.SchedulerHints.Query" + err.Value = opts.Query + err.Info = "Must be a conditional statement in the format of [op,variable,value]" + return nil, err + } + sh["query"] = opts.Query + } + + if opts.TargetCell != "" { + sh["target_cell"] = opts.TargetCell + } + + if opts.BuildNearHostIP != "" { + if _, _, err := net.ParseCIDR(opts.BuildNearHostIP); err != nil { + err := gophercloud.ErrInvalidInput{} + err.Argument = "schedulerhints.SchedulerHints.BuildNearHostIP" + err.Value = opts.BuildNearHostIP + err.Info = "Must be a valid subnet in the form 192.168.1.1/24" + return nil, err + } + ipParts := strings.Split(opts.BuildNearHostIP, "/") + sh["build_near_host_ip"] = ipParts[0] + sh["cidr"] = "/" + ipParts[1] + } + + if opts.AdditionalProperties != nil { + for k, v := range opts.AdditionalProperties { + sh[k] = v + } + } + + return sh, nil +} + +// CreateOptsExt adds a SchedulerHints option to the base CreateOpts. +type CreateOptsExt struct { + servers.CreateOptsBuilder + + // SchedulerHints provides a set of hints to the scheduler. + SchedulerHints CreateOptsBuilder +} + +// ToServerCreateMap adds the SchedulerHints option to the base server creation options. +func (opts CreateOptsExt) ToServerCreateMap() (map[string]interface{}, error) { + base, err := opts.CreateOptsBuilder.ToServerCreateMap() + if err != nil { + return nil, err + } + + schedulerHints, err := opts.SchedulerHints.ToServerSchedulerHintsCreateMap() + if err != nil { + return nil, err + } + + if len(schedulerHints) == 0 { + return base, nil + } + + base["os:scheduler_hints"] = schedulerHints + + return base, nil +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/BUILD.bazel b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/BUILD.bazel new file mode 100644 index 0000000000..b475cccfb3 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "requests.go", + "results.go", + "urls.go", + ], + importmap = "vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups", + importpath = "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gophercloud/gophercloud:go_default_library", + "//vendor/github.com/gophercloud/gophercloud/pagination:go_default_library", + ], +) diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go new file mode 100644 index 0000000000..814bde37f3 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/doc.go @@ -0,0 +1,40 @@ +/* +Package servergroups provides the ability to manage server groups. + +Example to List Server Groups + + allpages, err := servergroups.List(computeClient).AllPages() + if err != nil { + panic(err) + } + + allServerGroups, err := servergroups.ExtractServerGroups(allPages) + if err != nil { + panic(err) + } + + for _, sg := range allServerGroups { + fmt.Printf("%#v\n", sg) + } + +Example to Create a Server Group + + createOpts := servergroups.CreateOpts{ + Name: "my_sg", + Policies: []string{"anti-affinity"}, + } + + sg, err := servergroups.Create(computeClient, createOpts).Extract() + if err != nil { + panic(err) + } + +Example to Delete a Server Group + + sgID := "7a6f29ad-e34d-4368-951a-58a08f11cfb7" + err := servergroups.Delete(computeClient, sgID).ExtractErr() + if err != nil { + panic(err) + } +*/ +package servergroups diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/requests.go new file mode 100644 index 0000000000..1439a5a34c --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/requests.go @@ -0,0 +1,59 @@ +package servergroups + +import ( + "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/pagination" +) + +// List returns a Pager that allows you to iterate over a collection of +// ServerGroups. +func List(client *gophercloud.ServiceClient) pagination.Pager { + return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { + return ServerGroupPage{pagination.SinglePageBase(r)} + }) +} + +// CreateOptsBuilder allows extensions to add additional parameters to the +// Create request. +type CreateOptsBuilder interface { + ToServerGroupCreateMap() (map[string]interface{}, error) +} + +// CreateOpts specifies Server Group creation parameters. +type CreateOpts struct { + // Name is the name of the server group + Name string `json:"name" required:"true"` + + // Policies are the server group policies + Policies []string `json:"policies" required:"true"` +} + +// ToServerGroupCreateMap constructs a request body from CreateOpts. +func (opts CreateOpts) ToServerGroupCreateMap() (map[string]interface{}, error) { + return gophercloud.BuildRequestBody(opts, "server_group") +} + +// Create requests the creation of a new Server Group. +func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { + b, err := opts.ToServerGroupCreateMap() + if err != nil { + r.Err = err + return + } + _, r.Err = client.Post(createURL(client), b, &r.Body, &gophercloud.RequestOpts{ + OkCodes: []int{200}, + }) + return +} + +// Get returns data about a previously created ServerGroup. +func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { + _, r.Err = client.Get(getURL(client, id), &r.Body, nil) + return +} + +// Delete requests the deletion of a previously allocated ServerGroup. +func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult) { + _, r.Err = client.Delete(deleteURL(client, id), nil) + return +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/results.go new file mode 100644 index 0000000000..b9aeef9815 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/results.go @@ -0,0 +1,87 @@ +package servergroups + +import ( + "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/pagination" +) + +// A ServerGroup creates a policy for instance placement in the cloud. +type ServerGroup struct { + // ID is the unique ID of the Server Group. + ID string `json:"id"` + + // Name is the common name of the server group. + Name string `json:"name"` + + // Polices are the group policies. + // + // Normally a single policy is applied: + // + // "affinity" will place all servers within the server group on the + // same compute node. + // + // "anti-affinity" will place servers within the server group on different + // compute nodes. + Policies []string `json:"policies"` + + // Members are the members of the server group. + Members []string `json:"members"` + + // Metadata includes a list of all user-specified key-value pairs attached + // to the Server Group. + Metadata map[string]interface{} +} + +// ServerGroupPage stores a single page of all ServerGroups results from a +// List call. +type ServerGroupPage struct { + pagination.SinglePageBase +} + +// IsEmpty determines whether or not a ServerGroupsPage is empty. +func (page ServerGroupPage) IsEmpty() (bool, error) { + va, err := ExtractServerGroups(page) + return len(va) == 0, err +} + +// ExtractServerGroups interprets a page of results as a slice of +// ServerGroups. +func ExtractServerGroups(r pagination.Page) ([]ServerGroup, error) { + var s struct { + ServerGroups []ServerGroup `json:"server_groups"` + } + err := (r.(ServerGroupPage)).ExtractInto(&s) + return s.ServerGroups, err +} + +type ServerGroupResult struct { + gophercloud.Result +} + +// Extract is a method that attempts to interpret any Server Group resource +// response as a ServerGroup struct. +func (r ServerGroupResult) Extract() (*ServerGroup, error) { + var s struct { + ServerGroup *ServerGroup `json:"server_group"` + } + err := r.ExtractInto(&s) + return s.ServerGroup, err +} + +// CreateResult is the response from a Create operation. Call its Extract method +// to interpret it as a ServerGroup. +type CreateResult struct { + ServerGroupResult +} + +// GetResult is the response from a Get operation. Call its Extract method to +// interpret it as a ServerGroup. +type GetResult struct { + ServerGroupResult +} + +// DeleteResult is the response from a Delete operation. Call its ExtractErr +// method to determine if the call succeeded or failed. +type DeleteResult struct { + gophercloud.ErrResult +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go new file mode 100644 index 0000000000..9a1f99b199 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/servergroups/urls.go @@ -0,0 +1,25 @@ +package servergroups + +import "github.com/gophercloud/gophercloud" + +const resourcePath = "os-server-groups" + +func resourceURL(c *gophercloud.ServiceClient) string { + return c.ServiceURL(resourcePath) +} + +func listURL(c *gophercloud.ServiceClient) string { + return resourceURL(c) +} + +func createURL(c *gophercloud.ServiceClient) string { + return resourceURL(c) +} + +func getURL(c *gophercloud.ServiceClient, id string) string { + return c.ServiceURL(resourcePath, id) +} + +func deleteURL(c *gophercloud.ServiceClient, id string) string { + return getURL(c, id) +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go index e7041df059..539019e90d 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/requests.go @@ -52,6 +52,14 @@ type ListOpts struct { MinDisk int `q:"minDisk"` MinRAM int `q:"minRam"` + // SortDir allows to select sort direction. + // It can be "asc" or "desc" (default). + SortDir string `q:"sort_dir"` + + // SortKey allows to sort by one of the flavors attributes. + // Default is flavorid. + SortKey string `q:"sort_key"` + // Marker and Limit control paging. // Marker instructs List where to start listing from. Marker string `q:"marker"` @@ -236,21 +244,22 @@ func GetExtraSpec(client *gophercloud.ServiceClient, flavorID string, key string // CreateExtraSpecsOptsBuilder allows extensions to add additional parameters to the // CreateExtraSpecs requests. type CreateExtraSpecsOptsBuilder interface { - ToExtraSpecsCreateMap() (map[string]interface{}, error) + ToFlavorExtraSpecsCreateMap() (map[string]interface{}, error) } // ExtraSpecsOpts is a map that contains key-value pairs. type ExtraSpecsOpts map[string]string -// ToExtraSpecsCreateMap assembles a body for a Create request based on the -// contents of a ExtraSpecsOpts -func (opts ExtraSpecsOpts) ToExtraSpecsCreateMap() (map[string]interface{}, error) { +// ToFlavorExtraSpecsCreateMap assembles a body for a Create request based on +// the contents of ExtraSpecsOpts. +func (opts ExtraSpecsOpts) ToFlavorExtraSpecsCreateMap() (map[string]interface{}, error) { return map[string]interface{}{"extra_specs": opts}, nil } -// CreateExtraSpecs will create or update the extra-specs key-value pairs for the specified Flavor +// CreateExtraSpecs will create or update the extra-specs key-value pairs for +// the specified Flavor. func CreateExtraSpecs(client *gophercloud.ServiceClient, flavorID string, opts CreateExtraSpecsOptsBuilder) (r CreateExtraSpecsResult) { - b, err := opts.ToExtraSpecsCreateMap() + b, err := opts.ToFlavorExtraSpecsCreateMap() if err != nil { r.Err = err return @@ -261,15 +270,15 @@ func CreateExtraSpecs(client *gophercloud.ServiceClient, flavorID string, opts C return } -// UpdateExtraSpecOptsBuilder allows extensions to add additional parameters to the -// Update request. +// UpdateExtraSpecOptsBuilder allows extensions to add additional parameters to +// the Update request. type UpdateExtraSpecOptsBuilder interface { - ToExtraSpecUpdateMap() (map[string]string, string, error) + ToFlavorExtraSpecUpdateMap() (map[string]string, string, error) } -// ToExtraSpecUpdateMap assembles a body for an Update request based on the -// contents of a ExtraSpecOpts. -func (opts ExtraSpecsOpts) ToExtraSpecUpdateMap() (map[string]string, string, error) { +// ToFlavorExtraSpecUpdateMap assembles a body for an Update request based on +// the contents of a ExtraSpecOpts. +func (opts ExtraSpecsOpts) ToFlavorExtraSpecUpdateMap() (map[string]string, string, error) { if len(opts) != 1 { err := gophercloud.ErrInvalidInput{} err.Argument = "flavors.ExtraSpecOpts" @@ -285,9 +294,10 @@ func (opts ExtraSpecsOpts) ToExtraSpecUpdateMap() (map[string]string, string, er return opts, key, nil } -// UpdateExtraSpec will updates the value of the specified flavor's extra spec for the key in opts. +// UpdateExtraSpec will updates the value of the specified flavor's extra spec +// for the key in opts. func UpdateExtraSpec(client *gophercloud.ServiceClient, flavorID string, opts UpdateExtraSpecOptsBuilder) (r UpdateExtraSpecResult) { - b, key, err := opts.ToExtraSpecUpdateMap() + b, key, err := opts.ToFlavorExtraSpecUpdateMap() if err != nil { r.Err = err return diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go index 525cddaea2..92fe1b1809 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/flavors/results.go @@ -59,7 +59,7 @@ type Flavor struct { RxTxFactor float64 `json:"rxtx_factor"` // Swap is the amount of swap space, measured in MB. - Swap int `json:"swap"` + Swap int `json:"-"` // VCPUs indicates how many (virtual) CPUs are available for this flavor. VCPUs int `json:"vcpus"` diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go index 626eb63e91..a6530f8d65 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/requests.go @@ -383,7 +383,7 @@ type RebootOpts struct { } // ToServerRebootMap builds a body for the reboot request. -func (opts *RebootOpts) ToServerRebootMap() (map[string]interface{}, error) { +func (opts RebootOpts) ToServerRebootMap() (map[string]interface{}, error) { return gophercloud.BuildRequestBody(opts, "reboot") } @@ -545,39 +545,6 @@ func RevertResize(client *gophercloud.ServiceClient, id string) (r ActionResult) return } -// RescueOptsBuilder is an interface that allows extensions to override the -// default structure of a Rescue request. -type RescueOptsBuilder interface { - ToServerRescueMap() (map[string]interface{}, error) -} - -// RescueOpts represents the configuration options used to control a Rescue -// option. -type RescueOpts struct { - // AdminPass is the desired administrative password for the instance in - // RESCUE mode. If it's left blank, the server will generate a password. - AdminPass string `json:"adminPass,omitempty"` -} - -// ToServerRescueMap formats a RescueOpts as a map that can be used as a JSON -// request body for the Rescue request. -func (opts RescueOpts) ToServerRescueMap() (map[string]interface{}, error) { - return gophercloud.BuildRequestBody(opts, "rescue") -} - -// Rescue instructs the provider to place the server into RESCUE mode. -func Rescue(client *gophercloud.ServiceClient, id string, opts RescueOptsBuilder) (r RescueResult) { - b, err := opts.ToServerRescueMap() - if err != nil { - r.Err = err - return - } - _, r.Err = client.Post(actionURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ - OkCodes: []int{200}, - }) - return -} - // ResetMetadataOptsBuilder allows extensions to add additional parameters to // the Reset request. type ResetMetadataOptsBuilder interface { @@ -756,7 +723,12 @@ func CreateImage(client *gophercloud.ServiceClient, id string, opts CreateImageO func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - allPages, err := List(client, nil).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + allPages, err := List(client, listOpts).AllPages() if err != nil { return "", err } @@ -789,3 +761,34 @@ func GetPassword(client *gophercloud.ServiceClient, serverId string) (r GetPassw _, r.Err = client.Get(passwordURL(client, serverId), &r.Body, nil) return } + +// ShowConsoleOutputOptsBuilder is the interface types must satisfy in order to be +// used as ShowConsoleOutput options +type ShowConsoleOutputOptsBuilder interface { + ToServerShowConsoleOutputMap() (map[string]interface{}, error) +} + +// ShowConsoleOutputOpts satisfies the ShowConsoleOutputOptsBuilder +type ShowConsoleOutputOpts struct { + // The number of lines to fetch from the end of console log. + // All lines will be returned if this is not specified. + Length int `json:"length,omitempty"` +} + +// ToServerShowConsoleOutputMap formats a ShowConsoleOutputOpts structure into a request body. +func (opts ShowConsoleOutputOpts) ToServerShowConsoleOutputMap() (map[string]interface{}, error) { + return gophercloud.BuildRequestBody(opts, "os-getConsoleOutput") +} + +// ShowConsoleOutput makes a request against the nova API to get console log from the server +func ShowConsoleOutput(client *gophercloud.ServiceClient, id string, opts ShowConsoleOutputOptsBuilder) (r ShowConsoleOutputResult) { + b, err := opts.ToServerShowConsoleOutputMap() + if err != nil { + r.Err = err + return + } + _, r.Err = client.Post(actionURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ + OkCodes: []int{200}, + }) + return +} diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go index c6c1ff43f7..f973d1ea0e 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/servers/results.go @@ -68,18 +68,27 @@ type ActionResult struct { gophercloud.ErrResult } -// RescueResult is the response from a Rescue operation. Call its ExtractErr -// method to determine if the call succeeded or failed. -type RescueResult struct { - ActionResult -} - // CreateImageResult is the response from a CreateImage operation. Call its // ExtractImageID method to retrieve the ID of the newly created image. type CreateImageResult struct { gophercloud.Result } +// ShowConsoleOutputResult represents the result of console output from a server +type ShowConsoleOutputResult struct { + gophercloud.Result +} + +// Extract will return the console output from a ShowConsoleOutput request. +func (r ShowConsoleOutputResult) Extract() (string, error) { + var s struct { + Output string `json:"output"` + } + + err := r.ExtractInto(&s) + return s.Output, err +} + // GetPasswordResult represent the result of a get os-server-password operation. // Call its ExtractPassword method to retrieve the password. type GetPasswordResult struct { @@ -134,15 +143,6 @@ func (r CreateImageResult) ExtractImageID() (string, error) { return imageID, nil } -// Extract interprets any RescueResult as an AdminPass, if possible. -func (r RescueResult) Extract() (string, error) { - var s struct { - AdminPass string `json:"adminPass"` - } - err := r.ExtractInto(&s) - return s.AdminPass, err -} - // Server represents a server/instance in the OpenStack cloud. type Server struct { // ID uniquely identifies this server amongst all other servers, diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go b/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go index 070ea7cbef..12c8aebcf7 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go @@ -84,7 +84,7 @@ func V3EndpointURL(catalog *tokens3.ServiceCatalog, opts gophercloud.EndpointOpt return "", err } if (opts.Availability == gophercloud.Availability(endpoint.Interface)) && - (opts.Region == "" || endpoint.Region == opts.Region) { + (opts.Region == "" || endpoint.Region == opts.Region || endpoint.RegionID == opts.Region) { endpoints = append(endpoints, endpoint) } } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go index ca35851e4a..6e99a793c5 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go @@ -72,72 +72,15 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s // ToTokenV3CreateMap builds a scope request body from AuthOptions. func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { - if opts.Scope.ProjectName != "" { - // ProjectName provided: either DomainID or DomainName must also be supplied. - // ProjectID may not be supplied. - if opts.Scope.DomainID == "" && opts.Scope.DomainName == "" { - return nil, gophercloud.ErrScopeDomainIDOrDomainName{} - } - if opts.Scope.ProjectID != "" { - return nil, gophercloud.ErrScopeProjectIDOrProjectName{} - } + scope := gophercloud.AuthScope(opts.Scope) - if opts.Scope.DomainID != "" { - // ProjectName + DomainID - return map[string]interface{}{ - "project": map[string]interface{}{ - "name": &opts.Scope.ProjectName, - "domain": map[string]interface{}{"id": &opts.Scope.DomainID}, - }, - }, nil - } - - if opts.Scope.DomainName != "" { - // ProjectName + DomainName - return map[string]interface{}{ - "project": map[string]interface{}{ - "name": &opts.Scope.ProjectName, - "domain": map[string]interface{}{"name": &opts.Scope.DomainName}, - }, - }, nil - } - } else if opts.Scope.ProjectID != "" { - // ProjectID provided. ProjectName, DomainID, and DomainName may not be provided. - if opts.Scope.DomainID != "" { - return nil, gophercloud.ErrScopeProjectIDAlone{} - } - if opts.Scope.DomainName != "" { - return nil, gophercloud.ErrScopeProjectIDAlone{} - } - - // ProjectID - return map[string]interface{}{ - "project": map[string]interface{}{ - "id": &opts.Scope.ProjectID, - }, - }, nil - } else if opts.Scope.DomainID != "" { - // DomainID provided. ProjectID, ProjectName, and DomainName may not be provided. - if opts.Scope.DomainName != "" { - return nil, gophercloud.ErrScopeDomainIDOrDomainName{} - } - - // DomainID - return map[string]interface{}{ - "domain": map[string]interface{}{ - "id": &opts.Scope.DomainID, - }, - }, nil - } else if opts.Scope.DomainName != "" { - // DomainName - return map[string]interface{}{ - "domain": map[string]interface{}{ - "name": &opts.Scope.DomainName, - }, - }, nil + gophercloudAuthOpts := gophercloud.AuthOptions{ + Scope: &scope, + DomainID: opts.DomainID, + DomainName: opts.DomainName, } - return nil, nil + return gophercloudAuthOpts.ToTokenV3ScopeMap() } func (opts *AuthOptions) CanReauth() bool { @@ -190,7 +133,7 @@ func Get(c *gophercloud.ServiceClient, token string) (r GetResult) { // Validate determines if a specified token is valid or not. func Validate(c *gophercloud.ServiceClient, token string) (bool, error) { - resp, err := c.Request("HEAD", tokenURL(c), &gophercloud.RequestOpts{ + resp, err := c.Head(tokenURL(c), &gophercloud.RequestOpts{ MoreHeaders: subjectTokenHeaders(c, token), OkCodes: []int{200, 204, 404}, }) diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go index 6e78d1cbdb..ebdca58f65 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go @@ -13,6 +13,7 @@ import ( type Endpoint struct { ID string `json:"id"` Region string `json:"region"` + RegionID string `json:"region_id"` Interface string `json:"interface"` URL string `json:"url"` } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go index fa346c8555..8b2bde530e 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/requests.go @@ -17,6 +17,7 @@ type ListOpts struct { Distributed *bool `q:"distributed"` Status string `q:"status"` TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` Limit int `q:"limit"` Marker string `q:"marker"` SortKey string `q:"sort_key"` @@ -53,6 +54,7 @@ type CreateOpts struct { AdminStateUp *bool `json:"admin_state_up,omitempty"` Distributed *bool `json:"distributed,omitempty"` TenantID string `json:"tenant_id,omitempty"` + ProjectID string `json:"project_id,omitempty"` GatewayInfo *GatewayInfo `json:"external_gateway_info,omitempty"` AvailabilityZoneHints []string `json:"availability_zone_hints,omitempty"` } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go index da1b9e4bdf..dffdce8f48 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/routers/results.go @@ -54,10 +54,13 @@ type Router struct { // ID is the unique identifier for the router. ID string `json:"id"` - // TenantID is the owner of the router. Only admin users can specify a tenant - // identifier other than its own. + // TenantID is the project owner of the router. Only admin users can + // specify a project identifier other than its own. TenantID string `json:"tenant_id"` + // ProjectID is the project owner of the router. + ProjectID string `json:"project_id"` + // Routes are a collection of static routes that the router will host. Routes []Route `json:"routes"` diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go index 0a7ef79cf6..2a46ce6aa0 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/requests.go @@ -11,13 +11,14 @@ import ( // sort by a particular network attribute. SortDir sets the direction, and is // either `asc' or `desc'. Marker and Limit are used for pagination. type ListOpts struct { - ID string `q:"id"` - Name string `q:"name"` - TenantID string `q:"tenant_id"` - Limit int `q:"limit"` - Marker string `q:"marker"` - SortKey string `q:"sort_key"` - SortDir string `q:"sort_dir"` + ID string `q:"id"` + Name string `q:"name"` + TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` + Limit int `q:"limit"` + Marker string `q:"marker"` + SortKey string `q:"sort_key"` + SortDir string `q:"sort_dir"` } // List returns a Pager which allows you to iterate over a collection of @@ -45,10 +46,14 @@ type CreateOpts struct { // Human-readable name for the Security Group. Does not have to be unique. Name string `json:"name" required:"true"` - // The UUID of the tenant who owns the Group. Only administrative users - // can specify a tenant UUID other than their own. + // TenantID is the UUID of the project who owns the Group. + // Only administrative users can specify a tenant UUID other than their own. TenantID string `json:"tenant_id,omitempty"` + // ProjectID is the UUID of the project who owns the Group. + // Only administrative users can specify a tenant UUID other than their own. + ProjectID string `json:"project_id,omitempty"` + // Describes the security group. Description string `json:"description,omitempty"` } @@ -123,7 +128,12 @@ func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - pages, err := List(client, ListOpts{}).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + pages, err := List(client, listOpts).AllPages() if err != nil { return "", err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/results.go index 8a8e0ffcfd..66915e6e55 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/groups/results.go @@ -22,8 +22,11 @@ type SecGroup struct { // traffic entering and leaving the group. Rules []rules.SecGroupRule `json:"security_group_rules"` - // Owner of the security group. + // TenantID is the project owner of the security group. TenantID string `json:"tenant_id"` + + // ProjectID is the project owner of the security group. + ProjectID string `json:"project_id"` } // SecGroupPage is the page returned by a pager when traversing over a diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go index 197710fc4c..96cce2817d 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/requests.go @@ -21,6 +21,7 @@ type ListOpts struct { RemoteIPPrefix string `q:"remote_ip_prefix"` SecGroupID string `q:"security_group_id"` TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` Limit int `q:"limit"` Marker string `q:"marker"` SortKey string `q:"sort_key"` @@ -118,9 +119,9 @@ type CreateOpts struct { // specified IP prefix as the source IP address of the IP packet. RemoteIPPrefix string `json:"remote_ip_prefix,omitempty"` - // The UUID of the tenant who owns the Rule. Only administrative users - // can specify a tenant UUID other than their own. - TenantID string `json:"tenant_id,omitempty"` + // TenantID is the UUID of the project who owns the Rule. + // Only administrative users can specify a project UUID other than their own. + ProjectID string `json:"project_id,omitempty"` } // ToSecGroupRuleCreateMap builds a request body from CreateOpts. diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/results.go index 0d8c43f8ed..377e753140 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/security/rules/results.go @@ -48,8 +48,11 @@ type SecGroupRule struct { // matches the specified IP prefix as the source IP address of the IP packet. RemoteIPPrefix string `json:"remote_ip_prefix"` - // The owner of this security group rule. + // TenantID is the project owner of this security group rule. TenantID string `json:"tenant_id"` + + // ProjectID is the project owner of this security group rule. + ProjectID string `json:"project_id"` } // SecGroupRulePage is the page returned by a pager when traversing over a diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go index 040f32183b..1fbf62092c 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/requests.go @@ -21,6 +21,7 @@ type ListOpts struct { Name string `q:"name"` AdminStateUp *bool `q:"admin_state_up"` TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` Shared *bool `q:"shared"` ID string `q:"id"` Marker string `q:"marker"` @@ -70,6 +71,7 @@ type CreateOpts struct { Name string `json:"name,omitempty"` Shared *bool `json:"shared,omitempty"` TenantID string `json:"tenant_id,omitempty"` + ProjectID string `json:"project_id,omitempty"` AvailabilityZoneHints []string `json:"availability_zone_hints,omitempty"` } @@ -138,7 +140,12 @@ func Delete(c *gophercloud.ServiceClient, networkID string) (r DeleteResult) { func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - pages, err := List(client, nil).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + pages, err := List(client, listOpts).AllPages() if err != nil { return "", err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go index c73f9e1a63..62f4b3c3a5 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/networks/results.go @@ -64,9 +64,12 @@ type Network struct { // Subnets associated with this network. Subnets []string `json:"subnets"` - // Owner of network. + // TenantID is the project owner of the network. TenantID string `json:"tenant_id"` + // ProjectID is the project owner of the network. + ProjectID string `json:"project_id"` + // Specifies whether the network resource can be accessed by any tenant. Shared bool `json:"shared"` diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/requests.go index fd1e972576..2a5902d75d 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/requests.go @@ -22,6 +22,7 @@ type ListOpts struct { AdminStateUp *bool `q:"admin_state_up"` NetworkID string `q:"network_id"` TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` DeviceOwner string `q:"device_owner"` MACAddress string `q:"mac_address"` ID string `q:"id"` @@ -81,6 +82,7 @@ type CreateOpts struct { DeviceID string `json:"device_id,omitempty"` DeviceOwner string `json:"device_owner,omitempty"` TenantID string `json:"tenant_id,omitempty"` + ProjectID string `json:"project_id,omitempty"` SecurityGroups *[]string `json:"security_groups,omitempty"` AllowedAddressPairs []AddressPair `json:"allowed_address_pairs,omitempty"` } @@ -149,7 +151,12 @@ func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - pages, err := List(client, nil).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + pages, err := List(client, listOpts).AllPages() if err != nil { return "", err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/results.go index ebef98d5de..66937fd989 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/ports/results.go @@ -84,9 +84,12 @@ type Port struct { // the subnets where the IP addresses are picked from FixedIPs []IP `json:"fixed_ips"` - // Owner of network. + // TenantID is the project owner of the port. TenantID string `json:"tenant_id"` + // ProjectID is the project owner of the port. + ProjectID string `json:"project_id"` + // Identifies the entity (e.g.: dhcp agent) using this port. DeviceOwner string `json:"device_owner"` diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/requests.go index 403f692234..2597947b18 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/requests.go @@ -21,12 +21,14 @@ type ListOpts struct { EnableDHCP *bool `q:"enable_dhcp"` NetworkID string `q:"network_id"` TenantID string `q:"tenant_id"` + ProjectID string `q:"project_id"` IPVersion int `q:"ip_version"` GatewayIP string `q:"gateway_ip"` CIDR string `q:"cidr"` IPv6AddressMode string `q:"ipv6_address_mode"` IPv6RAMode string `q:"ipv6_ra_mode"` ID string `q:"id"` + SubnetPoolID string `q:"subnetpool_id"` Limit int `q:"limit"` Marker string `q:"marker"` SortKey string `q:"sort_key"` @@ -78,15 +80,19 @@ type CreateOpts struct { NetworkID string `json:"network_id" required:"true"` // CIDR is the address CIDR of the subnet. - CIDR string `json:"cidr" required:"true"` + CIDR string `json:"cidr,omitempty"` // Name is a human-readable name of the subnet. Name string `json:"name,omitempty"` - // The UUID of the tenant who owns the Subnet. Only administrative users - // can specify a tenant UUID other than their own. + // The UUID of the project who owns the Subnet. Only administrative users + // can specify a project UUID other than their own. TenantID string `json:"tenant_id,omitempty"` + // The UUID of the project who owns the Subnet. Only administrative users + // can specify a project UUID other than their own. + ProjectID string `json:"project_id,omitempty"` + // AllocationPools are IP Address pools that will be available for DHCP. AllocationPools []AllocationPool `json:"allocation_pools,omitempty"` @@ -114,6 +120,9 @@ type CreateOpts struct { // The IPv6 router advertisement specifies whether the networking service // should transmit ICMPv6 packets. IPv6RAMode string `json:"ipv6_ra_mode,omitempty"` + + // SubnetPoolID is the id of the subnet pool that subnet should be associated to. + SubnetPoolID string `json:"subnetpool_id,omitempty"` } // ToSubnetCreateMap builds a request body from CreateOpts. @@ -167,7 +176,7 @@ type UpdateOpts struct { DNSNameservers []string `json:"dns_nameservers,omitempty"` // HostRoutes are any static host routes to be set via DHCP. - HostRoutes []HostRoute `json:"host_routes,omitempty"` + HostRoutes *[]HostRoute `json:"host_routes,omitempty"` // EnableDHCP will either enable to disable the DHCP service. EnableDHCP *bool `json:"enable_dhcp,omitempty"` @@ -212,7 +221,12 @@ func Delete(c *gophercloud.ServiceClient, id string) (r DeleteResult) { func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) { count := 0 id := "" - pages, err := List(client, nil).AllPages() + + listOpts := ListOpts{ + Name: name, + } + + pages, err := List(client, listOpts).AllPages() if err != nil { return "", err } diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/results.go index 743610f01e..493e5c042e 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/networking/v2/subnets/results.go @@ -91,15 +91,21 @@ type Subnet struct { // Specifies whether DHCP is enabled for this subnet or not. EnableDHCP bool `json:"enable_dhcp"` - // Owner of network. + // TenantID is the project owner of the subnet. TenantID string `json:"tenant_id"` + // ProjectID is the project owner of the subnet. + ProjectID string `json:"project_id"` + // The IPv6 address modes specifies mechanisms for assigning IPv6 IP addresses. IPv6AddressMode string `json:"ipv6_address_mode"` // The IPv6 router advertisement specifies whether the networking service // should transmit ICMPv6 packets. IPv6RAMode string `json:"ipv6_ra_mode"` + + // SubnetPoolID is the id of the subnet pool associated with the subnet. + SubnetPoolID string `json:"subnetpool_id"` } // SubnetPage is the page returned by a pager when traversing over a collection diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/requests.go index df21587853..452a331c74 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/requests.go @@ -35,7 +35,7 @@ func Get(c *gophercloud.ServiceClient, opts GetOptsBuilder) (r GetResult) { h[k] = v } } - resp, err := c.Request("HEAD", getURL(c), &gophercloud.RequestOpts{ + resp, err := c.Head(getURL(c), &gophercloud.RequestOpts{ MoreHeaders: h, OkCodes: []int{204}, }) diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/results.go index bf5dc846fc..10661e6715 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts/results.go @@ -63,6 +63,7 @@ func (r UpdateResult) Extract() (*UpdateHeader, error) { // GetHeader represents the headers returned in the response from a Get request. type GetHeader struct { BytesUsed int64 `json:"-"` + QuotaBytes *int64 `json:"-"` ContainerCount int64 `json:"-"` ContentLength int64 `json:"-"` ObjectCount int64 `json:"-"` @@ -78,6 +79,7 @@ func (r *GetHeader) UnmarshalJSON(b []byte) error { var s struct { tmp BytesUsed string `json:"X-Account-Bytes-Used"` + QuotaBytes string `json:"X-Account-Meta-Quota-Bytes"` ContentLength string `json:"Content-Length"` ContainerCount string `json:"X-Account-Container-Count"` ObjectCount string `json:"X-Account-Object-Count"` @@ -100,6 +102,17 @@ func (r *GetHeader) UnmarshalJSON(b []byte) error { } } + switch s.QuotaBytes { + case "": + r.QuotaBytes = nil + default: + v, err := strconv.ParseInt(s.QuotaBytes, 10, 64) + if err != nil { + return err + } + r.QuotaBytes = &v + } + switch s.ContentLength { case "": r.ContentLength = 0 diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/doc.go index 1ac8504de7..9e5f664198 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/doc.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/doc.go @@ -7,6 +7,10 @@ containers represents two different objects. In addition to containing objects, you can also use the container to control access to objects by using an access control list (ACL). +Note: When referencing the Object Storage API docs, some of the API actions +are listed under "accounts" rather than "containers". This was an intentional +design in Gophercloud to make some container actions feel more natural. + Example to List Containers listOpts := containers.ListOpts{ diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/requests.go index ecb76075b1..4799204e70 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers/requests.go @@ -107,6 +107,7 @@ func Create(c *gophercloud.ServiceClient, containerName string, opts CreateOptsB }) if resp != nil { r.Header = resp.Header + resp.Body.Close() } r.Err = err return @@ -176,12 +177,41 @@ func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsB return } +// GetOptsBuilder allows extensions to add additional parameters to the Get +// request. +type GetOptsBuilder interface { + ToContainerGetMap() (map[string]string, error) +} + +// GetOpts is a structure that holds options for listing containers. +type GetOpts struct { + Newest bool `h:"X-Newest"` +} + +// ToContainerGetMap formats a GetOpts into a map of headers. +func (opts GetOpts) ToContainerGetMap() (map[string]string, error) { + return gophercloud.BuildHeaders(opts) +} + // Get is a function that retrieves the metadata of a container. To extract just // the custom metadata, pass the GetResult response to the ExtractMetadata // function. -func Get(c *gophercloud.ServiceClient, containerName string) (r GetResult) { - resp, err := c.Request("HEAD", getURL(c, containerName), &gophercloud.RequestOpts{ - OkCodes: []int{200, 204}, +func Get(c *gophercloud.ServiceClient, containerName string, opts GetOptsBuilder) (r GetResult) { + h := make(map[string]string) + if opts != nil { + headers, err := opts.ToContainerGetMap() + if err != nil { + r.Err = err + return + } + + for k, v := range headers { + h[k] = v + } + } + resp, err := c.Head(getURL(c, containerName), &gophercloud.RequestOpts{ + MoreHeaders: h, + OkCodes: []int{200, 204}, }) if resp != nil { r.Header = resp.Header diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/doc.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/doc.go index 1e02430fb4..e9b4b8a9f3 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/doc.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/doc.go @@ -4,6 +4,10 @@ object resources. An object is a resource that represents and contains data - such as documents, images, and so on. You can also store custom metadata with an object. +Note: When referencing the Object Storage API docs, some of the API actions +are listed under "containers" rather than "objects". This was an intentional +design in Gophercloud to make some object actions feel more natural. + Example to List Objects containerName := "my_container" diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/requests.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/requests.go index f67bfd1590..7325cd7d0b 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/requests.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/requests.go @@ -7,6 +7,7 @@ import ( "crypto/sha1" "fmt" "io" + "io/ioutil" "strings" "time" @@ -85,6 +86,7 @@ type DownloadOpts struct { IfModifiedSince time.Time `h:"If-Modified-Since"` IfNoneMatch string `h:"If-None-Match"` IfUnmodifiedSince time.Time `h:"If-Unmodified-Since"` + Newest bool `h:"X-Newest"` Range string `h:"Range"` Expires string `q:"expires"` MultipartManifest string `q:"multipart-manifest"` @@ -125,7 +127,7 @@ func Download(c *gophercloud.ServiceClient, containerName, objectName string, op resp, err := c.Get(url, nil, &gophercloud.RequestOpts{ MoreHeaders: h, - OkCodes: []int{200, 304}, + OkCodes: []int{200, 206, 304}, }) if resp != nil { r.Header = resp.Header @@ -145,6 +147,7 @@ type CreateOptsBuilder interface { type CreateOpts struct { Content io.Reader Metadata map[string]string + NoETag bool CacheControl string `h:"Cache-Control"` ContentDisposition string `h:"Content-Disposition"` ContentEncoding string `h:"Content-Encoding"` @@ -179,16 +182,37 @@ func (opts CreateOpts) ToObjectCreateParams() (io.Reader, map[string]string, str h["X-Object-Meta-"+k] = v } + if opts.NoETag { + delete(h, "etag") + return opts.Content, h, q.String(), nil + } + + if h["ETag"] != "" { + return opts.Content, h, q.String(), nil + } + + // When we're dealing with big files an io.ReadSeeker allows us to efficiently calculate + // the md5 sum. An io.Reader is only readable once which means we have to copy the entire + // file content into memory first. + readSeeker, isReadSeeker := opts.Content.(io.ReadSeeker) + if !isReadSeeker { + data, err := ioutil.ReadAll(opts.Content) + if err != nil { + return nil, nil, "", err + } + readSeeker = bytes.NewReader(data) + } + hash := md5.New() - buf := bytes.NewBuffer([]byte{}) - _, err = io.Copy(io.MultiWriter(hash, buf), opts.Content) - if err != nil { + // io.Copy into md5 is very efficient as it's done in small chunks. + if _, err := io.Copy(hash, readSeeker); err != nil { return nil, nil, "", err } - localChecksum := fmt.Sprintf("%x", hash.Sum(nil)) - h["ETag"] = localChecksum + readSeeker.Seek(0, io.SeekStart) - return buf, h, q.String(), nil + h["ETag"] = fmt.Sprintf("%x", hash.Sum(nil)) + + return readSeeker, h, q.String(), nil } // Create is a function that creates a new object or replaces an existing @@ -315,20 +339,28 @@ func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts // GetOptsBuilder allows extensions to add additional parameters to the // Get request. type GetOptsBuilder interface { - ToObjectGetQuery() (string, error) + ToObjectGetParams() (map[string]string, string, error) } // GetOpts is a structure that holds parameters for getting an object's // metadata. type GetOpts struct { + Newest bool `h:"X-Newest"` Expires string `q:"expires"` Signature string `q:"signature"` } -// ToObjectGetQuery formats a GetOpts into a query string. -func (opts GetOpts) ToObjectGetQuery() (string, error) { +// ToObjectGetParams formats a GetOpts into a query string and a map of headers. +func (opts GetOpts) ToObjectGetParams() (map[string]string, string, error) { q, err := gophercloud.BuildQueryString(opts) - return q.String(), err + if err != nil { + return nil, "", err + } + h, err := gophercloud.BuildHeaders(opts) + if err != nil { + return nil, q.String(), err + } + return h, q.String(), nil } // Get is a function that retrieves the metadata of an object. To extract just @@ -336,16 +368,22 @@ func (opts GetOpts) ToObjectGetQuery() (string, error) { // function. func Get(c *gophercloud.ServiceClient, containerName, objectName string, opts GetOptsBuilder) (r GetResult) { url := getURL(c, containerName, objectName) + h := make(map[string]string) if opts != nil { - query, err := opts.ToObjectGetQuery() + headers, query, err := opts.ToObjectGetParams() if err != nil { r.Err = err return } + for k, v := range headers { + h[k] = v + } url += query } - resp, err := c.Request("HEAD", url, &gophercloud.RequestOpts{ - OkCodes: []int{200, 204}, + + resp, err := c.Head(url, &gophercloud.RequestOpts{ + MoreHeaders: h, + OkCodes: []int{200, 204}, }) if resp != nil { r.Header = resp.Header diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/results.go b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/results.go index a47b39343c..dd7c7044d0 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/results.go +++ b/vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects/results.go @@ -25,8 +25,7 @@ type Object struct { // Hash represents the MD5 checksum value of the object's content. Hash string `json:"hash"` - // LastModified is the time the object was last modified, represented - // as a string. + // LastModified is the time the object was last modified. LastModified time.Time `json:"-"` // Name is the unique name for the object. @@ -40,7 +39,7 @@ func (r *Object) UnmarshalJSON(b []byte) error { type tmp Object var s *struct { tmp - LastModified gophercloud.JSONRFC3339MilliNoZ `json:"last_modified"` + LastModified string `json:"last_modified"` } err := json.Unmarshal(b, &s) @@ -50,10 +49,18 @@ func (r *Object) UnmarshalJSON(b []byte) error { *r = Object(s.tmp) - r.LastModified = time.Time(s.LastModified) + if s.LastModified != "" { + t, err := time.Parse(gophercloud.RFC3339MilliNoZ, s.LastModified) + if err != nil { + t, err = time.Parse(gophercloud.RFC3339Milli, s.LastModified) + if err != nil { + return err + } + } + r.LastModified = t + } return nil - } // ObjectPage is a single page of objects that is returned from a call to the @@ -134,7 +141,7 @@ type DownloadHeader struct { ETag string `json:"Etag"` LastModified time.Time `json:"-"` ObjectManifest string `json:"X-Object-Manifest"` - StaticLargeObject bool `json:"X-Static-Large-Object"` + StaticLargeObject bool `json:"-"` TransID string `json:"X-Trans-Id"` } @@ -142,10 +149,11 @@ func (r *DownloadHeader) UnmarshalJSON(b []byte) error { type tmp DownloadHeader var s struct { tmp - ContentLength string `json:"Content-Length"` - Date gophercloud.JSONRFC1123 `json:"Date"` - DeleteAt gophercloud.JSONUnix `json:"X-Delete-At"` - LastModified gophercloud.JSONRFC1123 `json:"Last-Modified"` + ContentLength string `json:"Content-Length"` + Date gophercloud.JSONRFC1123 `json:"Date"` + DeleteAt gophercloud.JSONUnix `json:"X-Delete-At"` + LastModified gophercloud.JSONRFC1123 `json:"Last-Modified"` + StaticLargeObject interface{} `json:"X-Static-Large-Object"` } err := json.Unmarshal(b, &s) if err != nil { @@ -164,6 +172,15 @@ func (r *DownloadHeader) UnmarshalJSON(b []byte) error { } } + switch t := s.StaticLargeObject.(type) { + case string: + if t == "True" || t == "true" { + r.StaticLargeObject = true + } + case bool: + r.StaticLargeObject = t + } + r.Date = time.Time(s.Date) r.DeleteAt = time.Time(s.DeleteAt) r.LastModified = time.Time(s.LastModified) @@ -214,7 +231,7 @@ type GetHeader struct { ETag string `json:"Etag"` LastModified time.Time `json:"-"` ObjectManifest string `json:"X-Object-Manifest"` - StaticLargeObject bool `json:"X-Static-Large-Object"` + StaticLargeObject bool `json:"-"` TransID string `json:"X-Trans-Id"` } @@ -222,10 +239,11 @@ func (r *GetHeader) UnmarshalJSON(b []byte) error { type tmp GetHeader var s struct { tmp - ContentLength string `json:"Content-Length"` - Date gophercloud.JSONRFC1123 `json:"Date"` - DeleteAt gophercloud.JSONUnix `json:"X-Delete-At"` - LastModified gophercloud.JSONRFC1123 `json:"Last-Modified"` + ContentLength string `json:"Content-Length"` + Date gophercloud.JSONRFC1123 `json:"Date"` + DeleteAt gophercloud.JSONUnix `json:"X-Delete-At"` + LastModified gophercloud.JSONRFC1123 `json:"Last-Modified"` + StaticLargeObject interface{} `json:"X-Static-Large-Object"` } err := json.Unmarshal(b, &s) if err != nil { @@ -244,6 +262,15 @@ func (r *GetHeader) UnmarshalJSON(b []byte) error { } } + switch t := s.StaticLargeObject.(type) { + case string: + if t == "True" || t == "true" { + r.StaticLargeObject = true + } + case bool: + r.StaticLargeObject = t + } + r.Date = time.Time(s.Date) r.DeleteAt = time.Time(s.DeleteAt) r.LastModified = time.Time(s.LastModified) @@ -391,7 +418,7 @@ func (r UpdateResult) Extract() (*UpdateHeader, error) { // DeleteHeader represents the headers returned in the response from a // Delete request. type DeleteHeader struct { - ContentLength int64 `json:"Content-Length"` + ContentLength int64 `json:"-"` ContentType string `json:"Content-Type"` Date time.Time `json:"-"` TransID string `json:"X-Trans-Id"` diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/utils/BUILD.bazel b/vendor/github.com/gophercloud/gophercloud/openstack/utils/BUILD.bazel index d171bbb9c1..105e7614dc 100644 --- a/vendor/github.com/gophercloud/gophercloud/openstack/utils/BUILD.bazel +++ b/vendor/github.com/gophercloud/gophercloud/openstack/utils/BUILD.bazel @@ -2,7 +2,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "go_default_library", - srcs = ["choose_version.go"], + srcs = [ + "base_endpoint.go", + "choose_version.go", + ], importmap = "vendor/github.com/gophercloud/gophercloud/openstack/utils", importpath = "github.com/gophercloud/gophercloud/openstack/utils", visibility = ["//visibility:public"], diff --git a/vendor/github.com/gophercloud/gophercloud/openstack/utils/base_endpoint.go b/vendor/github.com/gophercloud/gophercloud/openstack/utils/base_endpoint.go new file mode 100644 index 0000000000..40080f7af2 --- /dev/null +++ b/vendor/github.com/gophercloud/gophercloud/openstack/utils/base_endpoint.go @@ -0,0 +1,28 @@ +package utils + +import ( + "net/url" + "regexp" + "strings" +) + +// BaseEndpoint will return a URL without the /vX.Y +// portion of the URL. +func BaseEndpoint(endpoint string) (string, error) { + u, err := url.Parse(endpoint) + if err != nil { + return "", err + } + + u.RawQuery, u.Fragment = "", "" + + path := u.Path + versionRe := regexp.MustCompile("v[0-9.]+/?") + + if version := versionRe.FindString(path); version != "" { + versionIndex := strings.Index(path, version) + u.Path = path[:versionIndex] + } + + return u.String(), nil +} diff --git a/vendor/github.com/gophercloud/gophercloud/pagination/pager.go b/vendor/github.com/gophercloud/gophercloud/pagination/pager.go index 7c65926b72..42c0b2dbe5 100644 --- a/vendor/github.com/gophercloud/gophercloud/pagination/pager.go +++ b/vendor/github.com/gophercloud/gophercloud/pagination/pager.go @@ -41,6 +41,8 @@ type Pager struct { createPage func(r PageResult) Page + firstPage Page + Err error // Headers supplies additional HTTP headers to populate on each paged request. @@ -89,9 +91,18 @@ func (p Pager) EachPage(handler func(Page) (bool, error)) error { } currentURL := p.initialURL for { - currentPage, err := p.fetchNextPage(currentURL) - if err != nil { - return err + var currentPage Page + + // if first page has already been fetched, no need to fetch it again + if p.firstPage != nil { + currentPage = p.firstPage + p.firstPage = nil + } else { + var err error + currentPage, err = p.fetchNextPage(currentURL) + if err != nil { + return err + } } empty, err := currentPage.IsEmpty() @@ -128,23 +139,26 @@ func (p Pager) AllPages() (Page, error) { // body will contain the final concatenated Page body. var body reflect.Value - // Grab a test page to ascertain the page body type. - testPage, err := p.fetchNextPage(p.initialURL) + // Grab a first page to ascertain the page body type. + firstPage, err := p.fetchNextPage(p.initialURL) if err != nil { return nil, err } // Store the page type so we can use reflection to create a new mega-page of // that type. - pageType := reflect.TypeOf(testPage) + pageType := reflect.TypeOf(firstPage) - // if it's a single page, just return the testPage (first page) + // if it's a single page, just return the firstPage (first page) if _, found := pageType.FieldByName("SinglePageBase"); found { - return testPage, nil + return firstPage, nil } + // store the first page to avoid getting it twice + p.firstPage = firstPage + // Switch on the page body type. Recognized types are `map[string]interface{}`, // `[]byte`, and `[]interface{}`. - switch pb := testPage.GetBody().(type) { + switch pb := firstPage.GetBody().(type) { case map[string]interface{}: // key is the map key for the page body if the body type is `map[string]interface{}`. var key string diff --git a/vendor/github.com/gophercloud/gophercloud/params.go b/vendor/github.com/gophercloud/gophercloud/params.go index 28ad906856..19b8cf7bf8 100644 --- a/vendor/github.com/gophercloud/gophercloud/params.go +++ b/vendor/github.com/gophercloud/gophercloud/params.go @@ -363,9 +363,8 @@ func BuildQueryString(opts interface{}) (*url.URL, error) { } } } else { - // Otherwise, the field is not set. - if len(tags) == 2 && tags[1] == "required" { - // And the field is required. Return an error. + // if the field has a 'required' tag, it can't have a zero-value + if requiredTag := f.Tag.Get("required"); requiredTag == "true" { return &url.URL{}, fmt.Errorf("Required query parameter [%s] not set.", f.Name) } } @@ -439,10 +438,9 @@ func BuildHeaders(opts interface{}) (map[string]string, error) { optsMap[tags[0]] = strconv.FormatBool(v.Bool()) } } else { - // Otherwise, the field is not set. - if len(tags) == 2 && tags[1] == "required" { - // And the field is required. Return an error. - return optsMap, fmt.Errorf("Required header not set.") + // if the field has a 'required' tag, it can't have a zero-value + if requiredTag := f.Tag.Get("required"); requiredTag == "true" { + return optsMap, fmt.Errorf("Required header [%s] not set.", f.Name) } } } diff --git a/vendor/github.com/gophercloud/gophercloud/provider_client.go b/vendor/github.com/gophercloud/gophercloud/provider_client.go index 72daeb0a3e..95fa11a788 100644 --- a/vendor/github.com/gophercloud/gophercloud/provider_client.go +++ b/vendor/github.com/gophercloud/gophercloud/provider_client.go @@ -126,6 +126,36 @@ func (client *ProviderClient) SetToken(t string) { client.TokenID = t } +//Reauthenticate calls client.ReauthFunc in a thread-safe way. If this is +//called because of a 401 response, the caller may pass the previous token. In +//this case, the reauthentication can be skipped if another thread has already +//reauthenticated in the meantime. If no previous token is known, an empty +//string should be passed instead to force unconditional reauthentication. +func (client *ProviderClient) Reauthenticate(previousToken string) (err error) { + if client.ReauthFunc == nil { + return nil + } + + if client.mut == nil { + return client.ReauthFunc() + } + client.mut.Lock() + defer client.mut.Unlock() + + client.reauthmut.Lock() + client.reauthmut.reauthing = true + client.reauthmut.Unlock() + + if previousToken == "" || client.TokenID == previousToken { + err = client.ReauthFunc() + } + + client.reauthmut.Lock() + client.reauthmut.reauthing = false + client.reauthmut.Unlock() + return +} + // RequestOpts customizes the behavior of the provider.Request() method. type RequestOpts struct { // JSONBody, if provided, will be encoded as JSON and used as the body of the HTTP request. The @@ -254,21 +284,7 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts) } case http.StatusUnauthorized: if client.ReauthFunc != nil { - if client.mut != nil { - client.mut.Lock() - client.reauthmut.Lock() - client.reauthmut.reauthing = true - client.reauthmut.Unlock() - if curtok := client.TokenID; curtok == prereqtok { - err = client.ReauthFunc() - } - client.reauthmut.Lock() - client.reauthmut.reauthing = false - client.reauthmut.Unlock() - client.mut.Unlock() - } else { - err = client.ReauthFunc() - } + err = client.Reauthenticate(prereqtok) if err != nil { e := &ErrUnableToReauthenticate{} e.ErrOriginal = respErr @@ -279,7 +295,11 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts) seeker.Seek(0, 0) } } + // make a new call to request with a nil reauth func in order to avoid infinite loop + reauthFunc := client.ReauthFunc + client.ReauthFunc = nil resp, err = client.Request(method, url, options) + client.ReauthFunc = reauthFunc if err != nil { switch err.(type) { case *ErrUnexpectedResponseCode: @@ -298,6 +318,11 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts) if error401er, ok := errType.(Err401er); ok { err = error401er.Error401(respErr) } + case http.StatusForbidden: + err = ErrDefault403{respErr} + if error403er, ok := errType.(Err403er); ok { + err = error403er.Error403(respErr) + } case http.StatusNotFound: err = ErrDefault404{respErr} if error404er, ok := errType.(Err404er); ok { @@ -357,7 +382,7 @@ func defaultOkCodes(method string) []int { case method == "PUT": return []int{201, 202} case method == "PATCH": - return []int{200, 204} + return []int{200, 202, 204} case method == "DELETE": return []int{202, 204} } diff --git a/vendor/github.com/gophercloud/gophercloud/results.go b/vendor/github.com/gophercloud/gophercloud/results.go index e64feee19e..30d3b15599 100644 --- a/vendor/github.com/gophercloud/gophercloud/results.go +++ b/vendor/github.com/gophercloud/gophercloud/results.go @@ -89,23 +89,45 @@ func (r Result) extractIntoPtr(to interface{}, label string) error { if typeOfV.Kind() == reflect.Struct { if typeOfV.NumField() > 0 && typeOfV.Field(0).Anonymous { newSlice := reflect.MakeSlice(reflect.SliceOf(typeOfV), 0, 0) - newType := reflect.New(typeOfV).Elem() for _, v := range m[label].([]interface{}) { + // For each iteration of the slice, we create a new struct. + // This is to work around a bug where elements of a slice + // are reused and not overwritten when the same copy of the + // struct is used: + // + // https://github.com/golang/go/issues/21092 + // https://github.com/golang/go/issues/24155 + // https://play.golang.org/p/NHo3ywlPZli + newType := reflect.New(typeOfV).Elem() + b, err := json.Marshal(v) if err != nil { return err } + // This is needed for structs with an UnmarshalJSON method. + // Technically this is just unmarshalling the response into + // a struct that is never used, but it's good enough to + // trigger the UnmarshalJSON method. for i := 0; i < newType.NumField(); i++ { s := newType.Field(i).Addr().Interface() - err = json.NewDecoder(bytes.NewReader(b)).Decode(s) + + // Unmarshal is used rather than NewDecoder to also work + // around the above-mentioned bug. + err = json.Unmarshal(b, s) if err != nil { return err } } + newSlice = reflect.Append(newSlice, newType) } + + // "to" should now be properly modeled to receive the + // JSON response body and unmarshal into all the correct + // fields of the struct or composed extension struct + // at the end of this method. toValue.Set(newSlice) } } @@ -345,6 +367,48 @@ func (jt *JSONRFC3339NoZ) UnmarshalJSON(data []byte) error { return nil } +// RFC3339ZNoT is the time format used in Zun (Containers Service). +const RFC3339ZNoT = "2006-01-02 15:04:05-07:00" + +type JSONRFC3339ZNoT time.Time + +func (jt *JSONRFC3339ZNoT) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return err + } + if s == "" { + return nil + } + t, err := time.Parse(RFC3339ZNoT, s) + if err != nil { + return err + } + *jt = JSONRFC3339ZNoT(t) + return nil +} + +// RFC3339ZNoTNoZ is another time format used in Zun (Containers Service). +const RFC3339ZNoTNoZ = "2006-01-02 15:04:05" + +type JSONRFC3339ZNoTNoZ time.Time + +func (jt *JSONRFC3339ZNoTNoZ) UnmarshalJSON(data []byte) error { + var s string + if err := json.Unmarshal(data, &s); err != nil { + return err + } + if s == "" { + return nil + } + t, err := time.Parse(RFC3339ZNoTNoZ, s) + if err != nil { + return err + } + *jt = JSONRFC3339ZNoTNoZ(t) + return nil +} + /* Link is an internal type to be used in packages of collection resources that are paginated in a certain way. diff --git a/vendor/github.com/gophercloud/gophercloud/service_client.go b/vendor/github.com/gophercloud/gophercloud/service_client.go index d1a48fea35..2734510e1b 100644 --- a/vendor/github.com/gophercloud/gophercloud/service_client.go +++ b/vendor/github.com/gophercloud/gophercloud/service_client.go @@ -28,6 +28,10 @@ type ServiceClient struct { // The microversion of the service to use. Set this to use a particular microversion. Microversion string + + // MoreHeaders allows users (or Gophercloud) to set service-wide headers on requests. Put another way, + // values set in this field will be set on all the HTTP requests the service client sends. + MoreHeaders map[string]string } // ResourceBaseURL returns the base URL of any resources used by this service. It MUST end with a /. @@ -108,6 +112,15 @@ func (client *ServiceClient) Delete(url string, opts *RequestOpts) (*http.Respon return client.Request("DELETE", url, opts) } +// Head calls `Request` with the "HEAD" HTTP verb. +func (client *ServiceClient) Head(url string, opts *RequestOpts) (*http.Response, error) { + if opts == nil { + opts = new(RequestOpts) + } + client.initReqOpts(url, nil, nil, opts) + return client.Request("HEAD", url, opts) +} + func (client *ServiceClient) setMicroversionHeader(opts *RequestOpts) { switch client.Type { case "compute": @@ -122,3 +135,16 @@ func (client *ServiceClient) setMicroversionHeader(opts *RequestOpts) { opts.MoreHeaders["OpenStack-API-Version"] = client.Type + " " + client.Microversion } } + +// Request carries out the HTTP operation for the service client +func (client *ServiceClient) Request(method, url string, options *RequestOpts) (*http.Response, error) { + if len(client.MoreHeaders) > 0 { + if options == nil { + options = new(RequestOpts) + } + for k, v := range client.MoreHeaders { + options.MoreHeaders[k] = v + } + } + return client.ProviderClient.Request(method, url, options) +} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/BUILD.bazel b/vendor/github.com/spf13/cobra/cobra/cmd/BUILD.bazel deleted file mode 100644 index 75ba8dfb54..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/BUILD.bazel +++ /dev/null @@ -1,20 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = [ - "license_agpl.go", - "license_apache_2.go", - "license_bsd_clause_2.go", - "license_bsd_clause_3.go", - "license_gpl_2.go", - "license_gpl_3.go", - "license_lgpl.go", - "license_mit.go", - "licenses.go", - ], - importmap = "vendor/github.com/spf13/cobra/cobra/cmd", - importpath = "github.com/spf13/cobra/cobra/cmd", - visibility = ["//visibility:public"], - deps = ["//vendor/github.com/spf13/viper:go_default_library"], -) diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go deleted file mode 100644 index bc22e9732b..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_agpl.go +++ /dev/null @@ -1,683 +0,0 @@ -package cmd - -func initAgpl() { - Licenses["agpl"] = License{ - Name: "GNU Affero General Public License", - PossibleMatches: []string{"agpl", "affero gpl", "gnu agpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see .`, - Text: ` GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go deleted file mode 100644 index 38393d5417..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_apache_2.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initApache2() { - Licenses["apache"] = License{ - Name: "Apache 2.0", - PossibleMatches: []string{"apache", "apache20", "apache 2.0", "apache2.0", "apache-2.0"}, - Header: ` -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License.`, - Text: ` - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go deleted file mode 100644 index 4a847e04a0..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_2.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause2() { - Licenses["freebsd"] = License{ - Name: "Simplified BSD License", - PossibleMatches: []string{"freebsd", "simpbsd", "simple bsd", "2-clause bsd", - "2 clause bsd", "simplified bsd license"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go deleted file mode 100644 index c7476b31f5..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_bsd_clause_3.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initBsdClause3() { - Licenses["bsd"] = License{ - Name: "NewBSD", - PossibleMatches: []string{"bsd", "newbsd", "3 clause bsd", "3-clause bsd"}, - Header: `All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE.`, - Text: `{{ .copyright }} -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go deleted file mode 100644 index 03e05b3a7e..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_2.go +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl2() { - Licenses["gpl2"] = License{ - Name: "GNU General Public License 2.0", - PossibleMatches: []string{"gpl2", "gnu gpl2", "gplv2"}, - Header: ` -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go deleted file mode 100644 index ce07679c77..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_gpl_3.go +++ /dev/null @@ -1,711 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initGpl3() { - Licenses["gpl3"] = License{ - Name: "GNU General Public License 3.0", - PossibleMatches: []string{"gpl3", "gplv3", "gpl", "gnu gpl3", "gnu gpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see .`, - Text: ` GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go deleted file mode 100644 index 0f8b96cad0..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_lgpl.go +++ /dev/null @@ -1,186 +0,0 @@ -package cmd - -func initLgpl() { - Licenses["lgpl"] = License{ - Name: "GNU Lesser General Public License", - PossibleMatches: []string{"lgpl", "lesser gpl", "gnu lgpl"}, - Header: ` -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with this program. If not, see .`, - Text: ` GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library.`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go b/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go deleted file mode 100644 index bd2d0c4fa8..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/license_mit.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -func initMit() { - Licenses["mit"] = License{ - Name: "MIT License", - PossibleMatches: []string{"mit"}, - Header: ` -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.`, - Text: `The MIT License (MIT) - -{{ .copyright }} - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -`, - } -} diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go b/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go deleted file mode 100644 index a070134ddc..0000000000 --- a/vendor/github.com/spf13/cobra/cobra/cmd/licenses.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright © 2015 Steve Francia . -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Parts inspired by https://github.com/ryanuber/go-license - -package cmd - -import ( - "strings" - "time" - - "github.com/spf13/viper" -) - -// Licenses contains all possible licenses a user can choose from. -var Licenses = make(map[string]License) - -// License represents a software license agreement, containing the Name of -// the license, its possible matches (on the command line as given to cobra), -// the header to be used with each file on the file's creating, and the text -// of the license -type License struct { - Name string // The type of license in use - PossibleMatches []string // Similar names to guess - Text string // License text data - Header string // License header for source files -} - -func init() { - // Allows a user to not use a license. - Licenses["none"] = License{"None", []string{"none", "false"}, "", ""} - - initApache2() - initMit() - initBsdClause3() - initBsdClause2() - initGpl2() - initGpl3() - initLgpl() - initAgpl() -} - -// getLicense returns license specified by user in flag or in config. -// If user didn't specify the license, it returns Apache License 2.0. -// -// TODO: Inspect project for existing license -func getLicense() License { - // If explicitly flagged, use that. - if userLicense != "" { - return findLicense(userLicense) - } - - // If user wants to have custom license, use that. - if viper.IsSet("license.header") || viper.IsSet("license.text") { - return License{Header: viper.GetString("license.header"), - Text: viper.GetString("license.text")} - } - - // If user wants to have built-in license, use that. - if viper.IsSet("license") { - return findLicense(viper.GetString("license")) - } - - // If user didn't set any license, use Apache 2.0 by default. - return Licenses["apache"] -} - -func copyrightLine() string { - author := viper.GetString("author") - - year := viper.GetString("year") // For tests. - if year == "" { - year = time.Now().Format("2006") - } - - return "Copyright © " + year + " " + author -} - -// findLicense looks for License object of built-in licenses. -// If it didn't find license, then the app will be terminated and -// error will be printed. -func findLicense(name string) License { - found := matchLicense(name) - if found == "" { - er("unknown license: " + name) - } - return Licenses[found] -} - -// matchLicense compares the given a license name -// to PossibleMatches of all built-in licenses. -// It returns blank string, if name is blank string or it didn't find -// then appropriate match to name. -func matchLicense(name string) string { - if name == "" { - return "" - } - - for key, lic := range Licenses { - for _, match := range lic.PossibleMatches { - if strings.EqualFold(name, match) { - return key - } - } - } - - return "" -} diff --git a/vendor/github.com/vmware/govmomi/simulator/BUILD.bazel b/vendor/github.com/vmware/govmomi/simulator/BUILD.bazel deleted file mode 100644 index d5138a9578..0000000000 --- a/vendor/github.com/vmware/govmomi/simulator/BUILD.bazel +++ /dev/null @@ -1,16 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["license_manager.go"], - importmap = "vendor/github.com/vmware/govmomi/simulator", - importpath = "github.com/vmware/govmomi/simulator", - visibility = ["//visibility:public"], - deps = [ - "//vendor/github.com/vmware/govmomi/object:go_default_library", - "//vendor/github.com/vmware/govmomi/vim25/methods:go_default_library", - "//vendor/github.com/vmware/govmomi/vim25/mo:go_default_library", - "//vendor/github.com/vmware/govmomi/vim25/soap:go_default_library", - "//vendor/github.com/vmware/govmomi/vim25/types:go_default_library", - ], -) diff --git a/vendor/github.com/vmware/govmomi/simulator/license_manager.go b/vendor/github.com/vmware/govmomi/simulator/license_manager.go deleted file mode 100644 index 13565d32ef..0000000000 --- a/vendor/github.com/vmware/govmomi/simulator/license_manager.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Copyright 2017 VMware, Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package simulator - -import ( - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/soap" - "github.com/vmware/govmomi/vim25/types" -) - -// EvalLicense is the default license -var EvalLicense = types.LicenseManagerLicenseInfo{ - LicenseKey: "00000-00000-00000-00000-00000", - EditionKey: "eval", - Name: "Evaluation Mode", - Properties: []types.KeyAnyValue{ - { - Key: "feature", - Value: types.KeyValue{ - Key: "serialuri:2", - Value: "Remote virtual Serial Port Concentrator", - }, - }, - { - Key: "feature", - Value: types.KeyValue{ - Key: "dvs", - Value: "vSphere Distributed Switch", - }, - }, - }, -} - -type LicenseManager struct { - mo.LicenseManager -} - -func NewLicenseManager(ref types.ManagedObjectReference) object.Reference { - m := &LicenseManager{} - m.Self = ref - m.Licenses = []types.LicenseManagerLicenseInfo{EvalLicense} - - if Map.IsVPX() { - am := Map.Put(&LicenseAssignmentManager{}).Reference() - m.LicenseAssignmentManager = &am - } - - return m -} - -func (m *LicenseManager) AddLicense(req *types.AddLicense) soap.HasFault { - body := &methods.AddLicenseBody{ - Res: &types.AddLicenseResponse{}, - } - - for _, license := range m.Licenses { - if license.LicenseKey == req.LicenseKey { - body.Res.Returnval = licenseInfo(license.LicenseKey, license.Labels) - return body - } - } - - m.Licenses = append(m.Licenses, types.LicenseManagerLicenseInfo{ - LicenseKey: req.LicenseKey, - Labels: req.Labels, - }) - - body.Res.Returnval = licenseInfo(req.LicenseKey, req.Labels) - - return body -} - -func (m *LicenseManager) RemoveLicense(req *types.RemoveLicense) soap.HasFault { - body := &methods.RemoveLicenseBody{ - Res: &types.RemoveLicenseResponse{}, - } - - for i, license := range m.Licenses { - if req.LicenseKey == license.LicenseKey { - m.Licenses = append(m.Licenses[:i], m.Licenses[i+1:]...) - return body - } - } - return body -} - -type LicenseAssignmentManager struct { - mo.LicenseAssignmentManager -} - -func (m *LicenseAssignmentManager) QueryAssignedLicenses(req *types.QueryAssignedLicenses) soap.HasFault { - body := &methods.QueryAssignedLicensesBody{ - Res: &types.QueryAssignedLicensesResponse{}, - } - - // EntityId can be a HostSystem or the vCenter InstanceUuid - if req.EntityId != "" { - if req.EntityId != Map.content().About.InstanceUuid { - id := types.ManagedObjectReference{ - Type: "HostSystem", - Value: req.EntityId, - } - - if Map.Get(id) == nil { - return body - } - } - } - - body.Res.Returnval = []types.LicenseAssignmentManagerLicenseAssignment{ - { - EntityId: req.EntityId, - AssignedLicense: EvalLicense, - }, - } - - return body -} - -func licenseInfo(key string, labels []types.KeyValue) types.LicenseManagerLicenseInfo { - info := EvalLicense - - info.LicenseKey = key - info.Labels = labels - - return info -} diff --git a/vendor/github.com/weaveworks/mesh/BUILD.bazel b/vendor/github.com/weaveworks/mesh/BUILD.bazel index 34787ecf97..a96b4fb16f 100644 --- a/vendor/github.com/weaveworks/mesh/BUILD.bazel +++ b/vendor/github.com/weaveworks/mesh/BUILD.bazel @@ -11,7 +11,7 @@ go_library( "logger.go", "overlay.go", "peer.go", - "peer_name_mac.go", + "peer_name_hash.go", "peers.go", "protocol.go", "protocol_crypto.go", diff --git a/vendor/github.com/weaveworks/mesh/peer_name_hash.go b/vendor/github.com/weaveworks/mesh/peer_name_hash.go index 6aa6e59295..dc3b6cc916 100644 --- a/vendor/github.com/weaveworks/mesh/peer_name_hash.go +++ b/vendor/github.com/weaveworks/mesh/peer_name_hash.go @@ -1,4 +1,4 @@ -// +build peer_name_hash +// +build !peer_name_mac package mesh diff --git a/vendor/github.com/weaveworks/mesh/peer_name_mac.go b/vendor/github.com/weaveworks/mesh/peer_name_mac.go deleted file mode 100644 index 42ac3ba060..0000000000 --- a/vendor/github.com/weaveworks/mesh/peer_name_mac.go +++ /dev/null @@ -1,110 +0,0 @@ -// +build peer_name_mac !peer_name_alternative - -package mesh - -// The !peer_name_alternative effectively makes this the default, -// i.e. to choose an alternative, run -// -// go build -tags 'peer_name_alternative peer_name_hash' -// -// Let peer names be MACs... -// -// MACs need to be unique across our network, or bad things will -// happen anyway. So they make pretty good candidates for peer -// names. And doing so is pretty efficient both computationally and -// network overhead wise. -// -// Note that we do not mandate *what* MAC should be used as the peer -// name. In particular it doesn't actually have to be the MAC of, say, -// the network interface the peer is sniffing on. - -import ( - "fmt" - "net" -) - -// PeerName is used as a map key. Since net.HardwareAddr isn't suitable for -// that - it's a slice, and slices can't be map keys - we convert that to/from -// uint64. -type PeerName uint64 - -const ( - // PeerNameFlavour is the type of peer names we use. - PeerNameFlavour = "mac" - - // NameSize is the number of bytes in a peer name. - NameSize = 6 - - // UnknownPeerName is used as a sentinel value. - UnknownPeerName = PeerName(0) -) - -// PeerNameFromUserInput parses PeerName from a user-provided string. -func PeerNameFromUserInput(userInput string) (PeerName, error) { - return PeerNameFromString(userInput) -} - -// PeerNameFromString parses PeerName from a generic string. -func PeerNameFromString(nameStr string) (PeerName, error) { - var a, b, c, d, e, f uint64 - - match := func(format string, args ...interface{}) bool { - a, b, c, d, e, f = 0, 0, 0, 0, 0, 0 - n, err := fmt.Sscanf(nameStr+"\000", format+"\000", args...) - return err == nil && n == len(args) - } - - switch { - case match("%2x:%2x:%2x:%2x:%2x:%2x", &a, &b, &c, &d, &e, &f): - case match("::%2x:%2x:%2x:%2x", &c, &d, &e, &f): - case match("%2x::%2x:%2x:%2x", &a, &d, &e, &f): - case match("%2x:%2x::%2x:%2x", &a, &b, &e, &f): - case match("%2x:%2x:%2x::%2x", &a, &b, &c, &f): - case match("%2x:%2x:%2x:%2x::", &a, &b, &c, &d): - case match("::%2x:%2x:%2x", &d, &e, &f): - case match("%2x::%2x:%2x", &a, &e, &f): - case match("%2x:%2x::%2x", &a, &b, &f): - case match("%2x:%2x:%2x::", &a, &b, &c): - case match("::%2x:%2x", &e, &f): - case match("%2x::%2x", &a, &f): - case match("%2x:%2x::", &a, &b): - case match("::%2x", &f): - case match("%2x::", &a): - default: - return UnknownPeerName, fmt.Errorf("invalid peer name format: %q", nameStr) - } - - return PeerName(a<<40 | b<<32 | c<<24 | d<<16 | e<<8 | f), nil -} - -// PeerNameFromBin parses PeerName from a byte slice. -func PeerNameFromBin(nameByte []byte) PeerName { - return PeerName(macint(net.HardwareAddr(nameByte))) -} - -// bytes encodes PeerName as a byte slice. -func (name PeerName) bytes() []byte { - return intmac(uint64(name)) -} - -// String encodes PeerName as a string. -func (name PeerName) String() string { - return intmac(uint64(name)).String() -} - -func macint(mac net.HardwareAddr) (r uint64) { - for _, b := range mac { - r <<= 8 - r |= uint64(b) - } - return -} - -func intmac(key uint64) (r net.HardwareAddr) { - r = make([]byte, 6) - for i := 5; i >= 0; i-- { - r[i] = byte(key) - key >>= 8 - } - return -} diff --git a/version.go b/version.go index 0872a337cd..bd55db4fb0 100644 --- a/version.go +++ b/version.go @@ -23,8 +23,8 @@ var Version = KOPS_RELEASE_VERSION // These constants are parsed by build tooling - be careful about changing the formats const ( - KOPS_RELEASE_VERSION = "1.10.0-beta.1" - KOPS_CI_VERSION = "1.10.0-beta.2" + KOPS_RELEASE_VERSION = "1.10.0" + KOPS_CI_VERSION = "1.10.1-alpha.1" ) // GitVersion should be replaced by the makefile