update gophercloud dependencies

This commit is contained in:
Jesse Haka 2020-04-09 10:01:32 +03:00
parent 28c8f88675
commit 19ff6f94e6
43 changed files with 643 additions and 168 deletions

2
go.mod
View File

@ -46,6 +46,8 @@ replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.17.4
replace k8s.io/code-generator => k8s.io/code-generator v0.17.4
replace github.com/gophercloud/gophercloud => github.com/gophercloud/gophercloud v0.9.0
require (
cloud.google.com/go v0.38.0
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd

9
go.sum
View File

@ -377,11 +377,8 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk=
github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU=
github.com/gophercloud/gophercloud v0.0.0-20190212181753-892256c46858/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gophercloud/gophercloud v0.6.1-0.20191127023939-978be3847c66/go.mod h1:ozGNgr9KYOVATV5jsgHl/ceCDXGuguqOZAzoQ/2vcNM=
github.com/gophercloud/gophercloud v0.7.1-0.20200116011225-46fdd1830e9a h1:/w/lEUNqBq0nqlsZvSe6MP6JE6AMU415a+5zROioIt4=
github.com/gophercloud/gophercloud v0.7.1-0.20200116011225-46fdd1830e9a/go.mod h1:Kc/QKr9thLKruO/dG0szY8kRIYS+iENz0ziI0hJf76A=
github.com/gophercloud/gophercloud v0.9.0 h1:eJHQQFguQRv2FatH2d2VXH2ueTe2XzjgjwFjFS7SGcs=
github.com/gophercloud/gophercloud v0.9.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss=
github.com/gophercloud/utils v0.0.0-20191020172814-bd86af96d544/go.mod h1:SZ9FTKibIotDtCrxAU/evccoyu1yhKST6hgBvwTB5Eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
@ -804,7 +801,6 @@ golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnf
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@ -898,7 +894,6 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190122071731-054c452bb702/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

View File

@ -1,13 +1,35 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "DEFAULT_LANGUAGES", "gazelle_binary")
gazelle_binary(
name = "gazelle",
languages = DEFAULT_LANGUAGES,
msan = "off",
pure = "off",
race = "off",
static = "off",
visibility = ["//visibility:public"],
)
gazelle_binary(
name = "gazelle_pure",
languages = DEFAULT_LANGUAGES,
msan = "off",
pure = "on",
race = "off",
static = "off",
tags = ["manual"],
visibility = ["//visibility:public"],
)
go_library(
name = "go_default_library",
# keep
srcs = [
"diff.go",
"fix.go",
"fix-update.go",
"gazelle.go",
"langs.go",
"metaresolver.go",
"print.go",
"update-repos.go",
@ -15,7 +37,8 @@ go_library(
],
importmap = "k8s.io/kops/vendor/github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
importpath = "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
visibility = ["//visibility:private"],
tags = ["manual"],
visibility = ["//visibility:public"],
deps = [
"//vendor/github.com/bazelbuild/bazel-gazelle/config:go_default_library",
"//vendor/github.com/bazelbuild/bazel-gazelle/flag:go_default_library",
@ -33,8 +56,33 @@ go_library(
],
)
go_binary(
name = "gazelle",
embed = [":go_default_library"],
go_test(
name = "go_default_test",
size = "small",
srcs = [
"langs.go", # keep
],
args = ["-go_sdk=go_sdk"],
data = ["@go_sdk//:files"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"diff.go",
"diff_test.go",
"fix.go",
"fix-update.go",
"fix_test.go",
"gazelle.go",
"integration_test.go",
"langs.go",
"metaresolver.go",
"print.go",
"update-repos.go",
"version.go",
],
visibility = ["//visibility:public"],
)

View File

@ -14,3 +14,15 @@ go_library(
"//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"config.go",
"config_test.go",
"constants.go",
],
visibility = ["//visibility:public"],
)

View File

@ -7,3 +7,13 @@ go_library(
importpath = "github.com/bazelbuild/bazel-gazelle/flag",
visibility = ["//visibility:public"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"flag.go",
],
visibility = ["//visibility:public"],
)

View File

@ -5,5 +5,16 @@ go_library(
srcs = ["version.go"],
importmap = "k8s.io/kops/vendor/github.com/bazelbuild/bazel-gazelle/internal/version",
importpath = "github.com/bazelbuild/bazel-gazelle/internal/version",
visibility = ["//vendor/github.com/bazelbuild/bazel-gazelle:__subpackages__"],
visibility = ["//:__subpackages__"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"version.go",
"version_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -5,5 +5,16 @@ go_library(
srcs = ["finder.go"],
importmap = "k8s.io/kops/vendor/github.com/bazelbuild/bazel-gazelle/internal/wspace",
importpath = "github.com/bazelbuild/bazel-gazelle/internal/wspace",
visibility = ["//vendor/github.com/bazelbuild/bazel-gazelle:__subpackages__"],
visibility = ["//visibility:public"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"finder.go",
"finder_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -8,3 +8,14 @@ go_library(
visibility = ["//visibility:public"],
deps = ["//vendor/github.com/bazelbuild/bazel-gazelle/pathtools:go_default_library"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"label.go",
"label_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -16,3 +16,16 @@ go_library(
"//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"lang.go",
"update.go",
"//language/go:all_files",
"//language/proto:all_files",
],
visibility = ["//visibility:public"],
)

View File

@ -1,4 +1,31 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load(":def.bzl", "std_package_list")
# gazelle:exclude testdata
# TODO(jayconrod): test that the checked-in static file matches the generated
# file. The generated code is checked in so that Gazelle can still be built
# with "go get".
std_package_list(
name = "std_package_list",
out = "std_package_list.go",
)
genrule(
name = "known_proto_imports",
srcs = ["//language/proto:proto.csv"],
outs = ["known_proto_imports.go"],
cmd = "$(location //language/proto/gen:gen_known_imports) -proto_csv $< -known_imports $@ -package golang -var knownProtoImports -key 0 -value 3",
tools = ["//language/proto/gen:gen_known_imports"],
)
genrule(
name = "known_go_imports",
srcs = ["//language/proto:proto.csv"],
outs = ["known_go_imports.go"],
cmd = "$(location //language/proto/gen:gen_known_imports) -proto_csv $< -known_imports $@ -package golang -var knownGoProtoImports -key 2 -value 3",
tools = ["//language/proto/gen:gen_known_imports"],
)
go_library(
name = "go_default_library",
@ -38,3 +65,38 @@ go_library(
"//vendor/golang.org/x/sync/errgroup:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"config.go",
"config_test.go",
"constants.go",
"def.bzl",
"dep.go",
"fileinfo.go",
"fileinfo_go_test.go",
"fileinfo_test.go",
"fix.go",
"fix_test.go",
"generate.go",
"generate_test.go",
"godep.go",
"kinds.go",
"known_go_imports.go",
"known_proto_imports.go",
"lang.go",
"modules.go",
"package.go",
"resolve.go",
"resolve_test.go",
"std_package_list.go",
"stubs_test.go",
"update.go",
"update_import_test.go",
"//language/go/gen_std_package_list:all_files",
],
visibility = ["//visibility:public"],
)

View File

@ -1,5 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
# gazelle:exclude testdata
genrule(
name = "known_imports",
srcs = ["proto.csv"],
outs = ["known_imports.go"],
cmd = "$(location //language/proto/gen:gen_known_imports) -proto_csv $< -known_imports $@ -package proto -var knownImports -key 0 -value 1",
tools = ["//language/proto/gen:gen_known_imports"],
)
go_library(
name = "go_default_library",
srcs = [
@ -26,3 +36,30 @@ go_library(
"//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library",
],
)
exports_files(["proto.csv"])
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"config.go",
"config_test.go",
"constants.go",
"fileinfo.go",
"fileinfo_test.go",
"fix.go",
"generate.go",
"generate_test.go",
"kinds.go",
"known_imports.go",
"lang.go",
"package.go",
"proto.csv",
"resolve.go",
"resolve_test.go",
"//language/proto/gen:all_files",
],
visibility = ["//visibility:public"],
)

View File

@ -11,3 +11,15 @@ go_library(
visibility = ["//visibility:public"],
deps = ["//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"fix.go",
"merger.go",
"merger_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -7,3 +7,14 @@ go_library(
importpath = "github.com/bazelbuild/bazel-gazelle/pathtools",
visibility = ["//visibility:public"],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"path.go",
"path_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -16,3 +16,17 @@ go_library(
"//vendor/golang.org/x/tools/go/vcs:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"remote.go",
"remote_test.go",
"repo.go",
"repo_test.go",
"stubs_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -16,3 +16,14 @@ go_library(
"//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"config.go",
"index.go",
],
visibility = ["//visibility:public"],
)

View File

@ -22,3 +22,23 @@ go_library(
"//vendor/github.com/bazelbuild/buildtools/tables:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"directives.go",
"directives_test.go",
"expr.go",
"merge.go",
"platform.go",
"platform_strings.go",
"rule.go",
"rule_test.go",
"sort_labels.go",
"types.go",
"value.go",
],
visibility = ["//visibility:public"],
)

View File

@ -16,3 +16,15 @@ go_library(
"//vendor/github.com/bazelbuild/bazel-gazelle/rule:go_default_library",
],
)
filegroup(
name = "all_files",
testonly = True,
srcs = [
"BUILD.bazel",
"config.go",
"walk.go",
"walk_test.go",
],
visibility = ["//visibility:public"],
)

View File

@ -1,10 +1,17 @@
# gazelle:exclude parse.y.go
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load(":build_defs.bzl", "go_yacc")
go_yacc(
src = "parse.y",
out = "parse.y.baz.go",
)
go_library(
name = "go_default_library",
srcs = [
"lex.go",
"parse.y.go",
"parse.y.baz.go", # keep
"print.go",
"quote.go",
"rewrite.go",

View File

@ -76,16 +76,6 @@
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:
@ -93,9 +83,6 @@
- gophercloud-unittest
- gophercloud-acceptance-test
- gophercloud-acceptance-test-ironic
recheck-mitaka:
jobs:
- gophercloud-acceptance-test-mitaka
recheck-newton:
jobs:
- gophercloud-acceptance-test-newton

View File

@ -1,4 +1,57 @@
## 0.8.0 (Unreleased)
## 0.10.0 (Unreleased)
## 0.9.0 (March 10, 2020)
UPGRADE NOTES
* The way we implement new API result fields added by microversions has changed. Previously, we would declare a dedicated `ExtractFoo` function in a file called `microversions.go`. Now, we are declaring those fields inline of the original result struct as a pointer. [GH-1854](https://github.com/gophercloud/gophercloud/pull/1854)
* `compute/v2/servers.CreateOpts.Networks` has changed from `[]Network` to `interface{}` in order to support creating servers that have no networks. [GH-1884](https://github.com/gophercloud/gophercloud/pull/1884)
IMPROVEMENTS
* Added `compute/v2/extensions/instanceactions.List` [GH-1848](https://github.com/gophercloud/gophercloud/pull/1848)
* Added `compute/v2/extensions/instanceactions.Get` [GH-1848](https://github.com/gophercloud/gophercloud/pull/1848)
* Added `networking/v2/ports.List.FixedIPs` [GH-1849](https://github.com/gophercloud/gophercloud/pull/1849)
* Added `identity/v3/extensions/trusts.List` [GH-1855](https://github.com/gophercloud/gophercloud/pull/1855)
* Added `identity/v3/extensions/trusts.Get` [GH-1855](https://github.com/gophercloud/gophercloud/pull/1855)
* Added `identity/v3/extensions/trusts.Trust.ExpiresAt` [GH-1857](https://github.com/gophercloud/gophercloud/pull/1857)
* Added `identity/v3/extensions/trusts.Trust.DeletedAt` [GH-1857](https://github.com/gophercloud/gophercloud/pull/1857)
* Added `compute/v2/extensions/instanceactions.InstanceActionDetail` [GH-1851](https://github.com/gophercloud/gophercloud/pull/1851)
* Added `compute/v2/extensions/instanceactions.Event` [GH-1851](https://github.com/gophercloud/gophercloud/pull/1851)
* Added `compute/v2/extensions/instanceactions.ListOpts` [GH-1858](https://github.com/gophercloud/gophercloud/pull/1858)
* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey` [GH-1864](https://github.com/gophercloud/gophercloud/pull/1864)
* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey2` [GH-1864](https://github.com/gophercloud/gophercloud/pull/1864)
* Added `placement/v1/resourceproviders.GetUsages` [GH-1862](https://github.com/gophercloud/gophercloud/pull/1862)
* Added `placement/v1/resourceproviders.GetInventories` [GH-1862](https://github.com/gophercloud/gophercloud/pull/1862)
* Added `imageservice/v2/images.ReplaceImageMinRam` [GH-1867](https://github.com/gophercloud/gophercloud/pull/1867)
* Added `objectstorage/v1/containers.UpdateOpts.TempURLKey` [GH-1865](https://github.com/gophercloud/gophercloud/pull/1865)
* Added `objectstorage/v1/containers.CreateOpts.TempURLKey2` [GH-1865](https://github.com/gophercloud/gophercloud/pull/1865)
* Added `blockstorage/extensions/volumetransfers.List` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869)
* Added `blockstorage/extensions/volumetransfers.Create` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869)
* Added `blockstorage/extensions/volumetransfers.Accept` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869)
* Added `blockstorage/extensions/volumetransfers.Get` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869)
* Added `blockstorage/extensions/volumetransfers.Delete` [GH-1869](https://github.com/gophercloud/gophercloud/pull/1869)
* Added `blockstorage/extensions/backups.RestoreFromBackup` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871)
* Added `blockstorage/v3/volumes.CreateOpts.BackupID` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871)
* Added `blockstorage/v3/volumes.Volume.BackupID` [GH-1871](https://github.com/gophercloud/gophercloud/pull/1871)
* Added `identity/v3/projects.ListOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.ListOpts.TagsAny` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.ListOpts.NotTags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.ListOpts.NotTagsAny` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.CreateOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.UpdateOpts.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Added `identity/v3/projects.Project.Tags` [GH-1882](https://github.com/gophercloud/gophercloud/pull/1882)
* Changed `compute/v2/servers.CreateOpts.Networks` from `[]Network` to `interface{}` to support creating servers with no networks. [GH-1884](https://github.com/gophercloud/gophercloud/pull/1884)
BUG FIXES
* Added support for `int64` headers, which were previously being silently dropped [GH-1860](https://github.com/gophercloud/gophercloud/pull/1860)
* Allow image properties with empty values [GH-1875](https://github.com/gophercloud/gophercloud/pull/1875)
* Fixed `compute/v2/extensions/extendedserverattributes.ServerAttributesExt.Userdata` JSON tag [GH-1881](https://github.com/gophercloud/gophercloud/pull/1881)
## 0.8.0 (February 8, 2020)
UPGRADE NOTES
@ -27,12 +80,21 @@ IMPROVEMENTS
* Added `MonitorAddress` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824)
* Added `MonitorPort` to `loadbalancer/v2/pools.CreateMemberOpts` [GH-1824](https://github.com/gophercloud/gophercloud/pull/1824)
* Changed `Impersonation` to a non-required field in `identity/v3/extensions/trusts.CreateOpts` [GH-1818](https://github.com/gophercloud/gophercloud/pull/1818)
* Added `InsertHeaders` to `loadbalancer/v2/listeners.UpdateOpts` [GH-1835]
* Added `NUMATopology` to `baremetalintrospection/v1/introspection.Data` [GH-1842](https://github.com/gophercloud/gophercloud/pull/1842)
* Added `placement/v1/resourceproviders.Create` [GH-1841](https://github.com/gophercloud/gophercloud/pull/1841)
* Added `blockstorage/extensions/volumeactions.UploadImageOpts.Visibility` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873)
* Added `blockstorage/extensions/volumeactions.UploadImageOpts.Protected` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873)
* Added `blockstorage/extensions/volumeactions.VolumeImage.Visibility` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873)
* Added `blockstorage/extensions/volumeactions.VolumeImage.Protected` [GH-1873](https://github.com/gophercloud/gophercloud/pull/1873)
BUG FIXES
* Changed `sort_key` to `sort_keys` in ` workflow/v2/crontriggers.ListOpts` [GH-1809](https://github.com/gophercloud/gophercloud/pull/1809)
* Allow `blockstorage/extensions/schedulerstats.Capabilities.MaxOverSubscriptionRatio` to accept both string and int/float responses [GH-1817](https://github.com/gophercloud/gophercloud/pull/1817)
* Fixed bug in `NewLoadBalancerV2` for situations when the LBaaS service was advertised without a `/v2.0` endpoint [GH-1829](https://github.com/gophercloud/gophercloud/pull/1829)
* Fixed JSON tags in `baremetal/v1/ports.UpdateOperation` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840)
* Fixed JSON tags in `networking/v2/extensions/lbaas/vips.commonResult.Extract()` [GH-1840](https://github.com/gophercloud/gophercloud/pull/1840)
## 0.7.0 (December 3, 2019)

View File

@ -11,4 +11,3 @@ require (
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.7
)

View File

@ -198,7 +198,7 @@ func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder
return
}
// IDFromName is a convienience function that returns a server's ID given its name.
// IDFromName is a convienience function that returns a volume's ID given its name.
func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) {
count := 0
id := ""

View File

@ -4,7 +4,6 @@ go_library(
name = "go_default_library",
srcs = [
"doc.go",
"microversions.go",
"requests.go",
"results.go",
"urls.go",

View File

@ -47,16 +47,6 @@ Example to Create a Server Group with additional microversion 2.64 fields
panic(err)
}
policy, err := servergroups.ExtractPolicy(result.Result)
if err != nil {
panic(err)
}
rules, err := servergroups.ExtractRules(result.Result)
if err != nil {
panic(err)
}
Example to Delete a Server Group
sgID := "7a6f29ad-e34d-4368-951a-58a08f11cfb7"
@ -64,23 +54,5 @@ Example to Delete a Server Group
if err != nil {
panic(err)
}
Example to get additional fields with microversion 2.64 or later
computeClient.Microversion = "2.64"
result := servergroups.Get(computeClient, "616fb98f-46ca-475e-917e-2563e5a8cd19")
policy, err := servergroups.ExtractPolicy(result.Result)
if err != nil {
panic(err)
}
fmt.Printf("Policy: %s\n", policy)
rules, err := servergroups.ExtractRules(result.Result)
if err != nil {
panic(err)
}
fmt.Printf("Max server per host: %s\n", rules.MaxServerPerHost)
*/
package servergroups

View File

@ -1,32 +0,0 @@
package servergroups
import "github.com/gophercloud/gophercloud"
// ExtractPolicy will extract the policy attribute.
// This requires the client to be set to microversion 2.64 or later.
func ExtractPolicy(r gophercloud.Result) (string, error) {
var s struct {
Policy string `json:"policy"`
}
err := r.ExtractIntoStructPtr(&s, "server_group")
return s.Policy, err
}
// ExtractRules will extract the rules attribute.
// This requires the client to be set to microversion 2.64 or later.
func ExtractRules(r gophercloud.Result) (Rules, error) {
var s struct {
Rules Rules `json:"rules"`
}
err := r.ExtractIntoStructPtr(&s, "server_group")
return s.Rules, err
}
// Rules represents set of rules for a policy.
type Rules struct {
// MaxServerPerHost specifies how many servers can reside on a single compute host.
// It can be used only with the "anti-affinity" policy.
MaxServerPerHost int `json:"max_server_per_host,omitempty"`
}

View File

@ -32,6 +32,22 @@ type ServerGroup struct {
// Metadata includes a list of all user-specified key-value pairs attached
// to the Server Group.
Metadata map[string]interface{}
// Policy is the policy of a server group.
// This requires microversion 2.64 or later.
Policy *string `json:"policy"`
// Rules are the rules of the server group.
// This requires microversion 2.64 or later.
Rules *Rules `json:"rules"`
}
// Rules represents set of rules for a policy.
// This requires microversion 2.64 or later.
type Rules struct {
// MaxServerPerHost specifies how many servers can reside on a single compute host.
// It can be used only with the "anti-affinity" policy.
MaxServerPerHost int `json:"max_server_per_host"`
}
// ServerGroupPage stores a single page of all ServerGroups results from a

View File

@ -5,7 +5,6 @@ go_library(
srcs = [
"doc.go",
"errors.go",
"microversions.go",
"requests.go",
"results.go",
"urls.go",

View File

@ -111,30 +111,5 @@ Example to Snapshot a Server
if err != nil {
panic(err)
}
Example of Extend server result with Tags:
client.Microversion = "2.26"
type ServerWithTags struct {
servers.Server
servers.TagsExt
}
var allServers []ServerWithTags
allPages, err := servers.List(client, nil).AllPages()
if err != nil {
log.Fatal(err)
}
err = servers.ExtractServersInto(allPages, &allServers)
if err != nil {
log.Fatal(err)
}
for _, server := range allServers {
fmt.Println(server.Tags)
}
*/
package servers

View File

@ -1,29 +0,0 @@
package servers
// TagsExt is an extension to the base Server struct.
// Use this in combination with the Server struct to create
// a composed struct in order to extract a slice of servers
// with the Tag field.
//
// This requires the client to be set to microversion 2.26 or later.
//
// To interact with a server's tags directly, see the
// openstack/compute/v2/extensions/tags package.
type TagsExt struct {
// Tags contains a list of server tags.
Tags []string `json:"tags"`
}
// ExtractTags will extract the tags of a server.
//
// This requires the client to be set to microversion 2.26 or later.
//
// To interact with a server's tags directly, see the
// openstack/compute/v2/extensions/tags package.
func (r serverResult) ExtractTags() ([]string, error) {
var s struct {
Tags []string `json:"tags"`
}
err := r.ExtractInto(&s)
return s.Tags, err
}

View File

@ -3,6 +3,7 @@ package servers
import (
"encoding/base64"
"encoding/json"
"fmt"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
@ -179,7 +180,9 @@ type CreateOpts struct {
// Networks dictates how this server will be attached to available networks.
// By default, the server will be attached to all isolated networks for the
// tenant.
Networks []Network `json:"-"`
// Starting with microversion 2.37 networks can also be an "auto" or "none"
// string.
Networks interface{} `json:"-"`
// Metadata contains key-value pairs (up to 255 bytes each) to attach to the
// server.
@ -245,21 +248,30 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) {
b["security_groups"] = securityGroups
}
if len(opts.Networks) > 0 {
networks := make([]map[string]interface{}, len(opts.Networks))
for i, net := range opts.Networks {
networks[i] = make(map[string]interface{})
if net.UUID != "" {
networks[i]["uuid"] = net.UUID
}
if net.Port != "" {
networks[i]["port"] = net.Port
}
if net.FixedIP != "" {
networks[i]["fixed_ip"] = net.FixedIP
switch v := opts.Networks.(type) {
case []Network:
if len(v) > 0 {
networks := make([]map[string]interface{}, len(v))
for i, net := range v {
networks[i] = make(map[string]interface{})
if net.UUID != "" {
networks[i]["uuid"] = net.UUID
}
if net.Port != "" {
networks[i]["port"] = net.Port
}
if net.FixedIP != "" {
networks[i]["fixed_ip"] = net.FixedIP
}
}
b["networks"] = networks
}
case string:
if v == "auto" || v == "none" {
b["networks"] = v
} else {
return nil, fmt.Errorf(`networks must be a slice of Network struct or a string with "auto" or "none" values, current value is %q`, v)
}
b["networks"] = networks
}
// If ImageRef isn't provided, check if ImageName was provided to ascertain

View File

@ -217,6 +217,10 @@ type Server struct {
// Fault contains failure information about a server.
Fault Fault `json:"fault"`
// Tags is a slice/list of string tags in a server.
// The requires microversion 2.26 or later.
Tags *[]string `json:"tags"`
}
type AttachedVolume struct {

View File

@ -335,6 +335,20 @@ func (r ReplaceImageMinDisk) ToImagePatchMap() map[string]interface{} {
}
}
// ReplaceImageMinRam represents an updated min_ram property request.
type ReplaceImageMinRam struct {
NewMinRam int
}
// ToImagePatchMap assembles a request body based on ReplaceImageTags.
func (r ReplaceImageMinRam) ToImagePatchMap() map[string]interface{} {
return map[string]interface{}{
"op": "replace",
"path": "/min_ram",
"value": r.NewMinRam,
}
}
// UpdateOp represents a valid update operation.
type UpdateOp string
@ -358,9 +372,45 @@ func (r UpdateImageProperty) ToImagePatchMap() map[string]interface{} {
"path": fmt.Sprintf("/%s", r.Name),
}
if r.Value != "" {
if r.Op != RemoveOp {
updateMap["value"] = r.Value
}
return updateMap
}
// IDFromName is a convienience function that returns an image's ID given its name.
func IDFromName(client *gophercloud.ServiceClient, name string) (string, error) {
count := 0
id := ""
listOpts := ListOpts{
Name: name,
}
pages, err := List(client, listOpts).AllPages()
if err != nil {
return "", err
}
all, err := ExtractImages(pages)
if err != nil {
return "", err
}
for _, s := range all {
if s.Name == name {
count++
id = s.ID
}
}
switch count {
case 0:
return "", gophercloud.ErrResourceNotFound{Name: name, ResourceType: "image"}
case 1:
return id, nil
default:
return "", gophercloud.ErrMultipleResourcesFound{Name: name, Count: count, ResourceType: "image"}
}
}

View File

@ -206,6 +206,9 @@ type UpdateOpts struct {
// Time, in milliseconds, to wait for additional TCP packets for content inspection
TimeoutTCPInspect *int `json:"timeout_tcp_inspect,omitempty"`
// A dictionary of optional headers to insert into the request before it is sent to the backend member.
InsertHeaders *map[string]string `json:"insert_headers,omitempty"`
// A list of IPv4, IPv6 or mix of both CIDRs
AllowedCIDRs *[]string `json:"allowed_cidrs,omitempty"`
}

View File

@ -1,6 +1,10 @@
package ports
import (
"fmt"
"net/url"
"strings"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/pagination"
)
@ -36,11 +40,37 @@ type ListOpts struct {
TagsAny string `q:"tags-any"`
NotTags string `q:"not-tags"`
NotTagsAny string `q:"not-tags-any"`
FixedIPs []FixedIPOpts
}
type FixedIPOpts struct {
IPAddress string
IPAddressSubstr string
SubnetID string
}
func (f FixedIPOpts) String() string {
var res []string
if f.IPAddress != "" {
res = append(res, fmt.Sprintf("ip_address=%s", f.IPAddress))
}
if f.IPAddressSubstr != "" {
res = append(res, fmt.Sprintf("ip_address_substr=%s", f.IPAddressSubstr))
}
if f.SubnetID != "" {
res = append(res, fmt.Sprintf("subnet_id=%s", f.SubnetID))
}
return strings.Join(res, ",")
}
// ToPortListQuery formats a ListOpts into a query string.
func (opts ListOpts) ToPortListQuery() (string, error) {
q, err := gophercloud.BuildQueryString(opts)
params := q.Query()
for _, fixedIP := range opts.FixedIPs {
params.Add("fixed_ips", fixedIP.String())
}
q = &url.URL{RawQuery: params.Encode()}
return q.String(), err
}

View File

@ -75,6 +75,8 @@ type CreateOpts struct {
IfNoneMatch string `h:"If-None-Match"`
VersionsLocation string `h:"X-Versions-Location"`
HistoryLocation string `h:"X-History-Location"`
TempURLKey string `h:"X-Container-Meta-Temp-URL-Key"`
TempURLKey2 string `h:"X-Container-Meta-Temp-URL-Key-2"`
}
// ToContainerCreateMap formats a CreateOpts into a map of headers.
@ -141,6 +143,8 @@ type UpdateOpts struct {
VersionsLocation string `h:"X-Versions-Location"`
RemoveHistoryLocation string `h:"X-Remove-History-Location"`
HistoryLocation string `h:"X-History-Location"`
TempURLKey string `h:"X-Container-Meta-Temp-URL-Key"`
TempURLKey2 string `h:"X-Container-Meta-Temp-URL-Key-2"`
}
// ToContainerUpdateMap formats a UpdateOpts into a map of headers.

View File

@ -103,6 +103,8 @@ type GetHeader struct {
HistoryLocation string `json:"X-History-Location"`
Write []string `json:"-"`
StoragePolicy string `json:"X-Storage-Policy"`
TempURLKey string `json:"X-Container-Meta-Temp-URL-Key"`
TempURLKey2 string `json:"X-Container-Meta-Temp-URL-Key-2"`
}
func (r *GetHeader) UnmarshalJSON(b []byte) error {

View File

@ -15,6 +15,7 @@ go_library(
deps = [
"//vendor/github.com/gophercloud/gophercloud:go_default_library",
"//vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts:go_default_library",
"//vendor/github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers:go_default_library",
"//vendor/github.com/gophercloud/gophercloud/pagination:go_default_library",
],
)

View File

@ -13,6 +13,7 @@ import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/accounts"
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/containers"
"github.com/gophercloud/gophercloud/pagination"
)
@ -482,11 +483,20 @@ func CreateTempURL(c *gophercloud.ServiceClient, containerName, objectName strin
}
duration := time.Duration(opts.TTL) * time.Second
expiry := time.Now().Add(duration).Unix()
getHeader, err := accounts.Get(c, nil).Extract()
getHeader, err := containers.Get(c, containerName, nil).Extract()
if err != nil {
return "", err
}
secretKey := []byte(getHeader.TempURLKey)
tempURLKey := getHeader.TempURLKey
if tempURLKey == "" {
// fallback to an account TempURL key
getHeader, err := accounts.Get(c, nil).Extract()
if err != nil {
return "", err
}
tempURLKey = getHeader.TempURLKey
}
secretKey := []byte(tempURLKey)
url := getURL(c, containerName, objectName)
splitPath := strings.Split(url, opts.Split)
baseURL, objectPath := splitPath[0], splitPath[1]

View File

@ -450,6 +450,8 @@ func BuildHeaders(opts interface{}) (map[string]string, error) {
optsMap[tags[0]] = v.String()
case reflect.Int:
optsMap[tags[0]] = strconv.FormatInt(v.Int(), 10)
case reflect.Int64:
optsMap[tags[0]] = strconv.FormatInt(v.Int(), 10)
case reflect.Bool:
optsMap[tags[0]] = strconv.FormatBool(v.Bool())
}

View File

@ -11,7 +11,7 @@ go_library(
"logger.go",
"overlay.go",
"peer.go",
"peer_name_hash.go",
"peer_name_mac.go",
"peers.go",
"protocol.go",
"protocol_crypto.go",

View File

@ -1,4 +1,4 @@
// +build !peer_name_mac
// +build peer_name_hash
package mesh

110
vendor/github.com/weaveworks/mesh/peer_name_mac.go generated vendored Normal file
View File

@ -0,0 +1,110 @@
// +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
}

2
vendor/modules.txt vendored
View File

@ -251,7 +251,7 @@ github.com/googleapis/gax-go/v2
github.com/googleapis/gnostic/OpenAPIv2
github.com/googleapis/gnostic/compiler
github.com/googleapis/gnostic/extensions
# github.com/gophercloud/gophercloud v0.7.1-0.20200116011225-46fdd1830e9a
# github.com/gophercloud/gophercloud v0.7.1-0.20200116011225-46fdd1830e9a => github.com/gophercloud/gophercloud v0.9.0
github.com/gophercloud/gophercloud
github.com/gophercloud/gophercloud/internal
github.com/gophercloud/gophercloud/openstack