mirror of https://github.com/kubernetes/kops.git
Update dependencies
This commit is contained in:
parent
c59def3fe5
commit
a96f0e6c71
44
go.mod
44
go.mod
|
@ -14,10 +14,10 @@ require (
|
|||
github.com/Masterminds/sprig/v3 v3.2.2
|
||||
github.com/apparentlymart/go-cidr v1.1.0
|
||||
github.com/aws/amazon-ec2-instance-selector/v2 v2.4.0
|
||||
github.com/aws/aws-sdk-go v1.44.99
|
||||
github.com/aws/aws-sdk-go v1.44.104
|
||||
github.com/blang/semver/v4 v4.0.0
|
||||
github.com/cert-manager/cert-manager v1.9.1
|
||||
github.com/digitalocean/godo v1.83.0
|
||||
github.com/digitalocean/godo v1.85.0
|
||||
github.com/go-ini/ini v1.67.0
|
||||
github.com/go-logr/logr v1.2.3
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
|
@ -28,8 +28,8 @@ require (
|
|||
github.com/google/uuid v1.3.0
|
||||
github.com/gophercloud/gophercloud v1.0.0
|
||||
github.com/hashicorp/hcl/v2 v2.14.0
|
||||
github.com/hashicorp/vault/api v1.7.2
|
||||
github.com/hetznercloud/hcloud-go v1.35.2
|
||||
github.com/hashicorp/vault/api v1.8.0
|
||||
github.com/hetznercloud/hcloud-go v1.35.3
|
||||
github.com/jacksontj/memberlistmesh v0.0.0-20190905163944-93462b9d2bb7
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
|
@ -44,29 +44,29 @@ require (
|
|||
github.com/weaveworks/mesh v0.0.0-20191105120815-58dbcc3e8e63
|
||||
github.com/zclconf/go-cty v1.11.0
|
||||
go.uber.org/multierr v1.8.0
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69
|
||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1
|
||||
golang.org/x/sync v0.0.0-20220907140024-f12130a52804
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41
|
||||
google.golang.org/api v0.96.0
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8
|
||||
google.golang.org/api v0.97.0
|
||||
gopkg.in/gcfg.v1 v1.2.3
|
||||
gopkg.in/inf.v0 v0.9.1
|
||||
gopkg.in/square/go-jose.v2 v2.6.0
|
||||
helm.sh/helm/v3 v3.9.4
|
||||
k8s.io/api v0.25.0
|
||||
k8s.io/apimachinery v0.25.0
|
||||
k8s.io/cli-runtime v0.25.0
|
||||
k8s.io/client-go v0.25.0
|
||||
helm.sh/helm/v3 v3.10.0
|
||||
k8s.io/api v0.25.2
|
||||
k8s.io/apimachinery v0.25.2
|
||||
k8s.io/cli-runtime v0.25.2
|
||||
k8s.io/client-go v0.25.2
|
||||
k8s.io/cloud-provider-aws v1.25.0
|
||||
k8s.io/component-base v0.25.0
|
||||
k8s.io/component-base v0.25.2
|
||||
k8s.io/gengo v0.0.0-20220913193501-391367153a38
|
||||
k8s.io/klog/v2 v2.80.1
|
||||
k8s.io/kubectl v0.25.0
|
||||
k8s.io/kubelet v0.25.0
|
||||
k8s.io/legacy-cloud-providers v0.25.0
|
||||
k8s.io/mount-utils v0.25.0
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
|
||||
k8s.io/kubectl v0.25.2
|
||||
k8s.io/kubelet v0.25.2
|
||||
k8s.io/legacy-cloud-providers v0.25.2
|
||||
k8s.io/mount-utils v0.25.2
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324
|
||||
sigs.k8s.io/controller-runtime v0.13.0
|
||||
sigs.k8s.io/yaml v1.3.0
|
||||
)
|
||||
|
@ -153,7 +153,7 @@ require (
|
|||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/memberlist v0.3.1 // indirect
|
||||
github.com/hashicorp/vault/sdk v0.5.1 // indirect
|
||||
github.com/hashicorp/vault/sdk v0.6.0 // indirect
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
|
||||
github.com/huandu/xstrings v1.3.2 // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
|
@ -237,8 +237,8 @@ require (
|
|||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.25.0 // indirect
|
||||
k8s.io/cloud-provider v0.25.0 // indirect
|
||||
k8s.io/csi-translation-lib v0.25.0 // indirect
|
||||
k8s.io/cloud-provider v0.25.2 // indirect
|
||||
k8s.io/csi-translation-lib v0.25.2 // indirect
|
||||
k8s.io/klog v1.0.0 // indirect
|
||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
|
||||
oras.land/oras-go v1.2.0 // indirect
|
||||
|
|
91
go.sum
91
go.sum
|
@ -179,8 +179,8 @@ github.com/aws/amazon-ec2-instance-selector/v2 v2.4.0/go.mod h1:AEJrtkLkCkfIBIaz
|
|||
github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/aws/aws-sdk-go v1.44.99 h1:ITZ9q/fmH+Ksaz2TbyMU2d19vOOWs/hAlt8NbXAieHw=
|
||||
github.com/aws/aws-sdk-go v1.44.99/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go v1.44.104 h1:NiPYL60aOSH0TsAzQngx/aBdxC12TXhgw07DQFh76GU=
|
||||
github.com/aws/aws-sdk-go v1.44.104/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
|
@ -276,8 +276,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
|||
github.com/denis-tingajkin/go-header v0.4.2/go.mod h1:eLRHAVXzE5atsKAnNRDB90WHCFFnBUn4RN0nRcs1LJA=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
|
||||
github.com/digitalocean/godo v1.83.0 h1:K9CveJyECNLwrQnGZG+ovgapr7l5OuvQ6xZSKKW9Nz0=
|
||||
github.com/digitalocean/godo v1.83.0/go.mod h1:BPCqvwbjbGqxuUnIKB4EvS/AX7IDnNmt5fwvIkWo+ew=
|
||||
github.com/digitalocean/godo v1.85.0 h1:25H79kPw4+WY5PGeJp8oISJJ0Qylx+UtGeYdz6UCzfc=
|
||||
github.com/digitalocean/godo v1.85.0/go.mod h1:jELt1jkHVifd0rKaY0pt/m1QxGzbkkvoVVrDkR15/5A=
|
||||
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
|
||||
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
|
||||
github.com/distribution/distribution/v3 v3.0.0-20220526142353-ffbd94cbe269 h1:hbCT8ZPPMqefiAWD2ZKjn7ypokIGViTvBBg/ExLSdCk=
|
||||
|
@ -669,14 +669,14 @@ github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1
|
|||
github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
|
||||
github.com/hashicorp/vault/api v1.7.2 h1:kawHE7s/4xwrdKbkmwQi0wYaIeUhk5ueek7ljuezCVQ=
|
||||
github.com/hashicorp/vault/api v1.7.2/go.mod h1:xbfA+1AvxFseDzxxdWaL0uO99n1+tndus4GCrtouy0M=
|
||||
github.com/hashicorp/vault/sdk v0.5.1 h1:zly/TmNgOXCGgWIRA8GojyXzG817POtVh3uzIwzZx+8=
|
||||
github.com/hashicorp/vault/sdk v0.5.1/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU=
|
||||
github.com/hashicorp/vault/api v1.8.0 h1:7765sW1XBt+qf4XKIYE4ebY9qc/yi9V2/egzGSUNMZU=
|
||||
github.com/hashicorp/vault/api v1.8.0/go.mod h1:uJrw6D3y9Rv7hhmS17JQC50jbPDAZdjZoTtrCCxxs7E=
|
||||
github.com/hashicorp/vault/sdk v0.6.0 h1:6Z+In5DXHiUfZvIZdMx7e2loL1PPyDjA4bVh9ZTIAhs=
|
||||
github.com/hashicorp/vault/sdk v0.6.0/go.mod h1:+DRpzoXIdMvKc88R4qxr+edwy/RvH5QK8itmxLiDHLc=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
|
||||
github.com/hetznercloud/hcloud-go v1.35.2 h1:eEDtmDiI2plZ2UQmj4YpiYse5XbtpXOUBpAdIOLxzgE=
|
||||
github.com/hetznercloud/hcloud-go v1.35.2/go.mod h1:mepQwR6va27S3UQthaEPGS86jtzSY9xWL1e9dyxXpgA=
|
||||
github.com/hetznercloud/hcloud-go v1.35.3 h1:WCmFAhLRooih2QHAsbCbEdpIHnshQQmrPqsr3rHE1Ow=
|
||||
github.com/hetznercloud/hcloud-go v1.35.3/go.mod h1:mepQwR6va27S3UQthaEPGS86jtzSY9xWL1e9dyxXpgA=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
|
||||
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
|
||||
|
@ -922,14 +922,14 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108
|
|||
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||
github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
|
||||
github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
|
||||
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
|
||||
github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 h1:+czc/J8SlhPKLOtVLMQc+xDCFBT73ZStMsRhSsUhsSg=
|
||||
|
@ -1254,8 +1254,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y
|
|||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 h1:a5Yg6ylndHHYJqIPrdq0AhvR6KTvDTAvgBtaidhEevY=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
|
@ -1363,8 +1363,9 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su
|
|||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI=
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69 h1:hUJpGDpnfwdJW8iNypFjmSY0sCBEL+spFTZ2eO+Sfps=
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
|
@ -1512,8 +1513,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
|
@ -1698,8 +1699,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69
|
|||
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
|
||||
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
|
||||
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
|
||||
google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM=
|
||||
google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||
google.golang.org/api v0.97.0 h1:x/vEL1XDF/2V4xzdNgFPaKHluRESo2aTsL7QzHnBtGQ=
|
||||
google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
|
@ -1906,8 +1907,8 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|||
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
|
||||
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
|
||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
|
||||
helm.sh/helm/v3 v3.9.4 h1:TCI1QhJUeLVOdccfdw+vnSEO3Td6gNqibptB04QtExY=
|
||||
helm.sh/helm/v3 v3.9.4/go.mod h1:3eaWAIqzvlRSD06gR9MMwmp2KBKwlu9av1/1BZpjeWY=
|
||||
helm.sh/helm/v3 v3.10.0 h1:y/MYONZ/bsld9kHwqgBX2uPggnUr5hahpjwt9/jrHlI=
|
||||
helm.sh/helm/v3 v3.10.0/go.mod h1:paPw0hO5KVfrCMbi1M8+P8xdfBri3IiJiVKATZsFR94=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
@ -1918,33 +1919,33 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
|
|||
honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY=
|
||||
k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg=
|
||||
k8s.io/api v0.22.1/go.mod h1:bh13rkTp3F1XEaLGykbyRD2QaTTzPm0e/BMd8ptFONY=
|
||||
k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0=
|
||||
k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk=
|
||||
k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8=
|
||||
k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0=
|
||||
k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE=
|
||||
k8s.io/apiextensions-apiserver v0.25.0 h1:CJ9zlyXAbq0FIW8CD7HHyozCMBpDSiH7EdrSTCZcZFY=
|
||||
k8s.io/apiextensions-apiserver v0.25.0/go.mod h1:3pAjZiN4zw7R8aZC5gR0y3/vCkGlAjCazcg1me8iB/E=
|
||||
k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI=
|
||||
k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
|
||||
k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU=
|
||||
k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0=
|
||||
k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs=
|
||||
k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA=
|
||||
k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU=
|
||||
k8s.io/cli-runtime v0.25.0 h1:XBnTc2Fi+w818jcJGzhiJKQuXl8479sZ4FhtV5hVJ1Q=
|
||||
k8s.io/cli-runtime v0.25.0/go.mod h1:bHOI5ZZInRHhbq12OdUiYZQN8ml8aKZLwQgt9QlLINw=
|
||||
k8s.io/cli-runtime v0.25.2 h1:XOx+SKRjBpYMLY/J292BHTkmyDffl/qOx3YSuFZkTuc=
|
||||
k8s.io/cli-runtime v0.25.2/go.mod h1:OQx3+/0st6x5YpkkJQlEWLC73V0wHsOFMC1/roxV8Oc=
|
||||
k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU=
|
||||
k8s.io/client-go v0.22.1/go.mod h1:BquC5A4UOo4qVDUtoc04/+Nxp1MeHcVc1HJm1KmG8kk=
|
||||
k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E=
|
||||
k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8=
|
||||
k8s.io/cloud-provider v0.25.0 h1:ONX5BON6f1Mxa2GWvPyKn+QsZXaLauPUte7MZxfWUro=
|
||||
k8s.io/cloud-provider v0.25.0/go.mod h1:afVfVCIYOUER914WmSp0QpAtJn12gv4qu9NMT4XBxZo=
|
||||
k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo=
|
||||
k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4=
|
||||
k8s.io/cloud-provider v0.25.2 h1:KwglzrTOz5oR4ImT9aSgCo5T0GlK+FqeOXbus3D/TUQ=
|
||||
k8s.io/cloud-provider v0.25.2/go.mod h1:PTroa0bNv5Ik4whks5Cl/QX7adrl4I1mnydrM6vAhaU=
|
||||
k8s.io/cloud-provider-aws v1.25.0 h1:kTnNfMA4FDDAdPXWjc+aj8IzSn3iqMUqWTMmzElyCIs=
|
||||
k8s.io/cloud-provider-aws v1.25.0/go.mod h1:RaSxyc4nlJkBLSuKEf6rLA2gLhfbU7GrTGhGSYvVFsY=
|
||||
k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo=
|
||||
k8s.io/code-generator v0.22.0/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o=
|
||||
k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ=
|
||||
k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y=
|
||||
k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk=
|
||||
k8s.io/csi-translation-lib v0.25.0 h1:Jh3kn5p3kEGGA/q1fovTNIG9fypzt2c34sm+qij2W/8=
|
||||
k8s.io/csi-translation-lib v0.25.0/go.mod h1:Wb80CDywP4753F6wWkIyOuJIQtQAbhgw985veSgAn/4=
|
||||
k8s.io/component-base v0.25.2 h1:Nve/ZyHLUBHz1rqwkjXm/Re6IniNa5k7KgzxZpTfSQY=
|
||||
k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60=
|
||||
k8s.io/csi-translation-lib v0.25.2 h1:DU0ipV1VrqF+R4QuJyEP1jKsXaIxyGBE7WEl97DGp4A=
|
||||
k8s.io/csi-translation-lib v0.25.2/go.mod h1:q2OfTClapLeLlFeQBOklmyP/w4I2hvBZg6O3iHZcuSg=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
k8s.io/gengo v0.0.0-20201203183100-97869a43a9d9/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
|
@ -1965,20 +1966,20 @@ k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iL
|
|||
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw=
|
||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA=
|
||||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
|
||||
k8s.io/kubectl v0.25.0 h1:/Wn1cFqo8ik3iee1EvpxYre3bkWsGLXzLQI6uCCAkQc=
|
||||
k8s.io/kubectl v0.25.0/go.mod h1:n16ULWsOl2jmQpzt2o7Dud1t4o0+Y186ICb4O+GwKAU=
|
||||
k8s.io/kubelet v0.25.0 h1:eTS5B1u1o63ndExAHKLJytzz/GBy86ROcxYtu0VK3RA=
|
||||
k8s.io/kubelet v0.25.0/go.mod h1:J6aQxrZdSsGPrskYrhZdEn6PCnGha+GNvF0g9aWfQnw=
|
||||
k8s.io/legacy-cloud-providers v0.25.0 h1:c+boKaCw/2ZzvA8/XgTIeDrGUJJ2Ucy+jLJFf02+huE=
|
||||
k8s.io/legacy-cloud-providers v0.25.0/go.mod h1:bnmUgHHeBmK3M9JgQzu+ne6UCUVURDzkpF0Y7VeypVE=
|
||||
k8s.io/mount-utils v0.25.0 h1:dx+SKXBVjskPgkpv9Mk0mAfbLNOxz8jAqTXGTZJnd8I=
|
||||
k8s.io/mount-utils v0.25.0/go.mod h1:WTYq8Ev/JrnkqK2h1jFUnC8qWGuqzMb9XDC+Lu3WNU0=
|
||||
k8s.io/kubectl v0.25.2 h1:2993lTeVimxKSWx/7z2PiJxUILygRa3tmC4QhFaeioA=
|
||||
k8s.io/kubectl v0.25.2/go.mod h1:eoBGJtKUj7x38KXelz+dqVtbtbKwCqyKzJWmBHU0prg=
|
||||
k8s.io/kubelet v0.25.2 h1:L0PXLc2kTfIf6bm+wv4/1dIWwgXWDRTxTErxqFR4nqc=
|
||||
k8s.io/kubelet v0.25.2/go.mod h1:/ASc/pglUA3TeRMG4hRKSjTa7arT0D6yqLzwqSxwMlY=
|
||||
k8s.io/legacy-cloud-providers v0.25.2 h1:Yt9m20ChxFW9o/90JDphUjAP9Axs6rQk878AUj/5cw8=
|
||||
k8s.io/legacy-cloud-providers v0.25.2/go.mod h1:H9JjCeCuPv5GSmLD5lPzG7BXJr02D8BDYXabRHJZV1o=
|
||||
k8s.io/mount-utils v0.25.2 h1:ZNIHSaPaaPqFqtZzaTbgH3oHKoWZHoNBnTKafQRj6A4=
|
||||
k8s.io/mount-utils v0.25.2/go.mod h1:WTYq8Ev/JrnkqK2h1jFUnC8qWGuqzMb9XDC+Lu3WNU0=
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20210820185131-d34e5cb4466e/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 h1:H9TCJUUx+2VA0ZiD9lvtaX8fthFsMoD+Izn93E/hm8U=
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324 h1:i+xdFemcSNuJvIfBlaYuXgRondKxK4z4prVPKzEaelI=
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48=
|
||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||
|
|
|
@ -12,8 +12,8 @@ require (
|
|||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||
github.com/octago/sflags v0.2.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
k8s.io/api v0.25.0
|
||||
k8s.io/apimachinery v0.25.0
|
||||
k8s.io/api v0.25.2
|
||||
k8s.io/apimachinery v0.25.2
|
||||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||
k8s.io/klog/v2 v2.80.1
|
||||
k8s.io/kops v1.24.1
|
||||
|
@ -38,7 +38,7 @@ require (
|
|||
github.com/apparentlymart/go-cidr v1.1.0 // indirect
|
||||
github.com/armon/go-metrics v0.3.10 // indirect
|
||||
github.com/armon/go-radix v1.0.0 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.99 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.104 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
|
||||
|
@ -95,8 +95,8 @@ require (
|
|||
github.com/hashicorp/go-version v1.2.1 // indirect
|
||||
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/vault/api v1.7.2 // indirect
|
||||
github.com/hashicorp/vault/sdk v0.5.1 // indirect
|
||||
github.com/hashicorp/vault/api v1.8.0 // indirect
|
||||
github.com/hashicorp/vault/sdk v0.6.0 // indirect
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect
|
||||
github.com/imdario/mergo v0.3.12 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.0.0 // indirect
|
||||
|
@ -146,16 +146,16 @@ require (
|
|||
go.opencensus.io v0.23.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect
|
||||
golang.org/x/sync v0.0.0-20220907140024-f12130a52804 // indirect
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 // indirect
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
|
||||
google.golang.org/api v0.96.0 // indirect
|
||||
google.golang.org/api v0.97.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de // indirect
|
||||
google.golang.org/grpc v1.48.0 // indirect
|
||||
|
@ -168,7 +168,7 @@ require (
|
|||
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
|
||||
k8s.io/release v0.7.1-0.20210204090829-09fb5e3883b8 // indirect
|
||||
k8s.io/test-infra v0.0.0-20210730160938-8ad9b8c53bd8 // indirect
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 // indirect
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
|
||||
)
|
||||
|
|
|
@ -346,8 +346,8 @@ github.com/aws/aws-sdk-go v1.31.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve
|
|||
github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
|
||||
github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/aws/aws-sdk-go v1.37.22/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||
github.com/aws/aws-sdk-go v1.44.99 h1:ITZ9q/fmH+Ksaz2TbyMU2d19vOOWs/hAlt8NbXAieHw=
|
||||
github.com/aws/aws-sdk-go v1.44.99/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aws/aws-sdk-go v1.44.104 h1:NiPYL60aOSH0TsAzQngx/aBdxC12TXhgw07DQFh76GU=
|
||||
github.com/aws/aws-sdk-go v1.44.104/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||
github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I=
|
||||
github.com/bazelbuild/buildtools v0.0.0-20190917191645-69366ca98f89/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU=
|
||||
github.com/bazelbuild/buildtools v0.0.0-20200922170545-10384511ce98/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU=
|
||||
|
@ -1322,10 +1322,10 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
|
|||
github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
|
||||
github.com/hashicorp/vault/api v1.7.2 h1:kawHE7s/4xwrdKbkmwQi0wYaIeUhk5ueek7ljuezCVQ=
|
||||
github.com/hashicorp/vault/api v1.7.2/go.mod h1:xbfA+1AvxFseDzxxdWaL0uO99n1+tndus4GCrtouy0M=
|
||||
github.com/hashicorp/vault/sdk v0.5.1 h1:zly/TmNgOXCGgWIRA8GojyXzG817POtVh3uzIwzZx+8=
|
||||
github.com/hashicorp/vault/sdk v0.5.1/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU=
|
||||
github.com/hashicorp/vault/api v1.8.0 h1:7765sW1XBt+qf4XKIYE4ebY9qc/yi9V2/egzGSUNMZU=
|
||||
github.com/hashicorp/vault/api v1.8.0/go.mod h1:uJrw6D3y9Rv7hhmS17JQC50jbPDAZdjZoTtrCCxxs7E=
|
||||
github.com/hashicorp/vault/sdk v0.6.0 h1:6Z+In5DXHiUfZvIZdMx7e2loL1PPyDjA4bVh9ZTIAhs=
|
||||
github.com/hashicorp/vault/sdk v0.6.0/go.mod h1:+DRpzoXIdMvKc88R4qxr+edwy/RvH5QK8itmxLiDHLc=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
|
@ -1721,7 +1721,7 @@ github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k
|
|||
github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E=
|
||||
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
||||
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||
github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
|
||||
github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU=
|
||||
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
|
||||
github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
|
@ -1740,7 +1740,7 @@ github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7
|
|||
github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY=
|
||||
github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0=
|
||||
github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
|
||||
github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q=
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
|
||||
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
|
||||
|
@ -2358,8 +2358,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
|
|||
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM=
|
||||
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 h1:a5Yg6ylndHHYJqIPrdq0AhvR6KTvDTAvgBtaidhEevY=
|
||||
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
|
@ -2495,8 +2495,9 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su
|
|||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI=
|
||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69 h1:hUJpGDpnfwdJW8iNypFjmSY0sCBEL+spFTZ2eO+Sfps=
|
||||
golang.org/x/net v0.0.0-20220921203646-d300de134e69/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
|
@ -2697,8 +2698,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41 h1:ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
|
||||
golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
|
||||
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
|
@ -2943,8 +2944,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69
|
|||
google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
|
||||
google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
|
||||
google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
|
||||
google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM=
|
||||
google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||
google.golang.org/api v0.97.0 h1:x/vEL1XDF/2V4xzdNgFPaKHluRESo2aTsL7QzHnBtGQ=
|
||||
google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
|
@ -3245,8 +3246,8 @@ k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
|
|||
k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s=
|
||||
k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs=
|
||||
k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg=
|
||||
k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0=
|
||||
k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk=
|
||||
k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8=
|
||||
k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0=
|
||||
k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604/go.mod h1:7H8sjDlWQu89yWB3FhZfsLyRCRLuoXoCoY5qtwW1q6I=
|
||||
k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto=
|
||||
k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs=
|
||||
|
@ -3275,8 +3276,8 @@ k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP
|
|||
k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
|
||||
k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U=
|
||||
k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM=
|
||||
k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU=
|
||||
k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0=
|
||||
k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs=
|
||||
k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA=
|
||||
k8s.io/apiserver v0.0.0-20190918200908-1e17798da8c1/go.mod h1:4FuDU+iKPjdsdQSN3GsEKZLB/feQsj1y9dhhBDVV2Ns=
|
||||
k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc=
|
||||
k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg=
|
||||
|
@ -3406,8 +3407,8 @@ k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
|
|||
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 h1:H9TCJUUx+2VA0ZiD9lvtaX8fthFsMoD+Izn93E/hm8U=
|
||||
k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324 h1:i+xdFemcSNuJvIfBlaYuXgRondKxK4z4prVPKzEaelI=
|
||||
k8s.io/utils v0.0.0-20220922133306-665eaaec4324/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
knative.dev/caching v0.0.0-20190719140829-2032732871ff/go.mod h1:dHXFU6CGlLlbzaWc32g80cR92iuBSpsslDNBWI8C7eg=
|
||||
knative.dev/caching v0.0.0-20200116200605-67bca2c83dfa/go.mod h1:dHXFU6CGlLlbzaWc32g80cR92iuBSpsslDNBWI8C7eg=
|
||||
knative.dev/eventing-contrib v0.6.1-0.20190723221543-5ce18048c08b/go.mod h1:SnXZgSGgMSMLNFTwTnpaOH7hXDzTFtw0J8OmHflNx3g=
|
||||
|
|
|
@ -5822,12 +5822,42 @@ var awsPartition = partition{
|
|||
endpointKey{
|
||||
Region: "eu-west-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "fips-us-east-1",
|
||||
}: endpoint{
|
||||
Hostname: "connect-campaigns-fips.us-east-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-west-2",
|
||||
}: endpoint{
|
||||
Hostname: "connect-campaigns-fips.us-west-2.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-west-2",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-east-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-east-1",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "connect-campaigns-fips.us-east-1.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-west-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-west-2",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "connect-campaigns-fips.us-west-2.amazonaws.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
"contact-lens": service{
|
||||
|
@ -7283,6 +7313,9 @@ var awsPartition = partition{
|
|||
endpointKey{
|
||||
Region: "ap-southeast-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-southeast-3",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoint{},
|
||||
|
@ -9484,6 +9517,12 @@ var awsPartition = partition{
|
|||
endpointKey{
|
||||
Region: "ap-northeast-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-southeast-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-west-1",
|
||||
}: endpoint{},
|
||||
|
@ -9496,6 +9535,15 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-east-2",
|
||||
}: endpoint{
|
||||
Hostname: "emr-serverless-fips.us-east-2.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-east-2",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-west-2",
|
||||
}: endpoint{
|
||||
|
@ -9514,6 +9562,15 @@ var awsPartition = partition{
|
|||
}: endpoint{
|
||||
Hostname: "emr-serverless-fips.us-east-1.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-east-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-east-2",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "emr-serverless-fips.us-east-2.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-west-2",
|
||||
}: endpoint{},
|
||||
|
@ -10570,24 +10627,9 @@ var awsPartition = partition{
|
|||
},
|
||||
"fsx": service{
|
||||
Endpoints: serviceEndpoints{
|
||||
endpointKey{
|
||||
Region: "af-south-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-east-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-northeast-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-northeast-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-northeast-3",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-south-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-southeast-1",
|
||||
}: endpoint{},
|
||||
|
@ -10606,21 +10648,12 @@ var awsPartition = partition{
|
|||
endpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-north-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-south-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-west-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-west-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "eu-west-3",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "fips-ca-central-1",
|
||||
}: endpoint{
|
||||
|
@ -10657,15 +10690,6 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-prod-us-west-1",
|
||||
}: endpoint{
|
||||
Hostname: "fsx-fips.us-west-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-prod-us-west-2",
|
||||
}: endpoint{
|
||||
|
@ -10693,15 +10717,6 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-west-1",
|
||||
}: endpoint{
|
||||
Hostname: "fsx-fips.us-west-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-west-2",
|
||||
}: endpoint{
|
||||
|
@ -10711,9 +10726,6 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "me-south-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "prod-ca-central-1",
|
||||
}: endpoint{
|
||||
|
@ -10768,24 +10780,6 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "prod-us-west-1",
|
||||
}: endpoint{
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "prod-us-west-1",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "fsx-fips.us-west-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "prod-us-west-2",
|
||||
}: endpoint{
|
||||
|
@ -10804,9 +10798,6 @@ var awsPartition = partition{
|
|||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "sa-east-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-east-1",
|
||||
}: endpoint{},
|
||||
|
@ -10825,15 +10816,6 @@ var awsPartition = partition{
|
|||
}: endpoint{
|
||||
Hostname: "fsx-fips.us-east-2.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-west-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-west-1",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "fsx-fips.us-west-1.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-west-2",
|
||||
}: endpoint{},
|
||||
|
@ -17604,6 +17586,9 @@ var awsPartition = partition{
|
|||
endpointKey{
|
||||
Region: "ap-southeast-2",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ap-southeast-3",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoint{},
|
||||
|
@ -26719,6 +26704,16 @@ var awscnPartition = partition{
|
|||
}: endpoint{},
|
||||
},
|
||||
},
|
||||
"rbin": service{
|
||||
Endpoints: serviceEndpoints{
|
||||
endpointKey{
|
||||
Region: "cn-north-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "cn-northwest-1",
|
||||
}: endpoint{},
|
||||
},
|
||||
},
|
||||
"rds": service{
|
||||
Endpoints: serviceEndpoints{
|
||||
endpointKey{
|
||||
|
@ -30695,6 +30690,46 @@ var awsusgovPartition = partition{
|
|||
},
|
||||
},
|
||||
},
|
||||
"rbin": service{
|
||||
Endpoints: serviceEndpoints{
|
||||
endpointKey{
|
||||
Region: "fips-us-gov-east-1",
|
||||
}: endpoint{
|
||||
Hostname: "rbin-fips.us-gov-east-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-gov-east-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "fips-us-gov-west-1",
|
||||
}: endpoint{
|
||||
Hostname: "rbin-fips.us-gov-west-1.amazonaws.com",
|
||||
CredentialScope: credentialScope{
|
||||
Region: "us-gov-west-1",
|
||||
},
|
||||
Deprecated: boxedTrue,
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "rbin-fips.us-gov-east-1.amazonaws.com",
|
||||
},
|
||||
endpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
}: endpoint{},
|
||||
endpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
Variant: fipsVariant,
|
||||
}: endpoint{
|
||||
Hostname: "rbin-fips.us-gov-west-1.amazonaws.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
"rds": service{
|
||||
Defaults: endpointDefaults{
|
||||
defaultKey{}: endpoint{},
|
||||
|
|
|
@ -5,4 +5,4 @@ package aws
|
|||
const SDKName = "aws-sdk-go"
|
||||
|
||||
// SDKVersion is the version of this SDK
|
||||
const SDKVersion = "1.44.99"
|
||||
const SDKVersion = "1.44.104"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,21 @@
|
|||
# Change Log
|
||||
|
||||
## [v1.85.0] - 2022-09-21
|
||||
|
||||
- #560 - @andrewsomething - Bump golang.org/x/net (fixes: #557).
|
||||
- #559 - @kamaln7 - apps: update component spec interfaces
|
||||
- #555 - @kamaln7 - apps: add accessor methods and spec helpers
|
||||
- #556 - @kamaln7 - update CI for go 1.18 & 1.19
|
||||
|
||||
## [v1.84.1] - 2022-09-16
|
||||
|
||||
- #554 - @andrewsomething - reserved IPs: project_id should have omitempty in create req.
|
||||
|
||||
## [v1.84.0] - 2022-09-16
|
||||
|
||||
- #552 - @andrewsomething - reserved IPs: Expose project_id and locked attributes.
|
||||
- #549 - @rpmoore - adding the replica id to the database replica model
|
||||
|
||||
## [v1.83.0] - 2022-08-10
|
||||
|
||||
- #546 - @DWizGuy58 - Add support for database options
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.
|
||||
// $ bundle -pkg godo -prefix ./dev/dist/godo
|
||||
// Code generated automatically. DO NOT EDIT.
|
||||
|
||||
package godo
|
||||
|
||||
|
@ -77,23 +76,24 @@ type AppAlertSlackWebhook struct {
|
|||
|
||||
// App An application's configuration and status.
|
||||
type App struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
OwnerUUID string `json:"owner_uuid,omitempty"`
|
||||
Spec *AppSpec `json:"spec"`
|
||||
LastDeploymentActiveAt time.Time `json:"last_deployment_active_at,omitempty"`
|
||||
DefaultIngress string `json:"default_ingress,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
ActiveDeployment *Deployment `json:"active_deployment,omitempty"`
|
||||
InProgressDeployment *Deployment `json:"in_progress_deployment,omitempty"`
|
||||
LastDeploymentCreatedAt time.Time `json:"last_deployment_created_at,omitempty"`
|
||||
LiveURL string `json:"live_url,omitempty"`
|
||||
Region *AppRegion `json:"region,omitempty"`
|
||||
TierSlug string `json:"tier_slug,omitempty"`
|
||||
LiveURLBase string `json:"live_url_base,omitempty"`
|
||||
LiveDomain string `json:"live_domain,omitempty"`
|
||||
Domains []*AppDomain `json:"domains,omitempty"`
|
||||
PinnedDeployment *Deployment `json:"pinned_deployment,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
OwnerUUID string `json:"owner_uuid,omitempty"`
|
||||
Spec *AppSpec `json:"spec"`
|
||||
LastDeploymentActiveAt time.Time `json:"last_deployment_active_at,omitempty"`
|
||||
DefaultIngress string `json:"default_ingress,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
||||
UpdatedAt time.Time `json:"updated_at,omitempty"`
|
||||
ActiveDeployment *Deployment `json:"active_deployment,omitempty"`
|
||||
InProgressDeployment *Deployment `json:"in_progress_deployment,omitempty"`
|
||||
LastDeploymentCreatedAt time.Time `json:"last_deployment_created_at,omitempty"`
|
||||
LiveURL string `json:"live_url,omitempty"`
|
||||
Region *AppRegion `json:"region,omitempty"`
|
||||
TierSlug string `json:"tier_slug,omitempty"`
|
||||
LiveURLBase string `json:"live_url_base,omitempty"`
|
||||
LiveDomain string `json:"live_domain,omitempty"`
|
||||
Domains []*AppDomain `json:"domains,omitempty"`
|
||||
PinnedDeployment *Deployment `json:"pinned_deployment,omitempty"`
|
||||
BuildConfig *AppBuildConfig `json:"build_config,omitempty"`
|
||||
}
|
||||
|
||||
// AppAlertSpec Configuration of an alert for the app or a individual component.
|
||||
|
@ -150,6 +150,17 @@ const (
|
|||
AppAlertSpecWindow_OneHour AppAlertSpecWindow = "ONE_HOUR"
|
||||
)
|
||||
|
||||
// AppBuildConfig struct for AppBuildConfig
|
||||
type AppBuildConfig struct {
|
||||
CNBVersioning *AppBuildConfigCNBVersioning `json:"cnb_versioning,omitempty"`
|
||||
}
|
||||
|
||||
// AppBuildConfigCNBVersioning struct for AppBuildConfigCNBVersioning
|
||||
type AppBuildConfigCNBVersioning struct {
|
||||
// List of versioned buildpacks used for the application. Buildpacks are only versioned based on the major semver version, therefore exact versions will not be available at the app build config.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// AppDatabaseSpec struct for AppDatabaseSpec
|
||||
type AppDatabaseSpec struct {
|
||||
// The name. Must be unique across all components within the same app.
|
||||
|
@ -283,6 +294,7 @@ const (
|
|||
|
||||
// AppLogDestinationSpec struct for AppLogDestinationSpec
|
||||
type AppLogDestinationSpec struct {
|
||||
// Name of the log destination.
|
||||
Name string `json:"name"`
|
||||
Papertrail *AppLogDestinationSpecPapertrail `json:"papertrail,omitempty"`
|
||||
Datadog *AppLogDestinationSpecDataDog `json:"datadog,omitempty"`
|
||||
|
@ -368,15 +380,15 @@ type AppServiceSpec struct {
|
|||
type AppServiceSpecHealthCheck struct {
|
||||
// Deprecated. Use http_path instead.
|
||||
Path string `json:"path,omitempty"`
|
||||
// The number of seconds to wait before beginning health checks.
|
||||
// The number of seconds to wait before beginning health checks. Default: 0 seconds; start health checks as soon as the service starts.
|
||||
InitialDelaySeconds int32 `json:"initial_delay_seconds,omitempty"`
|
||||
// The number of seconds to wait between health checks.
|
||||
// The number of seconds to wait between health checks. Default: 10 seconds.
|
||||
PeriodSeconds int32 `json:"period_seconds,omitempty"`
|
||||
// The number of seconds after which the check times out.
|
||||
// The number of seconds after which the check times out. Default: 1 second.
|
||||
TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
|
||||
// The number of successful health checks before considered healthy.
|
||||
// The number of successful health checks before considered healthy. Default: 1.
|
||||
SuccessThreshold int32 `json:"success_threshold,omitempty"`
|
||||
// The number of failed health checks before considered unhealthy.
|
||||
// The number of failed health checks before considered unhealthy. Default: 9.
|
||||
FailureThreshold int32 `json:"failure_threshold,omitempty"`
|
||||
// The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
|
||||
HTTPPath string `json:"http_path,omitempty"`
|
||||
|
@ -479,6 +491,24 @@ type AppWorkerSpec struct {
|
|||
LogDestinations []*AppLogDestinationSpec `json:"log_destinations,omitempty"`
|
||||
}
|
||||
|
||||
// Buildpack struct for Buildpack
|
||||
type Buildpack struct {
|
||||
// The ID of the buildpack.
|
||||
ID string `json:"id,omitempty"`
|
||||
// Full semver version string.
|
||||
Version string `json:"version,omitempty"`
|
||||
// The major version line that the buildpack is pinned to. Example: a value of `1` indicates that the buildpack is pinned to versions `>=1.0.0 and <2.0.0`.
|
||||
MajorVersion int32 `json:"major_version,omitempty"`
|
||||
// Indicates whether the buildpack is on the latest major version line available.
|
||||
Latest bool `json:"latest,omitempty"`
|
||||
// A human friendly name.
|
||||
Name string `json:"name,omitempty"`
|
||||
// A description of the buildpack's purpose and steps performed at build time.
|
||||
Description []string `json:"description,omitempty"`
|
||||
// A link to the buildpack's documentation.
|
||||
DocsLink string `json:"docs_link,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentCauseDetailsDigitalOceanUser struct for DeploymentCauseDetailsDigitalOceanUser
|
||||
type DeploymentCauseDetailsDigitalOceanUser struct {
|
||||
UUID string `json:"uuid,omitempty"`
|
||||
|
@ -585,6 +615,8 @@ type DeploymentFunctions struct {
|
|||
type DeploymentJob struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
SourceCommitHash string `json:"source_commit_hash,omitempty"`
|
||||
// The list of resolved buildpacks used for a given deployment component.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentPhase the model 'DeploymentPhase'
|
||||
|
@ -649,18 +681,24 @@ const (
|
|||
type DeploymentService struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
SourceCommitHash string `json:"source_commit_hash,omitempty"`
|
||||
// The list of resolved buildpacks used for a given deployment component.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentStaticSite struct for DeploymentStaticSite
|
||||
type DeploymentStaticSite struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
SourceCommitHash string `json:"source_commit_hash,omitempty"`
|
||||
// The list of resolved buildpacks used for a given deployment component.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// DeploymentWorker struct for DeploymentWorker
|
||||
type DeploymentWorker struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
SourceCommitHash string `json:"source_commit_hash,omitempty"`
|
||||
// The list of resolved buildpacks used for a given deployment component.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// DetectRequest struct for DetectRequest
|
||||
|
@ -693,30 +731,41 @@ type DetectResponseComponent struct {
|
|||
RunCommand string `json:"run_command,omitempty"`
|
||||
EnvironmentSlug string `json:"environment_slug,omitempty"`
|
||||
// A list of HTTP ports that this component may listen on. The recommendation is to use the last port in the list.
|
||||
HTTPPorts []int64 `json:"http_ports,omitempty"`
|
||||
EnvVars []*AppVariableDefinition `json:"env_vars,omitempty"`
|
||||
HTTPPorts []int64 `json:"http_ports,omitempty"`
|
||||
EnvVars []*AppVariableDefinition `json:"env_vars,omitempty"`
|
||||
// List of serverless packages detected.
|
||||
ServerlessPackages []*DetectResponseServerlessPackage `json:"serverless_packages,omitempty"`
|
||||
SourceDir string `json:"source_dir,omitempty"`
|
||||
// The list of detected buildpacks that will be used for the component build.
|
||||
Buildpacks []*Buildpack `json:"buildpacks,omitempty"`
|
||||
}
|
||||
|
||||
// DetectResponseServerlessFunction struct for DetectResponseServerlessFunction
|
||||
type DetectResponseServerlessFunction struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Package string `json:"package,omitempty"`
|
||||
// Name of the function.
|
||||
Name string `json:"name,omitempty"`
|
||||
// Package that the function belongs to.
|
||||
Package string `json:"package,omitempty"`
|
||||
// Runtime detected for the function.
|
||||
Runtime string `json:"runtime,omitempty"`
|
||||
Limits *DetectResponseServerlessFunctionLimits `json:"limits,omitempty"`
|
||||
}
|
||||
|
||||
// DetectResponseServerlessFunctionLimits struct for DetectResponseServerlessFunctionLimits
|
||||
type DetectResponseServerlessFunctionLimits struct {
|
||||
// Timeout for function invocation in milliseconds.
|
||||
Timeout string `json:"timeout,omitempty"`
|
||||
Memory string `json:"memory,omitempty"`
|
||||
Logs string `json:"logs,omitempty"`
|
||||
// Max memory allocation for function invocation in megabytes.
|
||||
Memory string `json:"memory,omitempty"`
|
||||
// Max log size usage for function invocation in kilobytes.
|
||||
Logs string `json:"logs,omitempty"`
|
||||
}
|
||||
|
||||
// DetectResponseServerlessPackage struct for DetectResponseServerlessPackage
|
||||
type DetectResponseServerlessPackage struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
// Name of the serverless package.
|
||||
Name string `json:"name,omitempty"`
|
||||
// List of functions detected in the serverless package.
|
||||
Functions []*DetectResponseServerlessFunction `json:"functions,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -743,15 +792,19 @@ const (
|
|||
DeploymentCauseDetailsDigitalOceanUserActionName_ResetDatabasePassword DeploymentCauseDetailsDigitalOceanUserActionName = "RESET_DATABASE_PASSWORD"
|
||||
DeploymentCauseDetailsDigitalOceanUserActionName_RollbackApp DeploymentCauseDetailsDigitalOceanUserActionName = "ROLLBACK_APP"
|
||||
DeploymentCauseDetailsDigitalOceanUserActionName_RevertAppRollback DeploymentCauseDetailsDigitalOceanUserActionName = "REVERT_APP_ROLLBACK"
|
||||
DeploymentCauseDetailsDigitalOceanUserActionName_UpgradeBuildpack DeploymentCauseDetailsDigitalOceanUserActionName = "UPGRADE_BUILDPACK"
|
||||
)
|
||||
|
||||
// AppDomain struct for AppDomain
|
||||
type AppDomain struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Spec *AppDomainSpec `json:"spec,omitempty"`
|
||||
Phase AppDomainPhase `json:"phase,omitempty"`
|
||||
Progress *AppDomainProgress `json:"progress,omitempty"`
|
||||
Validation *AppDomainValidation `json:"validation,omitempty"`
|
||||
ID string `json:"id,omitempty"`
|
||||
Spec *AppDomainSpec `json:"spec,omitempty"`
|
||||
Phase AppDomainPhase `json:"phase,omitempty"`
|
||||
Progress *AppDomainProgress `json:"progress,omitempty"`
|
||||
Validation *AppDomainValidation `json:"validation,omitempty"`
|
||||
Validations []*AppDomainValidation `json:"validations,omitempty"`
|
||||
RotateValidationRecords bool `json:"rotate_validation_records,omitempty"`
|
||||
CertificateExpiresAt time.Time `json:"certificate_expires_at,omitempty"`
|
||||
}
|
||||
|
||||
// AppDomainPhase the model 'AppDomainPhase'
|
||||
|
@ -934,6 +987,25 @@ type AppTier struct {
|
|||
BuildSeconds string `json:"build_seconds,omitempty"`
|
||||
}
|
||||
|
||||
// UpgradeBuildpackRequest struct for UpgradeBuildpackRequest
|
||||
type UpgradeBuildpackRequest struct {
|
||||
// The ID of the app to upgrade buildpack versions for.
|
||||
AppID string `json:"app_id,omitempty"`
|
||||
// The ID of the buildpack to upgrade.
|
||||
BuildpackID string `json:"buildpack_id,omitempty"`
|
||||
// The Major Version to upgrade the buildpack to. If omitted, the latest available major version will be used.
|
||||
MajorVersion int32 `json:"major_version,omitempty"`
|
||||
// Whether or not to trigger a deployment for the app after upgrading the buildpack.
|
||||
TriggerDeployment bool `json:"trigger_deployment,omitempty"`
|
||||
}
|
||||
|
||||
// UpgradeBuildpackResponse struct for UpgradeBuildpackResponse
|
||||
type UpgradeBuildpackResponse struct {
|
||||
// The components that were affected by the upgrade.
|
||||
AffectedComponents []string `json:"affected_components,omitempty"`
|
||||
Deployment *Deployment `json:"deployment,omitempty"`
|
||||
}
|
||||
|
||||
// AppVariableScope the model 'AppVariableScope'
|
||||
type AppVariableScope string
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package godo
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
@ -442,3 +443,231 @@ func (s *AppsServiceOp) Detect(ctx context.Context, detect *DetectRequest) (*Det
|
|||
}
|
||||
return res, resp, nil
|
||||
}
|
||||
|
||||
// AppComponentType is an app component type.
|
||||
type AppComponentType string
|
||||
|
||||
const (
|
||||
// AppComponentTypeService is the type for a service component.
|
||||
AppComponentTypeService AppComponentType = "service"
|
||||
// AppComponentTypeWorker is the type for a worker component.
|
||||
AppComponentTypeWorker AppComponentType = "worker"
|
||||
// AppComponentTypeJob is the type for a job component.
|
||||
AppComponentTypeJob AppComponentType = "job"
|
||||
// AppComponentTypeStaticSite is the type for a static site component.
|
||||
AppComponentTypeStaticSite AppComponentType = "static_site"
|
||||
// AppComponentTypeDatabase is the type for a database component.
|
||||
AppComponentTypeDatabase AppComponentType = "database"
|
||||
// AppComponentTypeFunctions is the type for a functions component.
|
||||
AppComponentTypeFunctions AppComponentType = "functions"
|
||||
)
|
||||
|
||||
// GetType returns the Service component type.
|
||||
func (s *AppServiceSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeService
|
||||
}
|
||||
|
||||
// GetType returns the Worker component type.
|
||||
func (s *AppWorkerSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeWorker
|
||||
}
|
||||
|
||||
// GetType returns the Job component type.
|
||||
func (s *AppJobSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeJob
|
||||
}
|
||||
|
||||
// GetType returns the StaticSite component type.
|
||||
func (s *AppStaticSiteSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeStaticSite
|
||||
}
|
||||
|
||||
// GetType returns the Database component type.
|
||||
func (s *AppDatabaseSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeDatabase
|
||||
}
|
||||
|
||||
// GetType returns the Functions component type.
|
||||
func (s *AppFunctionsSpec) GetType() AppComponentType {
|
||||
return AppComponentTypeFunctions
|
||||
}
|
||||
|
||||
// AppComponentSpec represents a component's spec.
|
||||
type AppComponentSpec interface {
|
||||
GetName() string
|
||||
GetType() AppComponentType
|
||||
}
|
||||
|
||||
// AppBuildableComponentSpec is a component that is buildable from source.
|
||||
type AppBuildableComponentSpec interface {
|
||||
AppComponentSpec
|
||||
|
||||
GetGit() *GitSourceSpec
|
||||
GetGitHub() *GitHubSourceSpec
|
||||
GetGitLab() *GitLabSourceSpec
|
||||
|
||||
GetSourceDir() string
|
||||
|
||||
GetEnvs() []*AppVariableDefinition
|
||||
}
|
||||
|
||||
// AppDockerBuildableComponentSpec is a component that is buildable from source using Docker.
|
||||
type AppDockerBuildableComponentSpec interface {
|
||||
AppBuildableComponentSpec
|
||||
|
||||
GetDockerfilePath() string
|
||||
}
|
||||
|
||||
// AppCNBBuildableComponentSpec is a component that is buildable from source using cloud native buildpacks.
|
||||
type AppCNBBuildableComponentSpec interface {
|
||||
AppBuildableComponentSpec
|
||||
|
||||
GetBuildCommand() string
|
||||
}
|
||||
|
||||
// AppContainerComponentSpec is a component that runs in a cluster.
|
||||
type AppContainerComponentSpec interface {
|
||||
AppBuildableComponentSpec
|
||||
|
||||
GetImage() *ImageSourceSpec
|
||||
GetRunCommand() string
|
||||
GetInstanceSizeSlug() string
|
||||
GetInstanceCount() int64
|
||||
}
|
||||
|
||||
// AppRoutableComponentSpec is a component that defines routes.
|
||||
type AppRoutableComponentSpec interface {
|
||||
AppComponentSpec
|
||||
|
||||
GetRoutes() []*AppRouteSpec
|
||||
GetCORS() *AppCORSPolicy
|
||||
}
|
||||
|
||||
// AppSourceType is an app source type.
|
||||
type AppSourceType string
|
||||
|
||||
const (
|
||||
AppSourceTypeGitHub AppSourceType = "github"
|
||||
AppSourceTypeGitLab AppSourceType = "gitlab"
|
||||
AppSourceTypeGit AppSourceType = "git"
|
||||
AppSourceTypeImage AppSourceType = "image"
|
||||
)
|
||||
|
||||
// SourceSpec represents a source.
|
||||
type SourceSpec interface {
|
||||
GetType() AppSourceType
|
||||
}
|
||||
|
||||
// GetType returns the GitHub source type.
|
||||
func (s *GitHubSourceSpec) GetType() AppSourceType {
|
||||
return AppSourceTypeGitHub
|
||||
}
|
||||
|
||||
// GetType returns the GitLab source type.
|
||||
func (s *GitLabSourceSpec) GetType() AppSourceType {
|
||||
return AppSourceTypeGitLab
|
||||
}
|
||||
|
||||
// GetType returns the Git source type.
|
||||
func (s *GitSourceSpec) GetType() AppSourceType {
|
||||
return AppSourceTypeGit
|
||||
}
|
||||
|
||||
// GetType returns the Image source type.
|
||||
func (s *ImageSourceSpec) GetType() AppSourceType {
|
||||
return AppSourceTypeImage
|
||||
}
|
||||
|
||||
// VCSSourceSpec represents a VCS source.
|
||||
type VCSSourceSpec interface {
|
||||
SourceSpec
|
||||
GetRepo() string
|
||||
GetBranch() string
|
||||
}
|
||||
|
||||
// GetRepo allows GitSourceSpec to implement the SourceSpec interface.
|
||||
func (s *GitSourceSpec) GetRepo() string {
|
||||
return s.RepoCloneURL
|
||||
}
|
||||
|
||||
// ForEachAppComponentSpec iterates over each component spec in an app.
|
||||
func (s *AppSpec) ForEachAppComponentSpec(fn func(component AppComponentSpec) error) error {
|
||||
if s == nil {
|
||||
return nil
|
||||
}
|
||||
for _, c := range s.Services {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.Workers {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.Jobs {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.StaticSites {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.Databases {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.Functions {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ForEachAppSpecComponent loops over each component spec that matches the provided interface type.
|
||||
// The type constraint is intentionally set to `any` to allow use of arbitrary interfaces to match the desired component types.
|
||||
//
|
||||
// Examples:
|
||||
// - interface constraint
|
||||
// godo.ForEachAppSpecComponent(spec, func(component godo.AppBuildableComponentSpec) error { ... })
|
||||
// - struct type constraint
|
||||
// godo.ForEachAppSpecComponent(spec, func(component *godo.AppStaticSiteSpec) error { ... })
|
||||
func ForEachAppSpecComponent[T any](s *AppSpec, fn func(component T) error) error {
|
||||
return s.ForEachAppComponentSpec(func(component AppComponentSpec) error {
|
||||
if c, ok := component.(T); ok {
|
||||
if err := fn(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// GetAppSpecComponent returns an app spec component by type and name.
|
||||
//
|
||||
// Examples:
|
||||
// - interface constraint
|
||||
// godo.GetAppSpecComponent[godo.AppBuildableComponentSpec](spec, "component-name")
|
||||
// - struct type constraint
|
||||
// godo.GetAppSpecComponent[*godo.AppServiceSpec](spec, "component-name")
|
||||
func GetAppSpecComponent[T interface {
|
||||
GetName() string
|
||||
}](s *AppSpec, name string) (T, error) {
|
||||
var c T
|
||||
errStop := errors.New("stop")
|
||||
err := ForEachAppSpecComponent(s, func(component T) error {
|
||||
if component.GetName() == name {
|
||||
c = component
|
||||
return errStop
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err == errStop {
|
||||
return c, nil
|
||||
}
|
||||
return c, fmt.Errorf("component %s not found", name)
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -268,6 +268,7 @@ type DatabaseDB struct {
|
|||
|
||||
// DatabaseReplica represents a read-only replica of a particular database
|
||||
type DatabaseReplica struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Connection *DatabaseConnection `json:"connection"`
|
||||
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
|
||||
|
|
|
@ -28,9 +28,11 @@ var _ FloatingIPsService = &FloatingIPsServiceOp{}
|
|||
|
||||
// FloatingIP represents a Digital Ocean floating IP.
|
||||
type FloatingIP struct {
|
||||
Region *Region `json:"region"`
|
||||
Droplet *Droplet `json:"droplet"`
|
||||
IP string `json:"ip"`
|
||||
Region *Region `json:"region"`
|
||||
Droplet *Droplet `json:"droplet"`
|
||||
IP string `json:"ip"`
|
||||
ProjectID string `json:"project_id"`
|
||||
Locked bool `json:"locked"`
|
||||
}
|
||||
|
||||
func (f FloatingIP) String() string {
|
||||
|
@ -59,6 +61,7 @@ type floatingIPRoot struct {
|
|||
type FloatingIPCreateRequest struct {
|
||||
Region string `json:"region,omitempty"`
|
||||
DropletID int `json:"droplet_id,omitempty"`
|
||||
ProjectID string `json:"project_id,omitempty"`
|
||||
}
|
||||
|
||||
// List all floating IPs.
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
libraryVersion = "1.83.0"
|
||||
libraryVersion = "1.85.0"
|
||||
defaultBaseURL = "https://api.digitalocean.com/"
|
||||
userAgent = "godo/" + libraryVersion
|
||||
mediaType = "application/json"
|
||||
|
|
|
@ -29,9 +29,11 @@ var _ ReservedIPsService = &ReservedIPsServiceOp{}
|
|||
|
||||
// ReservedIP represents a Digital Ocean reserved IP.
|
||||
type ReservedIP struct {
|
||||
Region *Region `json:"region"`
|
||||
Droplet *Droplet `json:"droplet"`
|
||||
IP string `json:"ip"`
|
||||
Region *Region `json:"region"`
|
||||
Droplet *Droplet `json:"droplet"`
|
||||
IP string `json:"ip"`
|
||||
ProjectID string `json:"project_id"`
|
||||
Locked bool `json:"locked"`
|
||||
}
|
||||
|
||||
func (f ReservedIP) String() string {
|
||||
|
@ -60,6 +62,7 @@ type reservedIPRoot struct {
|
|||
type ReservedIPCreateRequest struct {
|
||||
Region string `json:"region,omitempty"`
|
||||
DropletID int `json:"droplet_id,omitempty"`
|
||||
ProjectID string `json:"project_id,omitempty"`
|
||||
}
|
||||
|
||||
// List all reserved IPs.
|
||||
|
|
|
@ -95,7 +95,7 @@ type Tag struct {
|
|||
Resources *TaggedResources `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
//TagCreateRequest represents the JSON structure of a request of that type.
|
||||
// TagCreateRequest represents the JSON structure of a request of that type.
|
||||
type TagCreateRequest struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
|
|
@ -4,5 +4,6 @@ Vault API
|
|||
This provides the `github.com/hashicorp/vault/api` package which contains code useful for interacting with a Vault server.
|
||||
|
||||
For examples of how to use this module, see the [vault-examples](https://github.com/hashicorp/vault-examples) repo.
|
||||
For a step-by-step walkthrough on using these client libraries, see the [developer quickstart](https://www.vaultproject.io/docs/get-started/developer-qs).
|
||||
|
||||
[](https://godoc.org/github.com/hashicorp/vault/api)
|
|
@ -347,8 +347,6 @@ func (c *Config) ReadEnvironment() error {
|
|||
}
|
||||
if v := os.Getenv(EnvVaultAgentAddr); v != "" {
|
||||
envAgentAddress = v
|
||||
} else if v := os.Getenv(EnvVaultAgentAddress); v != "" {
|
||||
envAgentAddress = v
|
||||
}
|
||||
if v := os.Getenv(EnvVaultMaxRetries); v != "" {
|
||||
maxRetries, err := strconv.ParseUint(v, 10, 32)
|
||||
|
@ -392,12 +390,6 @@ func (c *Config) ReadEnvironment() error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("could not parse VAULT_SKIP_VERIFY")
|
||||
}
|
||||
} else if v := os.Getenv(EnvVaultInsecure); v != "" {
|
||||
var err error
|
||||
envInsecure, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not parse VAULT_INSECURE")
|
||||
}
|
||||
}
|
||||
if v := os.Getenv(EnvVaultSRVLookup); v != "" {
|
||||
var err error
|
||||
|
@ -470,6 +462,51 @@ func (c *Config) ReadEnvironment() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// ParseAddress transforms the provided address into a url.URL and handles
|
||||
// the case of Unix domain sockets by setting the DialContext in the
|
||||
// configuration's HttpClient.Transport. This function must be called with
|
||||
// c.modifyLock held for write access.
|
||||
func (c *Config) ParseAddress(address string) (*url.URL, error) {
|
||||
u, err := url.Parse(address)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c.Address = address
|
||||
|
||||
if strings.HasPrefix(address, "unix://") {
|
||||
// When the address begins with unix://, always change the transport's
|
||||
// DialContext (to match previous behaviour)
|
||||
socket := strings.TrimPrefix(address, "unix://")
|
||||
|
||||
if transport, ok := c.HttpClient.Transport.(*http.Transport); ok {
|
||||
transport.DialContext = func(context.Context, string, string) (net.Conn, error) {
|
||||
return net.Dial("unix", socket)
|
||||
}
|
||||
|
||||
// Since the address points to a unix domain socket, the scheme in the
|
||||
// *URL would be set to `unix`. The *URL in the client is expected to
|
||||
// be pointing to the protocol used in the application layer and not to
|
||||
// the transport layer. Hence, setting the fields accordingly.
|
||||
u.Scheme = "http"
|
||||
u.Host = socket
|
||||
u.Path = ""
|
||||
} else {
|
||||
return nil, fmt.Errorf("attempting to specify unix:// address with non-transport transport")
|
||||
}
|
||||
} else if strings.HasPrefix(c.Address, "unix://") {
|
||||
// When the address being set does not begin with unix:// but the previous
|
||||
// address in the Config did, change the transport's DialContext back to
|
||||
// use the default configuration that cleanhttp uses.
|
||||
|
||||
if transport, ok := c.HttpClient.Transport.(*http.Transport); ok {
|
||||
transport.DialContext = cleanhttp.DefaultPooledTransport().DialContext
|
||||
}
|
||||
}
|
||||
|
||||
return u, nil
|
||||
}
|
||||
|
||||
func parseRateLimit(val string) (rate float64, burst int, err error) {
|
||||
_, err = fmt.Sscanf(val, "%f:%d", &rate, &burst)
|
||||
if err != nil {
|
||||
|
@ -542,27 +579,11 @@ func NewClient(c *Config) (*Client, error) {
|
|||
address = c.AgentAddress
|
||||
}
|
||||
|
||||
u, err := url.Parse(address)
|
||||
u, err := c.ParseAddress(address)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if strings.HasPrefix(address, "unix://") {
|
||||
socket := strings.TrimPrefix(address, "unix://")
|
||||
transport := c.HttpClient.Transport.(*http.Transport)
|
||||
transport.DialContext = func(context.Context, string, string) (net.Conn, error) {
|
||||
return net.Dial("unix", socket)
|
||||
}
|
||||
|
||||
// Since the address points to a unix domain socket, the scheme in the
|
||||
// *URL would be set to `unix`. The *URL in the client is expected to
|
||||
// be pointing to the protocol used in the application layer and not to
|
||||
// the transport layer. Hence, setting the fields accordingly.
|
||||
u.Scheme = "http"
|
||||
u.Host = socket
|
||||
u.Path = ""
|
||||
}
|
||||
|
||||
client := &Client{
|
||||
addr: u,
|
||||
config: c,
|
||||
|
@ -621,14 +642,11 @@ func (c *Client) SetAddress(addr string) error {
|
|||
c.modifyLock.Lock()
|
||||
defer c.modifyLock.Unlock()
|
||||
|
||||
parsedAddr, err := url.Parse(addr)
|
||||
parsedAddr, err := c.config.ParseAddress(addr)
|
||||
if err != nil {
|
||||
return errwrap.Wrapf("failed to set address: {{err}}", err)
|
||||
}
|
||||
|
||||
c.config.modifyLock.Lock()
|
||||
c.config.Address = addr
|
||||
c.config.modifyLock.Unlock()
|
||||
c.addr = parsedAddr
|
||||
return nil
|
||||
}
|
||||
|
@ -720,6 +738,42 @@ func (c *Client) SetMaxRetries(retries int) {
|
|||
c.config.MaxRetries = retries
|
||||
}
|
||||
|
||||
func (c *Client) SetMaxIdleConnections(idle int) {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.Lock()
|
||||
defer c.config.modifyLock.Unlock()
|
||||
|
||||
c.config.HttpClient.Transport.(*http.Transport).MaxIdleConns = idle
|
||||
}
|
||||
|
||||
func (c *Client) MaxIdleConnections() int {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.Lock()
|
||||
defer c.config.modifyLock.Unlock()
|
||||
|
||||
return c.config.HttpClient.Transport.(*http.Transport).MaxIdleConns
|
||||
}
|
||||
|
||||
func (c *Client) SetDisableKeepAlives(disable bool) {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.Lock()
|
||||
defer c.config.modifyLock.Unlock()
|
||||
|
||||
c.config.HttpClient.Transport.(*http.Transport).DisableKeepAlives = disable
|
||||
}
|
||||
|
||||
func (c *Client) DisableKeepAlives() bool {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.RLock()
|
||||
defer c.config.modifyLock.RUnlock()
|
||||
|
||||
return c.config.HttpClient.Transport.(*http.Transport).DisableKeepAlives
|
||||
}
|
||||
|
||||
func (c *Client) MaxRetries() int {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package api
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrSecretNotFound is returned by KVv1 and KVv2 wrappers to indicate that the
|
||||
// secret is missing at the given location.
|
||||
var ErrSecretNotFound = errors.New("secret not found")
|
||||
|
||||
// A KVSecret is a key-value secret returned by Vault's KV secrets engine,
|
||||
// and is the most basic type of secret stored in Vault.
|
||||
//
|
||||
|
|
|
@ -19,7 +19,7 @@ func (kv *KVv1) Get(ctx context.Context, secretPath string) (*KVSecret, error) {
|
|||
return nil, fmt.Errorf("error encountered while reading secret at %s: %w", pathToRead, err)
|
||||
}
|
||||
if secret == nil {
|
||||
return nil, fmt.Errorf("no secret found at %s", pathToRead)
|
||||
return nil, fmt.Errorf("%w: at %s", ErrSecretNotFound, pathToRead)
|
||||
}
|
||||
|
||||
return &KVSecret{
|
||||
|
|
|
@ -2,7 +2,9 @@ package api
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"time"
|
||||
|
@ -115,7 +117,7 @@ func (kv *KVv2) Get(ctx context.Context, secretPath string) (*KVSecret, error) {
|
|||
return nil, fmt.Errorf("error encountered while reading secret at %s: %w", pathToRead, err)
|
||||
}
|
||||
if secret == nil {
|
||||
return nil, fmt.Errorf("no secret found at %s", pathToRead)
|
||||
return nil, fmt.Errorf("%w: at %s", ErrSecretNotFound, pathToRead)
|
||||
}
|
||||
|
||||
kvSecret, err := extractDataAndVersionMetadata(secret)
|
||||
|
@ -149,7 +151,7 @@ func (kv *KVv2) GetVersion(ctx context.Context, secretPath string, version int)
|
|||
return nil, err
|
||||
}
|
||||
if secret == nil {
|
||||
return nil, fmt.Errorf("no secret with version %d found at %s", version, pathToRead)
|
||||
return nil, fmt.Errorf("%w: for version %d at %s", ErrSecretNotFound, version, pathToRead)
|
||||
}
|
||||
|
||||
kvSecret, err := extractDataAndVersionMetadata(secret)
|
||||
|
@ -175,7 +177,7 @@ func (kv *KVv2) GetVersionsAsList(ctx context.Context, secretPath string) ([]KVV
|
|||
return nil, err
|
||||
}
|
||||
if secret == nil || secret.Data == nil {
|
||||
return nil, fmt.Errorf("no secret metadata found at %s", pathToRead)
|
||||
return nil, fmt.Errorf("%w: no metadata at %s", ErrSecretNotFound, pathToRead)
|
||||
}
|
||||
|
||||
md, err := extractFullMetadata(secret)
|
||||
|
@ -202,7 +204,7 @@ func (kv *KVv2) GetMetadata(ctx context.Context, secretPath string) (*KVMetadata
|
|||
return nil, err
|
||||
}
|
||||
if secret == nil || secret.Data == nil {
|
||||
return nil, fmt.Errorf("no secret metadata found at %s", pathToRead)
|
||||
return nil, fmt.Errorf("%w: no metadata at %s", ErrSecretNotFound, pathToRead)
|
||||
}
|
||||
|
||||
md, err := extractFullMetadata(secret)
|
||||
|
@ -244,7 +246,7 @@ func (kv *KVv2) Put(ctx context.Context, secretPath string, data map[string]inte
|
|||
return nil, fmt.Errorf("error writing secret to %s: %w", pathToWriteTo, err)
|
||||
}
|
||||
if secret == nil {
|
||||
return nil, fmt.Errorf("no secret was written to %s", pathToWriteTo)
|
||||
return nil, fmt.Errorf("%w: after writing to %s", ErrSecretNotFound, pathToWriteTo)
|
||||
}
|
||||
|
||||
metadata, err := extractVersionMetadata(secret)
|
||||
|
@ -325,19 +327,19 @@ func (kv *KVv2) Patch(ctx context.Context, secretPath string, newData map[string
|
|||
// Determine which kind of patch to use,
|
||||
// the newer HTTP Patch style or the older read-then-write style
|
||||
var kvs *KVSecret
|
||||
var perr error
|
||||
var err error
|
||||
switch patchMethod {
|
||||
case "rw":
|
||||
kvs, perr = readThenWrite(ctx, kv.c, kv.mountPath, secretPath, newData)
|
||||
kvs, err = readThenWrite(ctx, kv.c, kv.mountPath, secretPath, newData)
|
||||
case "patch":
|
||||
kvs, perr = mergePatch(ctx, kv.c, kv.mountPath, secretPath, newData, opts...)
|
||||
kvs, err = mergePatch(ctx, kv.c, kv.mountPath, secretPath, newData, opts...)
|
||||
case "":
|
||||
kvs, perr = mergePatch(ctx, kv.c, kv.mountPath, secretPath, newData, opts...)
|
||||
kvs, err = mergePatch(ctx, kv.c, kv.mountPath, secretPath, newData, opts...)
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported patch method provided; value for patch method should be string \"rw\" or \"patch\"")
|
||||
}
|
||||
if perr != nil {
|
||||
return nil, fmt.Errorf("unable to perform patch: %w", perr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to perform patch: %w", err)
|
||||
}
|
||||
if kvs == nil {
|
||||
return nil, fmt.Errorf("no secret was written to %s", secretPath)
|
||||
|
@ -478,7 +480,7 @@ func (kv *KVv2) Rollback(ctx context.Context, secretPath string, toVersion int)
|
|||
// Now run it again and read the version we want to roll back to
|
||||
rollbackVersion, err := kv.GetVersion(ctx, secretPath, toVersion)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to get previous version %d of secret: %s", toVersion, err)
|
||||
return nil, fmt.Errorf("unable to get previous version %d of secret: %w", toVersion, err)
|
||||
}
|
||||
|
||||
err = validateRollbackVersion(rollbackVersion)
|
||||
|
@ -687,18 +689,28 @@ func mergePatch(ctx context.Context, client *Client, mountPath string, secretPat
|
|||
|
||||
secret, err := client.Logical().JSONMergePatch(ctx, pathToMergePatch, wrappedData)
|
||||
if err != nil {
|
||||
// If it's a 405, that probably means the server is running a pre-1.9
|
||||
// Vault version that doesn't support the HTTP PATCH method.
|
||||
// Fall back to the old way of doing it.
|
||||
if re, ok := err.(*ResponseError); ok && re.StatusCode == 405 {
|
||||
return readThenWrite(ctx, client, mountPath, secretPath, newData)
|
||||
var re *ResponseError
|
||||
|
||||
if errors.As(err, &re) {
|
||||
switch re.StatusCode {
|
||||
// 403
|
||||
case http.StatusForbidden:
|
||||
return nil, fmt.Errorf("received 403 from Vault server; please ensure that token's policy has \"patch\" capability: %w", err)
|
||||
|
||||
// 404
|
||||
case http.StatusNotFound:
|
||||
return nil, fmt.Errorf("%w: performing merge patch to %s", ErrSecretNotFound, pathToMergePatch)
|
||||
|
||||
// 405
|
||||
case http.StatusMethodNotAllowed:
|
||||
// If it's a 405, that probably means the server is running a pre-1.9
|
||||
// Vault version that doesn't support the HTTP PATCH method.
|
||||
// Fall back to the old way of doing it.
|
||||
return readThenWrite(ctx, client, mountPath, secretPath, newData)
|
||||
}
|
||||
}
|
||||
|
||||
if re, ok := err.(*ResponseError); ok && re.StatusCode == 403 {
|
||||
return nil, fmt.Errorf("received 403 from Vault server; please ensure that token's policy has \"patch\" capability: %w", err)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("error performing merge patch to %s: %s", pathToMergePatch, err)
|
||||
return nil, fmt.Errorf("error performing merge patch to %s: %w", pathToMergePatch, err)
|
||||
}
|
||||
|
||||
metadata, err := extractVersionMetadata(secret)
|
||||
|
@ -730,7 +742,7 @@ func readThenWrite(ctx context.Context, client *Client, mountPath string, secret
|
|||
|
||||
// Make sure the secret already exists
|
||||
if existingVersion == nil || existingVersion.Data == nil {
|
||||
return nil, fmt.Errorf("no existing secret was found at %s when doing read-then-write patch operation: %w", secretPath, err)
|
||||
return nil, fmt.Errorf("%w: at %s as part of read-then-write patch operation", ErrSecretNotFound, secretPath)
|
||||
}
|
||||
|
||||
// Verify existing secret has metadata
|
||||
|
|
|
@ -50,25 +50,24 @@ const (
|
|||
|
||||
// LifetimeWatcher is a process for watching lifetime of a secret.
|
||||
//
|
||||
// watcher, err := client.NewLifetimeWatcher(&LifetimeWatcherInput{
|
||||
// Secret: mySecret,
|
||||
// })
|
||||
// go watcher.Start()
|
||||
// defer watcher.Stop()
|
||||
// watcher, err := client.NewLifetimeWatcher(&LifetimeWatcherInput{
|
||||
// Secret: mySecret,
|
||||
// })
|
||||
// go watcher.Start()
|
||||
// defer watcher.Stop()
|
||||
//
|
||||
// for {
|
||||
// select {
|
||||
// case err := <-watcher.DoneCh():
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
//
|
||||
// // Renewal is now over
|
||||
// case renewal := <-watcher.RenewCh():
|
||||
// log.Printf("Successfully renewed: %#v", renewal)
|
||||
// }
|
||||
// }
|
||||
// for {
|
||||
// select {
|
||||
// case err := <-watcher.DoneCh():
|
||||
// if err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
//
|
||||
// // Renewal is now over
|
||||
// case renewal := <-watcher.RenewCh():
|
||||
// log.Printf("Successfully renewed: %#v", renewal)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// `DoneCh` will return if renewal fails, or if the remaining lease duration is
|
||||
// under a built-in threshold and either renewing is not extending it or
|
||||
|
@ -251,7 +250,8 @@ func (r *LifetimeWatcher) doRenew() error {
|
|||
}
|
||||
|
||||
func (r *LifetimeWatcher) doRenewWithOptions(tokenMode bool, nonRenewable bool, initLeaseDuration int, credString string,
|
||||
renew renewFunc, initialRetryInterval time.Duration) error {
|
||||
renew renewFunc, initialRetryInterval time.Duration,
|
||||
) error {
|
||||
if credString == "" ||
|
||||
(nonRenewable && r.renewBehavior == RenewBehaviorErrorOnErrors) {
|
||||
return r.errLifetimeWatcherNotRenewable
|
||||
|
|
|
@ -60,19 +60,19 @@ func (d *OutputStringError) buildCurlString() (string, error) {
|
|||
finalCurlString = fmt.Sprintf("%s-X %s ", finalCurlString, d.Request.Method)
|
||||
}
|
||||
if d.ClientCACert != "" {
|
||||
clientCACert := strings.Replace(d.ClientCACert, "'", "'\"'\"'", -1)
|
||||
clientCACert := strings.ReplaceAll(d.ClientCACert, "'", "'\"'\"'")
|
||||
finalCurlString = fmt.Sprintf("%s--cacert '%s' ", finalCurlString, clientCACert)
|
||||
}
|
||||
if d.ClientCAPath != "" {
|
||||
clientCAPath := strings.Replace(d.ClientCAPath, "'", "'\"'\"'", -1)
|
||||
clientCAPath := strings.ReplaceAll(d.ClientCAPath, "'", "'\"'\"'")
|
||||
finalCurlString = fmt.Sprintf("%s--capath '%s' ", finalCurlString, clientCAPath)
|
||||
}
|
||||
if d.ClientCert != "" {
|
||||
clientCert := strings.Replace(d.ClientCert, "'", "'\"'\"'", -1)
|
||||
clientCert := strings.ReplaceAll(d.ClientCert, "'", "'\"'\"'")
|
||||
finalCurlString = fmt.Sprintf("%s--cert '%s' ", finalCurlString, clientCert)
|
||||
}
|
||||
if d.ClientKey != "" {
|
||||
clientKey := strings.Replace(d.ClientKey, "'", "'\"'\"'", -1)
|
||||
clientKey := strings.ReplaceAll(d.ClientKey, "'", "'\"'\"'")
|
||||
finalCurlString = fmt.Sprintf("%s--key '%s' ", finalCurlString, clientKey)
|
||||
}
|
||||
for k, v := range d.Request.Header {
|
||||
|
@ -87,7 +87,7 @@ func (d *OutputStringError) buildCurlString() (string, error) {
|
|||
if len(body) > 0 {
|
||||
// We need to escape single quotes since that's what we're using to
|
||||
// quote the body
|
||||
escapedBody := strings.Replace(string(body), "'", "'\"'\"'", -1)
|
||||
escapedBody := strings.ReplaceAll(string(body), "'", "'\"'\"'")
|
||||
finalCurlString = fmt.Sprintf("%s-d '%s' ", finalCurlString, escapedBody)
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,11 @@ import (
|
|||
"github.com/hashicorp/errwrap"
|
||||
)
|
||||
|
||||
var (
|
||||
const (
|
||||
// PluginAutoMTLSEnv is used to ensure AutoMTLS is used. This will override
|
||||
// setting a TLSProviderFunc for a plugin.
|
||||
PluginAutoMTLSEnv = "VAULT_PLUGIN_AUTOMTLS_ENABLED"
|
||||
|
||||
// PluginMetadataModeEnv is an ENV name used to disable TLS communication
|
||||
// to bootstrap mounting plugins.
|
||||
PluginMetadataModeEnv = "VAULT_PLUGIN_METADATA_MODE"
|
||||
|
@ -24,51 +28,51 @@ var (
|
|||
// PluginUnwrapTokenEnv is the ENV name used to pass unwrap tokens to the
|
||||
// plugin.
|
||||
PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN"
|
||||
|
||||
// sudoPaths is a map containing the paths that require a token's policy
|
||||
// to have the "sudo" capability. The keys are the paths as strings, in
|
||||
// the same format as they are returned by the OpenAPI spec. The values
|
||||
// are the regular expressions that can be used to test whether a given
|
||||
// path matches that path or not (useful specifically for the paths that
|
||||
// contain templated fields.)
|
||||
sudoPaths = map[string]*regexp.Regexp{
|
||||
"/auth/token/accessors/": regexp.MustCompile(`^/auth/token/accessors/$`),
|
||||
"/pki/root": regexp.MustCompile(`^/pki/root$`),
|
||||
"/pki/root/sign-self-issued": regexp.MustCompile(`^/pki/root/sign-self-issued$`),
|
||||
"/sys/audit": regexp.MustCompile(`^/sys/audit$`),
|
||||
"/sys/audit/{path}": regexp.MustCompile(`^/sys/audit/.+$`),
|
||||
"/sys/auth/{path}": regexp.MustCompile(`^/sys/auth/.+$`),
|
||||
"/sys/auth/{path}/tune": regexp.MustCompile(`^/sys/auth/.+/tune$`),
|
||||
"/sys/config/auditing/request-headers": regexp.MustCompile(`^/sys/config/auditing/request-headers$`),
|
||||
"/sys/config/auditing/request-headers/{header}": regexp.MustCompile(`^/sys/config/auditing/request-headers/.+$`),
|
||||
"/sys/config/cors": regexp.MustCompile(`^/sys/config/cors$`),
|
||||
"/sys/config/ui/headers/": regexp.MustCompile(`^/sys/config/ui/headers/$`),
|
||||
"/sys/config/ui/headers/{header}": regexp.MustCompile(`^/sys/config/ui/headers/.+$`),
|
||||
"/sys/leases": regexp.MustCompile(`^/sys/leases$`),
|
||||
"/sys/leases/lookup/": regexp.MustCompile(`^/sys/leases/lookup/$`),
|
||||
"/sys/leases/lookup/{prefix}": regexp.MustCompile(`^/sys/leases/lookup/.+$`),
|
||||
"/sys/leases/revoke-force/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-force/.+$`),
|
||||
"/sys/leases/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-prefix/.+$`),
|
||||
"/sys/plugins/catalog/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[^/]+$`),
|
||||
"/sys/plugins/catalog/{type}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+$`),
|
||||
"/sys/plugins/catalog/{type}/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+/[^/]+$`),
|
||||
"/sys/raw": regexp.MustCompile(`^/sys/raw$`),
|
||||
"/sys/raw/{path}": regexp.MustCompile(`^/sys/raw/.+$`),
|
||||
"/sys/remount": regexp.MustCompile(`^/sys/remount$`),
|
||||
"/sys/revoke-force/{prefix}": regexp.MustCompile(`^/sys/revoke-force/.+$`),
|
||||
"/sys/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/revoke-prefix/.+$`),
|
||||
"/sys/rotate": regexp.MustCompile(`^/sys/rotate$`),
|
||||
|
||||
// enterprise-only paths
|
||||
"/sys/replication/dr/primary/secondary-token": regexp.MustCompile(`^/sys/replication/dr/primary/secondary-token$`),
|
||||
"/sys/replication/performance/primary/secondary-token": regexp.MustCompile(`^/sys/replication/performance/primary/secondary-token$`),
|
||||
"/sys/replication/primary/secondary-token": regexp.MustCompile(`^/sys/replication/primary/secondary-token$`),
|
||||
"/sys/replication/reindex": regexp.MustCompile(`^/sys/replication/reindex$`),
|
||||
"/sys/storage/raft/snapshot-auto/config/": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/$`),
|
||||
"/sys/storage/raft/snapshot-auto/config/{name}": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/[^/]+$`),
|
||||
}
|
||||
)
|
||||
|
||||
// sudoPaths is a map containing the paths that require a token's policy
|
||||
// to have the "sudo" capability. The keys are the paths as strings, in
|
||||
// the same format as they are returned by the OpenAPI spec. The values
|
||||
// are the regular expressions that can be used to test whether a given
|
||||
// path matches that path or not (useful specifically for the paths that
|
||||
// contain templated fields.)
|
||||
var sudoPaths = map[string]*regexp.Regexp{
|
||||
"/auth/token/accessors/": regexp.MustCompile(`^/auth/token/accessors/$`),
|
||||
"/pki/root": regexp.MustCompile(`^/pki/root$`),
|
||||
"/pki/root/sign-self-issued": regexp.MustCompile(`^/pki/root/sign-self-issued$`),
|
||||
"/sys/audit": regexp.MustCompile(`^/sys/audit$`),
|
||||
"/sys/audit/{path}": regexp.MustCompile(`^/sys/audit/.+$`),
|
||||
"/sys/auth/{path}": regexp.MustCompile(`^/sys/auth/.+$`),
|
||||
"/sys/auth/{path}/tune": regexp.MustCompile(`^/sys/auth/.+/tune$`),
|
||||
"/sys/config/auditing/request-headers": regexp.MustCompile(`^/sys/config/auditing/request-headers$`),
|
||||
"/sys/config/auditing/request-headers/{header}": regexp.MustCompile(`^/sys/config/auditing/request-headers/.+$`),
|
||||
"/sys/config/cors": regexp.MustCompile(`^/sys/config/cors$`),
|
||||
"/sys/config/ui/headers/": regexp.MustCompile(`^/sys/config/ui/headers/$`),
|
||||
"/sys/config/ui/headers/{header}": regexp.MustCompile(`^/sys/config/ui/headers/.+$`),
|
||||
"/sys/leases": regexp.MustCompile(`^/sys/leases$`),
|
||||
"/sys/leases/lookup/": regexp.MustCompile(`^/sys/leases/lookup/$`),
|
||||
"/sys/leases/lookup/{prefix}": regexp.MustCompile(`^/sys/leases/lookup/.+$`),
|
||||
"/sys/leases/revoke-force/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-force/.+$`),
|
||||
"/sys/leases/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-prefix/.+$`),
|
||||
"/sys/plugins/catalog/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[^/]+$`),
|
||||
"/sys/plugins/catalog/{type}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+$`),
|
||||
"/sys/plugins/catalog/{type}/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+/[^/]+$`),
|
||||
"/sys/raw": regexp.MustCompile(`^/sys/raw$`),
|
||||
"/sys/raw/{path}": regexp.MustCompile(`^/sys/raw/.+$`),
|
||||
"/sys/remount": regexp.MustCompile(`^/sys/remount$`),
|
||||
"/sys/revoke-force/{prefix}": regexp.MustCompile(`^/sys/revoke-force/.+$`),
|
||||
"/sys/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/revoke-prefix/.+$`),
|
||||
"/sys/rotate": regexp.MustCompile(`^/sys/rotate$`),
|
||||
|
||||
// enterprise-only paths
|
||||
"/sys/replication/dr/primary/secondary-token": regexp.MustCompile(`^/sys/replication/dr/primary/secondary-token$`),
|
||||
"/sys/replication/performance/primary/secondary-token": regexp.MustCompile(`^/sys/replication/performance/primary/secondary-token$`),
|
||||
"/sys/replication/primary/secondary-token": regexp.MustCompile(`^/sys/replication/primary/secondary-token$`),
|
||||
"/sys/replication/reindex": regexp.MustCompile(`^/sys/replication/reindex$`),
|
||||
"/sys/storage/raft/snapshot-auto/config/": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/$`),
|
||||
"/sys/storage/raft/snapshot-auto/config/{name}": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/[^/]+$`),
|
||||
}
|
||||
|
||||
// PluginAPIClientMeta is a helper that plugins can use to configure TLS connections
|
||||
// back to Vault.
|
||||
type PluginAPIClientMeta struct {
|
||||
|
@ -120,7 +124,7 @@ func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error)
|
|||
// VaultPluginTLSProviderContext is run inside a plugin and retrieves the response
|
||||
// wrapped TLS certificate from vault. It returns a configured TLS Config.
|
||||
func VaultPluginTLSProviderContext(ctx context.Context, apiTLSConfig *TLSConfig) func() (*tls.Config, error) {
|
||||
if os.Getenv(PluginMetadataModeEnv) == "true" {
|
||||
if os.Getenv(PluginAutoMTLSEnv) == "true" || os.Getenv(PluginMetadataModeEnv) == "true" {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -85,11 +85,10 @@ func (c *SSHHelperConfig) SetTLSParameters(clientConfig *Config, certPool *x509.
|
|||
}
|
||||
|
||||
// Returns true if any of the following conditions are true:
|
||||
// * CA cert is configured
|
||||
// * CA path is configured
|
||||
// * configured to skip certificate verification
|
||||
// * TLS server name is configured
|
||||
//
|
||||
// - CA cert is configured
|
||||
// - CA path is configured
|
||||
// - configured to skip certificate verification
|
||||
// - TLS server name is configured
|
||||
func (c *SSHHelperConfig) shouldSetTLSParameters() bool {
|
||||
return c.CACert != "" || c.CAPath != "" || c.TLSServerName != "" || c.TLSSkipVerify
|
||||
}
|
||||
|
|
|
@ -87,7 +87,8 @@ func (c *Sys) ListAuditWithContext(ctx context.Context) (map[string]*Audit, erro
|
|||
|
||||
// DEPRECATED: Use EnableAuditWithOptions instead
|
||||
func (c *Sys) EnableAudit(
|
||||
path string, auditType string, desc string, opts map[string]string) error {
|
||||
path string, auditType string, desc string, opts map[string]string,
|
||||
) error {
|
||||
return c.EnableAuditWithOptions(path, &EnableAuditOptions{
|
||||
Type: auditType,
|
||||
Description: desc,
|
||||
|
|
|
@ -247,6 +247,7 @@ type MountInput struct {
|
|||
SealWrap bool `json:"seal_wrap" mapstructure:"seal_wrap"`
|
||||
ExternalEntropyAccess bool `json:"external_entropy_access" mapstructure:"external_entropy_access"`
|
||||
Options map[string]string `json:"options"`
|
||||
PluginVersion string `json:"plugin_version,omitempty"`
|
||||
|
||||
// Deprecated: Newer server responses should be returning this information in the
|
||||
// Type field (json: "type") instead.
|
||||
|
@ -281,6 +282,10 @@ type MountOutput struct {
|
|||
Local bool `json:"local"`
|
||||
SealWrap bool `json:"seal_wrap" mapstructure:"seal_wrap"`
|
||||
ExternalEntropyAccess bool `json:"external_entropy_access" mapstructure:"external_entropy_access"`
|
||||
PluginVersion string `json:"plugin_version" mapstructure:"plugin_version"`
|
||||
RunningVersion string `json:"running_plugin_version" mapstructure:"running_plugin_version"`
|
||||
RunningSha256 string `json:"running_sha256" mapstructure:"running_sha256"`
|
||||
DeprecationStatus string `json:"deprecation_status" mapstructure:"deprecation_status"`
|
||||
}
|
||||
|
||||
type MountConfigOutput struct {
|
||||
|
|
|
@ -22,6 +22,8 @@ type ListPluginsResponse struct {
|
|||
// PluginsByType is the list of plugins by type.
|
||||
PluginsByType map[consts.PluginType][]string `json:"types"`
|
||||
|
||||
Details []PluginDetails `json:"details,omitempty"`
|
||||
|
||||
// Names is the list of names of the plugins.
|
||||
//
|
||||
// Deprecated: Newer server responses should be returning PluginsByType (json:
|
||||
|
@ -29,6 +31,14 @@ type ListPluginsResponse struct {
|
|||
Names []string `json:"names"`
|
||||
}
|
||||
|
||||
type PluginDetails struct {
|
||||
Type string `json:"string"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
DeprecationStatus string `json:"deprecation_status,omitempty" mapstructure:"deprecation_status"`
|
||||
}
|
||||
|
||||
// ListPlugins wraps ListPluginsWithContext using context.Background.
|
||||
func (c *Sys) ListPlugins(i *ListPluginsInput) (*ListPluginsResponse, error) {
|
||||
return c.ListPluginsWithContext(context.Background(), i)
|
||||
|
@ -98,6 +108,7 @@ func (c *Sys) ListPluginsWithContext(ctx context.Context, i *ListPluginsInput) (
|
|||
|
||||
result := &ListPluginsResponse{
|
||||
PluginsByType: make(map[consts.PluginType][]string),
|
||||
Details: []PluginDetails{},
|
||||
}
|
||||
if i.Type == consts.PluginTypeUnknown {
|
||||
for _, pluginType := range consts.PluginTypes {
|
||||
|
@ -129,6 +140,12 @@ func (c *Sys) ListPluginsWithContext(ctx context.Context, i *ListPluginsInput) (
|
|||
result.PluginsByType[i.Type] = respKeys
|
||||
}
|
||||
|
||||
if detailed, ok := secret.Data["detailed"]; ok {
|
||||
if err := mapstructure.Decode(detailed, &result.Details); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
@ -142,11 +159,12 @@ type GetPluginInput struct {
|
|||
|
||||
// GetPluginResponse is the response from the GetPlugin call.
|
||||
type GetPluginResponse struct {
|
||||
Args []string `json:"args"`
|
||||
Builtin bool `json:"builtin"`
|
||||
Command string `json:"command"`
|
||||
Name string `json:"name"`
|
||||
SHA256 string `json:"sha256"`
|
||||
Args []string `json:"args"`
|
||||
Builtin bool `json:"builtin"`
|
||||
Command string `json:"command"`
|
||||
Name string `json:"name"`
|
||||
SHA256 string `json:"sha256"`
|
||||
DeprecationStatus string `json:"deprecation_status,omitempty"`
|
||||
}
|
||||
|
||||
// GetPlugin wraps GetPluginWithContext using context.Background.
|
||||
|
@ -194,6 +212,9 @@ type RegisterPluginInput struct {
|
|||
|
||||
// SHA256 is the shasum of the plugin.
|
||||
SHA256 string `json:"sha256,omitempty"`
|
||||
|
||||
// Version is the optional version of the plugin being registered
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// RegisterPlugin wraps RegisterPluginWithContext using context.Background.
|
||||
|
@ -227,6 +248,9 @@ type DeregisterPluginInput struct {
|
|||
|
||||
// Type of the plugin. Required.
|
||||
Type consts.PluginType `json:"type"`
|
||||
|
||||
// Version of the plugin. Optional.
|
||||
Version string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// DeregisterPlugin wraps DeregisterPluginWithContext using context.Background.
|
||||
|
@ -242,7 +266,7 @@ func (c *Sys) DeregisterPluginWithContext(ctx context.Context, i *DeregisterPlug
|
|||
|
||||
path := catalogPathByType(i.Type, i.Name)
|
||||
req := c.c.NewRequest(http.MethodDelete, path)
|
||||
|
||||
req.Params.Set("version", i.Version)
|
||||
resp, err := c.c.rawRequestWithContext(ctx, req)
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
|
|
|
@ -93,20 +93,22 @@ func sealStatusRequestWithContext(ctx context.Context, c *Sys, r *Request) (*Sea
|
|||
}
|
||||
|
||||
type SealStatusResponse struct {
|
||||
Type string `json:"type"`
|
||||
Initialized bool `json:"initialized"`
|
||||
Sealed bool `json:"sealed"`
|
||||
T int `json:"t"`
|
||||
N int `json:"n"`
|
||||
Progress int `json:"progress"`
|
||||
Nonce string `json:"nonce"`
|
||||
Version string `json:"version"`
|
||||
BuildDate string `json:"build_date"`
|
||||
Migration bool `json:"migration"`
|
||||
ClusterName string `json:"cluster_name,omitempty"`
|
||||
ClusterID string `json:"cluster_id,omitempty"`
|
||||
RecoverySeal bool `json:"recovery_seal"`
|
||||
StorageType string `json:"storage_type,omitempty"`
|
||||
Type string `json:"type"`
|
||||
Initialized bool `json:"initialized"`
|
||||
Sealed bool `json:"sealed"`
|
||||
T int `json:"t"`
|
||||
N int `json:"n"`
|
||||
Progress int `json:"progress"`
|
||||
Nonce string `json:"nonce"`
|
||||
Version string `json:"version"`
|
||||
BuildDate string `json:"build_date"`
|
||||
Migration bool `json:"migration"`
|
||||
ClusterName string `json:"cluster_name,omitempty"`
|
||||
ClusterID string `json:"cluster_id,omitempty"`
|
||||
RecoverySeal bool `json:"recovery_seal"`
|
||||
StorageType string `json:"storage_type,omitempty"`
|
||||
HCPLinkStatus string `json:"hcp_link_status,omitempty"`
|
||||
HCPLinkResourceID string `json:"hcp_link_resource_ID,omitempty"`
|
||||
}
|
||||
|
||||
type UnsealOpts struct {
|
||||
|
|
|
@ -49,6 +49,26 @@ var expectedNISTPCurveHashBits = map[int]int{
|
|||
521: 512,
|
||||
}
|
||||
|
||||
// Mapping of constant names<->constant values for SignatureAlgorithm
|
||||
var SignatureAlgorithmNames = map[string]x509.SignatureAlgorithm{
|
||||
"sha256withrsa": x509.SHA256WithRSA,
|
||||
"sha384withrsa": x509.SHA384WithRSA,
|
||||
"sha512withrsa": x509.SHA512WithRSA,
|
||||
"ecdsawithsha256": x509.ECDSAWithSHA256,
|
||||
"ecdsawithsha384": x509.ECDSAWithSHA384,
|
||||
"ecdsawithsha512": x509.ECDSAWithSHA512,
|
||||
"sha256withrsapss": x509.SHA256WithRSAPSS,
|
||||
"sha384withrsapss": x509.SHA384WithRSAPSS,
|
||||
"sha512withrsapss": x509.SHA512WithRSAPSS,
|
||||
"pureed25519": x509.PureEd25519,
|
||||
"ed25519": x509.PureEd25519, // Duplicated for clarity; most won't expect the "Pure" prefix.
|
||||
}
|
||||
|
||||
// OID for RFC 5280 Delta CRL Indicator CRL extension.
|
||||
//
|
||||
// > id-ce-deltaCRLIndicator OBJECT IDENTIFIER ::= { id-ce 27 }
|
||||
var DeltaCRLIndicatorOID = asn1.ObjectIdentifier([]int{2, 5, 29, 27})
|
||||
|
||||
// GetHexFormatted returns the byte buffer formatted in hex with
|
||||
// the specified separator between bytes.
|
||||
func GetHexFormatted(buf []byte, sep string) string {
|
||||
|
@ -87,6 +107,16 @@ func GetSubjKeyID(privateKey crypto.Signer) ([]byte, error) {
|
|||
return getSubjectKeyID(privateKey.Public())
|
||||
}
|
||||
|
||||
// Returns the explicit SKID when used for cross-signing, else computes a new
|
||||
// SKID from the key itself.
|
||||
func getSubjectKeyIDFromBundle(data *CreationBundle) ([]byte, error) {
|
||||
if len(data.Params.SKID) > 0 {
|
||||
return data.Params.SKID, nil
|
||||
}
|
||||
|
||||
return getSubjectKeyID(data.CSR.PublicKey)
|
||||
}
|
||||
|
||||
func getSubjectKeyID(pub interface{}) ([]byte, error) {
|
||||
var publicKeyBytes []byte
|
||||
switch pub := pub.(type) {
|
||||
|
@ -151,18 +181,21 @@ func ParsePKIJSON(input []byte) (*ParsedCertBundle, error) {
|
|||
}
|
||||
|
||||
func ParseDERKey(privateKeyBytes []byte) (signer crypto.Signer, format BlockType, err error) {
|
||||
if signer, err = x509.ParseECPrivateKey(privateKeyBytes); err == nil {
|
||||
var firstError error
|
||||
if signer, firstError = x509.ParseECPrivateKey(privateKeyBytes); firstError == nil {
|
||||
format = ECBlock
|
||||
return
|
||||
}
|
||||
|
||||
if signer, err = x509.ParsePKCS1PrivateKey(privateKeyBytes); err == nil {
|
||||
var secondError error
|
||||
if signer, secondError = x509.ParsePKCS1PrivateKey(privateKeyBytes); secondError == nil {
|
||||
format = PKCS1Block
|
||||
return
|
||||
}
|
||||
|
||||
var thirdError error
|
||||
var rawKey interface{}
|
||||
if rawKey, err = x509.ParsePKCS8PrivateKey(privateKeyBytes); err == nil {
|
||||
if rawKey, thirdError = x509.ParsePKCS8PrivateKey(privateKeyBytes); thirdError == nil {
|
||||
switch rawSigner := rawKey.(type) {
|
||||
case *rsa.PrivateKey:
|
||||
signer = rawSigner
|
||||
|
@ -178,7 +211,7 @@ func ParseDERKey(privateKeyBytes []byte) (signer crypto.Signer, format BlockType
|
|||
return
|
||||
}
|
||||
|
||||
return nil, UnknownBlock, err
|
||||
return nil, UnknownBlock, fmt.Errorf("got errors attempting to parse DER private key:\n1. %v\n2. %v\n3. %v", firstError, secondError, thirdError)
|
||||
}
|
||||
|
||||
func ParsePEMKey(keyPem string) (crypto.Signer, BlockType, error) {
|
||||
|
@ -756,6 +789,29 @@ func CreateCertificateWithKeyGenerator(data *CreationBundle, randReader io.Reade
|
|||
return createCertificate(data, randReader, keyGenerator)
|
||||
}
|
||||
|
||||
// Set correct correct RSA sig algo
|
||||
func certTemplateSetSigAlgo(certTemplate *x509.Certificate, data *CreationBundle) {
|
||||
if data.Params.UsePSS {
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA256WithRSAPSS
|
||||
case 384:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA384WithRSAPSS
|
||||
case 512:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA512WithRSAPSS
|
||||
}
|
||||
} else {
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA256WithRSA
|
||||
case 384:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA384WithRSA
|
||||
case 512:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA512WithRSA
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func createCertificate(data *CreationBundle, randReader io.Reader, privateKeyGenerator KeyGenerator) (*ParsedCertBundle, error) {
|
||||
var err error
|
||||
result := &ParsedCertBundle{}
|
||||
|
@ -824,14 +880,7 @@ func createCertificate(data *CreationBundle, randReader io.Reader, privateKeyGen
|
|||
if data.SigningBundle != nil {
|
||||
switch data.SigningBundle.PrivateKeyType {
|
||||
case RSAPrivateKey:
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA256WithRSA
|
||||
case 384:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA384WithRSA
|
||||
case 512:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA512WithRSA
|
||||
}
|
||||
certTemplateSetSigAlgo(certTemplate, data)
|
||||
case Ed25519PrivateKey:
|
||||
certTemplate.SignatureAlgorithm = x509.PureEd25519
|
||||
case ECPrivateKey:
|
||||
|
@ -853,14 +902,7 @@ func createCertificate(data *CreationBundle, randReader io.Reader, privateKeyGen
|
|||
|
||||
switch data.Params.KeyType {
|
||||
case "rsa":
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA256WithRSA
|
||||
case 384:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA384WithRSA
|
||||
case 512:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA512WithRSA
|
||||
}
|
||||
certTemplateSetSigAlgo(certTemplate, data)
|
||||
case "ed25519":
|
||||
certTemplate.SignatureAlgorithm = x509.PureEd25519
|
||||
case "ec":
|
||||
|
@ -1066,7 +1108,7 @@ func signCertificate(data *CreationBundle, randReader io.Reader) (*ParsedCertBun
|
|||
return nil, err
|
||||
}
|
||||
|
||||
subjKeyID, err := getSubjectKeyID(data.CSR.PublicKey)
|
||||
subjKeyID, err := getSubjectKeyIDFromBundle(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1087,14 +1129,7 @@ func signCertificate(data *CreationBundle, randReader io.Reader) (*ParsedCertBun
|
|||
|
||||
switch data.SigningBundle.PrivateKeyType {
|
||||
case RSAPrivateKey:
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA256WithRSA
|
||||
case 384:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA384WithRSA
|
||||
case 512:
|
||||
certTemplate.SignatureAlgorithm = x509.SHA512WithRSA
|
||||
}
|
||||
certTemplateSetSigAlgo(certTemplate, data)
|
||||
case ECPrivateKey:
|
||||
switch data.Params.SignatureBits {
|
||||
case 256:
|
||||
|
@ -1266,3 +1301,26 @@ func CreateKeyBundleWithKeyGenerator(keyType string, keyBits int, randReader io.
|
|||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// CreateDeltaCRLIndicatorExt allows creating correctly formed delta CRLs
|
||||
// that point back to the last complete CRL that they're based on.
|
||||
func CreateDeltaCRLIndicatorExt(completeCRLNumber int64) (pkix.Extension, error) {
|
||||
bigNum := big.NewInt(completeCRLNumber)
|
||||
bigNumValue, err := asn1.Marshal(bigNum)
|
||||
if err != nil {
|
||||
return pkix.Extension{}, fmt.Errorf("unable to marshal complete CRL number (%v): %v", completeCRLNumber, err)
|
||||
}
|
||||
return pkix.Extension{
|
||||
Id: DeltaCRLIndicatorOID,
|
||||
// > When a conforming CRL issuer generates a delta CRL, the delta
|
||||
// > CRL MUST include a critical delta CRL indicator extension.
|
||||
Critical: true,
|
||||
// This extension only includes the complete CRL number:
|
||||
//
|
||||
// > BaseCRLNumber ::= CRLNumber
|
||||
//
|
||||
// But, this needs to be encoded as a big number for encoding/asn1
|
||||
// to work properly.
|
||||
Value: bigNumValue,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -710,6 +710,7 @@ type CAInfoBundle struct {
|
|||
ParsedCertBundle
|
||||
URLs *URLEntries
|
||||
LeafNotAfterBehavior NotAfterBehavior
|
||||
RevocationSigAlg x509.SignatureAlgorithm
|
||||
}
|
||||
|
||||
func (b *CAInfoBundle) GetCAChain() []*CertBlock {
|
||||
|
@ -782,6 +783,7 @@ type CreationParameters struct {
|
|||
PolicyIdentifiers []string
|
||||
BasicConstraintsValidForNonCA bool
|
||||
SignatureBits int
|
||||
UsePSS bool
|
||||
ForceAppendCaChain bool
|
||||
|
||||
// Only used when signing a CA cert
|
||||
|
@ -796,6 +798,9 @@ type CreationParameters struct {
|
|||
|
||||
// The duration the certificate will use NotBefore
|
||||
NotBeforeDuration time.Duration
|
||||
|
||||
// The explicit SKID to use; especially useful for cross-signing.
|
||||
SKID []byte
|
||||
}
|
||||
|
||||
type CreationBundle struct {
|
||||
|
|
31
vendor/github.com/hashicorp/vault/sdk/helper/consts/deprecation_status.go
generated
vendored
Normal file
31
vendor/github.com/hashicorp/vault/sdk/helper/consts/deprecation_status.go
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
package consts
|
||||
|
||||
const VaultAllowPendingRemovalMountsEnv = "VAULT_ALLOW_PENDING_REMOVAL_MOUNTS"
|
||||
|
||||
// DeprecationStatus represents the current deprecation state for builtins
|
||||
type DeprecationStatus uint32
|
||||
|
||||
// These are the states of deprecation for builtin plugins
|
||||
const (
|
||||
Supported = iota
|
||||
Deprecated
|
||||
PendingRemoval
|
||||
Removed
|
||||
Unknown
|
||||
)
|
||||
|
||||
// String returns the string representation of a builtin deprecation status
|
||||
func (s DeprecationStatus) String() string {
|
||||
switch s {
|
||||
case Supported:
|
||||
return "supported"
|
||||
case Deprecated:
|
||||
return "deprecated"
|
||||
case PendingRemoval:
|
||||
return "pending removal"
|
||||
case Removed:
|
||||
return "removed"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
|
@ -25,7 +25,6 @@ type LockEntry struct {
|
|||
// Lock B, Lock A
|
||||
//
|
||||
// Where process 1 is now deadlocked trying to lock B, and process 2 deadlocked trying to lock A
|
||||
//
|
||||
func CreateLocks() []*LockEntry {
|
||||
ret := make([]*LockEntry, LockCount)
|
||||
for i := range ret {
|
||||
|
|
|
@ -42,9 +42,10 @@ func NewVaultLogger(level log.Level) log.Logger {
|
|||
// writer and a Vault formatter
|
||||
func NewVaultLoggerWithWriter(w io.Writer, level log.Level) log.Logger {
|
||||
opts := &log.LoggerOptions{
|
||||
Level: level,
|
||||
Output: w,
|
||||
JSONFormat: ParseEnvLogFormat() == JSONFormat,
|
||||
Level: level,
|
||||
IndependentLevels: true,
|
||||
Output: w,
|
||||
JSONFormat: ParseEnvLogFormat() == JSONFormat,
|
||||
}
|
||||
return log.New(opts)
|
||||
}
|
||||
|
|
|
@ -7,7 +7,11 @@ import (
|
|||
version "github.com/hashicorp/go-version"
|
||||
)
|
||||
|
||||
var (
|
||||
const (
|
||||
// PluginAutoMTLSEnv is used to ensure AutoMTLS is used. This will override
|
||||
// setting a TLSProviderFunc for a plugin.
|
||||
PluginAutoMTLSEnv = "VAULT_PLUGIN_AUTOMTLS_ENABLED"
|
||||
|
||||
// PluginMlockEnabled is the ENV name used to pass the configuration for
|
||||
// enabling mlock
|
||||
PluginMlockEnabled = "VAULT_PLUGIN_MLOCK_ENABLED"
|
||||
|
@ -27,6 +31,10 @@ var (
|
|||
// PluginCACertPEMEnv is an ENV name used for holding a CA PEM-encoded
|
||||
// string. Used for testing.
|
||||
PluginCACertPEMEnv = "VAULT_TESTING_PLUGIN_CA_PEM"
|
||||
|
||||
// PluginMultiplexingOptOut is an ENV name used to define a comma separated list of plugin names
|
||||
// opted-out of the multiplexing feature; for emergencies if multiplexing ever causes issues
|
||||
PluginMultiplexingOptOut = "VAULT_PLUGIN_MULTIPLEXING_OPT_OUT"
|
||||
)
|
||||
|
||||
// OptionallyEnableMlock determines if mlock should be called, and if so enables
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
package pluginutil
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
"github.com/hashicorp/go-secure-stdlib/strutil"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/metadata"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type PluginMultiplexingServerImpl struct {
|
||||
|
@ -15,17 +19,22 @@ type PluginMultiplexingServerImpl struct {
|
|||
Supported bool
|
||||
}
|
||||
|
||||
func (pm PluginMultiplexingServerImpl) MultiplexingSupport(ctx context.Context, req *MultiplexingSupportRequest) (*MultiplexingSupportResponse, error) {
|
||||
func (pm PluginMultiplexingServerImpl) MultiplexingSupport(_ context.Context, _ *MultiplexingSupportRequest) (*MultiplexingSupportResponse, error) {
|
||||
return &MultiplexingSupportResponse{
|
||||
Supported: pm.Supported,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func MultiplexingSupported(ctx context.Context, cc grpc.ClientConnInterface) (bool, error) {
|
||||
func MultiplexingSupported(ctx context.Context, cc grpc.ClientConnInterface, name string) (bool, error) {
|
||||
if cc == nil {
|
||||
return false, fmt.Errorf("client connection is nil")
|
||||
}
|
||||
|
||||
out := strings.Split(os.Getenv(PluginMultiplexingOptOut), ",")
|
||||
if strutil.StrListContains(out, name) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
req := new(MultiplexingSupportRequest)
|
||||
resp, err := NewPluginMultiplexingClient(cc).MultiplexingSupport(ctx, req)
|
||||
if err != nil {
|
||||
|
@ -45,3 +54,22 @@ func MultiplexingSupported(ctx context.Context, cc grpc.ClientConnInterface) (bo
|
|||
|
||||
return resp.Supported, nil
|
||||
}
|
||||
|
||||
func GetMultiplexIDFromContext(ctx context.Context) (string, error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("missing plugin multiplexing metadata")
|
||||
}
|
||||
|
||||
multiplexIDs := md[MultiplexingCtxKey]
|
||||
if len(multiplexIDs) != 1 {
|
||||
return "", fmt.Errorf("unexpected number of IDs in metadata: (%d)", len(multiplexIDs))
|
||||
}
|
||||
|
||||
multiplexID := multiplexIDs[0]
|
||||
if multiplexID == "" {
|
||||
return "", fmt.Errorf("empty multiplex ID in metadata")
|
||||
}
|
||||
|
||||
return multiplexID, nil
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.19.4
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.5
|
||||
// source: sdk/helper/pluginutil/multiplexing.proto
|
||||
|
||||
package pluginutil
|
||||
|
|
|
@ -16,12 +16,14 @@ import (
|
|||
type PluginClientConfig struct {
|
||||
Name string
|
||||
PluginType consts.PluginType
|
||||
Version string
|
||||
PluginSets map[int]plugin.PluginSet
|
||||
HandshakeConfig plugin.HandshakeConfig
|
||||
Logger log.Logger
|
||||
IsMetadataMode bool
|
||||
AutoMTLS bool
|
||||
MLock bool
|
||||
Wrapper RunnerUtil
|
||||
}
|
||||
|
||||
type runConfig struct {
|
||||
|
@ -33,8 +35,6 @@ type runConfig struct {
|
|||
// Initialized with what's in PluginRunner.Env, but can be added to
|
||||
env []string
|
||||
|
||||
wrapper RunnerUtil
|
||||
|
||||
PluginClientConfig
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ func (rc runConfig) makeConfig(ctx context.Context) (*plugin.ClientConfig, error
|
|||
cmd.Env = append(cmd.Env, rc.env...)
|
||||
|
||||
// Add the mlock setting to the ENV of the plugin
|
||||
if rc.MLock || (rc.wrapper != nil && rc.wrapper.MlockEnabled()) {
|
||||
if rc.MLock || (rc.Wrapper != nil && rc.Wrapper.MlockEnabled()) {
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", PluginMlockEnabled, "true"))
|
||||
}
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", PluginVaultVersionEnv, version.GetVersion().Version))
|
||||
|
@ -54,6 +54,9 @@ func (rc runConfig) makeConfig(ctx context.Context) (*plugin.ClientConfig, error
|
|||
metadataEnv := fmt.Sprintf("%s=%t", PluginMetadataModeEnv, rc.IsMetadataMode)
|
||||
cmd.Env = append(cmd.Env, metadataEnv)
|
||||
|
||||
automtlsEnv := fmt.Sprintf("%s=%t", PluginAutoMTLSEnv, rc.AutoMTLS)
|
||||
cmd.Env = append(cmd.Env, automtlsEnv)
|
||||
|
||||
var clientTLSConfig *tls.Config
|
||||
if !rc.AutoMTLS && !rc.IsMetadataMode {
|
||||
// Get a CA TLS Certificate
|
||||
|
@ -70,7 +73,7 @@ func (rc runConfig) makeConfig(ctx context.Context) (*plugin.ClientConfig, error
|
|||
|
||||
// Use CA to sign a server cert and wrap the values in a response wrapped
|
||||
// token.
|
||||
wrapToken, err := wrapServerConfig(ctx, rc.wrapper, certBytes, key)
|
||||
wrapToken, err := wrapServerConfig(ctx, rc.Wrapper, certBytes, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -120,7 +123,7 @@ func Env(env ...string) RunOpt {
|
|||
|
||||
func Runner(wrapper RunnerUtil) RunOpt {
|
||||
return func(rc *runConfig) {
|
||||
rc.wrapper = wrapper
|
||||
rc.Wrapper = wrapper
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ import (
|
|||
"time"
|
||||
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/hashicorp/go-plugin"
|
||||
"github.com/hashicorp/go-version"
|
||||
"github.com/hashicorp/vault/sdk/helper/consts"
|
||||
"github.com/hashicorp/vault/sdk/helper/wrapping"
|
||||
"google.golang.org/grpc"
|
||||
|
@ -14,7 +15,8 @@ import (
|
|||
// Looker defines the plugin Lookup function that looks into the plugin catalog
|
||||
// for available plugins and returns a PluginRunner
|
||||
type Looker interface {
|
||||
LookupPlugin(context.Context, string, consts.PluginType) (*PluginRunner, error)
|
||||
LookupPlugin(ctx context.Context, pluginName string, pluginType consts.PluginType) (*PluginRunner, error)
|
||||
LookupPluginVersion(ctx context.Context, pluginName string, pluginType consts.PluginType, version string) (*PluginRunner, error)
|
||||
}
|
||||
|
||||
// RunnerUtil interface defines the functions needed by the runner to wrap the
|
||||
|
@ -35,6 +37,7 @@ type LookRunnerUtil interface {
|
|||
|
||||
type PluginClient interface {
|
||||
Conn() grpc.ClientConnInterface
|
||||
Reload() error
|
||||
plugin.ClientProtocol
|
||||
}
|
||||
|
||||
|
@ -45,6 +48,7 @@ const MultiplexingCtxKey string = "multiplex_id"
|
|||
type PluginRunner struct {
|
||||
Name string `json:"name" structs:"name"`
|
||||
Type consts.PluginType `json:"type" structs:"type"`
|
||||
Version string `json:"version" structs:"version"`
|
||||
Command string `json:"command" structs:"command"`
|
||||
Args []string `json:"args" structs:"args"`
|
||||
Env []string `json:"env" structs:"env"`
|
||||
|
@ -81,6 +85,20 @@ func (r *PluginRunner) RunMetadataMode(ctx context.Context, wrapper RunnerUtil,
|
|||
)
|
||||
}
|
||||
|
||||
// VersionedPlugin holds any versioning information stored about a plugin in the
|
||||
// plugin catalog.
|
||||
type VersionedPlugin struct {
|
||||
Type string `json:"type"` // string instead of consts.PluginType so that we get the string form in API responses.
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
SHA256 string `json:"sha256,omitempty"`
|
||||
Builtin bool `json:"builtin"`
|
||||
DeprecationStatus string `json:"deprecation_status,omitempty"`
|
||||
|
||||
// Pre-parsed semver struct of the Version field
|
||||
SemanticVersion *version.Version `json:"-"`
|
||||
}
|
||||
|
||||
// CtxCancelIfCanceled takes a context cancel func and a context. If the context is
|
||||
// shutdown the cancelfunc is called. This is useful for merging two cancel
|
||||
// functions.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.19.4
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.5
|
||||
// source: sdk/logical/identity.proto
|
||||
|
||||
package logical
|
||||
|
|
|
@ -137,3 +137,20 @@ type Auditor interface {
|
|||
AuditRequest(ctx context.Context, input *LogInput) error
|
||||
AuditResponse(ctx context.Context, input *LogInput) error
|
||||
}
|
||||
|
||||
// Externaler allows us to check if a backend is running externally (i.e., over GRPC)
|
||||
type Externaler interface {
|
||||
IsExternal() bool
|
||||
}
|
||||
|
||||
type PluginVersion struct {
|
||||
Version string
|
||||
}
|
||||
|
||||
// PluginVersioner is an optional interface to return version info.
|
||||
type PluginVersioner interface {
|
||||
// PluginVersion returns the version for the backend
|
||||
PluginVersion() PluginVersion
|
||||
}
|
||||
|
||||
var EmptyPluginVersion = PluginVersion{""}
|
||||
|
|
|
@ -3,6 +3,7 @@ package logical
|
|||
import (
|
||||
"context"
|
||||
"crypto"
|
||||
"crypto/cipher"
|
||||
"io"
|
||||
)
|
||||
|
||||
|
@ -33,8 +34,9 @@ type ManagedKey interface {
|
|||
}
|
||||
|
||||
type (
|
||||
ManagedKeyConsumer func(context.Context, ManagedKey) error
|
||||
ManagedSigningKeyConsumer func(context.Context, ManagedSigningKey) error
|
||||
ManagedKeyConsumer func(context.Context, ManagedKey) error
|
||||
ManagedSigningKeyConsumer func(context.Context, ManagedSigningKey) error
|
||||
ManagedEncryptingKeyConsumer func(context.Context, ManagedEncryptingKey) error
|
||||
)
|
||||
|
||||
type ManagedKeySystemView interface {
|
||||
|
@ -51,6 +53,12 @@ type ManagedKeySystemView interface {
|
|||
// WithManagedSigningKeyByUUID retrieves an instantiated managed signing key for consumption by the given function,
|
||||
// with the same semantics as WithManagedKeyByUUID
|
||||
WithManagedSigningKeyByUUID(ctx context.Context, keyUuid, backendUUID string, f ManagedSigningKeyConsumer) error
|
||||
// WithManagedSigningKeyByName retrieves an instantiated managed signing key for consumption by the given function,
|
||||
// with the same semantics as WithManagedKeyByName
|
||||
WithManagedEncryptingKeyByName(ctx context.Context, keyName, backendUUID string, f ManagedEncryptingKeyConsumer) error
|
||||
// WithManagedSigningKeyByUUID retrieves an instantiated managed signing key for consumption by the given function,
|
||||
// with the same semantics as WithManagedKeyByUUID
|
||||
WithManagedEncryptingKeyByUUID(ctx context.Context, keyUuid, backendUUID string, f ManagedEncryptingKeyConsumer) error
|
||||
}
|
||||
|
||||
type ManagedAsymmetricKey interface {
|
||||
|
@ -82,3 +90,8 @@ type ManagedSigningKey interface {
|
|||
// as needed so as to use per request contexts.
|
||||
GetSigner(context.Context) (crypto.Signer, error)
|
||||
}
|
||||
|
||||
type ManagedEncryptingKey interface {
|
||||
ManagedKey
|
||||
GetAEAD(iv []byte) (cipher.AEAD, error)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc v3.19.4
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.5
|
||||
// source: sdk/logical/plugin.proto
|
||||
|
||||
package logical
|
||||
|
|
|
@ -365,6 +365,7 @@ const (
|
|||
ListOperation = "list"
|
||||
HelpOperation = "help"
|
||||
AliasLookaheadOperation = "alias-lookahead"
|
||||
ResolveRoleOperation = "resolve-role"
|
||||
|
||||
// The operations below are called globally, the path is less relevant.
|
||||
RevokeOperation Operation = "revoke"
|
||||
|
@ -377,7 +378,6 @@ type MFACreds map[string][]string
|
|||
// InitializationRequest stores the parameters and context of an Initialize()
|
||||
// call being made to a logical.Backend.
|
||||
type InitializationRequest struct {
|
||||
|
||||
// Storage can be used to durably store and retrieve state.
|
||||
Storage Storage
|
||||
}
|
||||
|
|
|
@ -310,3 +310,12 @@ func (w *StatusHeaderResponseWriter) setCustomResponseHeaders(status int) {
|
|||
}
|
||||
|
||||
var _ WrappingResponseWriter = &StatusHeaderResponseWriter{}
|
||||
|
||||
// ResolveRoleResponse returns a standard response to be returned by functions handling a ResolveRoleOperation
|
||||
func ResolveRoleResponse(roleName string) (*Response, error) {
|
||||
return &Response{
|
||||
Data: map[string]interface{}{
|
||||
"role": roleName,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -54,7 +54,15 @@ type SystemView interface {
|
|||
|
||||
// LookupPlugin looks into the plugin catalog for a plugin with the given
|
||||
// name. Returns a PluginRunner or an error if a plugin can not be found.
|
||||
LookupPlugin(context.Context, string, consts.PluginType) (*pluginutil.PluginRunner, error)
|
||||
LookupPlugin(ctx context.Context, pluginName string, pluginType consts.PluginType) (*pluginutil.PluginRunner, error)
|
||||
|
||||
// LookupPluginVersion looks into the plugin catalog for a plugin with the given
|
||||
// name and version. Returns a PluginRunner or an error if a plugin can not be found.
|
||||
LookupPluginVersion(ctx context.Context, pluginName string, pluginType consts.PluginType, version string) (*pluginutil.PluginRunner, error)
|
||||
|
||||
// ListVersionedPlugins returns information about all plugins of a certain
|
||||
// type in the catalog, including any versioning information stored for them.
|
||||
ListVersionedPlugins(ctx context.Context, pluginType consts.PluginType) ([]pluginutil.VersionedPlugin, error)
|
||||
|
||||
// NewPluginClient returns a client for managing the lifecycle of plugin
|
||||
// processes
|
||||
|
@ -168,6 +176,14 @@ func (d StaticSystemView) LookupPlugin(_ context.Context, _ string, _ consts.Plu
|
|||
return nil, errors.New("LookupPlugin is not implemented in StaticSystemView")
|
||||
}
|
||||
|
||||
func (d StaticSystemView) LookupPluginVersion(_ context.Context, _ string, _ consts.PluginType, _ string) (*pluginutil.PluginRunner, error) {
|
||||
return nil, errors.New("LookupPluginVersion is not implemented in StaticSystemView")
|
||||
}
|
||||
|
||||
func (d StaticSystemView) ListVersionedPlugins(_ context.Context, _ consts.PluginType) ([]pluginutil.VersionedPlugin, error) {
|
||||
return nil, errors.New("ListVersionedPlugins is not implemented in StaticSystemView")
|
||||
}
|
||||
|
||||
func (d StaticSystemView) MlockEnabled() bool {
|
||||
return d.EnableMlock
|
||||
}
|
||||
|
|
|
@ -0,0 +1,204 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.5
|
||||
// source: sdk/logical/version.proto
|
||||
|
||||
package logical
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Empty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *Empty) Reset() {
|
||||
*x = Empty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_sdk_logical_version_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Empty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Empty) ProtoMessage() {}
|
||||
|
||||
func (x *Empty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sdk_logical_version_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
|
||||
func (*Empty) Descriptor() ([]byte, []int) {
|
||||
return file_sdk_logical_version_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// VersionReply is the reply for the Version method.
|
||||
type VersionReply struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
PluginVersion string `protobuf:"bytes,1,opt,name=plugin_version,json=pluginVersion,proto3" json:"plugin_version,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VersionReply) Reset() {
|
||||
*x = VersionReply{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_sdk_logical_version_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VersionReply) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VersionReply) ProtoMessage() {}
|
||||
|
||||
func (x *VersionReply) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_sdk_logical_version_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VersionReply.ProtoReflect.Descriptor instead.
|
||||
func (*VersionReply) Descriptor() ([]byte, []int) {
|
||||
return file_sdk_logical_version_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *VersionReply) GetPluginVersion() string {
|
||||
if x != nil {
|
||||
return x.PluginVersion
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_sdk_logical_version_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_sdk_logical_version_proto_rawDesc = []byte{
|
||||
0x0a, 0x19, 0x73, 0x64, 0x6b, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x2f, 0x76, 0x65,
|
||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x67,
|
||||
0x69, 0x63, 0x61, 0x6c, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x35, 0x0a,
|
||||
0x0c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x25, 0x0a,
|
||||
0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x32, 0x41, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65,
|
||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x12, 0x0e, 0x2e, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
||||
0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f,
|
||||
0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61,
|
||||
0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_sdk_logical_version_proto_rawDescOnce sync.Once
|
||||
file_sdk_logical_version_proto_rawDescData = file_sdk_logical_version_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_sdk_logical_version_proto_rawDescGZIP() []byte {
|
||||
file_sdk_logical_version_proto_rawDescOnce.Do(func() {
|
||||
file_sdk_logical_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_logical_version_proto_rawDescData)
|
||||
})
|
||||
return file_sdk_logical_version_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_sdk_logical_version_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_sdk_logical_version_proto_goTypes = []interface{}{
|
||||
(*Empty)(nil), // 0: logical.Empty
|
||||
(*VersionReply)(nil), // 1: logical.VersionReply
|
||||
}
|
||||
var file_sdk_logical_version_proto_depIdxs = []int32{
|
||||
0, // 0: logical.PluginVersion.Version:input_type -> logical.Empty
|
||||
1, // 1: logical.PluginVersion.Version:output_type -> logical.VersionReply
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_sdk_logical_version_proto_init() }
|
||||
func file_sdk_logical_version_proto_init() {
|
||||
if File_sdk_logical_version_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_sdk_logical_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Empty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_sdk_logical_version_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VersionReply); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_sdk_logical_version_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_sdk_logical_version_proto_goTypes,
|
||||
DependencyIndexes: file_sdk_logical_version_proto_depIdxs,
|
||||
MessageInfos: file_sdk_logical_version_proto_msgTypes,
|
||||
}.Build()
|
||||
File_sdk_logical_version_proto = out.File
|
||||
file_sdk_logical_version_proto_rawDesc = nil
|
||||
file_sdk_logical_version_proto_goTypes = nil
|
||||
file_sdk_logical_version_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
syntax = "proto3";
|
||||
package logical;
|
||||
|
||||
option go_package = "github.com/hashicorp/vault/sdk/logical";
|
||||
|
||||
message Empty {}
|
||||
|
||||
// VersionReply is the reply for the Version method.
|
||||
message VersionReply {
|
||||
string plugin_version = 1;
|
||||
}
|
||||
|
||||
// PluginVersion is an optional RPC service implemented by plugins.
|
||||
service PluginVersion {
|
||||
// Version returns version information for the plugin.
|
||||
rpc Version(Empty) returns (VersionReply);
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package logical
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// PluginVersionClient is the client API for PluginVersion service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PluginVersionClient interface {
|
||||
// Version returns version information for the plugin.
|
||||
Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionReply, error)
|
||||
}
|
||||
|
||||
type pluginVersionClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPluginVersionClient(cc grpc.ClientConnInterface) PluginVersionClient {
|
||||
return &pluginVersionClient{cc}
|
||||
}
|
||||
|
||||
func (c *pluginVersionClient) Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionReply, error) {
|
||||
out := new(VersionReply)
|
||||
err := c.cc.Invoke(ctx, "/logical.PluginVersion/Version", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PluginVersionServer is the server API for PluginVersion service.
|
||||
// All implementations must embed UnimplementedPluginVersionServer
|
||||
// for forward compatibility
|
||||
type PluginVersionServer interface {
|
||||
// Version returns version information for the plugin.
|
||||
Version(context.Context, *Empty) (*VersionReply, error)
|
||||
mustEmbedUnimplementedPluginVersionServer()
|
||||
}
|
||||
|
||||
// UnimplementedPluginVersionServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedPluginVersionServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedPluginVersionServer) Version(context.Context, *Empty) (*VersionReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
|
||||
}
|
||||
func (UnimplementedPluginVersionServer) mustEmbedUnimplementedPluginVersionServer() {}
|
||||
|
||||
// UnsafePluginVersionServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PluginVersionServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePluginVersionServer interface {
|
||||
mustEmbedUnimplementedPluginVersionServer()
|
||||
}
|
||||
|
||||
func RegisterPluginVersionServer(s grpc.ServiceRegistrar, srv PluginVersionServer) {
|
||||
s.RegisterService(&PluginVersion_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PluginVersion_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PluginVersionServer).Version(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/logical.PluginVersion/Version",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PluginVersionServer).Version(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PluginVersion_ServiceDesc is the grpc.ServiceDesc for PluginVersion service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PluginVersion_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "logical.PluginVersion",
|
||||
HandlerType: (*PluginVersionServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Version",
|
||||
Handler: _PluginVersion_Version_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "sdk/logical/version.proto",
|
||||
}
|
|
@ -1,5 +1,10 @@
|
|||
package physical
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Entry is used to represent data stored by the physical backend
|
||||
type Entry struct {
|
||||
Key string
|
||||
|
@ -9,3 +14,7 @@ type Entry struct {
|
|||
// Only used in replication
|
||||
ValueHash []byte
|
||||
}
|
||||
|
||||
func (e *Entry) String() string {
|
||||
return fmt.Sprintf("Key: %s. SealWrap: %t. Value: %s. ValueHash: %s", e.Key, e.SealWrap, hex.EncodeToString(e.Value), hex.EncodeToString(e.ValueHash))
|
||||
}
|
||||
|
|
|
@ -10,10 +10,9 @@ import (
|
|||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/armon/go-radix"
|
||||
log "github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/vault/sdk/physical"
|
||||
|
||||
radix "github.com/armon/go-radix"
|
||||
)
|
||||
|
||||
// Verify interfaces are satisfied
|
||||
|
@ -27,10 +26,11 @@ var (
|
|||
)
|
||||
|
||||
var (
|
||||
PutDisabledError = errors.New("put operations disabled in inmem backend")
|
||||
GetDisabledError = errors.New("get operations disabled in inmem backend")
|
||||
DeleteDisabledError = errors.New("delete operations disabled in inmem backend")
|
||||
ListDisabledError = errors.New("list operations disabled in inmem backend")
|
||||
PutDisabledError = errors.New("put operations disabled in inmem backend")
|
||||
GetDisabledError = errors.New("get operations disabled in inmem backend")
|
||||
DeleteDisabledError = errors.New("delete operations disabled in inmem backend")
|
||||
ListDisabledError = errors.New("list operations disabled in inmem backend")
|
||||
GetInTxnDisabledError = errors.New("get operations inside transactions are disabled in inmem backend")
|
||||
)
|
||||
|
||||
// InmemBackend is an in-memory only physical backend. It is useful
|
||||
|
@ -45,6 +45,7 @@ type InmemBackend struct {
|
|||
failPut *uint32
|
||||
failDelete *uint32
|
||||
failList *uint32
|
||||
failGetInTxn *uint32
|
||||
logOps bool
|
||||
maxValueSize int
|
||||
}
|
||||
|
@ -73,6 +74,7 @@ func NewInmem(conf map[string]string, logger log.Logger) (physical.Backend, erro
|
|||
failPut: new(uint32),
|
||||
failDelete: new(uint32),
|
||||
failList: new(uint32),
|
||||
failGetInTxn: new(uint32),
|
||||
logOps: os.Getenv("VAULT_INMEM_LOG_ALL_OPS") != "",
|
||||
maxValueSize: maxValueSize,
|
||||
}, nil
|
||||
|
@ -100,6 +102,7 @@ func NewTransactionalInmem(conf map[string]string, logger log.Logger) (physical.
|
|||
failPut: new(uint32),
|
||||
failDelete: new(uint32),
|
||||
failList: new(uint32),
|
||||
failGetInTxn: new(uint32),
|
||||
logOps: os.Getenv("VAULT_INMEM_LOG_ALL_OPS") != "",
|
||||
maxValueSize: maxValueSize,
|
||||
},
|
||||
|
@ -189,6 +192,14 @@ func (i *InmemBackend) FailGet(fail bool) {
|
|||
atomic.StoreUint32(i.failGet, val)
|
||||
}
|
||||
|
||||
func (i *InmemBackend) FailGetInTxn(fail bool) {
|
||||
var val uint32
|
||||
if fail {
|
||||
val = 1
|
||||
}
|
||||
atomic.StoreUint32(i.failGetInTxn, val)
|
||||
}
|
||||
|
||||
// Delete is used to permanently delete an entry
|
||||
func (i *InmemBackend) Delete(ctx context.Context, key string) error {
|
||||
i.permitPool.Acquire()
|
||||
|
@ -280,7 +291,7 @@ func (i *InmemBackend) FailList(fail bool) {
|
|||
atomic.StoreUint32(i.failList, val)
|
||||
}
|
||||
|
||||
// Implements the transaction interface
|
||||
// Transaction implements the transaction interface
|
||||
func (t *TransactionalInmemBackend) Transaction(ctx context.Context, txns []*physical.TxnEntry) error {
|
||||
t.permitPool.Acquire()
|
||||
defer t.permitPool.Release()
|
||||
|
@ -288,5 +299,12 @@ func (t *TransactionalInmemBackend) Transaction(ctx context.Context, txns []*phy
|
|||
t.Lock()
|
||||
defer t.Unlock()
|
||||
|
||||
failGetInTxn := atomic.LoadUint32(t.failGetInTxn)
|
||||
for _, t := range txns {
|
||||
if t.Operation == physical.GetOperation && failGetInTxn != 0 {
|
||||
return GetInTxnDisabledError
|
||||
}
|
||||
}
|
||||
|
||||
return physical.GenericTransactionHandler(ctx, t, txns)
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@ package physical
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
multierror "github.com/hashicorp/go-multierror"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
)
|
||||
|
||||
// TxnEntry is an operation that takes atomically as part of
|
||||
|
@ -13,6 +14,10 @@ type TxnEntry struct {
|
|||
Entry *Entry
|
||||
}
|
||||
|
||||
func (t *TxnEntry) String() string {
|
||||
return fmt.Sprintf("Operation: %s. Entry: %s", t.Operation, t.Entry)
|
||||
}
|
||||
|
||||
// Transactional is an optional interface for backends that
|
||||
// support doing transactional updates of multiple keys. This is
|
||||
// required for some features such as replication.
|
||||
|
@ -40,6 +45,19 @@ func GenericTransactionHandler(ctx context.Context, t PseudoTransactional, txns
|
|||
rollbackStack := make([]*TxnEntry, 0, len(txns))
|
||||
var dirty bool
|
||||
|
||||
// Update all of our GET transaction entries, so we can populate existing values back at the wal layer.
|
||||
for _, txn := range txns {
|
||||
if txn.Operation == GetOperation {
|
||||
entry, err := t.GetInternal(ctx, txn.Entry.Key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if entry != nil {
|
||||
txn.Entry.Value = entry.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We walk the transactions in order; each successful operation goes into a
|
||||
// LIFO for rollback if we hit an error along the way
|
||||
TxnWalk:
|
||||
|
@ -78,6 +96,7 @@ TxnWalk:
|
|||
dirty = true
|
||||
break TxnWalk
|
||||
}
|
||||
|
||||
// Nothing existed so in fact rolling back requires a delete
|
||||
var rollbackEntry *TxnEntry
|
||||
if entry == nil {
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
|
@ -222,7 +221,7 @@ func (c *Client) Do(r *http.Request, v interface{}) (*Response, error) {
|
|||
var body []byte
|
||||
var err error
|
||||
if r.ContentLength > 0 {
|
||||
body, err = ioutil.ReadAll(r.Body)
|
||||
body, err = io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
r.Body.Close()
|
||||
return nil, err
|
||||
|
@ -231,7 +230,7 @@ func (c *Client) Do(r *http.Request, v interface{}) (*Response, error) {
|
|||
}
|
||||
for {
|
||||
if r.ContentLength > 0 {
|
||||
r.Body = ioutil.NopCloser(bytes.NewReader(body))
|
||||
r.Body = io.NopCloser(bytes.NewReader(body))
|
||||
}
|
||||
|
||||
if c.debugWriter != nil {
|
||||
|
@ -247,13 +246,13 @@ func (c *Client) Do(r *http.Request, v interface{}) (*Response, error) {
|
|||
return nil, err
|
||||
}
|
||||
response := &Response{Response: resp}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
resp.Body.Close()
|
||||
return response, err
|
||||
}
|
||||
resp.Body.Close()
|
||||
resp.Body = ioutil.NopCloser(bytes.NewReader(body))
|
||||
resp.Body = io.NopCloser(bytes.NewReader(body))
|
||||
|
||||
if c.debugWriter != nil {
|
||||
dumpResp, err := httputil.DumpResponse(resp, true)
|
||||
|
@ -271,7 +270,7 @@ func (c *Client) Do(r *http.Request, v interface{}) (*Response, error) {
|
|||
err = errorFromResponse(resp, body)
|
||||
if err == nil {
|
||||
err = fmt.Errorf("hcloud: server responded with status code %d", resp.StatusCode)
|
||||
} else if isRetryable(err) {
|
||||
} else if isConflict(err) {
|
||||
c.backoff(retries)
|
||||
retries++
|
||||
continue
|
||||
|
@ -290,12 +289,12 @@ func (c *Client) Do(r *http.Request, v interface{}) (*Response, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func isRetryable(error error) bool {
|
||||
func isConflict(error error) bool {
|
||||
err, ok := error.(Error)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
return err.Code == ErrorCodeRateLimitExceeded || err.Code == ErrorCodeConflict
|
||||
return err.Code == ErrorCodeConflict
|
||||
}
|
||||
|
||||
func (c *Client) backoff(retries int) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package metadata
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
@ -73,7 +73,7 @@ func (c *Client) get(path string) (string, error) {
|
|||
return "", err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
bodyBytes, err := ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import (
|
|||
"fmt"
|
||||
"hash"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"golang.org/x/crypto/chacha20"
|
||||
"golang.org/x/crypto/internal/poly1305"
|
||||
|
@ -497,7 +496,7 @@ func (c *cbcCipher) readCipherPacket(seqNum uint32, r io.Reader) ([]byte, error)
|
|||
// data, to make distinguishing between
|
||||
// failing MAC and failing length check more
|
||||
// difficult.
|
||||
io.CopyN(ioutil.Discard, r, int64(c.oracleCamouflage))
|
||||
io.CopyN(io.Discard, r, int64(c.oracleCamouflage))
|
||||
}
|
||||
}
|
||||
return p, err
|
||||
|
|
|
@ -13,7 +13,6 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
)
|
||||
|
||||
|
@ -124,7 +123,7 @@ type Session struct {
|
|||
// output and error.
|
||||
//
|
||||
// If either is nil, Run connects the corresponding file
|
||||
// descriptor to an instance of ioutil.Discard. There is a
|
||||
// descriptor to an instance of io.Discard. There is a
|
||||
// fixed amount of buffering that is shared for the two streams.
|
||||
// If either blocks it may eventually cause the remote
|
||||
// command to block.
|
||||
|
@ -506,7 +505,7 @@ func (s *Session) stdout() {
|
|||
return
|
||||
}
|
||||
if s.Stdout == nil {
|
||||
s.Stdout = ioutil.Discard
|
||||
s.Stdout = io.Discard
|
||||
}
|
||||
s.copyFuncs = append(s.copyFuncs, func() error {
|
||||
_, err := io.Copy(s.Stdout, s.ch)
|
||||
|
@ -519,7 +518,7 @@ func (s *Session) stderr() {
|
|||
return
|
||||
}
|
||||
if s.Stderr == nil {
|
||||
s.Stderr = ioutil.Discard
|
||||
s.Stderr = io.Discard
|
||||
}
|
||||
s.copyFuncs = append(s.copyFuncs, func() error {
|
||||
_, err := io.Copy(s.Stderr, s.ch.Stderr())
|
||||
|
|
|
@ -869,9 +869,7 @@ func (sc *serverConn) serve() {
|
|||
|
||||
// Each connection starts with initialWindowSize inflow tokens.
|
||||
// If a higher value is configured, we add more tokens.
|
||||
if diff := sc.srv.initialConnRecvWindowSize() - initialWindowSize; diff > 0 {
|
||||
sc.sendWindowUpdate(nil, int(diff))
|
||||
}
|
||||
sc.sendWindowUpdate(nil)
|
||||
|
||||
if err := sc.readPreface(); err != nil {
|
||||
sc.condlogf(err, "http2: server: error reading preface from client %v: %v", sc.conn.RemoteAddr(), err)
|
||||
|
@ -1588,7 +1586,7 @@ func (sc *serverConn) closeStream(st *stream, err error) {
|
|||
if p := st.body; p != nil {
|
||||
// Return any buffered unread bytes worth of conn-level flow control.
|
||||
// See golang.org/issue/16481
|
||||
sc.sendWindowUpdate(nil, p.Len())
|
||||
sc.sendWindowUpdate(nil)
|
||||
|
||||
p.CloseWithError(err)
|
||||
}
|
||||
|
@ -1736,7 +1734,7 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
|||
// sendWindowUpdate, which also schedules sending the
|
||||
// frames.
|
||||
sc.inflow.take(int32(f.Length))
|
||||
sc.sendWindowUpdate(nil, int(f.Length)) // conn-level
|
||||
sc.sendWindowUpdate(nil) // conn-level
|
||||
|
||||
if st != nil && st.resetQueued {
|
||||
// Already have a stream error in flight. Don't send another.
|
||||
|
@ -1754,7 +1752,7 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
|||
return sc.countError("data_flow", streamError(id, ErrCodeFlowControl))
|
||||
}
|
||||
sc.inflow.take(int32(f.Length))
|
||||
sc.sendWindowUpdate(nil, int(f.Length)) // conn-level
|
||||
sc.sendWindowUpdate(nil) // conn-level
|
||||
|
||||
st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes))
|
||||
// RFC 7540, sec 8.1.2.6: A request or response is also malformed if the
|
||||
|
@ -1772,7 +1770,7 @@ func (sc *serverConn) processData(f *DataFrame) error {
|
|||
if len(data) > 0 {
|
||||
wrote, err := st.body.Write(data)
|
||||
if err != nil {
|
||||
sc.sendWindowUpdate(nil, int(f.Length)-wrote)
|
||||
sc.sendWindowUpdate32(nil, int32(f.Length)-int32(wrote))
|
||||
return sc.countError("body_write_err", streamError(id, ErrCodeStreamClosed))
|
||||
}
|
||||
if wrote != len(data) {
|
||||
|
@ -2099,12 +2097,6 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res
|
|||
return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol))
|
||||
}
|
||||
|
||||
bodyOpen := !f.StreamEnded()
|
||||
if rp.method == "HEAD" && bodyOpen {
|
||||
// HEAD requests can't have bodies
|
||||
return nil, nil, sc.countError("head_body", streamError(f.StreamID, ErrCodeProtocol))
|
||||
}
|
||||
|
||||
rp.header = make(http.Header)
|
||||
for _, hf := range f.RegularFields() {
|
||||
rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value)
|
||||
|
@ -2117,6 +2109,7 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res
|
|||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
bodyOpen := !f.StreamEnded()
|
||||
if bodyOpen {
|
||||
if vv, ok := rp.header["Content-Length"]; ok {
|
||||
if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil {
|
||||
|
@ -2329,17 +2322,32 @@ func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int, err error) {
|
|||
|
||||
func (sc *serverConn) noteBodyRead(st *stream, n int) {
|
||||
sc.serveG.check()
|
||||
sc.sendWindowUpdate(nil, n) // conn-level
|
||||
sc.sendWindowUpdate(nil) // conn-level
|
||||
if st.state != stateHalfClosedRemote && st.state != stateClosed {
|
||||
// Don't send this WINDOW_UPDATE if the stream is closed
|
||||
// remotely.
|
||||
sc.sendWindowUpdate(st, n)
|
||||
sc.sendWindowUpdate(st)
|
||||
}
|
||||
}
|
||||
|
||||
// st may be nil for conn-level
|
||||
func (sc *serverConn) sendWindowUpdate(st *stream, n int) {
|
||||
func (sc *serverConn) sendWindowUpdate(st *stream) {
|
||||
sc.serveG.check()
|
||||
|
||||
var n int32
|
||||
if st == nil {
|
||||
if avail, windowSize := sc.inflow.available(), sc.srv.initialConnRecvWindowSize(); avail > windowSize/2 {
|
||||
return
|
||||
} else {
|
||||
n = windowSize - avail
|
||||
}
|
||||
} else {
|
||||
if avail, windowSize := st.inflow.available(), sc.srv.initialStreamRecvWindowSize(); avail > windowSize/2 {
|
||||
return
|
||||
} else {
|
||||
n = windowSize - avail
|
||||
}
|
||||
}
|
||||
// "The legal range for the increment to the flow control
|
||||
// window is 1 to 2^31-1 (2,147,483,647) octets."
|
||||
// A Go Read call on 64-bit machines could in theory read
|
||||
|
@ -2505,6 +2513,10 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
|
|||
rws.writeHeader(200)
|
||||
}
|
||||
|
||||
if rws.handlerDone {
|
||||
rws.promoteUndeclaredTrailers()
|
||||
}
|
||||
|
||||
isHeadResp := rws.req.Method == "HEAD"
|
||||
if !rws.sentHeader {
|
||||
rws.sentHeader = true
|
||||
|
@ -2576,10 +2588,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
|
|||
return 0, nil
|
||||
}
|
||||
|
||||
if rws.handlerDone {
|
||||
rws.promoteUndeclaredTrailers()
|
||||
}
|
||||
|
||||
// only send trailers if they have actually been defined by the
|
||||
// server handler.
|
||||
hasNonemptyTrailers := rws.hasNonemptyTrailers()
|
||||
|
|
|
@ -258,7 +258,8 @@ func (t *Transport) initConnPool() {
|
|||
// HTTP/2 server.
|
||||
type ClientConn struct {
|
||||
t *Transport
|
||||
tconn net.Conn // usually *tls.Conn, except specialized impls
|
||||
tconn net.Conn // usually *tls.Conn, except specialized impls
|
||||
tconnClosed bool
|
||||
tlsState *tls.ConnectionState // nil only for specialized impls
|
||||
reused uint32 // whether conn is being reused; atomic
|
||||
singleUse bool // whether being used for a single http.Request
|
||||
|
@ -921,10 +922,10 @@ func (cc *ClientConn) onIdleTimeout() {
|
|||
cc.closeIfIdle()
|
||||
}
|
||||
|
||||
func (cc *ClientConn) closeConn() error {
|
||||
func (cc *ClientConn) closeConn() {
|
||||
t := time.AfterFunc(250*time.Millisecond, cc.forceCloseConn)
|
||||
defer t.Stop()
|
||||
return cc.tconn.Close()
|
||||
cc.tconn.Close()
|
||||
}
|
||||
|
||||
// A tls.Conn.Close can hang for a long time if the peer is unresponsive.
|
||||
|
@ -990,7 +991,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error {
|
|||
shutdownEnterWaitStateHook()
|
||||
select {
|
||||
case <-done:
|
||||
return cc.closeConn()
|
||||
cc.closeConn()
|
||||
return nil
|
||||
case <-ctx.Done():
|
||||
cc.mu.Lock()
|
||||
// Free the goroutine above
|
||||
|
@ -1027,7 +1029,7 @@ func (cc *ClientConn) sendGoAway() error {
|
|||
|
||||
// closes the client connection immediately. In-flight requests are interrupted.
|
||||
// err is sent to streams.
|
||||
func (cc *ClientConn) closeForError(err error) error {
|
||||
func (cc *ClientConn) closeForError(err error) {
|
||||
cc.mu.Lock()
|
||||
cc.closed = true
|
||||
for _, cs := range cc.streams {
|
||||
|
@ -1035,7 +1037,7 @@ func (cc *ClientConn) closeForError(err error) error {
|
|||
}
|
||||
cc.cond.Broadcast()
|
||||
cc.mu.Unlock()
|
||||
return cc.closeConn()
|
||||
cc.closeConn()
|
||||
}
|
||||
|
||||
// Close closes the client connection immediately.
|
||||
|
@ -1043,16 +1045,17 @@ func (cc *ClientConn) closeForError(err error) error {
|
|||
// In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead.
|
||||
func (cc *ClientConn) Close() error {
|
||||
err := errors.New("http2: client connection force closed via ClientConn.Close")
|
||||
return cc.closeForError(err)
|
||||
cc.closeForError(err)
|
||||
return nil
|
||||
}
|
||||
|
||||
// closes the client connection immediately. In-flight requests are interrupted.
|
||||
func (cc *ClientConn) closeForLostPing() error {
|
||||
func (cc *ClientConn) closeForLostPing() {
|
||||
err := errors.New("http2: client connection lost")
|
||||
if f := cc.t.CountError; f != nil {
|
||||
f("conn_close_lost_ping")
|
||||
}
|
||||
return cc.closeForError(err)
|
||||
cc.closeForError(err)
|
||||
}
|
||||
|
||||
// errRequestCanceled is a copy of net/http's errRequestCanceled because it's not
|
||||
|
@ -2005,7 +2008,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) {
|
|||
// wake up RoundTrip if there is a pending request.
|
||||
cc.cond.Broadcast()
|
||||
|
||||
closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives()
|
||||
closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil
|
||||
if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 {
|
||||
if VerboseLogs {
|
||||
cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, cc.nextStreamID-2)
|
||||
|
@ -2674,7 +2677,6 @@ func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error {
|
|||
if fn := cc.t.CountError; fn != nil {
|
||||
fn("recv_goaway_" + f.ErrCode.stringToken())
|
||||
}
|
||||
|
||||
}
|
||||
cc.setGoAway(f)
|
||||
return nil
|
||||
|
|
|
@ -442,6 +442,10 @@ func NewCallbackCDecl(fn interface{}) uintptr {
|
|||
//sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable
|
||||
//sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable
|
||||
|
||||
// Desktop Window Manager API (Dwmapi)
|
||||
//sys DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmGetWindowAttribute
|
||||
//sys DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) = dwmapi.DwmSetWindowAttribute
|
||||
|
||||
// syscall interface implementation for other packages
|
||||
|
||||
// GetCurrentProcess returns the handle for the current process.
|
||||
|
|
|
@ -3232,3 +3232,29 @@ type GUIThreadInfo struct {
|
|||
CaretHandle HWND
|
||||
CaretRect Rect
|
||||
}
|
||||
|
||||
const (
|
||||
DWMWA_NCRENDERING_ENABLED = 1
|
||||
DWMWA_NCRENDERING_POLICY = 2
|
||||
DWMWA_TRANSITIONS_FORCEDISABLED = 3
|
||||
DWMWA_ALLOW_NCPAINT = 4
|
||||
DWMWA_CAPTION_BUTTON_BOUNDS = 5
|
||||
DWMWA_NONCLIENT_RTL_LAYOUT = 6
|
||||
DWMWA_FORCE_ICONIC_REPRESENTATION = 7
|
||||
DWMWA_FLIP3D_POLICY = 8
|
||||
DWMWA_EXTENDED_FRAME_BOUNDS = 9
|
||||
DWMWA_HAS_ICONIC_BITMAP = 10
|
||||
DWMWA_DISALLOW_PEEK = 11
|
||||
DWMWA_EXCLUDED_FROM_PEEK = 12
|
||||
DWMWA_CLOAK = 13
|
||||
DWMWA_CLOAKED = 14
|
||||
DWMWA_FREEZE_REPRESENTATION = 15
|
||||
DWMWA_PASSIVE_UPDATE_MODE = 16
|
||||
DWMWA_USE_HOSTBACKDROPBRUSH = 17
|
||||
DWMWA_USE_IMMERSIVE_DARK_MODE = 20
|
||||
DWMWA_WINDOW_CORNER_PREFERENCE = 33
|
||||
DWMWA_BORDER_COLOR = 34
|
||||
DWMWA_CAPTION_COLOR = 35
|
||||
DWMWA_TEXT_COLOR = 36
|
||||
DWMWA_VISIBLE_FRAME_BORDER_THICKNESS = 37
|
||||
)
|
||||
|
|
|
@ -40,6 +40,7 @@ var (
|
|||
modadvapi32 = NewLazySystemDLL("advapi32.dll")
|
||||
modcrypt32 = NewLazySystemDLL("crypt32.dll")
|
||||
moddnsapi = NewLazySystemDLL("dnsapi.dll")
|
||||
moddwmapi = NewLazySystemDLL("dwmapi.dll")
|
||||
modiphlpapi = NewLazySystemDLL("iphlpapi.dll")
|
||||
modkernel32 = NewLazySystemDLL("kernel32.dll")
|
||||
modmswsock = NewLazySystemDLL("mswsock.dll")
|
||||
|
@ -175,6 +176,8 @@ var (
|
|||
procDnsNameCompare_W = moddnsapi.NewProc("DnsNameCompare_W")
|
||||
procDnsQuery_W = moddnsapi.NewProc("DnsQuery_W")
|
||||
procDnsRecordListFree = moddnsapi.NewProc("DnsRecordListFree")
|
||||
procDwmGetWindowAttribute = moddwmapi.NewProc("DwmGetWindowAttribute")
|
||||
procDwmSetWindowAttribute = moddwmapi.NewProc("DwmSetWindowAttribute")
|
||||
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
|
||||
procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo")
|
||||
procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx")
|
||||
|
@ -1534,6 +1537,22 @@ func DnsRecordListFree(rl *DNSRecord, freetype uint32) {
|
|||
return
|
||||
}
|
||||
|
||||
func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) {
|
||||
r0, _, _ := syscall.Syscall6(procDwmGetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) {
|
||||
r0, _, _ := syscall.Syscall6(procDwmSetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0)
|
||||
if r0 != 0 {
|
||||
ret = syscall.Errno(r0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) {
|
||||
r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0)
|
||||
if r0 != 0 {
|
||||
|
|
|
@ -2487,7 +2487,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"revision": "20220727",
|
||||
"revision": "20220826",
|
||||
"rootUrl": "https://container.googleapis.com/",
|
||||
"schemas": {
|
||||
"AcceleratorConfig": {
|
||||
|
@ -2636,7 +2636,7 @@
|
|||
"description": "Specifies the node management options for NAP created node-pools."
|
||||
},
|
||||
"minCpuPlatform": {
|
||||
"description": "Deprecated. Minimum CPU platform to be used for NAP created node pools. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: Intel Haswell or minCpuPlatform: Intel Sandy Bridge. For more information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) This field is deprecated, min_cpu_platform should be specified using https://cloud.google.com/requested-min-cpu-platform label selector on the pod. To unset the min cpu platform field pass \"automatic\" as field value.",
|
||||
"description": "Deprecated. Minimum CPU platform to be used for NAP created node pools. The instance may be scheduled on the specified or newer CPU platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: Intel Haswell or minCpuPlatform: Intel Sandy Bridge. For more information, read [how to specify min CPU platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform). This field is deprecated, min_cpu_platform should be specified using https://cloud.google.com/requested-min-cpu-platform label selector on the pod. To unset the min cpu platform field pass \"automatic\" as field value.",
|
||||
"type": "string"
|
||||
},
|
||||
"oauthScopes": {
|
||||
|
@ -3284,6 +3284,10 @@
|
|||
"description": "The node pool to be upgraded. This field is mandatory if \"desired_node_version\", \"desired_image_family\" or \"desired_node_pool_autoscaling\" is specified and there is more than one node pool on the cluster.",
|
||||
"type": "string"
|
||||
},
|
||||
"desiredNodePoolLoggingConfig": {
|
||||
"$ref": "NodePoolLoggingConfig",
|
||||
"description": "The desired node pool logging configuration defaults for the cluster."
|
||||
},
|
||||
"desiredNodeVersion": {
|
||||
"description": "The Kubernetes version to change the nodes to (typically an upgrade). Users may specify either explicit versions offered by Kubernetes Engine or version aliases, which have the following behavior: - \"latest\": picks the highest valid Kubernetes version - \"1.X\": picks the highest valid patch+gke.N patch in the 1.X version - \"1.X.Y\": picks the highest valid gke.N patch in the 1.X.Y version - \"1.X.Y-gke.N\": picks an explicit Kubernetes version - \"-\": picks the Kubernetes master version",
|
||||
"type": "string"
|
||||
|
@ -4033,6 +4037,27 @@
|
|||
},
|
||||
"type": "object"
|
||||
},
|
||||
"LoggingVariantConfig": {
|
||||
"description": "LoggingVariantConfig specifies the behaviour of the logging component.",
|
||||
"id": "LoggingVariantConfig",
|
||||
"properties": {
|
||||
"variant": {
|
||||
"description": "Logging variant deployed on nodes.",
|
||||
"enum": [
|
||||
"VARIANT_UNSPECIFIED",
|
||||
"DEFAULT",
|
||||
"MAX_THROUGHPUT"
|
||||
],
|
||||
"enumDescriptions": [
|
||||
"Default value. This shouldn't be used.",
|
||||
"default logging variant.",
|
||||
"maximum logging throughput variant."
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"MaintenanceExclusionOptions": {
|
||||
"description": "Represents the Maintenance exclusion option.",
|
||||
"id": "MaintenanceExclusionOptions",
|
||||
|
@ -4438,6 +4463,10 @@
|
|||
"format": "int32",
|
||||
"type": "integer"
|
||||
},
|
||||
"loggingConfig": {
|
||||
"$ref": "NodePoolLoggingConfig",
|
||||
"description": "Logging configuration."
|
||||
},
|
||||
"machineType": {
|
||||
"description": "The name of a Google Compute Engine [machine type](https://cloud.google.com/compute/docs/machine-types) If unspecified, the default machine type is `e2-medium`.",
|
||||
"type": "string"
|
||||
|
@ -4516,6 +4545,10 @@
|
|||
"gcfsConfig": {
|
||||
"$ref": "GcfsConfig",
|
||||
"description": "GCFS (Google Container File System, also known as Riptide) options."
|
||||
},
|
||||
"loggingConfig": {
|
||||
"$ref": "NodePoolLoggingConfig",
|
||||
"description": "Logging configuration for node pools."
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
@ -4776,6 +4809,17 @@
|
|||
},
|
||||
"type": "object"
|
||||
},
|
||||
"NodePoolLoggingConfig": {
|
||||
"description": "NodePoolLoggingConfig specifies logging configuration for nodepools.",
|
||||
"id": "NodePoolLoggingConfig",
|
||||
"properties": {
|
||||
"variantConfig": {
|
||||
"$ref": "LoggingVariantConfig",
|
||||
"description": "Logging variant configuration."
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"NodeTaint": {
|
||||
"description": "Kubernetes taint is comprised of three fields: key, value, and effect. Effect can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. See [here](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration) for more information, including usage and the valid values.",
|
||||
"id": "NodeTaint",
|
||||
|
@ -5160,7 +5204,7 @@
|
|||
"type": "string"
|
||||
},
|
||||
"key": {
|
||||
"description": "Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify \"googleapis.com/reservation-name\" as the key and specify the name of your reservation as its value.",
|
||||
"description": "Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify \"compute.googleapis.com/reservation-name\" as the key and specify the name of your reservation as its value.",
|
||||
"type": "string"
|
||||
},
|
||||
"values": {
|
||||
|
@ -6042,6 +6086,10 @@
|
|||
},
|
||||
"type": "array"
|
||||
},
|
||||
"loggingConfig": {
|
||||
"$ref": "NodePoolLoggingConfig",
|
||||
"description": "Logging configuration."
|
||||
},
|
||||
"name": {
|
||||
"description": "The name (project, location, cluster, node pool) of the node pool to update. Specified in the format `projects/*/locations/*/clusters/*/nodePools/*`.",
|
||||
"type": "string"
|
||||
|
|
|
@ -562,7 +562,7 @@ type AutoprovisioningNodePoolDefaults struct {
|
|||
// platforms, such as minCpuPlatform: Intel Haswell or minCpuPlatform:
|
||||
// Intel Sandy Bridge. For more information, read how to specify min CPU
|
||||
// platform
|
||||
// (https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform)
|
||||
// (https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform).
|
||||
// This field is deprecated, min_cpu_platform should be specified using
|
||||
// https://cloud.google.com/requested-min-cpu-platform label selector on
|
||||
// the pod. To unset the min cpu platform field pass "automatic" as
|
||||
|
@ -1466,6 +1466,10 @@ type ClusterUpdate struct {
|
|||
// one node pool on the cluster.
|
||||
DesiredNodePoolId string `json:"desiredNodePoolId,omitempty"`
|
||||
|
||||
// DesiredNodePoolLoggingConfig: The desired node pool logging
|
||||
// configuration defaults for the cluster.
|
||||
DesiredNodePoolLoggingConfig *NodePoolLoggingConfig `json:"desiredNodePoolLoggingConfig,omitempty"`
|
||||
|
||||
// DesiredNodeVersion: The Kubernetes version to change the nodes to
|
||||
// (typically an upgrade). Users may specify either explicit versions
|
||||
// offered by Kubernetes Engine or version aliases, which have the
|
||||
|
@ -2906,6 +2910,40 @@ func (s *LoggingConfig) MarshalJSON() ([]byte, error) {
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// LoggingVariantConfig: LoggingVariantConfig specifies the behaviour of
|
||||
// the logging component.
|
||||
type LoggingVariantConfig struct {
|
||||
// Variant: Logging variant deployed on nodes.
|
||||
//
|
||||
// Possible values:
|
||||
// "VARIANT_UNSPECIFIED" - Default value. This shouldn't be used.
|
||||
// "DEFAULT" - default logging variant.
|
||||
// "MAX_THROUGHPUT" - maximum logging throughput variant.
|
||||
Variant string `json:"variant,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Variant") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
// non-pointer, non-interface field appearing in ForceSendFields will be
|
||||
// sent to the server regardless of whether the field is empty or not.
|
||||
// This may be used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Variant") to include in
|
||||
// API requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *LoggingVariantConfig) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod LoggingVariantConfig
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// MaintenanceExclusionOptions: Represents the Maintenance exclusion
|
||||
// option.
|
||||
type MaintenanceExclusionOptions struct {
|
||||
|
@ -3633,6 +3671,9 @@ type NodeConfig struct {
|
|||
// information.
|
||||
LocalSsdCount int64 `json:"localSsdCount,omitempty"`
|
||||
|
||||
// LoggingConfig: Logging configuration.
|
||||
LoggingConfig *NodePoolLoggingConfig `json:"loggingConfig,omitempty"`
|
||||
|
||||
// MachineType: The name of a Google Compute Engine machine type
|
||||
// (https://cloud.google.com/compute/docs/machine-types) If unspecified,
|
||||
// the default machine type is `e2-medium`.
|
||||
|
@ -3754,6 +3795,9 @@ type NodeConfigDefaults struct {
|
|||
// Riptide) options.
|
||||
GcfsConfig *GcfsConfig `json:"gcfsConfig,omitempty"`
|
||||
|
||||
// LoggingConfig: Logging configuration for node pools.
|
||||
LoggingConfig *NodePoolLoggingConfig `json:"loggingConfig,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "GcfsConfig") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
|
@ -4212,6 +4256,35 @@ func (s *NodePoolDefaults) MarshalJSON() ([]byte, error) {
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// NodePoolLoggingConfig: NodePoolLoggingConfig specifies logging
|
||||
// configuration for nodepools.
|
||||
type NodePoolLoggingConfig struct {
|
||||
// VariantConfig: Logging variant configuration.
|
||||
VariantConfig *LoggingVariantConfig `json:"variantConfig,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "VariantConfig") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
// non-pointer, non-interface field appearing in ForceSendFields will be
|
||||
// sent to the server regardless of whether the field is empty or not.
|
||||
// This may be used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "VariantConfig") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *NodePoolLoggingConfig) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod NodePoolLoggingConfig
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
// NodeTaint: Kubernetes taint is comprised of three fields: key, value,
|
||||
// and effect. Effect can only be one of three types: NoSchedule,
|
||||
// PreferNoSchedule or NoExecute. See here
|
||||
|
@ -4765,8 +4838,8 @@ type ReservationAffinity struct {
|
|||
|
||||
// Key: Corresponds to the label key of a reservation resource. To
|
||||
// target a SPECIFIC_RESERVATION by name, specify
|
||||
// "googleapis.com/reservation-name" as the key and specify the name of
|
||||
// your reservation as its value.
|
||||
// "compute.googleapis.com/reservation-name" as the key and specify the
|
||||
// name of your reservation as its value.
|
||||
Key string `json:"key,omitempty"`
|
||||
|
||||
// Values: Corresponds to the label value(s) of reservation resource(s).
|
||||
|
@ -6331,6 +6404,9 @@ type UpdateNodePoolRequest struct {
|
|||
// removed.
|
||||
Locations []string `json:"locations,omitempty"`
|
||||
|
||||
// LoggingConfig: Logging configuration.
|
||||
LoggingConfig *NodePoolLoggingConfig `json:"loggingConfig,omitempty"`
|
||||
|
||||
// Name: The name (project, location, cluster, node pool) of the node
|
||||
// pool to update. Specified in the format
|
||||
// `projects/*/locations/*/clusters/*/nodePools/*`.
|
||||
|
|
|
@ -1824,7 +1824,7 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"revision": "20220804",
|
||||
"revision": "20220908",
|
||||
"rootUrl": "https://dns.googleapis.com/",
|
||||
"schemas": {
|
||||
"Change": {
|
||||
|
@ -2156,7 +2156,7 @@
|
|||
"description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)."
|
||||
},
|
||||
"members": {
|
||||
"description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ",
|
||||
"description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -2517,6 +2517,13 @@
|
|||
"ManagedZonePrivateVisibilityConfig": {
|
||||
"id": "ManagedZonePrivateVisibilityConfig",
|
||||
"properties": {
|
||||
"gkeClusters": {
|
||||
"description": "The list of Google Kubernetes Engine clusters that can see this zone.",
|
||||
"items": {
|
||||
"$ref": "ManagedZonePrivateVisibilityConfigGKECluster"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"kind": {
|
||||
"default": "dns#managedZonePrivateVisibilityConfig",
|
||||
"type": "string"
|
||||
|
@ -2531,6 +2538,20 @@
|
|||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ManagedZonePrivateVisibilityConfigGKECluster": {
|
||||
"id": "ManagedZonePrivateVisibilityConfigGKECluster",
|
||||
"properties": {
|
||||
"gkeClusterName": {
|
||||
"description": "The resource name of the cluster to bind this ManagedZone to. This should be specified in the format like: projects/*/locations/*/clusters/*. This is referenced from GKE projects.locations.clusters.get API: https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"default": "dns#managedZonePrivateVisibilityConfigGKECluster",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ManagedZonePrivateVisibilityConfigNetwork": {
|
||||
"id": "ManagedZonePrivateVisibilityConfigNetwork",
|
||||
"properties": {
|
||||
|
@ -3338,6 +3359,13 @@
|
|||
"description": "User-provided description for this Response Policy.",
|
||||
"type": "string"
|
||||
},
|
||||
"gkeClusters": {
|
||||
"description": "The list of Google Kubernetes Engine clusters to which this response policy is applied.",
|
||||
"items": {
|
||||
"$ref": "ResponsePolicyGKECluster"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"id": {
|
||||
"description": "Unique identifier for the resource; defined by the server (output only).",
|
||||
"format": "int64",
|
||||
|
@ -3361,6 +3389,20 @@
|
|||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ResponsePolicyGKECluster": {
|
||||
"id": "ResponsePolicyGKECluster",
|
||||
"properties": {
|
||||
"gkeClusterName": {
|
||||
"description": "The resource name of the cluster to bind this response policy to. This should be specified in the format like: projects/*/locations/*/clusters/*. This is referenced from GKE projects.locations.clusters.get API: https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"default": "dns#responsePolicyGKECluster",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"ResponsePolicyNetwork": {
|
||||
"id": "ResponsePolicyNetwork",
|
||||
"properties": {
|
||||
|
|
|
@ -780,11 +780,12 @@ type GoogleIamV1Binding struct {
|
|||
// `allUsers`: A special identifier that represents anyone who is on the
|
||||
// internet; with or without a Google account. *
|
||||
// `allAuthenticatedUsers`: A special identifier that represents anyone
|
||||
// who is authenticated with a Google account or a service account. *
|
||||
// `user:{emailid}`: An email address that represents a specific Google
|
||||
// account. For example, `alice@example.com` . *
|
||||
// `serviceAccount:{emailid}`: An email address that represents a Google
|
||||
// service account. For example,
|
||||
// who is authenticated with a Google account or a service account. Does
|
||||
// not include identities that come from external identity providers
|
||||
// (IdPs) through identity federation. * `user:{emailid}`: An email
|
||||
// address that represents a specific Google account. For example,
|
||||
// `alice@example.com` . * `serviceAccount:{emailid}`: An email address
|
||||
// that represents a Google service account. For example,
|
||||
// `my-other-app@appspot.gserviceaccount.com`. *
|
||||
// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`:
|
||||
// An identifier for a Kubernetes service account
|
||||
|
@ -1508,12 +1509,16 @@ func (s *ManagedZonePeeringConfigTargetNetwork) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
type ManagedZonePrivateVisibilityConfig struct {
|
||||
// GkeClusters: The list of Google Kubernetes Engine clusters that can
|
||||
// see this zone.
|
||||
GkeClusters []*ManagedZonePrivateVisibilityConfigGKECluster `json:"gkeClusters,omitempty"`
|
||||
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// Networks: The list of VPC networks that can see this zone.
|
||||
Networks []*ManagedZonePrivateVisibilityConfigNetwork `json:"networks,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "Kind") to
|
||||
// ForceSendFields is a list of field names (e.g. "GkeClusters") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
// non-pointer, non-interface field appearing in ForceSendFields will be
|
||||
|
@ -1521,10 +1526,10 @@ type ManagedZonePrivateVisibilityConfig struct {
|
|||
// This may be used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "Kind") to include in API
|
||||
// requests with the JSON null value. By default, fields with empty
|
||||
// values are omitted from API requests. However, any field with an
|
||||
// empty value appearing in NullFields will be sent to the server as
|
||||
// NullFields is a list of field names (e.g. "GkeClusters") to include
|
||||
// in API requests with the JSON null value. By default, fields with
|
||||
// empty values are omitted from API requests. However, any field with
|
||||
// an empty value appearing in NullFields will be sent to the server as
|
||||
// null. It is an error if a field in this list has a non-empty value.
|
||||
// This may be used to include null fields in Patch requests.
|
||||
NullFields []string `json:"-"`
|
||||
|
@ -1536,6 +1541,40 @@ func (s *ManagedZonePrivateVisibilityConfig) MarshalJSON() ([]byte, error) {
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type ManagedZonePrivateVisibilityConfigGKECluster struct {
|
||||
// GkeClusterName: The resource name of the cluster to bind this
|
||||
// ManagedZone to. This should be specified in the format like:
|
||||
// projects/*/locations/*/clusters/*. This is referenced from GKE
|
||||
// projects.locations.clusters.get API:
|
||||
// https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get
|
||||
GkeClusterName string `json:"gkeClusterName,omitempty"`
|
||||
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "GkeClusterName") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
// non-pointer, non-interface field appearing in ForceSendFields will be
|
||||
// sent to the server regardless of whether the field is empty or not.
|
||||
// This may be used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "GkeClusterName") to
|
||||
// include in API requests with the JSON null value. By default, fields
|
||||
// with empty values are omitted from API requests. However, any field
|
||||
// with an empty value appearing in NullFields will be sent to the
|
||||
// server as null. It is an error if a field in this list has a
|
||||
// non-empty value. This may be used to include null fields in Patch
|
||||
// requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *ManagedZonePrivateVisibilityConfigGKECluster) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod ManagedZonePrivateVisibilityConfigGKECluster
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type ManagedZonePrivateVisibilityConfigNetwork struct {
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
|
@ -2905,6 +2944,10 @@ type ResponsePolicy struct {
|
|||
// Description: User-provided description for this Response Policy.
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// GkeClusters: The list of Google Kubernetes Engine clusters to which
|
||||
// this response policy is applied.
|
||||
GkeClusters []*ResponsePolicyGKECluster `json:"gkeClusters,omitempty"`
|
||||
|
||||
// Id: Unique identifier for the resource; defined by the server (output
|
||||
// only).
|
||||
Id int64 `json:"id,omitempty,string"`
|
||||
|
@ -2945,6 +2988,40 @@ func (s *ResponsePolicy) MarshalJSON() ([]byte, error) {
|
|||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type ResponsePolicyGKECluster struct {
|
||||
// GkeClusterName: The resource name of the cluster to bind this
|
||||
// response policy to. This should be specified in the format like:
|
||||
// projects/*/locations/*/clusters/*. This is referenced from GKE
|
||||
// projects.locations.clusters.get API:
|
||||
// https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/get
|
||||
GkeClusterName string `json:"gkeClusterName,omitempty"`
|
||||
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
// ForceSendFields is a list of field names (e.g. "GkeClusterName") to
|
||||
// unconditionally include in API requests. By default, fields with
|
||||
// empty or default values are omitted from API requests. However, any
|
||||
// non-pointer, non-interface field appearing in ForceSendFields will be
|
||||
// sent to the server regardless of whether the field is empty or not.
|
||||
// This may be used to include empty fields in Patch requests.
|
||||
ForceSendFields []string `json:"-"`
|
||||
|
||||
// NullFields is a list of field names (e.g. "GkeClusterName") to
|
||||
// include in API requests with the JSON null value. By default, fields
|
||||
// with empty values are omitted from API requests. However, any field
|
||||
// with an empty value appearing in NullFields will be sent to the
|
||||
// server as null. It is an error if a field in this list has a
|
||||
// non-empty value. This may be used to include null fields in Patch
|
||||
// requests.
|
||||
NullFields []string `json:"-"`
|
||||
}
|
||||
|
||||
func (s *ResponsePolicyGKECluster) MarshalJSON() ([]byte, error) {
|
||||
type NoMethod ResponsePolicyGKECluster
|
||||
raw := NoMethod(*s)
|
||||
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
|
||||
}
|
||||
|
||||
type ResponsePolicyNetwork struct {
|
||||
Kind string `json:"kind,omitempty"`
|
||||
|
||||
|
|
|
@ -289,13 +289,12 @@ func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newB
|
|||
// be retried because the data is stored in the MediaBuffer.
|
||||
media, _, _, _ = mi.buffer.Chunk()
|
||||
}
|
||||
toCleanup := []io.Closer{}
|
||||
if media != nil {
|
||||
fb := readerFunc(body)
|
||||
fm := readerFunc(media)
|
||||
combined, ctype := CombineBodyMedia(body, "application/json", media, mi.mType)
|
||||
toCleanup := []io.Closer{
|
||||
combined,
|
||||
}
|
||||
toCleanup = append(toCleanup, combined)
|
||||
if fb != nil && fm != nil {
|
||||
getBody = func() (io.ReadCloser, error) {
|
||||
rb := ioutil.NopCloser(fb())
|
||||
|
@ -309,18 +308,30 @@ func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newB
|
|||
return r, nil
|
||||
}
|
||||
}
|
||||
cleanup = func() {
|
||||
for _, closer := range toCleanup {
|
||||
_ = closer.Close()
|
||||
}
|
||||
|
||||
}
|
||||
reqHeaders.Set("Content-Type", ctype)
|
||||
body = combined
|
||||
}
|
||||
if mi.buffer != nil && mi.mType != "" && !mi.singleChunk {
|
||||
// This happens when initiating a resumable upload session.
|
||||
// The initial request contains a JSON body rather than media.
|
||||
// It can be retried with a getBody function that re-creates the request body.
|
||||
fb := readerFunc(body)
|
||||
if fb != nil {
|
||||
getBody = func() (io.ReadCloser, error) {
|
||||
rb := ioutil.NopCloser(fb())
|
||||
toCleanup = append(toCleanup, rb)
|
||||
return rb, nil
|
||||
}
|
||||
}
|
||||
reqHeaders.Set("X-Upload-Content-Type", mi.mType)
|
||||
}
|
||||
// Ensure that any bodies created in getBody are cleaned up.
|
||||
cleanup = func() {
|
||||
for _, closer := range toCleanup {
|
||||
_ = closer.Close()
|
||||
}
|
||||
|
||||
}
|
||||
return body, getBody, cleanup
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,27 @@ import (
|
|||
"github.com/googleapis/gax-go/v2"
|
||||
)
|
||||
|
||||
// Use this error type to return an error which allows introspection of both
|
||||
// the context error and the error from the service.
|
||||
type wrappedCallErr struct {
|
||||
ctxErr error
|
||||
wrappedErr error
|
||||
}
|
||||
|
||||
func (e wrappedCallErr) Error() string {
|
||||
return fmt.Sprintf("retry failed with %v; last error: %v", e.ctxErr, e.wrappedErr)
|
||||
}
|
||||
|
||||
func (e wrappedCallErr) Unwrap() error {
|
||||
return e.wrappedErr
|
||||
}
|
||||
|
||||
// Is allows errors.Is to match the error from the call as well as context
|
||||
// sentinel errors.
|
||||
func (e wrappedCallErr) Is(target error) bool {
|
||||
return errors.Is(e.ctxErr, target) || errors.Is(e.wrappedErr, target)
|
||||
}
|
||||
|
||||
// SendRequest sends a single HTTP request using the given client.
|
||||
// If ctx is non-nil, it calls all hooks, then sends the request with
|
||||
// req.WithContext, then calls any functions returned by the hooks in
|
||||
|
@ -96,12 +117,12 @@ func sendAndRetry(ctx context.Context, client *http.Client, req *http.Request, r
|
|||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
// If we got an error, and the context has been canceled,
|
||||
// the context's error is probably more useful.
|
||||
if err == nil {
|
||||
err = ctx.Err()
|
||||
// If we got an error and the context has been canceled, return an error acknowledging
|
||||
// both the context cancelation and the service error.
|
||||
if err != nil {
|
||||
return resp, wrappedCallErr{ctx.Err(), err}
|
||||
}
|
||||
return resp, err
|
||||
return resp, ctx.Err()
|
||||
case <-time.After(pause):
|
||||
}
|
||||
|
||||
|
@ -110,10 +131,10 @@ func sendAndRetry(ctx context.Context, client *http.Client, req *http.Request, r
|
|||
// select is satisfied at the same time, Go will choose one arbitrarily.
|
||||
// That can cause an operation to go through even if the context was
|
||||
// canceled before.
|
||||
if err == nil {
|
||||
err = ctx.Err()
|
||||
if err != nil {
|
||||
return resp, wrappedCallErr{ctx.Err(), err}
|
||||
}
|
||||
return resp, err
|
||||
return resp, ctx.Err()
|
||||
}
|
||||
invocationHeader := fmt.Sprintf("gccl-invocation-id/%s gccl-attempt-count/%d", invocationID, attempts)
|
||||
xGoogHeader := strings.Join([]string{invocationHeader, baseXGoogHeader}, " ")
|
||||
|
|
|
@ -5,4 +5,4 @@
|
|||
package internal
|
||||
|
||||
// Version is the current tagged release of the library.
|
||||
const Version = "0.96.0"
|
||||
const Version = "0.97.0"
|
||||
|
|
|
@ -29,7 +29,7 @@ var (
|
|||
//
|
||||
// Increment major number for new feature additions and behavioral changes.
|
||||
// Increment minor number for bug fixes and performance enhancements.
|
||||
version = "v3.9"
|
||||
version = "v3.10"
|
||||
|
||||
// metadata is extra build time data
|
||||
metadata = ""
|
||||
|
|
|
@ -30,6 +30,7 @@ import (
|
|||
|
||||
"github.com/spf13/pflag"
|
||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||
"k8s.io/client-go/rest"
|
||||
|
||||
"helm.sh/helm/v3/pkg/helmpath"
|
||||
)
|
||||
|
@ -37,6 +38,9 @@ import (
|
|||
// defaultMaxHistory sets the maximum number of releases to 0: unlimited
|
||||
const defaultMaxHistory = 10
|
||||
|
||||
// defaultBurstLimit sets the default client-side throttling limit
|
||||
const defaultBurstLimit = 100
|
||||
|
||||
// EnvSettings describes all of the environment settings.
|
||||
type EnvSettings struct {
|
||||
namespace string
|
||||
|
@ -56,6 +60,12 @@ type EnvSettings struct {
|
|||
KubeAPIServer string
|
||||
// Custom certificate authority file.
|
||||
KubeCaFile string
|
||||
// KubeInsecureSkipTLSVerify indicates if server's certificate will not be checked for validity.
|
||||
// This makes the HTTPS connections insecure
|
||||
KubeInsecureSkipTLSVerify bool
|
||||
// KubeTLSServerName overrides the name to use for server certificate validation.
|
||||
// If it is not provided, the hostname used to contact the server is used
|
||||
KubeTLSServerName string
|
||||
// Debug indicates whether or not Helm is running in Debug mode.
|
||||
Debug bool
|
||||
// RegistryConfig is the path to the registry config file.
|
||||
|
@ -68,22 +78,27 @@ type EnvSettings struct {
|
|||
PluginsDirectory string
|
||||
// MaxHistory is the max release history maintained.
|
||||
MaxHistory int
|
||||
// BurstLimit is the default client-side throttling limit.
|
||||
BurstLimit int
|
||||
}
|
||||
|
||||
func New() *EnvSettings {
|
||||
env := &EnvSettings{
|
||||
namespace: os.Getenv("HELM_NAMESPACE"),
|
||||
MaxHistory: envIntOr("HELM_MAX_HISTORY", defaultMaxHistory),
|
||||
KubeContext: os.Getenv("HELM_KUBECONTEXT"),
|
||||
KubeToken: os.Getenv("HELM_KUBETOKEN"),
|
||||
KubeAsUser: os.Getenv("HELM_KUBEASUSER"),
|
||||
KubeAsGroups: envCSV("HELM_KUBEASGROUPS"),
|
||||
KubeAPIServer: os.Getenv("HELM_KUBEAPISERVER"),
|
||||
KubeCaFile: os.Getenv("HELM_KUBECAFILE"),
|
||||
PluginsDirectory: envOr("HELM_PLUGINS", helmpath.DataPath("plugins")),
|
||||
RegistryConfig: envOr("HELM_REGISTRY_CONFIG", helmpath.ConfigPath("registry/config.json")),
|
||||
RepositoryConfig: envOr("HELM_REPOSITORY_CONFIG", helmpath.ConfigPath("repositories.yaml")),
|
||||
RepositoryCache: envOr("HELM_REPOSITORY_CACHE", helmpath.CachePath("repository")),
|
||||
namespace: os.Getenv("HELM_NAMESPACE"),
|
||||
MaxHistory: envIntOr("HELM_MAX_HISTORY", defaultMaxHistory),
|
||||
KubeContext: os.Getenv("HELM_KUBECONTEXT"),
|
||||
KubeToken: os.Getenv("HELM_KUBETOKEN"),
|
||||
KubeAsUser: os.Getenv("HELM_KUBEASUSER"),
|
||||
KubeAsGroups: envCSV("HELM_KUBEASGROUPS"),
|
||||
KubeAPIServer: os.Getenv("HELM_KUBEAPISERVER"),
|
||||
KubeCaFile: os.Getenv("HELM_KUBECAFILE"),
|
||||
KubeTLSServerName: os.Getenv("HELM_KUBETLS_SERVER_NAME"),
|
||||
KubeInsecureSkipTLSVerify: envBoolOr("HELM_KUBEINSECURE_SKIP_TLS_VERIFY", false),
|
||||
PluginsDirectory: envOr("HELM_PLUGINS", helmpath.DataPath("plugins")),
|
||||
RegistryConfig: envOr("HELM_REGISTRY_CONFIG", helmpath.ConfigPath("registry/config.json")),
|
||||
RepositoryConfig: envOr("HELM_REPOSITORY_CONFIG", helmpath.ConfigPath("repositories.yaml")),
|
||||
RepositoryCache: envOr("HELM_REPOSITORY_CACHE", helmpath.CachePath("repository")),
|
||||
BurstLimit: envIntOr("HELM_BURST_LIMIT", defaultBurstLimit),
|
||||
}
|
||||
env.Debug, _ = strconv.ParseBool(os.Getenv("HELM_DEBUG"))
|
||||
|
||||
|
@ -96,7 +111,13 @@ func New() *EnvSettings {
|
|||
CAFile: &env.KubeCaFile,
|
||||
KubeConfig: &env.KubeConfig,
|
||||
Impersonate: &env.KubeAsUser,
|
||||
Insecure: &env.KubeInsecureSkipTLSVerify,
|
||||
TLSServerName: &env.KubeTLSServerName,
|
||||
ImpersonateGroup: &env.KubeAsGroups,
|
||||
WrapConfigFn: func(config *rest.Config) *rest.Config {
|
||||
config.Burst = env.BurstLimit
|
||||
return config
|
||||
},
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
@ -111,10 +132,13 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.StringArrayVar(&s.KubeAsGroups, "kube-as-group", s.KubeAsGroups, "group to impersonate for the operation, this flag can be repeated to specify multiple groups.")
|
||||
fs.StringVar(&s.KubeAPIServer, "kube-apiserver", s.KubeAPIServer, "the address and the port for the Kubernetes API server")
|
||||
fs.StringVar(&s.KubeCaFile, "kube-ca-file", s.KubeCaFile, "the certificate authority file for the Kubernetes API server connection")
|
||||
fs.StringVar(&s.KubeTLSServerName, "kube-tls-server-name", s.KubeTLSServerName, "server name to use for Kubernetes API server certificate validation. If it is not provided, the hostname used to contact the server is used")
|
||||
fs.BoolVar(&s.KubeInsecureSkipTLSVerify, "kube-insecure-skip-tls-verify", s.KubeInsecureSkipTLSVerify, "if true, the Kubernetes API server's certificate will not be checked for validity. This will make your HTTPS connections insecure")
|
||||
fs.BoolVar(&s.Debug, "debug", s.Debug, "enable verbose output")
|
||||
fs.StringVar(&s.RegistryConfig, "registry-config", s.RegistryConfig, "path to the registry config file")
|
||||
fs.StringVar(&s.RepositoryConfig, "repository-config", s.RepositoryConfig, "path to the file containing repository names and URLs")
|
||||
fs.StringVar(&s.RepositoryCache, "repository-cache", s.RepositoryCache, "path to the file containing cached repository indexes")
|
||||
fs.IntVar(&s.BurstLimit, "burst-limit", s.BurstLimit, "client-side default throttling limit")
|
||||
}
|
||||
|
||||
func envOr(name, def string) string {
|
||||
|
@ -124,6 +148,18 @@ func envOr(name, def string) string {
|
|||
return def
|
||||
}
|
||||
|
||||
func envBoolOr(name string, def bool) bool {
|
||||
if name == "" {
|
||||
return def
|
||||
}
|
||||
envVal := envOr(name, strconv.FormatBool(def))
|
||||
ret, err := strconv.ParseBool(envVal)
|
||||
if err != nil {
|
||||
return def
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func envIntOr(name string, def int) int {
|
||||
if name == "" {
|
||||
return def
|
||||
|
@ -157,14 +193,17 @@ func (s *EnvSettings) EnvVars() map[string]string {
|
|||
"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
|
||||
"HELM_NAMESPACE": s.Namespace(),
|
||||
"HELM_MAX_HISTORY": strconv.Itoa(s.MaxHistory),
|
||||
"HELM_BURST_LIMIT": strconv.Itoa(s.BurstLimit),
|
||||
|
||||
// broken, these are populated from helm flags and not kubeconfig.
|
||||
"HELM_KUBECONTEXT": s.KubeContext,
|
||||
"HELM_KUBETOKEN": s.KubeToken,
|
||||
"HELM_KUBEASUSER": s.KubeAsUser,
|
||||
"HELM_KUBEASGROUPS": strings.Join(s.KubeAsGroups, ","),
|
||||
"HELM_KUBEAPISERVER": s.KubeAPIServer,
|
||||
"HELM_KUBECAFILE": s.KubeCaFile,
|
||||
"HELM_KUBECONTEXT": s.KubeContext,
|
||||
"HELM_KUBETOKEN": s.KubeToken,
|
||||
"HELM_KUBEASUSER": s.KubeAsUser,
|
||||
"HELM_KUBEASGROUPS": strings.Join(s.KubeAsGroups, ","),
|
||||
"HELM_KUBEAPISERVER": s.KubeAPIServer,
|
||||
"HELM_KUBECAFILE": s.KubeCaFile,
|
||||
"HELM_KUBEINSECURE_SKIP_TLS_VERIFY": strconv.FormatBool(s.KubeInsecureSkipTLSVerify),
|
||||
"HELM_KUBETLS_SERVER_NAME": s.KubeTLSServerName,
|
||||
}
|
||||
if s.KubeConfig != "" {
|
||||
envvars["KUBECONFIG"] = s.KubeConfig
|
||||
|
|
|
@ -34,6 +34,7 @@ type Options struct {
|
|||
StringValues []string
|
||||
Values []string
|
||||
FileValues []string
|
||||
JSONValues []string
|
||||
}
|
||||
|
||||
// MergeValues merges values from files specified via -f/--values and directly
|
||||
|
@ -57,6 +58,13 @@ func (opts *Options) MergeValues(p getter.Providers) (map[string]interface{}, er
|
|||
base = mergeMaps(base, currentMap)
|
||||
}
|
||||
|
||||
// User specified a value via --set-json
|
||||
for _, value := range opts.JSONValues {
|
||||
if err := strvals.ParseJSON(value, base); err != nil {
|
||||
return nil, errors.Errorf("failed parsing --set-json data %s", value)
|
||||
}
|
||||
}
|
||||
|
||||
// User specified a value via --set
|
||||
for _, value := range opts.Values {
|
||||
if err := strvals.ParseInto(value, base); err != nil {
|
||||
|
@ -112,7 +120,10 @@ func readFile(filePath string, p getter.Providers) ([]byte, error) {
|
|||
if strings.TrimSpace(filePath) == "-" {
|
||||
return ioutil.ReadAll(os.Stdin)
|
||||
}
|
||||
u, _ := url.Parse(filePath)
|
||||
u, err := url.Parse(filePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// FIXME: maybe someone handle other protocols like ftp.
|
||||
g, err := p.ByScheme(u.Scheme)
|
||||
|
|
|
@ -17,10 +17,13 @@ package strvals
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
@ -98,6 +101,18 @@ func ParseIntoString(s string, dest map[string]interface{}) error {
|
|||
return t.parse()
|
||||
}
|
||||
|
||||
// ParseJSON parses a string with format key1=val1, key2=val2, ...
|
||||
// where values are json strings (null, or scalars, or arrays, or objects).
|
||||
// An empty val is treated as null.
|
||||
//
|
||||
// If a key exists in dest, the new value overwrites the dest version.
|
||||
//
|
||||
func ParseJSON(s string, dest map[string]interface{}) error {
|
||||
scanner := bytes.NewBufferString(s)
|
||||
t := newJSONParser(scanner, dest)
|
||||
return t.parse()
|
||||
}
|
||||
|
||||
// ParseIntoFile parses a filevals line and merges the result into dest.
|
||||
//
|
||||
// This method always returns a string as the value.
|
||||
|
@ -117,9 +132,10 @@ type RunesValueReader func([]rune) (interface{}, error)
|
|||
// where sc is the source of the original data being parsed
|
||||
// where data is the final parsed data from the parses with correct types
|
||||
type parser struct {
|
||||
sc *bytes.Buffer
|
||||
data map[string]interface{}
|
||||
reader RunesValueReader
|
||||
sc *bytes.Buffer
|
||||
data map[string]interface{}
|
||||
reader RunesValueReader
|
||||
isjsonval bool
|
||||
}
|
||||
|
||||
func newParser(sc *bytes.Buffer, data map[string]interface{}, stringBool bool) *parser {
|
||||
|
@ -129,6 +145,10 @@ func newParser(sc *bytes.Buffer, data map[string]interface{}, stringBool bool) *
|
|||
return &parser{sc: sc, data: data, reader: stringConverter}
|
||||
}
|
||||
|
||||
func newJSONParser(sc *bytes.Buffer, data map[string]interface{}) *parser {
|
||||
return &parser{sc: sc, data: data, reader: nil, isjsonval: true}
|
||||
}
|
||||
|
||||
func newFileParser(sc *bytes.Buffer, data map[string]interface{}, reader RunesValueReader) *parser {
|
||||
return &parser{sc: sc, data: data, reader: reader}
|
||||
}
|
||||
|
@ -188,6 +208,33 @@ func (t *parser) key(data map[string]interface{}) (reterr error) {
|
|||
set(data, kk, list)
|
||||
return err
|
||||
case last == '=':
|
||||
if t.isjsonval {
|
||||
empval, err := t.emptyVal()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if empval {
|
||||
set(data, string(k), nil)
|
||||
return nil
|
||||
}
|
||||
// parse jsonvals by using Go’s JSON standard library
|
||||
// Decode is preferred to Unmarshal in order to parse just the json parts of the list key1=jsonval1,key2=jsonval2,...
|
||||
// Since Decode has its own buffer that consumes more characters (from underlying t.sc) than the ones actually decoded,
|
||||
// we invoke Decode on a separate reader built with a copy of what is left in t.sc. After Decode is executed, we
|
||||
// discard in t.sc the chars of the decoded json value (the number of those characters is returned by InputOffset).
|
||||
var jsonval interface{}
|
||||
dec := json.NewDecoder(strings.NewReader(t.sc.String()))
|
||||
if err = dec.Decode(&jsonval); err != nil {
|
||||
return err
|
||||
}
|
||||
set(data, string(k), jsonval)
|
||||
if _, err = io.CopyN(ioutil.Discard, t.sc, dec.InputOffset()); err != nil {
|
||||
return err
|
||||
}
|
||||
// skip possible blanks and comma
|
||||
_, err = t.emptyVal()
|
||||
return err
|
||||
}
|
||||
//End of key. Consume =, Get value.
|
||||
// FIXME: Get value list first
|
||||
vl, e := t.valList()
|
||||
|
@ -209,7 +256,6 @@ func (t *parser) key(data map[string]interface{}) (reterr error) {
|
|||
default:
|
||||
return e
|
||||
}
|
||||
|
||||
case last == ',':
|
||||
// No value given. Set the value to empty string. Return error.
|
||||
set(data, string(k), "")
|
||||
|
@ -287,6 +333,34 @@ func (t *parser) listItem(list []interface{}, i int) ([]interface{}, error) {
|
|||
case err != nil:
|
||||
return list, err
|
||||
case last == '=':
|
||||
if t.isjsonval {
|
||||
empval, err := t.emptyVal()
|
||||
if err != nil {
|
||||
return list, err
|
||||
}
|
||||
if empval {
|
||||
return setIndex(list, i, nil)
|
||||
}
|
||||
// parse jsonvals by using Go’s JSON standard library
|
||||
// Decode is preferred to Unmarshal in order to parse just the json parts of the list key1=jsonval1,key2=jsonval2,...
|
||||
// Since Decode has its own buffer that consumes more characters (from underlying t.sc) than the ones actually decoded,
|
||||
// we invoke Decode on a separate reader built with a copy of what is left in t.sc. After Decode is executed, we
|
||||
// discard in t.sc the chars of the decoded json value (the number of those characters is returned by InputOffset).
|
||||
var jsonval interface{}
|
||||
dec := json.NewDecoder(strings.NewReader(t.sc.String()))
|
||||
if err = dec.Decode(&jsonval); err != nil {
|
||||
return list, err
|
||||
}
|
||||
if list, err = setIndex(list, i, jsonval); err != nil {
|
||||
return list, err
|
||||
}
|
||||
if _, err = io.CopyN(ioutil.Discard, t.sc, dec.InputOffset()); err != nil {
|
||||
return list, err
|
||||
}
|
||||
// skip possible blanks and comma
|
||||
_, err = t.emptyVal()
|
||||
return list, err
|
||||
}
|
||||
vl, e := t.valList()
|
||||
switch e {
|
||||
case nil:
|
||||
|
@ -350,6 +424,28 @@ func (t *parser) listItem(list []interface{}, i int) ([]interface{}, error) {
|
|||
}
|
||||
}
|
||||
|
||||
// check for an empty value
|
||||
// read and consume optional spaces until comma or EOF (empty val) or any other char (not empty val)
|
||||
// comma and spaces are consumed, while any other char is not cosumed
|
||||
func (t *parser) emptyVal() (bool, error) {
|
||||
for {
|
||||
r, _, e := t.sc.ReadRune()
|
||||
if e == io.EOF {
|
||||
return true, nil
|
||||
}
|
||||
if e != nil {
|
||||
return false, e
|
||||
}
|
||||
if r == ',' {
|
||||
return true, nil
|
||||
}
|
||||
if !unicode.IsSpace(r) {
|
||||
t.sc.UnreadRune()
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *parser) val() ([]rune, error) {
|
||||
stop := runeSet([]rune{','})
|
||||
v, _, err := runesUntil(t.sc, stop)
|
||||
|
|
|
@ -199,14 +199,18 @@ func newAuthenticator(c *cache, isTerminalFunc func(int) bool, config *api.ExecC
|
|||
now: time.Now,
|
||||
environ: os.Environ,
|
||||
|
||||
defaultDialer: defaultDialer,
|
||||
connTracker: connTracker,
|
||||
connTracker: connTracker,
|
||||
}
|
||||
|
||||
for _, env := range config.Env {
|
||||
a.env = append(a.env, env.Name+"="+env.Value)
|
||||
}
|
||||
|
||||
// these functions are made comparable and stored in the cache so that repeated clientset
|
||||
// construction with the same rest.Config results in a single TLS cache and Authenticator
|
||||
a.getCert = &transport.GetCertHolder{GetCert: a.cert}
|
||||
a.dial = &transport.DialHolder{Dial: defaultDialer.DialContext}
|
||||
|
||||
return c.put(key, a), nil
|
||||
}
|
||||
|
||||
|
@ -261,8 +265,6 @@ type Authenticator struct {
|
|||
now func() time.Time
|
||||
environ func() []string
|
||||
|
||||
// defaultDialer is used for clients which don't specify a custom dialer
|
||||
defaultDialer *connrotation.Dialer
|
||||
// connTracker tracks all connections opened that we need to close when rotating a client certificate
|
||||
connTracker *connrotation.ConnectionTracker
|
||||
|
||||
|
@ -273,6 +275,12 @@ type Authenticator struct {
|
|||
mu sync.Mutex
|
||||
cachedCreds *credentials
|
||||
exp time.Time
|
||||
|
||||
// getCert makes Authenticator.cert comparable to support TLS config caching
|
||||
getCert *transport.GetCertHolder
|
||||
// dial is used for clients which do not specify a custom dialer
|
||||
// it is comparable to support TLS config caching
|
||||
dial *transport.DialHolder
|
||||
}
|
||||
|
||||
type credentials struct {
|
||||
|
@ -300,18 +308,20 @@ func (a *Authenticator) UpdateTransportConfig(c *transport.Config) error {
|
|||
if c.HasCertCallback() {
|
||||
return errors.New("can't add TLS certificate callback: transport.Config.TLS.GetCert already set")
|
||||
}
|
||||
c.TLS.GetCert = a.cert
|
||||
c.TLS.GetCert = a.getCert.GetCert
|
||||
c.TLS.GetCertHolder = a.getCert // comparable for TLS config caching
|
||||
|
||||
var d *connrotation.Dialer
|
||||
if c.Dial != nil {
|
||||
// if c has a custom dialer, we have to wrap it
|
||||
d = connrotation.NewDialerWithTracker(c.Dial, a.connTracker)
|
||||
// TLS config caching is not supported for this config
|
||||
d := connrotation.NewDialerWithTracker(c.Dial, a.connTracker)
|
||||
c.Dial = d.DialContext
|
||||
c.DialHolder = nil
|
||||
} else {
|
||||
d = a.defaultDialer
|
||||
c.Dial = a.dial.Dial
|
||||
c.DialHolder = a.dial // comparable for TLS config caching
|
||||
}
|
||||
|
||||
c.Dial = d.DialContext
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -508,6 +508,87 @@ func (r *Request) URL() *url.URL {
|
|||
return finalURL
|
||||
}
|
||||
|
||||
// finalURLTemplate is similar to URL(), but will make all specific parameter values equal
|
||||
// - instead of name or namespace, "{name}" and "{namespace}" will be used, and all query
|
||||
// parameters will be reset. This creates a copy of the url so as not to change the
|
||||
// underlying object.
|
||||
func (r Request) finalURLTemplate() url.URL {
|
||||
newParams := url.Values{}
|
||||
v := []string{"{value}"}
|
||||
for k := range r.params {
|
||||
newParams[k] = v
|
||||
}
|
||||
r.params = newParams
|
||||
u := r.URL()
|
||||
if u == nil {
|
||||
return url.URL{}
|
||||
}
|
||||
|
||||
segments := strings.Split(u.Path, "/")
|
||||
groupIndex := 0
|
||||
index := 0
|
||||
trimmedBasePath := ""
|
||||
if r.c.base != nil && strings.Contains(u.Path, r.c.base.Path) {
|
||||
p := strings.TrimPrefix(u.Path, r.c.base.Path)
|
||||
if !strings.HasPrefix(p, "/") {
|
||||
p = "/" + p
|
||||
}
|
||||
// store the base path that we have trimmed so we can append it
|
||||
// before returning the URL
|
||||
trimmedBasePath = r.c.base.Path
|
||||
segments = strings.Split(p, "/")
|
||||
groupIndex = 1
|
||||
}
|
||||
if len(segments) <= 2 {
|
||||
return *u
|
||||
}
|
||||
|
||||
const CoreGroupPrefix = "api"
|
||||
const NamedGroupPrefix = "apis"
|
||||
isCoreGroup := segments[groupIndex] == CoreGroupPrefix
|
||||
isNamedGroup := segments[groupIndex] == NamedGroupPrefix
|
||||
if isCoreGroup {
|
||||
// checking the case of core group with /api/v1/... format
|
||||
index = groupIndex + 2
|
||||
} else if isNamedGroup {
|
||||
// checking the case of named group with /apis/apps/v1/... format
|
||||
index = groupIndex + 3
|
||||
} else {
|
||||
// this should not happen that the only two possibilities are /api... and /apis..., just want to put an
|
||||
// outlet here in case more API groups are added in future if ever possible:
|
||||
// https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups
|
||||
// if a wrong API groups name is encountered, return the {prefix} for url.Path
|
||||
u.Path = "/{prefix}"
|
||||
u.RawQuery = ""
|
||||
return *u
|
||||
}
|
||||
// switch segLength := len(segments) - index; segLength {
|
||||
switch {
|
||||
// case len(segments) - index == 1:
|
||||
// resource (with no name) do nothing
|
||||
case len(segments)-index == 2:
|
||||
// /$RESOURCE/$NAME: replace $NAME with {name}
|
||||
segments[index+1] = "{name}"
|
||||
case len(segments)-index == 3:
|
||||
if segments[index+2] == "finalize" || segments[index+2] == "status" {
|
||||
// /$RESOURCE/$NAME/$SUBRESOURCE: replace $NAME with {name}
|
||||
segments[index+1] = "{name}"
|
||||
} else {
|
||||
// /namespace/$NAMESPACE/$RESOURCE: replace $NAMESPACE with {namespace}
|
||||
segments[index+1] = "{namespace}"
|
||||
}
|
||||
case len(segments)-index >= 4:
|
||||
segments[index+1] = "{namespace}"
|
||||
// /namespace/$NAMESPACE/$RESOURCE/$NAME: replace $NAMESPACE with {namespace}, $NAME with {name}
|
||||
if segments[index+3] != "finalize" && segments[index+3] != "status" {
|
||||
// /$RESOURCE/$NAME/$SUBRESOURCE: replace $NAME with {name}
|
||||
segments[index+3] = "{name}"
|
||||
}
|
||||
}
|
||||
u.Path = path.Join(trimmedBasePath, path.Join(segments...))
|
||||
return *u
|
||||
}
|
||||
|
||||
func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) error {
|
||||
if r.rateLimiter == nil {
|
||||
return nil
|
||||
|
@ -537,7 +618,7 @@ func (r *Request) tryThrottleWithInfo(ctx context.Context, retryInfo string) err
|
|||
// but we use a throttled logger to prevent spamming.
|
||||
globalThrottledLogger.Infof("%s", message)
|
||||
}
|
||||
metrics.RateLimiterLatency.Observe(ctx, r.verb, *r.URL(), latency)
|
||||
metrics.RateLimiterLatency.Observe(ctx, r.verb, r.finalURLTemplate(), latency)
|
||||
|
||||
return err
|
||||
}
|
||||
|
@ -826,7 +907,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp
|
|||
// Metrics for total request latency
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metrics.RequestLatency.Observe(ctx, r.verb, *r.URL(), time.Since(start))
|
||||
metrics.RequestLatency.Observe(ctx, r.verb, r.finalURLTemplate(), time.Since(start))
|
||||
}()
|
||||
|
||||
if r.err != nil {
|
||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package transport
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
|
@ -55,6 +56,9 @@ type tlsCacheKey struct {
|
|||
serverName string
|
||||
nextProtos string
|
||||
disableCompression bool
|
||||
// these functions are wrapped to allow them to be used as map keys
|
||||
getCert *GetCertHolder
|
||||
dial *DialHolder
|
||||
}
|
||||
|
||||
func (t tlsCacheKey) String() string {
|
||||
|
@ -62,7 +66,8 @@ func (t tlsCacheKey) String() string {
|
|||
if len(t.keyData) > 0 {
|
||||
keyText = "<redacted>"
|
||||
}
|
||||
return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s, disableCompression:%t", t.insecure, t.caData, t.certData, keyText, t.serverName, t.disableCompression)
|
||||
return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s, disableCompression:%t, getCert:%p, dial:%p",
|
||||
t.insecure, t.caData, t.certData, keyText, t.serverName, t.disableCompression, t.getCert, t.dial)
|
||||
}
|
||||
|
||||
func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
||||
|
@ -92,8 +97,10 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
|||
return http.DefaultTransport, nil
|
||||
}
|
||||
|
||||
dial := config.Dial
|
||||
if dial == nil {
|
||||
var dial func(ctx context.Context, network, address string) (net.Conn, error)
|
||||
if config.Dial != nil {
|
||||
dial = config.Dial
|
||||
} else {
|
||||
dial = (&net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
KeepAlive: 30 * time.Second,
|
||||
|
@ -138,10 +145,18 @@ func tlsConfigKey(c *Config) (tlsCacheKey, bool, error) {
|
|||
return tlsCacheKey{}, false, err
|
||||
}
|
||||
|
||||
if c.TLS.GetCert != nil || c.Dial != nil || c.Proxy != nil {
|
||||
if c.Proxy != nil {
|
||||
// cannot determine equality for functions
|
||||
return tlsCacheKey{}, false, nil
|
||||
}
|
||||
if c.Dial != nil && c.DialHolder == nil {
|
||||
// cannot determine equality for dial function that doesn't have non-nil DialHolder set as well
|
||||
return tlsCacheKey{}, false, nil
|
||||
}
|
||||
if c.TLS.GetCert != nil && c.TLS.GetCertHolder == nil {
|
||||
// cannot determine equality for getCert function that doesn't have non-nil GetCertHolder set as well
|
||||
return tlsCacheKey{}, false, nil
|
||||
}
|
||||
|
||||
k := tlsCacheKey{
|
||||
insecure: c.TLS.Insecure,
|
||||
|
@ -149,6 +164,8 @@ func tlsConfigKey(c *Config) (tlsCacheKey, bool, error) {
|
|||
serverName: c.TLS.ServerName,
|
||||
nextProtos: strings.Join(c.TLS.NextProtos, ","),
|
||||
disableCompression: c.DisableCompression,
|
||||
getCert: c.TLS.GetCertHolder,
|
||||
dial: c.DialHolder,
|
||||
}
|
||||
|
||||
if c.TLS.ReloadTLSFiles {
|
||||
|
|
|
@ -68,7 +68,11 @@ type Config struct {
|
|||
WrapTransport WrapperFunc
|
||||
|
||||
// Dial specifies the dial function for creating unencrypted TCP connections.
|
||||
// If specified, this transport will be non-cacheable unless DialHolder is also set.
|
||||
Dial func(ctx context.Context, network, address string) (net.Conn, error)
|
||||
// DialHolder can be populated to make transport configs cacheable.
|
||||
// If specified, DialHolder.Dial must be equal to Dial.
|
||||
DialHolder *DialHolder
|
||||
|
||||
// Proxy is the proxy func to be used for all requests made by this
|
||||
// transport. If Proxy is nil, http.ProxyFromEnvironment is used. If Proxy
|
||||
|
@ -78,6 +82,11 @@ type Config struct {
|
|||
Proxy func(*http.Request) (*url.URL, error)
|
||||
}
|
||||
|
||||
// DialHolder is used to make the wrapped function comparable so that it can be used as a map key.
|
||||
type DialHolder struct {
|
||||
Dial func(ctx context.Context, network, address string) (net.Conn, error)
|
||||
}
|
||||
|
||||
// ImpersonationConfig has all the available impersonation options
|
||||
type ImpersonationConfig struct {
|
||||
// UserName matches user.Info.GetName()
|
||||
|
@ -143,5 +152,15 @@ type TLSConfig struct {
|
|||
// To use only http/1.1, set to ["http/1.1"].
|
||||
NextProtos []string
|
||||
|
||||
GetCert func() (*tls.Certificate, error) // Callback that returns a TLS client certificate. CertData, CertFile, KeyData and KeyFile supercede this field.
|
||||
// Callback that returns a TLS client certificate. CertData, CertFile, KeyData and KeyFile supercede this field.
|
||||
// If specified, this transport is non-cacheable unless CertHolder is populated.
|
||||
GetCert func() (*tls.Certificate, error)
|
||||
// CertHolder can be populated to make transport configs that set GetCert cacheable.
|
||||
// If set, CertHolder.GetCert must be equal to GetCert.
|
||||
GetCertHolder *GetCertHolder
|
||||
}
|
||||
|
||||
// GetCertHolder is used to make the wrapped function comparable so that it can be used as a map key.
|
||||
type GetCertHolder struct {
|
||||
GetCert func() (*tls.Certificate, error)
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -39,6 +40,10 @@ func New(config *Config) (http.RoundTripper, error) {
|
|||
return nil, fmt.Errorf("using a custom transport with TLS certificate options or the insecure flag is not allowed")
|
||||
}
|
||||
|
||||
if !isValidHolders(config) {
|
||||
return nil, fmt.Errorf("misconfigured holder for dialer or cert callback")
|
||||
}
|
||||
|
||||
var (
|
||||
rt http.RoundTripper
|
||||
err error
|
||||
|
@ -56,6 +61,26 @@ func New(config *Config) (http.RoundTripper, error) {
|
|||
return HTTPWrappersForConfig(config, rt)
|
||||
}
|
||||
|
||||
func isValidHolders(config *Config) bool {
|
||||
if config.TLS.GetCertHolder != nil {
|
||||
if config.TLS.GetCertHolder.GetCert == nil ||
|
||||
config.TLS.GetCert == nil ||
|
||||
reflect.ValueOf(config.TLS.GetCertHolder.GetCert).Pointer() != reflect.ValueOf(config.TLS.GetCert).Pointer() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if config.DialHolder != nil {
|
||||
if config.DialHolder.Dial == nil ||
|
||||
config.Dial == nil ||
|
||||
reflect.ValueOf(config.DialHolder.Dial).Pointer() != reflect.ValueOf(config.Dial).Pointer() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// TLSConfigFor returns a tls.Config that will provide the transport level security defined
|
||||
// by the provided Config. Will return nil if no transport level security is requested.
|
||||
func TLSConfigFor(c *Config) (*tls.Config, error) {
|
||||
|
|
|
@ -133,6 +133,20 @@ func CheckDiffErr(err error) {
|
|||
})
|
||||
}
|
||||
|
||||
// isInvalidReasonStatusError returns true if this is an API Status error with reason=Invalid.
|
||||
// This is distinct from generic 422 errors we want to fall back to generic error handling.
|
||||
func isInvalidReasonStatusError(err error) bool {
|
||||
if !apierrors.IsInvalid(err) {
|
||||
return false
|
||||
}
|
||||
statusError, isStatusError := err.(*apierrors.StatusError)
|
||||
if !isStatusError {
|
||||
return false
|
||||
}
|
||||
status := statusError.Status()
|
||||
return status.Reason == metav1.StatusReasonInvalid
|
||||
}
|
||||
|
||||
// checkErr formats a given error as a string and calls the passed handleErr
|
||||
// func with that string and an kubectl exit code.
|
||||
func checkErr(err error, handleErr func(string, int)) {
|
||||
|
@ -148,16 +162,26 @@ func checkErr(err error, handleErr func(string, int)) {
|
|||
switch {
|
||||
case err == ErrExit:
|
||||
handleErr("", DefaultErrorExitCode)
|
||||
case apierrors.IsInvalid(err):
|
||||
details := err.(*apierrors.StatusError).Status().Details
|
||||
case isInvalidReasonStatusError(err):
|
||||
status := err.(*apierrors.StatusError).Status()
|
||||
details := status.Details
|
||||
s := "The request is invalid"
|
||||
if details == nil {
|
||||
// if we have no other details, include the message from the server if present
|
||||
if len(status.Message) > 0 {
|
||||
s += ": " + status.Message
|
||||
}
|
||||
handleErr(s, DefaultErrorExitCode)
|
||||
return
|
||||
}
|
||||
if len(details.Kind) != 0 || len(details.Name) != 0 {
|
||||
s = fmt.Sprintf("The %s %q is invalid", details.Kind, details.Name)
|
||||
} else if len(status.Message) > 0 && len(details.Causes) == 0 {
|
||||
// only append the message if we have no kind/name details and no causes,
|
||||
// since default invalid error constructors duplicate that information in the message
|
||||
s += ": " + status.Message
|
||||
}
|
||||
|
||||
if len(details.Causes) > 0 {
|
||||
errs := statusCausesToAggrError(details.Causes)
|
||||
handleErr(MultilineError(s+": ", errs), DefaultErrorExitCode)
|
||||
|
|
|
@ -103,7 +103,7 @@ github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes
|
|||
github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector
|
||||
github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs
|
||||
github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter
|
||||
# github.com/aws/aws-sdk-go v1.44.99
|
||||
# github.com/aws/aws-sdk-go v1.44.104
|
||||
## explicit; go 1.11
|
||||
github.com/aws/aws-sdk-go/aws
|
||||
github.com/aws/aws-sdk-go/aws/arn
|
||||
|
@ -254,7 +254,7 @@ github.com/cpuguy83/go-md2man/v2/md2man
|
|||
# github.com/davecgh/go-spew v1.1.1
|
||||
## explicit
|
||||
github.com/davecgh/go-spew/spew
|
||||
# github.com/digitalocean/godo v1.83.0
|
||||
# github.com/digitalocean/godo v1.85.0
|
||||
## explicit; go 1.18
|
||||
github.com/digitalocean/godo
|
||||
github.com/digitalocean/godo/metrics
|
||||
|
@ -577,11 +577,11 @@ github.com/hashicorp/hcl/v2/hclwrite
|
|||
# github.com/hashicorp/memberlist v0.3.1
|
||||
## explicit; go 1.12
|
||||
github.com/hashicorp/memberlist
|
||||
# github.com/hashicorp/vault/api v1.7.2
|
||||
# github.com/hashicorp/vault/api v1.8.0
|
||||
## explicit; go 1.17
|
||||
github.com/hashicorp/vault/api
|
||||
# github.com/hashicorp/vault/sdk v0.5.1
|
||||
## explicit; go 1.17
|
||||
# github.com/hashicorp/vault/sdk v0.6.0
|
||||
## explicit; go 1.19
|
||||
github.com/hashicorp/vault/sdk/helper/certutil
|
||||
github.com/hashicorp/vault/sdk/helper/compressutil
|
||||
github.com/hashicorp/vault/sdk/helper/consts
|
||||
|
@ -603,7 +603,7 @@ github.com/hashicorp/vault/sdk/version
|
|||
# github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb
|
||||
## explicit
|
||||
github.com/hashicorp/yamux
|
||||
# github.com/hetznercloud/hcloud-go v1.35.2
|
||||
# github.com/hetznercloud/hcloud-go v1.35.3
|
||||
## explicit; go 1.18
|
||||
github.com/hetznercloud/hcloud-go/hcloud
|
||||
github.com/hetznercloud/hcloud-go/hcloud/internal/instrumentation
|
||||
|
@ -936,7 +936,7 @@ go.uber.org/atomic
|
|||
# go.uber.org/multierr v1.8.0
|
||||
## explicit; go 1.14
|
||||
go.uber.org/multierr
|
||||
# golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
|
||||
# golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0
|
||||
## explicit; go 1.17
|
||||
golang.org/x/crypto/bcrypt
|
||||
golang.org/x/crypto/blake2b
|
||||
|
@ -963,7 +963,7 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
|
|||
golang.org/x/mod/internal/lazyregexp
|
||||
golang.org/x/mod/module
|
||||
golang.org/x/mod/semver
|
||||
# golang.org/x/net v0.0.0-20220909164309-bea034e7d591
|
||||
# golang.org/x/net v0.0.0-20220921203646-d300de134e69
|
||||
## explicit; go 1.17
|
||||
golang.org/x/net/bpf
|
||||
golang.org/x/net/context
|
||||
|
@ -994,7 +994,7 @@ golang.org/x/oauth2/jwt
|
|||
## explicit
|
||||
golang.org/x/sync/errgroup
|
||||
golang.org/x/sync/semaphore
|
||||
# golang.org/x/sys v0.0.0-20220915200043-7b5979e65e41
|
||||
# golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8
|
||||
## explicit; go 1.17
|
||||
golang.org/x/sys/cpu
|
||||
golang.org/x/sys/execabs
|
||||
|
@ -1045,7 +1045,7 @@ golang.org/x/tools/internal/typesinternal
|
|||
# gomodules.xyz/jsonpatch/v2 v2.2.0
|
||||
## explicit; go 1.12
|
||||
gomodules.xyz/jsonpatch/v2
|
||||
# google.golang.org/api v0.96.0
|
||||
# google.golang.org/api v0.97.0
|
||||
## explicit; go 1.15
|
||||
google.golang.org/api/cloudresourcemanager/v1
|
||||
google.golang.org/api/compute/v0.alpha
|
||||
|
@ -1202,8 +1202,8 @@ gopkg.in/yaml.v2
|
|||
# gopkg.in/yaml.v3 v3.0.1
|
||||
## explicit
|
||||
gopkg.in/yaml.v3
|
||||
# helm.sh/helm/v3 v3.9.4
|
||||
## explicit; go 1.17
|
||||
# helm.sh/helm/v3 v3.10.0
|
||||
## explicit; go 1.18
|
||||
helm.sh/helm/v3/internal/ignore
|
||||
helm.sh/helm/v3/internal/sympath
|
||||
helm.sh/helm/v3/internal/tlsutil
|
||||
|
@ -1219,7 +1219,7 @@ helm.sh/helm/v3/pkg/helmpath/xdg
|
|||
helm.sh/helm/v3/pkg/plugin
|
||||
helm.sh/helm/v3/pkg/registry
|
||||
helm.sh/helm/v3/pkg/strvals
|
||||
# k8s.io/api v0.25.0
|
||||
# k8s.io/api v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/api/admission/v1
|
||||
k8s.io/api/admission/v1beta1
|
||||
|
@ -1274,7 +1274,7 @@ k8s.io/api/storage/v1beta1
|
|||
## explicit; go 1.19
|
||||
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions
|
||||
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
|
||||
# k8s.io/apimachinery v0.25.0
|
||||
# k8s.io/apimachinery v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/apimachinery/pkg/api/equality
|
||||
k8s.io/apimachinery/pkg/api/errors
|
||||
|
@ -1331,12 +1331,12 @@ k8s.io/apimachinery/pkg/watch
|
|||
k8s.io/apimachinery/third_party/forked/golang/json
|
||||
k8s.io/apimachinery/third_party/forked/golang/netutil
|
||||
k8s.io/apimachinery/third_party/forked/golang/reflect
|
||||
# k8s.io/cli-runtime v0.25.0
|
||||
# k8s.io/cli-runtime v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/cli-runtime/pkg/genericclioptions
|
||||
k8s.io/cli-runtime/pkg/printers
|
||||
k8s.io/cli-runtime/pkg/resource
|
||||
# k8s.io/client-go v0.25.0
|
||||
# k8s.io/client-go v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/client-go/applyconfigurations/admissionregistration/v1
|
||||
k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1
|
||||
|
@ -1638,7 +1638,7 @@ k8s.io/client-go/util/jsonpath
|
|||
k8s.io/client-go/util/keyutil
|
||||
k8s.io/client-go/util/retry
|
||||
k8s.io/client-go/util/workqueue
|
||||
# k8s.io/cloud-provider v0.25.0
|
||||
# k8s.io/cloud-provider v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/cloud-provider
|
||||
k8s.io/cloud-provider/node/helpers
|
||||
|
@ -1649,7 +1649,7 @@ k8s.io/cloud-provider/volume/helpers
|
|||
# k8s.io/cloud-provider-aws v1.25.0
|
||||
## explicit; go 1.19
|
||||
k8s.io/cloud-provider-aws/pkg/providers/v1
|
||||
# k8s.io/component-base v0.25.0
|
||||
# k8s.io/component-base v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/component-base/cli/flag
|
||||
k8s.io/component-base/config
|
||||
|
@ -1662,7 +1662,7 @@ k8s.io/component-base/metrics/prometheus/restclient
|
|||
k8s.io/component-base/metrics/prometheusextension
|
||||
k8s.io/component-base/tracing/api/v1
|
||||
k8s.io/component-base/version
|
||||
# k8s.io/csi-translation-lib v0.25.0
|
||||
# k8s.io/csi-translation-lib v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/csi-translation-lib/plugins
|
||||
# k8s.io/gengo v0.0.0-20220913193501-391367153a38
|
||||
|
@ -1697,7 +1697,7 @@ k8s.io/kube-openapi/pkg/spec3
|
|||
k8s.io/kube-openapi/pkg/util/proto
|
||||
k8s.io/kube-openapi/pkg/util/proto/validation
|
||||
k8s.io/kube-openapi/pkg/validation/spec
|
||||
# k8s.io/kubectl v0.25.0
|
||||
# k8s.io/kubectl v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/kubectl/pkg/cmd/util
|
||||
k8s.io/kubectl/pkg/cmd/util/editor
|
||||
|
@ -1713,17 +1713,17 @@ k8s.io/kubectl/pkg/util/slice
|
|||
k8s.io/kubectl/pkg/util/templates
|
||||
k8s.io/kubectl/pkg/util/term
|
||||
k8s.io/kubectl/pkg/validation
|
||||
# k8s.io/kubelet v0.25.0
|
||||
# k8s.io/kubelet v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/kubelet/config/v1beta1
|
||||
# k8s.io/legacy-cloud-providers v0.25.0
|
||||
# k8s.io/legacy-cloud-providers v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/legacy-cloud-providers/gce
|
||||
# k8s.io/mount-utils v0.25.0
|
||||
# k8s.io/mount-utils v0.25.2
|
||||
## explicit; go 1.19
|
||||
k8s.io/mount-utils
|
||||
# k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
|
||||
## explicit; go 1.12
|
||||
# k8s.io/utils v0.0.0-20220922133306-665eaaec4324
|
||||
## explicit; go 1.18
|
||||
k8s.io/utils/buffer
|
||||
k8s.io/utils/clock
|
||||
k8s.io/utils/clock/testing
|
||||
|
|
Loading…
Reference in New Issue