diff --git a/docs/driver-parameters.md b/docs/driver-parameters.md
index 9bb37778e..e165ee787 100644
--- a/docs/driver-parameters.md
+++ b/docs/driver-parameters.md
@@ -28,6 +28,7 @@ useDataPlaneAPI | specify whether use data plane API for blob container create/d
--- | **Following parameters are only for blobfuse** | --- | --- |
subscriptionID | specify Azure subscription ID in which blob storage directory will be created | Azure subscription ID | No | if not empty, `resourceGroup` must be provided
storeAccountKey | whether store account key to k8s secret
Note:
`false` means driver would leverage kubelet identity to get account key | `true`,`false` | No | `true`
+getLatestAccountKey | whether getting the latest account key based on the creation time, this driver would get the first key by default | `true`,`false` | No | `false`
secretName | specify secret name to store account key | | No |
secretNamespace | specify the namespace of secret to store account key | `default`,`kube-system`, etc | No | pvc namespace
isHnsEnabled | enable `Hierarchical namespace` for Azure DataLake storage account | `true`,`false` | No | `false`
@@ -80,6 +81,7 @@ volumeAttributes.protocol | specify blobfuse, blobfuse2 or NFSv3 mount (blobfuse
--- | **Following parameters are only for blobfuse** | --- | --- |
volumeAttributes.secretName | secret name that stores storage account name and key(only applies for SMB) | | No |
volumeAttributes.secretNamespace | secret namespace | `default`,`kube-system`, etc | No | pvc namespace
+volumeAttributes.getLatestAccountKey | whether getting the latest account key based on the creation time, this driver would get the first key by default | `true`,`false` | No | `false`
nodeStageSecretRef.name | secret name that stores(check below examples):
`azurestorageaccountkey`
`azurestorageaccountsastoken`
`msisecret`
`azurestoragespnclientsecret` | existing Kubernetes secret name | No |
nodeStageSecretRef.namespace | secret namespace | k8s namespace | Yes |
--- | **Following parameters are only for NFS protocol** | --- | --- |
diff --git a/go.mod b/go.mod
index 14bb3a111..5e04e47cc 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.20
require (
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0
- github.com/Azure/go-autorest/autorest v0.11.28
+ github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/adal v0.9.23
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/container-storage-interface/spec v1.8.0
@@ -14,22 +14,22 @@ require (
github.com/golang/protobuf v1.5.3
github.com/imdario/mergo v0.3.9 // indirect
github.com/kubernetes-csi/csi-lib-utils v0.13.0
- github.com/onsi/gomega v1.27.6
+ github.com/onsi/gomega v1.27.8
github.com/pborman/uuid v1.2.0
github.com/pelletier/go-toml v1.9.4
- github.com/stretchr/testify v1.8.2
+ github.com/stretchr/testify v1.8.4
golang.org/x/net v0.10.0
google.golang.org/grpc v1.51.0
google.golang.org/protobuf v1.30.0
- k8s.io/api v0.27.1
- k8s.io/apimachinery v0.27.1
- k8s.io/client-go v0.27.1
- k8s.io/component-base v0.27.1
- k8s.io/klog/v2 v2.90.1
+ k8s.io/api v0.27.2
+ k8s.io/apimachinery v0.27.2
+ k8s.io/client-go v0.27.2
+ k8s.io/component-base v0.27.2
+ k8s.io/klog/v2 v2.100.1
k8s.io/kubernetes v1.27.1
k8s.io/mount-utils v0.27.1
k8s.io/utils v0.0.0-20230209194617-a36077c30491
- sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230423180712-b979bea29b6a
+ sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230613061957-d0cd51201edc
sigs.k8s.io/yaml v1.3.0
)
@@ -39,10 +39,10 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
github.com/go-ini/ini v1.67.0
github.com/jongio/azidext/go/azidext v0.4.0
- github.com/onsi/ginkgo/v2 v2.9.5
+ github.com/onsi/ginkgo/v2 v2.10.0
github.com/pkg/errors v0.9.1
github.com/satori/go.uuid v1.2.0
- k8s.io/apiserver v0.27.1
+ k8s.io/apiserver v0.27.2
k8s.io/pod-security-admission v0.27.1
)
@@ -126,14 +126,14 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
- golang.org/x/crypto v0.8.0 // indirect
+ golang.org/x/crypto v0.9.0 // indirect
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sync v0.2.0 // indirect
- golang.org/x/sys v0.8.0 // indirect
+ golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.8.0 // indirect
- golang.org/x/text v0.9.0 // indirect
+ golang.org/x/text v0.10.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
- golang.org/x/tools v0.9.1 // indirect
+ golang.org/x/tools v0.9.3 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -141,14 +141,14 @@ require (
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.0.0 // indirect
- k8s.io/cloud-provider v0.27.1 // indirect
- k8s.io/component-helpers v0.27.1 // indirect
- k8s.io/controller-manager v0.27.1 // indirect
- k8s.io/kms v0.27.1 // indirect
- k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
+ k8s.io/cloud-provider v0.27.2 // indirect
+ k8s.io/component-helpers v0.27.2 // indirect
+ k8s.io/controller-manager v0.27.2 // indirect
+ k8s.io/kms v0.27.2 // indirect
+ k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/kubectl v0.0.0 // indirect
- k8s.io/kubelet v0.27.1 // indirect
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.1 // indirect
+ k8s.io/kubelet v0.27.2 // indirect
+ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)
diff --git a/go.sum b/go.sum
index 71aef1581..52f4ffd62 100644
--- a/go.sum
+++ b/go.sum
@@ -48,9 +48,9 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1 h1:YvQv9Mz6T8oR5ypQO
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
-github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM=
-github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA=
-github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
+github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw=
+github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs=
+github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk=
github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8=
github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c=
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
@@ -181,7 +181,6 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
-github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -331,10 +330,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
-github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
-github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
-github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
+github.com/onsi/ginkgo/v2 v2.10.0 h1:sfUl4qgLdvkChZrWCYndY2EAu9BRIw1YphNAzy1VNWs=
+github.com/onsi/ginkgo/v2 v2.10.0/go.mod h1:UDQOh5wbQUlMnkLfVaIUMtQ1Vus92oM+P2JX1aulgcE=
+github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc=
+github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ=
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/selinux v1.10.0 h1:rAiKF8hTcgLI3w0DHm6i0ylVVcOrlgR1kK99DRLDhyU=
@@ -408,8 +407,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -472,8 +472,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
-golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
-golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
+golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
+golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
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=
@@ -617,8 +617,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
-golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s=
+golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@@ -633,8 +633,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
-golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
-golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58=
+golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -685,8 +685,8 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
-golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo=
-golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
+golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
+golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -835,12 +835,12 @@ k8s.io/component-helpers v0.27.1/go.mod h1:oOpwSYW1AdL+pU7abHADwX1ZcJl+5c8mnIkvo
k8s.io/controller-manager v0.27.1 h1:+4OGWAzg4JVLEauPSmyQFIfrYrYQoUsC4MbHmRuPaFU=
k8s.io/controller-manager v0.27.1/go.mod h1:oe9vKl0RPiedlCXmeVbhkDV2yX8r7C4K/B8OGaKdYtY=
k8s.io/csi-translation-lib v0.27.1 h1:D9Hw2iBZzFPriFH0FDyUFdfflYAW6S032P6Yps9sKq8=
-k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw=
-k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kms v0.27.1 h1:JTSQbJb+mcobScQwF0bOmZhIwP17k8GvBsiLlA6SQqw=
-k8s.io/kms v0.27.1/go.mod h1:VuTsw0uHlSycKLCkypCGxfFCjLfzf/5YMeATECd/zJA=
-k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a h1:gmovKNur38vgoWfGtP5QOGNOA7ki4n6qNYoFAgMlNvg=
-k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY=
+k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
+k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kms v0.27.2 h1:wCdmPCa3kubcVd3AssOeaVjLQSu45k5g/vruJ3iqwDU=
+k8s.io/kms v0.27.2/go.mod h1:dahSqjI05J55Fo5qipzvHSRbm20d7llrSeQjjl86A7c=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg=
+k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg=
k8s.io/kubectl v0.27.1 h1:9T5c5KdpburYiW8XKQSH0Uly1kMNE90aGSnbYUZNdcA=
k8s.io/kubectl v0.27.1/go.mod h1:QsAkSmrRsKTPlAFzF8kODGDl4p35BIwQnc9XFhkcsy8=
k8s.io/kubelet v0.27.1 h1:IkfZ0N9CX/g6EDis7nJw8ZsOuHcpFA6cm0pXQx0g5TY=
@@ -856,10 +856,10 @@ k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.1 h1:MB1zkK+WMOmfLxEpjr1wEmkpcIhZC7kfTkZ0stg5bog=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.1/go.mod h1:/4NLd21PQY0B+H+X0aDZdwUiVXYJQl/2NXA5KVtDiP4=
-sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230423180712-b979bea29b6a h1:wscyx3uWXA8OiV8v8x18ak1lIK8U3q6yS2laIHfe8RQ=
-sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230423180712-b979bea29b6a/go.mod h1:vRG0GaFye/VlBpSNUGxYHdC3ZTBwFUnc5ZLng+YoE9g=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2/go.mod h1:+qG7ISXqCDVVcyO8hLn12AKVYYUjM7ftlqsqmrhMZE0=
+sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230613061957-d0cd51201edc h1:VuFd2muy0t7XTFv+pYnb+Y27taqrkPr0dYshXHFeJr8=
+sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230613061957-d0cd51201edc/go.mod h1:2fuRslJpbPeTFvLqpsEKyO7+oJqM4i8Bv3Z/LF8v4YI=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
diff --git a/pkg/blob/blob.go b/pkg/blob/blob.go
index 17b23d8a6..bf89cb2fc 100644
--- a/pkg/blob/blob.go
+++ b/pkg/blob/blob.go
@@ -19,6 +19,7 @@ package blob
import (
"fmt"
"os"
+ "strconv"
"strings"
"sync"
"time"
@@ -70,6 +71,7 @@ const (
containerNameField = "containername"
containerNamePrefixField = "containernameprefix"
storeAccountKeyField = "storeaccountkey"
+ getLatestAccountKeyField = "getlatestaccountkey"
isHnsEnabledField = "ishnsenabled"
softDeleteBlobsField = "softdeleteblobs"
softDeleteContainersField = "softdeletecontainers"
@@ -387,6 +389,7 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
azureStorageAuthType string
authEnv []string
getAccountKeyFromSecret bool
+ getLatestAccountKey bool
)
for k, v := range attrib {
@@ -432,6 +435,10 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
storageSPNTenantID = v
case storageAADEndpointField:
authEnv = append(authEnv, "AZURE_STORAGE_AAD_ENDPOINT="+v)
+ case getLatestAccountKeyField:
+ if getLatestAccountKey, err = strconv.ParseBool(v); err != nil {
+ return rgName, accountName, accountKey, containerName, authEnv, fmt.Errorf("invalid %s: %s in volume context", getLatestAccountKeyField, v)
+ }
}
}
klog.V(2).Infof("volumeID(%s) authEnv: %s", volumeID, authEnv)
@@ -491,7 +498,7 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
if err != nil && !getAccountKeyFromSecret && (azureStorageAuthType == "" || strings.EqualFold(azureStorageAuthType, "key")) {
klog.V(2).Infof("get account(%s) key from secret(%s, %s) failed with error: %v, use cluster identity to get account key instead",
accountName, secretNamespace, secretName, err)
- accountKey, err = d.cloud.GetStorageAccesskey(ctx, subsID, accountName, rgName)
+ accountKey, err = d.cloud.GetStorageAccesskey(ctx, subsID, accountName, rgName, getLatestAccountKey)
if err != nil {
return rgName, accountName, accountKey, containerName, authEnv, fmt.Errorf("no key for storage account(%s) under resource group(%s), err %w", accountName, rgName, err)
}
@@ -573,6 +580,7 @@ func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID str
keyVaultURL string
keyVaultSecretName string
keyVaultSecretVersion string
+ getLatestAccountKey bool
err error
)
@@ -592,6 +600,10 @@ func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID str
accountName = v
case storageAccountNameField: // for compatibility
accountName = v
+ case getLatestAccountKeyField:
+ if getLatestAccountKey, err = strconv.ParseBool(v); err != nil {
+ return "", "", "", "", fmt.Errorf("invalid %s: %s in volume context", getLatestAccountKeyField, v)
+ }
}
}
@@ -620,7 +632,7 @@ func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID str
rgName = d.cloud.ResourceGroup
}
- accountKey, err = d.cloud.GetStorageAccesskey(ctx, subsID, accountName, rgName)
+ accountKey, err = d.cloud.GetStorageAccesskey(ctx, subsID, accountName, rgName, getLatestAccountKey)
if err != nil {
return "", "", "", "", fmt.Errorf("no key for storage account(%s) under resource group(%s), err %w", accountName, rgName, err)
}
@@ -790,7 +802,7 @@ func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.
_, accountKey, _, _, _, _, _, err := d.GetInfoFromSecret(ctx, secretName, secretNamespace) //nolint
if err != nil {
klog.V(2).Infof("could not get account(%s) key from secret(%s) namespace(%s), error: %v, use cluster identity to get account key instead", accountOptions.Name, secretName, secretNamespace, err)
- accountKey, err = d.cloud.GetStorageAccesskey(ctx, accountOptions.SubscriptionID, accountOptions.Name, accountOptions.ResourceGroup)
+ accountKey, err = d.cloud.GetStorageAccesskey(ctx, accountOptions.SubscriptionID, accountOptions.Name, accountOptions.ResourceGroup, accountOptions.GetLatestAccountKey)
}
return accountOptions.Name, accountKey, err
}
diff --git a/pkg/blob/blob_test.go b/pkg/blob/blob_test.go
index ffa18091f..d464afbe3 100644
--- a/pkg/blob/blob_test.go
+++ b/pkg/blob/blob_test.go
@@ -551,6 +551,37 @@ func TestGetAuthEnv(t *testing.T) {
}
},
},
+ {
+ name: "invalid getLatestAccountKey value",
+ testFunc: func(t *testing.T) {
+ d := NewFakeDriver()
+ attrib := map[string]string{
+ getLatestAccountKeyField: "invalid",
+ }
+ secret := make(map[string]string)
+ volumeID := "rg#f5713de20cde511e8ba4900#pvc-fuse-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41"
+ d.cloud = &azure.Cloud{}
+ ctrl := gomock.NewController(t)
+ defer ctrl.Finish()
+ mockStorageAccountsClient := mockstorageaccountclient.NewMockInterface(ctrl)
+ d.cloud.StorageAccountClient = mockStorageAccountsClient
+ s := "unit-test"
+ accountkey := storage.AccountKey{
+ Value: &s,
+ }
+ accountkeylist := []storage.AccountKey{}
+ accountkeylist = append(accountkeylist, accountkey)
+ list := storage.AccountListKeysResult{
+ Keys: &accountkeylist,
+ }
+ mockStorageAccountsClient.EXPECT().ListKeys(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(list, nil).AnyTimes()
+ _, _, _, _, _, err := d.GetAuthEnv(context.TODO(), volumeID, "", attrib, secret)
+ expectedErr := fmt.Errorf("invalid getlatestaccountkey: %s in volume context", "invalid")
+ if !reflect.DeepEqual(err, expectedErr) {
+ t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
+ }
+ },
+ },
{
name: "secret not empty",
testFunc: func(t *testing.T) {
@@ -720,6 +751,37 @@ func TestGetStorageAccountAndContainer(t *testing.T) {
}
},
},
+ {
+ name: "invalid getLatestAccountKey value",
+ testFunc: func(t *testing.T) {
+ d := NewFakeDriver()
+ attrib := map[string]string{
+ getLatestAccountKeyField: "invalid",
+ }
+ secret := make(map[string]string)
+ volumeID := "rg#f5713de20cde511e8ba4900#pvc-fuse-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41"
+ d.cloud = &azure.Cloud{}
+ ctrl := gomock.NewController(t)
+ defer ctrl.Finish()
+ mockStorageAccountsClient := mockstorageaccountclient.NewMockInterface(ctrl)
+ d.cloud.StorageAccountClient = mockStorageAccountsClient
+ s := "unit-test"
+ accountkey := storage.AccountKey{
+ Value: &s,
+ }
+ accountkeylist := []storage.AccountKey{}
+ accountkeylist = append(accountkeylist, accountkey)
+ list := storage.AccountListKeysResult{
+ Keys: &accountkeylist,
+ }
+ mockStorageAccountsClient.EXPECT().ListKeys(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(list, nil).AnyTimes()
+ _, _, _, _, err := d.GetStorageAccountAndContainer(context.TODO(), volumeID, attrib, secret)
+ expectedErr := fmt.Errorf("invalid getlatestaccountkey: %s in volume context", "invalid")
+ if !reflect.DeepEqual(err, expectedErr) {
+ t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
+ }
+ },
+ },
}
for _, tc := range testCases {
t.Run(tc.name, tc.testFunc)
diff --git a/pkg/blob/controllerserver.go b/pkg/blob/controllerserver.go
index 670d43739..9163e5da6 100644
--- a/pkg/blob/controllerserver.go
+++ b/pkg/blob/controllerserver.go
@@ -75,8 +75,9 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
var storageAccountType, subsID, resourceGroup, location, account, containerName, containerNamePrefix, protocol, customTags, secretName, secretNamespace, pvcNamespace string
var isHnsEnabled, requireInfraEncryption, enableBlobVersioning *bool
var vnetResourceGroup, vnetName, subnetName, accessTier, networkEndpointType, storageEndpointSuffix string
- var matchTags, useDataPlaneAPI bool
+ var matchTags, useDataPlaneAPI, getLatestAccountKey bool
var softDeleteBlobs, softDeleteContainers int32
+ var err error
// set allowBlobPublicAccess as false by default
allowBlobPublicAccess := pointer.Bool(false)
@@ -137,6 +138,10 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
if strings.EqualFold(v, falseValue) {
storeAccountKey = false
}
+ case getLatestAccountKeyField:
+ if getLatestAccountKey, err = strconv.ParseBool(v); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid %s: %s in volume context", getLatestAccountKeyField, v)
+ }
case allowBlobPublicAccessField:
if strings.EqualFold(v, trueValue) {
allowBlobPublicAccess = pointer.Bool(true)
@@ -308,6 +313,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
EnableBlobVersioning: enableBlobVersioning,
SoftDeleteBlobs: softDeleteBlobs,
SoftDeleteContainers: softDeleteContainers,
+ GetLatestAccountKey: getLatestAccountKey,
}
var accountKey string
diff --git a/pkg/blob/controllerserver_test.go b/pkg/blob/controllerserver_test.go
index 3da649076..cabf75202 100644
--- a/pkg/blob/controllerserver_test.go
+++ b/pkg/blob/controllerserver_test.go
@@ -229,15 +229,9 @@ func TestCreateVolume(t *testing.T) {
testFunc: func(t *testing.T) {
d := NewFakeDriver()
d.cloud = &azure.Cloud{}
- mp := make(map[string]string)
- mp[protocolField] = "unit-test"
- mp[skuNameField] = "unit-test"
- mp[storageAccountTypeField] = "unit-test"
- mp[locationField] = "unit-test"
- mp[storageAccountField] = "unit-test"
- mp[resourceGroupField] = "unit-test"
- mp[containerNameField] = "unit-test"
- mp[mountPermissionsField] = "0750"
+ mp := map[string]string{
+ protocolField: "unit-test",
+ }
req := &csi.CreateVolumeRequest{
Name: "unit-test",
VolumeCapabilities: stdVolumeCapabilities,
@@ -253,6 +247,29 @@ func TestCreateVolume(t *testing.T) {
}
},
},
+ {
+ name: "invalid getLatestAccountKey value",
+ testFunc: func(t *testing.T) {
+ d := NewFakeDriver()
+ d.cloud = &azure.Cloud{}
+ mp := map[string]string{
+ getLatestAccountKeyField: "invalid",
+ }
+ req := &csi.CreateVolumeRequest{
+ Name: "unit-test",
+ VolumeCapabilities: stdVolumeCapabilities,
+ Parameters: mp,
+ }
+ d.Cap = []*csi.ControllerServiceCapability{
+ controllerServiceCapability,
+ }
+ _, err := d.CreateVolume(context.Background(), req)
+ expectedErr := status.Errorf(codes.InvalidArgument, "invalid %s: %s in volume context", getLatestAccountKeyField, "invalid")
+ if !reflect.DeepEqual(err, expectedErr) {
+ t.Errorf("actualErr: (%v), expectedErr: (%v)", err, expectedErr)
+ }
+ },
+ },
{
name: "storageAccount and matchTags conflict",
testFunc: func(t *testing.T) {
diff --git a/test/e2e/dynamic_provisioning_test.go b/test/e2e/dynamic_provisioning_test.go
index e6eef215c..1495f993a 100644
--- a/test/e2e/dynamic_provisioning_test.go
+++ b/test/e2e/dynamic_provisioning_test.go
@@ -82,6 +82,7 @@ var _ = ginkgo.Describe("[blob-csi-e2e] Dynamic Provisioning", func() {
"secretNamespace": "default",
// make sure this is the first test case due to storeAccountKey is set as false
"storeAccountKey": "false",
+ "getLatestAccountKey": "true",
"requireInfraEncryption": "true",
"accessTier": "Hot",
},
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimages.go
deleted file mode 100644
index ef82a37bc..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimages.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// CommunityGalleryImagesClient is the compute Client
-type CommunityGalleryImagesClient struct {
- BaseClient
-}
-
-// NewCommunityGalleryImagesClient creates an instance of the CommunityGalleryImagesClient client.
-func NewCommunityGalleryImagesClient(subscriptionID string) CommunityGalleryImagesClient {
- return NewCommunityGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewCommunityGalleryImagesClientWithBaseURI creates an instance of the CommunityGalleryImagesClient client using a
-// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds,
-// Azure stack).
-func NewCommunityGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImagesClient {
- return CommunityGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get get a community gallery image.
-// Parameters:
-// location - resource location.
-// publicGalleryName - the public name of the community gallery.
-// galleryImageName - the name of the community gallery image definition.
-func (client CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImage, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CommunityGalleryImagesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "galleryImageName": autorest.Encode("path", galleryImageName),
- "location": autorest.Encode("path", location),
- "publicGalleryName": autorest.Encode("path", publicGalleryName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2021-07-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CommunityGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CommunityGalleryImagesClient) GetResponder(resp *http.Response) (result CommunityGalleryImage, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimageversions.go
deleted file mode 100644
index 03d67523d..000000000
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleryimageversions.go
+++ /dev/null
@@ -1,114 +0,0 @@
-package compute
-
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is regenerated.
-
-import (
- "context"
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/autorest/azure"
- "github.com/Azure/go-autorest/tracing"
- "net/http"
-)
-
-// CommunityGalleryImageVersionsClient is the compute Client
-type CommunityGalleryImageVersionsClient struct {
- BaseClient
-}
-
-// NewCommunityGalleryImageVersionsClient creates an instance of the CommunityGalleryImageVersionsClient client.
-func NewCommunityGalleryImageVersionsClient(subscriptionID string) CommunityGalleryImageVersionsClient {
- return NewCommunityGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
-}
-
-// NewCommunityGalleryImageVersionsClientWithBaseURI creates an instance of the CommunityGalleryImageVersionsClient
-// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI
-// (sovereign clouds, Azure stack).
-func NewCommunityGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImageVersionsClient {
- return CommunityGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)}
-}
-
-// Get get a community gallery image version.
-// Parameters:
-// location - resource location.
-// publicGalleryName - the public name of the community gallery.
-// galleryImageName - the name of the community gallery image definition.
-// galleryImageVersionName - the name of the community gallery image version. Needs to follow semantic version
-// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit
-// integer. Format: ..
-func (client CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result CommunityGalleryImageVersion, err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.Get")
- defer func() {
- sc := -1
- if result.Response.Response != nil {
- sc = result.Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", nil, "Failure preparing request")
- return
- }
-
- resp, err := client.GetSender(req)
- if err != nil {
- result.Response = autorest.Response{Response: resp}
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure sending request")
- return
- }
-
- result, err = client.GetResponder(resp)
- if err != nil {
- err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure responding to request")
- return
- }
-
- return
-}
-
-// GetPreparer prepares the Get request.
-func (client CommunityGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) {
- pathParameters := map[string]interface{}{
- "galleryImageName": autorest.Encode("path", galleryImageName),
- "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName),
- "location": autorest.Encode("path", location),
- "publicGalleryName": autorest.Encode("path", publicGalleryName),
- "subscriptionId": autorest.Encode("path", client.SubscriptionID),
- }
-
- const APIVersion = "2021-07-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(client.BaseURI),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters),
- autorest.WithQueryParameters(queryParameters))
- return preparer.Prepare((&http.Request{}).WithContext(ctx))
-}
-
-// GetSender sends the Get request. The method will close the
-// http.Response Body if it receives an error.
-func (client CommunityGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) {
- return client.Send(req, azure.DoRetryWithRegistration(client.Client))
-}
-
-// GetResponder handles the response to the Get request. The method always
-// closes the http.Response Body.
-func (client CommunityGalleryImageVersionsClient) GetResponder(resp *http.Response) (result CommunityGalleryImageVersion, err error) {
- err = autorest.Respond(
- resp,
- azure.WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&result),
- autorest.ByClosing())
- result.Response = autorest.Response{Response: resp}
- return
-}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md
similarity index 100%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/CHANGELOG.md
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/CHANGELOG.md
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json
similarity index 56%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/_meta.json
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json
index b93e50bd7..2af6e17d2 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/_meta.json
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "1c8d7850afbec9ede6de6f2d14bcc30896a74ed6",
+ "commit": "dad644cc6d0c88991f291eda37e18f27c16739b2",
"readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
- "tag": "package-2022-03-01",
+ "tag": "package-2022-08-01",
"use": "@microsoft.azure/autorest.go@2.1.188",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
- "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-03-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
+ "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-08-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
"additional_properties": {
- "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
+ "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --debug"
}
}
\ No newline at end of file
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/availabilitysets.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go
index ea14bbbb5..90fce14e0 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/availabilitysets.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/availabilitysets.go
@@ -77,7 +77,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +155,7 @@ func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourc
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -230,7 +230,7 @@ func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -309,7 +309,7 @@ func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -423,7 +423,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -501,7 +501,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -618,7 +618,7 @@ func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourc
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservationgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservationgroups.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go
index e73d47dde..b8d398016 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservationgroups.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservationgroups.go
@@ -78,7 +78,7 @@ func (client CapacityReservationGroupsClient) CreateOrUpdatePreparer(ctx context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -158,7 +158,7 @@ func (client CapacityReservationGroupsClient) DeletePreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -237,7 +237,7 @@ func (client CapacityReservationGroupsClient) GetPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -323,7 +323,7 @@ func (client CapacityReservationGroupsClient) ListByResourceGroupPreparer(ctx co
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -444,7 +444,7 @@ func (client CapacityReservationGroupsClient) ListBySubscriptionPreparer(ctx con
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -562,7 +562,7 @@ func (client CapacityReservationGroupsClient) UpdatePreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservations.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go
index c2599c462..d8f7e2ca2 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/capacityreservations.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/capacityreservations.go
@@ -80,7 +80,7 @@ func (client CapacityReservationsClient) CreateOrUpdatePreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -165,7 +165,7 @@ func (client CapacityReservationsClient) DeletePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -255,7 +255,7 @@ func (client CapacityReservationsClient) GetPreparer(ctx context.Context, resour
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -340,7 +340,7 @@ func (client CapacityReservationsClient) ListByCapacityReservationGroupPreparer(
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -449,7 +449,7 @@ func (client CapacityReservationsClient) UpdatePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go
similarity index 100%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/client.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/client.go
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceoperatingsystems.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceoperatingsystems.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go
index 7dfce08d9..31ee54e5f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceoperatingsystems.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceoperatingsystems.go
@@ -77,7 +77,7 @@ func (client CloudServiceOperatingSystemsClient) GetOSFamilyPreparer(ctx context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -154,7 +154,7 @@ func (client CloudServiceOperatingSystemsClient) GetOSVersionPreparer(ctx contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -235,7 +235,7 @@ func (client CloudServiceOperatingSystemsClient) ListOSFamiliesPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -353,7 +353,7 @@ func (client CloudServiceOperatingSystemsClient) ListOSVersionsPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroleinstances.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go
similarity index 96%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroleinstances.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go
index 4edea0aec..f29213d9f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroleinstances.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroleinstances.go
@@ -34,6 +34,8 @@ func NewCloudServiceRoleInstancesClientWithBaseURI(baseURI string, subscriptionI
// Delete deletes a role instance from a cloud service.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) Delete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Delete")
@@ -69,7 +71,7 @@ func (client CloudServiceRoleInstancesClient) DeletePreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -112,6 +114,8 @@ func (client CloudServiceRoleInstancesClient) DeleteResponder(resp *http.Respons
// Get gets a role instance from a cloud service.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services.
func (client CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstance, err error) {
if tracing.IsEnabled() {
@@ -155,7 +159,7 @@ func (client CloudServiceRoleInstancesClient) GetPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -192,6 +196,8 @@ func (client CloudServiceRoleInstancesClient) GetResponder(resp *http.Response)
// GetInstanceView retrieves information about the run-time state of a role instance in a cloud service.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result RoleInstanceInstanceView, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetInstanceView")
@@ -234,7 +240,7 @@ func (client CloudServiceRoleInstancesClient) GetInstanceViewPreparer(ctx contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -268,6 +274,8 @@ func (client CloudServiceRoleInstancesClient) GetInstanceViewResponder(resp *htt
// GetRemoteDesktopFile gets a remote desktop file for a role instance in a cloud service.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result ReadCloser, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetRemoteDesktopFile")
@@ -310,7 +318,7 @@ func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFilePreparer(ctx c
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -343,6 +351,8 @@ func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileResponder(resp
// List gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next
// page of role instances. Do this till nextLink is null to fetch all the role instances.
// Parameters:
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services.
func (client CloudServiceRoleInstancesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultPage, err error) {
if tracing.IsEnabled() {
@@ -390,7 +400,7 @@ func (client CloudServiceRoleInstancesClient) ListPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -466,6 +476,8 @@ func (client CloudServiceRoleInstancesClient) ListComplete(ctx context.Context,
// storage resources, you can use Reimage Role Instance.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) Rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRebuildFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Rebuild")
@@ -501,7 +513,7 @@ func (client CloudServiceRoleInstancesClient) RebuildPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -545,6 +557,8 @@ func (client CloudServiceRoleInstancesClient) RebuildResponder(resp *http.Respon
// or worker roles.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) Reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesReimageFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Reimage")
@@ -580,7 +594,7 @@ func (client CloudServiceRoleInstancesClient) ReimagePreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -623,6 +637,8 @@ func (client CloudServiceRoleInstancesClient) ReimageResponder(resp *http.Respon
// Restart the Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service.
// Parameters:
// roleInstanceName - name of the role instance.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRoleInstancesClient) Restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRestartFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Restart")
@@ -658,7 +674,7 @@ func (client CloudServiceRoleInstancesClient) RestartPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroles.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go
similarity index 96%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroles.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go
index dac28bd98..a67f63511 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudserviceroles.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudserviceroles.go
@@ -34,6 +34,8 @@ func NewCloudServiceRolesClientWithBaseURI(baseURI string, subscriptionID string
// Get gets a role from a cloud service.
// Parameters:
// roleName - name of the role.
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRole, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.Get")
@@ -76,7 +78,7 @@ func (client CloudServiceRolesClient) GetPreparer(ctx context.Context, roleName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -109,6 +111,9 @@ func (client CloudServiceRolesClient) GetResponder(resp *http.Response) (result
// List gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of
// roles. Do this till nextLink is null to fetch all the roles.
+// Parameters:
+// resourceGroupName - name of the resource group.
+// cloudServiceName - name of the cloud service.
func (client CloudServiceRolesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List")
@@ -155,7 +160,7 @@ func (client CloudServiceRolesClient) ListPreparer(ctx context.Context, resource
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservices.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go
index 7086dd644..e467efb8f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservices.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservices.go
@@ -78,7 +78,7 @@ func (client CloudServicesClient) CreateOrUpdatePreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -165,7 +165,7 @@ func (client CloudServicesClient) DeletePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -251,7 +251,7 @@ func (client CloudServicesClient) DeleteInstancesPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -341,7 +341,7 @@ func (client CloudServicesClient) GetPreparer(ctx context.Context, resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -417,7 +417,7 @@ func (client CloudServicesClient) GetInstanceViewPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -497,7 +497,7 @@ func (client CloudServicesClient) ListPreparer(ctx context.Context, resourceGrou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -612,7 +612,7 @@ func (client CloudServicesClient) ListAllPreparer(ctx context.Context) (*http.Re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -719,7 +719,7 @@ func (client CloudServicesClient) PowerOffPreparer(ctx context.Context, resource
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -807,7 +807,7 @@ func (client CloudServicesClient) RebuildPreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -898,7 +898,7 @@ func (client CloudServicesClient) ReimagePreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -989,7 +989,7 @@ func (client CloudServicesClient) RestartPreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1072,7 +1072,7 @@ func (client CloudServicesClient) StartPreparer(ctx context.Context, resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1151,7 +1151,7 @@ func (client CloudServicesClient) UpdatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservicesupdatedomain.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservicesupdatedomain.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go
index eabe4deef..74f7d76a3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/cloudservicesupdatedomain.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/cloudservicesupdatedomain.go
@@ -80,7 +80,7 @@ func (client CloudServicesUpdateDomainClient) GetUpdateDomainPreparer(ctx contex
"updateDomain": autorest.Encode("path", updateDomain),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -161,7 +161,7 @@ func (client CloudServicesUpdateDomainClient) ListUpdateDomainsPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -271,7 +271,7 @@ func (client CloudServicesUpdateDomainClient) WalkUpdateDomainPreparer(ctx conte
"updateDomain": autorest.Encode("path", updateDomain),
}
- const APIVersion = "2021-03-01"
+ const APIVersion = "2022-04-04"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleries.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go
index 995963871..6a6335a1e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/communitygalleries.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleries.go
@@ -76,7 +76,7 @@ func (client CommunityGalleriesClient) GetPreparer(ctx context.Context, location
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go
new file mode 100644
index 000000000..b77c378c6
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimages.go
@@ -0,0 +1,228 @@
+package compute
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// CommunityGalleryImagesClient is the compute Client
+type CommunityGalleryImagesClient struct {
+ BaseClient
+}
+
+// NewCommunityGalleryImagesClient creates an instance of the CommunityGalleryImagesClient client.
+func NewCommunityGalleryImagesClient(subscriptionID string) CommunityGalleryImagesClient {
+ return NewCommunityGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCommunityGalleryImagesClientWithBaseURI creates an instance of the CommunityGalleryImagesClient client using a
+// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds,
+// Azure stack).
+func NewCommunityGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImagesClient {
+ return CommunityGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get get a community gallery image.
+// Parameters:
+// location - resource location.
+// publicGalleryName - the public name of the community gallery.
+// galleryImageName - the name of the community gallery image definition.
+func (client CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client CommunityGalleryImagesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "galleryImageName": autorest.Encode("path", galleryImageName),
+ "location": autorest.Encode("path", location),
+ "publicGalleryName": autorest.Encode("path", publicGalleryName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2022-01-03"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client CommunityGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client CommunityGalleryImagesClient) GetResponder(resp *http.Response) (result CommunityGalleryImage, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list community gallery images inside a gallery.
+// Parameters:
+// location - resource location.
+// publicGalleryName - the public name of the community gallery.
+func (client CommunityGalleryImagesClient) List(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List")
+ defer func() {
+ sc := -1
+ if result.cgil.Response.Response != nil {
+ sc = result.cgil.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, location, publicGalleryName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.cgil.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.cgil, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.cgil.hasNextLink() && result.cgil.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client CommunityGalleryImagesClient) ListPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "location": autorest.Encode("path", location),
+ "publicGalleryName": autorest.Encode("path", publicGalleryName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2022-01-03"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client CommunityGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client CommunityGalleryImagesClient) ListResponder(resp *http.Response) (result CommunityGalleryImageList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client CommunityGalleryImagesClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageList) (result CommunityGalleryImageList, err error) {
+ req, err := lastResults.communityGalleryImageListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client CommunityGalleryImagesClient) ListComplete(ctx context.Context, location string, publicGalleryName string) (result CommunityGalleryImageListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, location, publicGalleryName)
+ return
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go
new file mode 100644
index 000000000..dfa0ea75d
--- /dev/null
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/communitygalleryimageversions.go
@@ -0,0 +1,234 @@
+package compute
+
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// CommunityGalleryImageVersionsClient is the compute Client
+type CommunityGalleryImageVersionsClient struct {
+ BaseClient
+}
+
+// NewCommunityGalleryImageVersionsClient creates an instance of the CommunityGalleryImageVersionsClient client.
+func NewCommunityGalleryImageVersionsClient(subscriptionID string) CommunityGalleryImageVersionsClient {
+ return NewCommunityGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewCommunityGalleryImageVersionsClientWithBaseURI creates an instance of the CommunityGalleryImageVersionsClient
+// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI
+// (sovereign clouds, Azure stack).
+func NewCommunityGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImageVersionsClient {
+ return CommunityGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// Get get a community gallery image version.
+// Parameters:
+// location - resource location.
+// publicGalleryName - the public name of the community gallery.
+// galleryImageName - the name of the community gallery image definition.
+// galleryImageVersionName - the name of the community gallery image version. Needs to follow semantic version
+// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit
+// integer. Format: ..
+func (client CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result CommunityGalleryImageVersion, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure responding to request")
+ return
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client CommunityGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "galleryImageName": autorest.Encode("path", galleryImageName),
+ "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName),
+ "location": autorest.Encode("path", location),
+ "publicGalleryName": autorest.Encode("path", publicGalleryName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2022-01-03"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client CommunityGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client CommunityGalleryImageVersionsClient) GetResponder(resp *http.Response) (result CommunityGalleryImageVersion, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List list community gallery image versions inside an image.
+// Parameters:
+// location - resource location.
+// publicGalleryName - the public name of the community gallery.
+// galleryImageName - the name of the community gallery image definition.
+func (client CommunityGalleryImageVersionsClient) List(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List")
+ defer func() {
+ sc := -1
+ if result.cgivl.Response.Response != nil {
+ sc = result.cgivl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, location, publicGalleryName, galleryImageName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.cgivl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.cgivl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "List", resp, "Failure responding to request")
+ return
+ }
+ if result.cgivl.hasNextLink() && result.cgivl.IsEmpty() {
+ err = result.NextWithContext(ctx)
+ return
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client CommunityGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "galleryImageName": autorest.Encode("path", galleryImageName),
+ "location": autorest.Encode("path", location),
+ "publicGalleryName": autorest.Encode("path", publicGalleryName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2022-01-03"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client CommunityGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return client.Send(req, azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client CommunityGalleryImageVersionsClient) ListResponder(resp *http.Response) (result CommunityGalleryImageVersionList, err error) {
+ err = autorest.Respond(
+ resp,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client CommunityGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults CommunityGalleryImageVersionList) (result CommunityGalleryImageVersionList, err error) {
+ req, err := lastResults.communityGalleryImageVersionListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client CommunityGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImageVersionListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, location, publicGalleryName, galleryImageName)
+ return
+}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhostgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhostgroups.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go
index 0b7ea6ca3..0165ab393 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhostgroups.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhostgroups.go
@@ -88,7 +88,7 @@ func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Conte
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -166,7 +166,7 @@ func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, reso
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -244,7 +244,7 @@ func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourc
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -327,7 +327,7 @@ func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -441,7 +441,7 @@ func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.C
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -555,7 +555,7 @@ func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, reso
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhosts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhosts.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go
index 67a3daf01..2e52a6e1d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/dedicatedhosts.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/dedicatedhosts.go
@@ -82,7 +82,7 @@ func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -165,7 +165,7 @@ func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -254,7 +254,7 @@ func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGrou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -339,7 +339,7 @@ func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -450,7 +450,7 @@ func (client DedicatedHostsClient) RestartPreparer(ctx context.Context, resource
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -531,7 +531,7 @@ func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskaccesses.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskaccesses.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go
index 0026f2946..f7e51959c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskaccesses.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskaccesses.go
@@ -72,7 +72,7 @@ func (client DiskAccessesClient) CreateOrUpdatePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +155,7 @@ func (client DiskAccessesClient) DeletePreparer(ctx context.Context, resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -237,7 +237,7 @@ func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionPreparer(ctx co
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -324,7 +324,7 @@ func (client DiskAccessesClient) GetPreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -404,7 +404,7 @@ func (client DiskAccessesClient) GetAPrivateEndpointConnectionPreparer(ctx conte
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -482,7 +482,7 @@ func (client DiskAccessesClient) GetPrivateLinkResourcesPreparer(ctx context.Con
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -558,7 +558,7 @@ func (client DiskAccessesClient) ListPreparer(ctx context.Context) (*http.Reques
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -674,7 +674,7 @@ func (client DiskAccessesClient) ListByResourceGroupPreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -794,7 +794,7 @@ func (client DiskAccessesClient) ListPrivateEndpointConnectionsPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -903,7 +903,7 @@ func (client DiskAccessesClient) UpdatePreparer(ctx context.Context, resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -998,7 +998,7 @@ func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionPreparer(ctx co
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskencryptionsets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskencryptionsets.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go
index ee62e9aa7..ed5632a30 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskencryptionsets.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskencryptionsets.go
@@ -83,7 +83,7 @@ func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -166,7 +166,7 @@ func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -253,7 +253,7 @@ func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resource
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -329,7 +329,7 @@ func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -449,7 +449,7 @@ func (client DiskEncryptionSetsClient) ListAssociatedResourcesPreparer(ctx conte
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -565,7 +565,7 @@ func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.C
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -675,7 +675,7 @@ func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskrestorepoint.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskrestorepoint.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go
index dcc708c62..2f38511cc 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/diskrestorepoint.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/diskrestorepoint.go
@@ -81,7 +81,7 @@ func (client DiskRestorePointClient) GetPreparer(ctx context.Context, resourceGr
"vmRestorePointName": autorest.Encode("path", VMRestorePointName),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -161,7 +161,7 @@ func (client DiskRestorePointClient) GrantAccessPreparer(ctx context.Context, re
"vmRestorePointName": autorest.Encode("path", VMRestorePointName),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -256,7 +256,7 @@ func (client DiskRestorePointClient) ListByRestorePointPreparer(ctx context.Cont
"vmRestorePointName": autorest.Encode("path", VMRestorePointName),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -366,7 +366,7 @@ func (client DiskRestorePointClient) RevokeAccessPreparer(ctx context.Context, r
"vmRestorePointName": autorest.Encode("path", VMRestorePointName),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go
similarity index 97%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/disks.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go
index bef84adc4..a8a4f4113 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/disks.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/disks.go
@@ -57,12 +57,7 @@ func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName
{Target: "disk.DiskProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "disk.DiskProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil},
}},
- {Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "disk.DiskProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
+ {Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil},
{Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}},
}}}}}); err != nil {
@@ -92,7 +87,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -177,7 +172,7 @@ func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -264,7 +259,7 @@ func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName str
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -342,7 +337,7 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -430,7 +425,7 @@ func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, erro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -546,7 +541,7 @@ func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -654,7 +649,7 @@ func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGrou
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -735,7 +730,7 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go
similarity index 95%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/enums.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go
index 15b22d526..cf404eb9a 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/enums.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/enums.go
@@ -131,6 +131,21 @@ func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationI
return []CapacityReservationInstanceViewTypes{CapacityReservationInstanceViewTypesInstanceView}
}
+// CloudServiceSlotType enumerates the values for cloud service slot type.
+type CloudServiceSlotType string
+
+const (
+ // Production ...
+ Production CloudServiceSlotType = "Production"
+ // Staging ...
+ Staging CloudServiceSlotType = "Staging"
+)
+
+// PossibleCloudServiceSlotTypeValues returns an array of possible values for the CloudServiceSlotType const type.
+func PossibleCloudServiceSlotTypeValues() []CloudServiceSlotType {
+ return []CloudServiceSlotType{Production, Staging}
+}
+
// CloudServiceUpgradeMode enumerates the values for cloud service upgrade mode.
type CloudServiceUpgradeMode string
@@ -272,6 +287,21 @@ func PossibleDiffDiskPlacementValues() []DiffDiskPlacement {
return []DiffDiskPlacement{CacheDisk, ResourceDisk}
}
+// DiskControllerTypes enumerates the values for disk controller types.
+type DiskControllerTypes string
+
+const (
+ // NVMe ...
+ NVMe DiskControllerTypes = "NVMe"
+ // SCSI ...
+ SCSI DiskControllerTypes = "SCSI"
+)
+
+// PossibleDiskControllerTypesValues returns an array of possible values for the DiskControllerTypes const type.
+func PossibleDiskControllerTypesValues() []DiskControllerTypes {
+ return []DiskControllerTypes{NVMe, SCSI}
+}
+
// DiskCreateOption enumerates the values for disk create option.
type DiskCreateOption string
@@ -364,11 +394,15 @@ const (
DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None"
// DiskEncryptionSetIdentityTypeSystemAssigned ...
DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned"
+ // DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned ...
+ DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned DiskEncryptionSetIdentityType = "SystemAssigned, UserAssigned"
+ // DiskEncryptionSetIdentityTypeUserAssigned ...
+ DiskEncryptionSetIdentityTypeUserAssigned DiskEncryptionSetIdentityType = "UserAssigned"
)
// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type.
func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType {
- return []DiskEncryptionSetIdentityType{DiskEncryptionSetIdentityTypeNone, DiskEncryptionSetIdentityTypeSystemAssigned}
+ return []DiskEncryptionSetIdentityType{DiskEncryptionSetIdentityTypeNone, DiskEncryptionSetIdentityTypeSystemAssigned, DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned, DiskEncryptionSetIdentityTypeUserAssigned}
}
// DiskEncryptionSetType enumerates the values for disk encryption set type.
@@ -450,6 +484,9 @@ const (
// PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive
// workloads.
PremiumLRS DiskStorageAccountTypes = "Premium_LRS"
+ // PremiumV2LRS Premium SSD v2 locally redundant storage. Best for production and performance-sensitive
+ // workloads that consistently require low latency and high IOPS and throughput.
+ PremiumV2LRS DiskStorageAccountTypes = "PremiumV2_LRS"
// PremiumZRS Premium SSD zone redundant storage. Best for the production workloads that need storage
// resiliency against zone failures.
PremiumZRS DiskStorageAccountTypes = "Premium_ZRS"
@@ -469,7 +506,7 @@ const (
// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type.
func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes {
- return []DiskStorageAccountTypes{PremiumLRS, PremiumZRS, StandardLRS, StandardSSDLRS, StandardSSDZRS, UltraSSDLRS}
+ return []DiskStorageAccountTypes{PremiumLRS, PremiumV2LRS, PremiumZRS, StandardLRS, StandardSSDLRS, StandardSSDZRS, UltraSSDLRS}
}
// EncryptionType enumerates the values for encryption type.
@@ -600,10 +637,35 @@ func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType {
return []GalleryExtendedLocationType{GalleryExtendedLocationTypeEdgeZone, GalleryExtendedLocationTypeUnknown}
}
+// GalleryProvisioningState enumerates the values for gallery provisioning state.
+type GalleryProvisioningState string
+
+const (
+ // GalleryProvisioningStateCreating ...
+ GalleryProvisioningStateCreating GalleryProvisioningState = "Creating"
+ // GalleryProvisioningStateDeleting ...
+ GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting"
+ // GalleryProvisioningStateFailed ...
+ GalleryProvisioningStateFailed GalleryProvisioningState = "Failed"
+ // GalleryProvisioningStateMigrating ...
+ GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating"
+ // GalleryProvisioningStateSucceeded ...
+ GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded"
+ // GalleryProvisioningStateUpdating ...
+ GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating"
+)
+
+// PossibleGalleryProvisioningStateValues returns an array of possible values for the GalleryProvisioningState const type.
+func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState {
+ return []GalleryProvisioningState{GalleryProvisioningStateCreating, GalleryProvisioningStateDeleting, GalleryProvisioningStateFailed, GalleryProvisioningStateMigrating, GalleryProvisioningStateSucceeded, GalleryProvisioningStateUpdating}
+}
+
// GallerySharingPermissionTypes enumerates the values for gallery sharing permission types.
type GallerySharingPermissionTypes string
const (
+ // Community ...
+ Community GallerySharingPermissionTypes = "Community"
// Groups ...
Groups GallerySharingPermissionTypes = "Groups"
// Private ...
@@ -612,7 +674,7 @@ const (
// PossibleGallerySharingPermissionTypesValues returns an array of possible values for the GallerySharingPermissionTypes const type.
func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes {
- return []GallerySharingPermissionTypes{Groups, Private}
+ return []GallerySharingPermissionTypes{Community, Groups, Private}
}
// HostCaching enumerates the values for host caching.
@@ -1069,98 +1131,6 @@ func PossibleProtocolTypesValues() []ProtocolTypes {
return []ProtocolTypes{HTTP, HTTPS}
}
-// ProvisioningState enumerates the values for provisioning state.
-type ProvisioningState string
-
-const (
- // ProvisioningStateCreating ...
- ProvisioningStateCreating ProvisioningState = "Creating"
- // ProvisioningStateDeleting ...
- ProvisioningStateDeleting ProvisioningState = "Deleting"
- // ProvisioningStateFailed ...
- ProvisioningStateFailed ProvisioningState = "Failed"
- // ProvisioningStateMigrating ...
- ProvisioningStateMigrating ProvisioningState = "Migrating"
- // ProvisioningStateSucceeded ...
- ProvisioningStateSucceeded ProvisioningState = "Succeeded"
- // ProvisioningStateUpdating ...
- ProvisioningStateUpdating ProvisioningState = "Updating"
-)
-
-// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
-func PossibleProvisioningStateValues() []ProvisioningState {
- return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating}
-}
-
-// ProvisioningState1 enumerates the values for provisioning state 1.
-type ProvisioningState1 string
-
-const (
- // ProvisioningState1Creating ...
- ProvisioningState1Creating ProvisioningState1 = "Creating"
- // ProvisioningState1Deleting ...
- ProvisioningState1Deleting ProvisioningState1 = "Deleting"
- // ProvisioningState1Failed ...
- ProvisioningState1Failed ProvisioningState1 = "Failed"
- // ProvisioningState1Migrating ...
- ProvisioningState1Migrating ProvisioningState1 = "Migrating"
- // ProvisioningState1Succeeded ...
- ProvisioningState1Succeeded ProvisioningState1 = "Succeeded"
- // ProvisioningState1Updating ...
- ProvisioningState1Updating ProvisioningState1 = "Updating"
-)
-
-// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type.
-func PossibleProvisioningState1Values() []ProvisioningState1 {
- return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating}
-}
-
-// ProvisioningState2 enumerates the values for provisioning state 2.
-type ProvisioningState2 string
-
-const (
- // ProvisioningState2Creating ...
- ProvisioningState2Creating ProvisioningState2 = "Creating"
- // ProvisioningState2Deleting ...
- ProvisioningState2Deleting ProvisioningState2 = "Deleting"
- // ProvisioningState2Failed ...
- ProvisioningState2Failed ProvisioningState2 = "Failed"
- // ProvisioningState2Migrating ...
- ProvisioningState2Migrating ProvisioningState2 = "Migrating"
- // ProvisioningState2Succeeded ...
- ProvisioningState2Succeeded ProvisioningState2 = "Succeeded"
- // ProvisioningState2Updating ...
- ProvisioningState2Updating ProvisioningState2 = "Updating"
-)
-
-// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type.
-func PossibleProvisioningState2Values() []ProvisioningState2 {
- return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating}
-}
-
-// ProvisioningState3 enumerates the values for provisioning state 3.
-type ProvisioningState3 string
-
-const (
- // ProvisioningState3Creating ...
- ProvisioningState3Creating ProvisioningState3 = "Creating"
- // ProvisioningState3Deleting ...
- ProvisioningState3Deleting ProvisioningState3 = "Deleting"
- // ProvisioningState3Failed ...
- ProvisioningState3Failed ProvisioningState3 = "Failed"
- // ProvisioningState3Migrating ...
- ProvisioningState3Migrating ProvisioningState3 = "Migrating"
- // ProvisioningState3Succeeded ...
- ProvisioningState3Succeeded ProvisioningState3 = "Succeeded"
- // ProvisioningState3Updating ...
- ProvisioningState3Updating ProvisioningState3 = "Updating"
-)
-
-// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type.
-func PossibleProvisioningState3Values() []ProvisioningState3 {
- return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating}
-}
-
// ProximityPlacementGroupType enumerates the values for proximity placement group type.
type ProximityPlacementGroupType string
@@ -1488,6 +1458,23 @@ func PossibleSettingNamesValues() []SettingNames {
return []SettingNames{AutoLogon, FirstLogonCommands}
}
+// SharedGalleryHostCaching enumerates the values for shared gallery host caching.
+type SharedGalleryHostCaching string
+
+const (
+ // SharedGalleryHostCachingNone ...
+ SharedGalleryHostCachingNone SharedGalleryHostCaching = "None"
+ // SharedGalleryHostCachingReadOnly ...
+ SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly"
+ // SharedGalleryHostCachingReadWrite ...
+ SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite"
+)
+
+// PossibleSharedGalleryHostCachingValues returns an array of possible values for the SharedGalleryHostCaching const type.
+func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching {
+ return []SharedGalleryHostCaching{SharedGalleryHostCachingNone, SharedGalleryHostCachingReadOnly, SharedGalleryHostCachingReadWrite}
+}
+
// SharedToValues enumerates the values for shared to values.
type SharedToValues string
@@ -1507,15 +1494,13 @@ type SharingProfileGroupTypes string
const (
// AADTenants ...
AADTenants SharingProfileGroupTypes = "AADTenants"
- // Community ...
- Community SharingProfileGroupTypes = "Community"
// Subscriptions ...
Subscriptions SharingProfileGroupTypes = "Subscriptions"
)
// PossibleSharingProfileGroupTypesValues returns an array of possible values for the SharingProfileGroupTypes const type.
func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes {
- return []SharingProfileGroupTypes{AADTenants, Community, Subscriptions}
+ return []SharingProfileGroupTypes{AADTenants, Subscriptions}
}
// SharingState enumerates the values for sharing state.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleries.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go
index 370c530f0..334db1f6c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleries.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleries.go
@@ -70,7 +70,7 @@ func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resour
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -151,7 +151,7 @@ func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -238,7 +238,7 @@ func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -320,7 +320,7 @@ func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -436,7 +436,7 @@ func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -544,7 +544,7 @@ func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplications.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplications.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go
index a5804d0f3..d1599af68 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplications.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplications.go
@@ -75,7 +75,7 @@ func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Conte
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -159,7 +159,7 @@ func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, reso
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -247,7 +247,7 @@ func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourc
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -329,7 +329,7 @@ func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -441,7 +441,7 @@ func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, reso
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplicationversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplicationversions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go
index 965afa79b..364a3c02d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryapplicationversions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryapplicationversions.go
@@ -94,7 +94,7 @@ func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -180,7 +180,7 @@ func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -271,7 +271,7 @@ func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -358,7 +358,7 @@ func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -472,7 +472,7 @@ func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimages.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go
index 2f92ec0e7..61283069b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimages.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimages.go
@@ -86,7 +86,7 @@ func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -169,7 +169,7 @@ func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -256,7 +256,7 @@ func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -337,7 +337,7 @@ func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -448,7 +448,7 @@ func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimageversions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go
index 496a6686d..e06108847 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/galleryimageversions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/galleryimageversions.go
@@ -84,7 +84,7 @@ func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -169,7 +169,7 @@ func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -259,7 +259,7 @@ func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resour
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -346,7 +346,7 @@ func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -459,7 +459,7 @@ func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/gallerysharingprofile.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/gallerysharingprofile.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go
index 2f55daecf..311d7e7c8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/gallerysharingprofile.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/gallerysharingprofile.go
@@ -70,7 +70,7 @@ func (client GallerySharingProfileClient) UpdatePreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-10-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/images.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go
index 57908cb56..6c41cf7ce 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/images.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/images.go
@@ -69,7 +69,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -150,7 +150,7 @@ func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -236,7 +236,7 @@ func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName st
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -316,7 +316,7 @@ func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, err
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -432,7 +432,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, reso
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -539,7 +539,7 @@ func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/loganalytics.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go
index 0e82102d8..9182f969d 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/loganalytics.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/loganalytics.go
@@ -75,7 +75,7 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -162,7 +162,7 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go
similarity index 96%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/models.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go
index 551a1b034..5580543b4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/models.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/models.go
@@ -19,7 +19,7 @@ import (
)
// The package's fully qualified name.
-const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
// AccessURI a disk access SAS uri.
type AccessURI struct {
@@ -1252,6 +1252,8 @@ type CapacityReservationProfile struct {
type CapacityReservationProperties struct {
// ReservationID - READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
ReservationID *string `json:"reservationId,omitempty"`
+ // PlatformFaultDomainCount - READ-ONLY; Specifies the value of fault domain count that Capacity Reservation supports for requested VM size.
NOTE: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation.
Minimum api-version: 2022-08-01.
+ PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"`
// VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation.
VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"`
// ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated.
@@ -1260,7 +1262,7 @@ type CapacityReservationProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
// InstanceView - READ-ONLY; The Capacity reservation instance view.
InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"`
- // TimeCreated - READ-ONLY; Specifies the time at which the Capacity Reservation resource was created.
Minimum api-version: 2022-03-01.
+ // TimeCreated - READ-ONLY; Specifies the time at which the Capacity Reservation resource was created.
Minimum api-version: 2021-11-01.
TimeCreated *date.Time `json:"timeCreated,omitempty"`
}
@@ -1463,6 +1465,8 @@ func (cru *CapacityReservationUpdate) UnmarshalJSON(body []byte) error {
// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources
// allocated.
type CapacityReservationUtilization struct {
+ // CurrentCapacity - READ-ONLY; The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed.
Minimum api-version: 2022-08-01.
+ CurrentCapacity *int32 `json:"currentCapacity,omitempty"`
// VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation.
VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"`
}
@@ -1492,6 +1496,7 @@ type CloudService struct {
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
Properties *CloudServiceProperties `json:"properties,omitempty"`
+ SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for CloudService.
@@ -1506,6 +1511,9 @@ func (cs CloudService) MarshalJSON() ([]byte, error) {
if cs.Properties != nil {
objectMap["properties"] = cs.Properties
}
+ if cs.SystemData != nil {
+ objectMap["systemData"] = cs.SystemData
+ }
return json.Marshal(objectMap)
}
@@ -1526,9 +1534,9 @@ type CloudServiceExtensionProperties struct {
// AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available.
AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"`
// Settings - Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension.
- Settings *string `json:"settings,omitempty"`
+ Settings interface{} `json:"settings,omitempty"`
// ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance.
- ProtectedSettings *string `json:"protectedSettings,omitempty"`
+ ProtectedSettings interface{} `json:"protectedSettings,omitempty"`
ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"`
// ForceUpdateTag - Tag to force apply the provided public and protected settings.
// Changing the tag value allows for re-running the extension without changing any of the public or protected settings.
@@ -1596,11 +1604,13 @@ func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// CloudServiceListResult ...
+// CloudServiceListResult the list operation result.
type CloudServiceListResult struct {
autorest.Response `json:"-"`
- Value *[]CloudService `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]CloudService `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// CloudServiceListResultIterator provides access to a complete listing of CloudService values.
@@ -1757,6 +1767,8 @@ func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(
type CloudServiceNetworkProfile struct {
// LoadBalancerConfigurations - List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer.
LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"`
+ // SlotType - Possible values include: 'Production', 'Staging'
+ SlotType CloudServiceSlotType `json:"slotType,omitempty"`
// SwappableCloudService - The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be present otherwise an error will be thrown.
SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"`
}
@@ -2006,11 +2018,13 @@ func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudService
return
}
-// CloudServiceRoleListResult ...
+// CloudServiceRoleListResult the list operation result.
type CloudServiceRoleListResult struct {
autorest.Response `json:"-"`
- Value *[]CloudServiceRole `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]CloudServiceRole `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values.
@@ -2176,7 +2190,7 @@ type CloudServiceRoleProfileProperties struct {
Sku *CloudServiceRoleSku `json:"sku,omitempty"`
}
-// CloudServiceRoleProperties ...
+// CloudServiceRoleProperties the cloud service role properties.
type CloudServiceRoleProperties struct {
// UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role.
UniqueID *string `json:"uniqueId,omitempty"`
@@ -2595,10 +2609,13 @@ func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// CloudServiceVaultAndSecretReference ...
+// CloudServiceVaultAndSecretReference protected settings for the extension, referenced using KeyVault
+// which are encrypted before sent to the role instance.
type CloudServiceVaultAndSecretReference struct {
+ // SourceVault - The ARM Resource ID of the Key Vault
SourceVault *SubResource `json:"sourceVault,omitempty"`
- SecretURL *string `json:"secretUrl,omitempty"`
+ // SecretURL - Secret URL which contains the protected settings of the extension
+ SecretURL *string `json:"secretUrl,omitempty"`
}
// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the
@@ -2780,6 +2797,165 @@ func (cgiVar *CommunityGalleryImage) UnmarshalJSON(body []byte) error {
return nil
}
+// CommunityGalleryImageList the List Community Gallery Images operation response.
+type CommunityGalleryImageList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of community gallery images.
+ Value *[]CommunityGalleryImage `json:"value,omitempty"`
+ // NextLink - The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community gallery images.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// CommunityGalleryImageListIterator provides access to a complete listing of CommunityGalleryImage values.
+type CommunityGalleryImageListIterator struct {
+ i int
+ page CommunityGalleryImageListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *CommunityGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *CommunityGalleryImageListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter CommunityGalleryImageListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter CommunityGalleryImageListIterator) Response() CommunityGalleryImageList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter CommunityGalleryImageListIterator) Value() CommunityGalleryImage {
+ if !iter.page.NotDone() {
+ return CommunityGalleryImage{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the CommunityGalleryImageListIterator type.
+func NewCommunityGalleryImageListIterator(page CommunityGalleryImageListPage) CommunityGalleryImageListIterator {
+ return CommunityGalleryImageListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (cgil CommunityGalleryImageList) IsEmpty() bool {
+ return cgil.Value == nil || len(*cgil.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (cgil CommunityGalleryImageList) hasNextLink() bool {
+ return cgil.NextLink != nil && len(*cgil.NextLink) != 0
+}
+
+// communityGalleryImageListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (cgil CommunityGalleryImageList) communityGalleryImageListPreparer(ctx context.Context) (*http.Request, error) {
+ if !cgil.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(cgil.NextLink)))
+}
+
+// CommunityGalleryImageListPage contains a page of CommunityGalleryImage values.
+type CommunityGalleryImageListPage struct {
+ fn func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error)
+ cgil CommunityGalleryImageList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *CommunityGalleryImageListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.cgil)
+ if err != nil {
+ return err
+ }
+ page.cgil = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *CommunityGalleryImageListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page CommunityGalleryImageListPage) NotDone() bool {
+ return !page.cgil.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page CommunityGalleryImageListPage) Response() CommunityGalleryImageList {
+ return page.cgil
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page CommunityGalleryImageListPage) Values() []CommunityGalleryImage {
+ if page.cgil.IsEmpty() {
+ return nil
+ }
+ return *page.cgil.Value
+}
+
+// Creates a new instance of the CommunityGalleryImageListPage type.
+func NewCommunityGalleryImageListPage(cur CommunityGalleryImageList, getNextPage func(context.Context, CommunityGalleryImageList) (CommunityGalleryImageList, error)) CommunityGalleryImageListPage {
+ return CommunityGalleryImageListPage{
+ fn: getNextPage,
+ cgil: cur,
+ }
+}
+
// CommunityGalleryImageProperties describes the properties of a gallery image definition.
type CommunityGalleryImageProperties struct {
// OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.
Possible values are:
**Windows**
**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux'
@@ -2796,6 +2972,12 @@ type CommunityGalleryImageProperties struct {
// Features - A list of gallery image features.
Features *[]GalleryImageFeature `json:"features,omitempty"`
PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"`
+ // Architecture - Possible values include: 'X64', 'Arm64'
+ Architecture Architecture `json:"architecture,omitempty"`
+ // PrivacyStatementURI - Privacy statement uri for the current community gallery image.
+ PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"`
+ // Eula - End-user license agreement for the current community gallery image.
+ Eula *string `json:"eula,omitempty"`
}
// CommunityGalleryImageVersion specifies information about the gallery image version that you want to
@@ -2884,23 +3066,187 @@ func (cgiv *CommunityGalleryImageVersion) UnmarshalJSON(body []byte) error {
return nil
}
+// CommunityGalleryImageVersionList the List Community Gallery Image versions operation response.
+type CommunityGalleryImageVersionList struct {
+ autorest.Response `json:"-"`
+ // Value - A list of community gallery image versions.
+ Value *[]CommunityGalleryImageVersion `json:"value,omitempty"`
+ // NextLink - The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of community gallery image versions.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// CommunityGalleryImageVersionListIterator provides access to a complete listing of
+// CommunityGalleryImageVersion values.
+type CommunityGalleryImageVersionListIterator struct {
+ i int
+ page CommunityGalleryImageVersionListPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *CommunityGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *CommunityGalleryImageVersionListIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter CommunityGalleryImageVersionListIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter CommunityGalleryImageVersionListIterator) Response() CommunityGalleryImageVersionList {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter CommunityGalleryImageVersionListIterator) Value() CommunityGalleryImageVersion {
+ if !iter.page.NotDone() {
+ return CommunityGalleryImageVersion{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the CommunityGalleryImageVersionListIterator type.
+func NewCommunityGalleryImageVersionListIterator(page CommunityGalleryImageVersionListPage) CommunityGalleryImageVersionListIterator {
+ return CommunityGalleryImageVersionListIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (cgivl CommunityGalleryImageVersionList) IsEmpty() bool {
+ return cgivl.Value == nil || len(*cgivl.Value) == 0
+}
+
+// hasNextLink returns true if the NextLink is not empty.
+func (cgivl CommunityGalleryImageVersionList) hasNextLink() bool {
+ return cgivl.NextLink != nil && len(*cgivl.NextLink) != 0
+}
+
+// communityGalleryImageVersionListPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (cgivl CommunityGalleryImageVersionList) communityGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) {
+ if !cgivl.hasNextLink() {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(cgivl.NextLink)))
+}
+
+// CommunityGalleryImageVersionListPage contains a page of CommunityGalleryImageVersion values.
+type CommunityGalleryImageVersionListPage struct {
+ fn func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error)
+ cgivl CommunityGalleryImageVersionList
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *CommunityGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionListPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ for {
+ next, err := page.fn(ctx, page.cgivl)
+ if err != nil {
+ return err
+ }
+ page.cgivl = next
+ if !next.hasNextLink() || !next.IsEmpty() {
+ break
+ }
+ }
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *CommunityGalleryImageVersionListPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page CommunityGalleryImageVersionListPage) NotDone() bool {
+ return !page.cgivl.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page CommunityGalleryImageVersionListPage) Response() CommunityGalleryImageVersionList {
+ return page.cgivl
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page CommunityGalleryImageVersionListPage) Values() []CommunityGalleryImageVersion {
+ if page.cgivl.IsEmpty() {
+ return nil
+ }
+ return *page.cgivl.Value
+}
+
+// Creates a new instance of the CommunityGalleryImageVersionListPage type.
+func NewCommunityGalleryImageVersionListPage(cur CommunityGalleryImageVersionList, getNextPage func(context.Context, CommunityGalleryImageVersionList) (CommunityGalleryImageVersionList, error)) CommunityGalleryImageVersionListPage {
+ return CommunityGalleryImageVersionListPage{
+ fn: getNextPage,
+ cgivl: cur,
+ }
+}
+
// CommunityGalleryImageVersionProperties describes the properties of a gallery image version.
type CommunityGalleryImageVersionProperties struct {
// PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable.
PublishedDate *date.Time `json:"publishedDate,omitempty"`
// EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable.
EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"`
+ // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"`
+ // StorageProfile - Describes the storage profile of the image version.
+ StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"`
}
// CommunityGalleryInfo information of community gallery if current gallery is shared to community
type CommunityGalleryInfo struct {
- // PublisherURI - Community gallery publisher uri
+ // PublisherURI - The link to the publisher website. Visible to all users.
PublisherURI *string `json:"publisherUri,omitempty"`
- // PublisherContact - Community gallery publisher contact email
+ // PublisherContact - Community gallery publisher support email. The email address of the publisher. Visible to all users.
PublisherContact *string `json:"publisherContact,omitempty"`
- // Eula - Community gallery publisher eula
+ // Eula - End-user license agreement for community gallery image.
Eula *string `json:"eula,omitempty"`
- // PublicNamePrefix - Community gallery public name prefix
+ // PublicNamePrefix - The prefix of the gallery name that will be displayed publicly. Visible to all users.
PublicNamePrefix *string `json:"publicNamePrefix,omitempty"`
// CommunityGalleryEnabled - READ-ONLY; Contains info about whether community gallery sharing is enabled.
CommunityGalleryEnabled *bool `json:"communityGalleryEnabled,omitempty"`
@@ -2926,15 +3272,24 @@ func (cgiVar CommunityGalleryInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
+// CopyCompletionError indicates the error details if the background copy of a resource created via the
+// CopyStart operation fails.
+type CopyCompletionError struct {
+ // ErrorCode - Indicates the error code if the background copy of a resource created via the CopyStart operation fails.
+ ErrorCode *string `json:"errorCode,omitempty"`
+ // ErrorMessage - Indicates the error message if the background copy of a resource created via the CopyStart operation fails.
+ ErrorMessage *string `json:"errorMessage,omitempty"`
+}
+
// CreationData data used when creating a disk.
type CreationData struct {
// CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload', 'CopyStart', 'ImportSecure', 'UploadPreparedSecure'
CreateOption DiskCreateOption `json:"createOption,omitempty"`
// StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk.
StorageAccountID *string `json:"storageAccountId,omitempty"`
- // ImageReference - Disk source information.
+ // ImageReference - Disk source information for PIR or user images.
ImageReference *ImageDiskReference `json:"imageReference,omitempty"`
- // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk.
+ // GalleryImageReference - Required if creating from a Gallery Image. The id/sharedGalleryImageId/communityGalleryImageId of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk.
GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"`
// SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk.
SourceURI *string `json:"sourceUri,omitempty"`
@@ -2948,6 +3303,8 @@ type CreationData struct {
LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"`
// SecurityDataURI - If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state.
SecurityDataURI *string `json:"securityDataUri,omitempty"`
+ // PerformancePlus - Set this flag to true to get a boost on the performance target of the disk deployed, see here on the respective performance target. This flag can only be set on disk creation time and cannot be disabled after enabled.
+ PerformancePlus *bool `json:"performancePlus,omitempty"`
}
// MarshalJSON is the custom marshaler for CreationData.
@@ -2980,6 +3337,9 @@ func (cd CreationData) MarshalJSON() ([]byte, error) {
if cd.SecurityDataURI != nil {
objectMap["securityDataUri"] = cd.SecurityDataURI
}
+ if cd.PerformancePlus != nil {
+ objectMap["performancePlus"] = cd.PerformancePlus
+ }
return json.Marshal(objectMap)
}
@@ -2999,7 +3359,7 @@ type DataDisk struct {
WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
// CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// ManagedDisk - The managed disk parameters.
ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"`
@@ -3814,7 +4174,7 @@ type DedicatedHostProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
// InstanceView - READ-ONLY; The dedicated host instance view.
InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"`
- // TimeCreated - READ-ONLY; Specifies the time at which the Dedicated Host resource was created.
Minimum api-version: 2022-03-01.
+ // TimeCreated - READ-ONLY; Specifies the time at which the Dedicated Host resource was created.
Minimum api-version: 2021-11-01.
TimeCreated *date.Time `json:"timeCreated,omitempty"`
}
@@ -5229,6 +5589,8 @@ type DiskEncryptionSetUpdateProperties struct {
ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"`
// RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version.
RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"`
+ // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.
+ FederatedClientID *string `json:"federatedClientId,omitempty"`
}
// DiskImageEncryption this is the disk image encryption base class.
@@ -5450,6 +5812,8 @@ type DiskProperties struct {
NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"`
// DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks.
DiskAccessID *string `json:"diskAccessId,omitempty"`
+ // BurstingEnabledTime - READ-ONLY; Latest time when bursting was last enabled on a disk.
+ BurstingEnabledTime *date.Time `json:"burstingEnabledTime,omitempty"`
// Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks.
Tier *string `json:"tier,omitempty"`
// BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks.
@@ -5466,6 +5830,8 @@ type DiskProperties struct {
PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone'
DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"`
+ // OptimizedForFrequentAttach - Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine.
+ OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"`
}
// MarshalJSON is the custom marshaler for DiskProperties.
@@ -5540,6 +5906,9 @@ func (dp DiskProperties) MarshalJSON() ([]byte, error) {
if dp.DataAccessAuthMode != "" {
objectMap["dataAccessAuthMode"] = dp.DataAccessAuthMode
}
+ if dp.OptimizedForFrequentAttach != nil {
+ objectMap["optimizedForFrequentAttach"] = dp.OptimizedForFrequentAttach
+ }
return json.Marshal(objectMap)
}
@@ -5859,6 +6228,8 @@ type DiskRestorePointProperties struct {
ReplicationState *string `json:"replicationState,omitempty"`
// SourceResourceLocation - READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region.
SourceResourceLocation *string `json:"sourceResourceLocation,omitempty"`
+ // SecurityProfile - Contains the security related information for the resource.
+ SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"`
}
// MarshalJSON is the custom marshaler for DiskRestorePointProperties.
@@ -5888,6 +6259,9 @@ func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) {
if drpp.CompletionPercent != nil {
objectMap["completionPercent"] = drpp.CompletionPercent
}
+ if drpp.SecurityProfile != nil {
+ objectMap["securityProfile"] = drpp.SecurityProfile
+ }
return json.Marshal(objectMap)
}
@@ -6067,9 +6441,9 @@ func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI,
}
// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS,
-// Premium_ZRS, or StandardSSD_ZRS.
+// Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS.
type DiskSku struct {
- // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS', 'PremiumZRS', 'StandardSSDZRS'
+ // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS', 'PremiumZRS', 'StandardSSDZRS', 'PremiumV2LRS'
Name DiskStorageAccountTypes `json:"name,omitempty"`
// Tier - READ-ONLY; The sku tier.
Tier *string `json:"tier,omitempty"`
@@ -6268,6 +6642,8 @@ type DiskUpdateProperties struct {
PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone'
DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"`
+ // OptimizedForFrequentAttach - Setting this property to true improves reliability and performance of data disks that are frequently (more than 5 times a day) by detached from one virtual machine and attached to another. This property should not be set for disks that are not detached and attached frequently as it causes the disks to not align with the fault domain of the virtual machine.
+ OptimizedForFrequentAttach *bool `json:"optimizedForFrequentAttach,omitempty"`
}
// MarshalJSON is the custom marshaler for DiskUpdateProperties.
@@ -6327,6 +6703,9 @@ func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) {
if dup.DataAccessAuthMode != "" {
objectMap["dataAccessAuthMode"] = dup.DataAccessAuthMode
}
+ if dup.OptimizedForFrequentAttach != nil {
+ objectMap["optimizedForFrequentAttach"] = dup.OptimizedForFrequentAttach
+ }
return json.Marshal(objectMap)
}
@@ -6349,12 +6728,14 @@ type EncryptionImages struct {
// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on
// the key vault before it can be used to encrypt disks.
type EncryptionSetIdentity struct {
- // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeNone'
+ // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeUserAssigned', 'DiskEncryptionSetIdentityTypeSystemAssignedUserAssigned', 'DiskEncryptionSetIdentityTypeNone'
Type DiskEncryptionSetIdentityType `json:"type,omitempty"`
// PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity
PrincipalID *string `json:"principalId,omitempty"`
// TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity
TenantID *string `json:"tenantId,omitempty"`
+ // UserAssignedIdentities - The list of user identities associated with the disk encryption set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
+ UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities"`
}
// MarshalJSON is the custom marshaler for EncryptionSetIdentity.
@@ -6363,6 +6744,9 @@ func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) {
if esi.Type != "" {
objectMap["type"] = esi.Type
}
+ if esi.UserAssignedIdentities != nil {
+ objectMap["userAssignedIdentities"] = esi.UserAssignedIdentities
+ }
return json.Marshal(objectMap)
}
@@ -6382,6 +6766,8 @@ type EncryptionSetProperties struct {
LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"`
// AutoKeyRotationError - READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed.
AutoKeyRotationError *APIError `json:"autoKeyRotationError,omitempty"`
+ // FederatedClientID - Multi-tenant application client id to access key vault in a different tenant. Setting the value to 'None' will clear the property.
+ FederatedClientID *string `json:"federatedClientId,omitempty"`
}
// MarshalJSON is the custom marshaler for EncryptionSetProperties.
@@ -6396,6 +6782,9 @@ func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) {
if esp.RotationToLatestKeyVersionEnabled != nil {
objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled
}
+ if esp.FederatedClientID != nil {
+ objectMap["federatedClientId"] = esp.FederatedClientID
+ }
return json.Marshal(objectMap)
}
@@ -7404,8 +7793,8 @@ func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, get
// GalleryApplicationVersionProperties describes the properties of a gallery image version.
type GalleryApplicationVersionProperties struct {
PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating'
- ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"`
+ // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating'
+ ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"`
// ReplicationStatus - READ-ONLY
ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"`
}
@@ -7421,8 +7810,11 @@ func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) {
// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version.
type GalleryApplicationVersionPublishingProfile struct {
- Source *UserArtifactSource `json:"source,omitempty"`
- ManageActions *UserArtifactManage `json:"manageActions,omitempty"`
+ Source *UserArtifactSource `json:"source,omitempty"`
+ ManageActions *UserArtifactManage `json:"manageActions,omitempty"`
+ Settings *UserArtifactSettings `json:"settings,omitempty"`
+ // AdvancedSettings - Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only.
+ AdvancedSettings map[string]*string `json:"advancedSettings"`
// EnableHealthCheck - Optional. Whether or not this application reports health.
EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"`
// TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable.
@@ -7452,6 +7844,12 @@ func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, e
if gavpp.ManageActions != nil {
objectMap["manageActions"] = gavpp.ManageActions
}
+ if gavpp.Settings != nil {
+ objectMap["settings"] = gavpp.Settings
+ }
+ if gavpp.AdvancedSettings != nil {
+ objectMap["advancedSettings"] = gavpp.AdvancedSettings
+ }
if gavpp.EnableHealthCheck != nil {
objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck
}
@@ -8113,11 +8511,11 @@ type GalleryImageProperties struct {
Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"`
Disallowed *Disallowed `json:"disallowed,omitempty"`
PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating'
- ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"`
+ // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating'
+ ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"`
// Features - A list of gallery image features.
Features *[]GalleryImageFeature `json:"features,omitempty"`
- // Architecture - The architecture of the image. Applicable to OS disks only. Possible values include: 'X64', 'Arm64'
+ // Architecture - Possible values include: 'X64', 'Arm64'
Architecture Architecture `json:"architecture,omitempty"`
}
@@ -8640,8 +9038,8 @@ func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage fun
// GalleryImageVersionProperties describes the properties of a gallery image version.
type GalleryImageVersionProperties struct {
PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating'
- ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"`
+ // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating'
+ ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"`
StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"`
// ReplicationStatus - READ-ONLY
ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"`
@@ -9107,10 +9505,10 @@ type GalleryProperties struct {
// Description - The description of this Shared Image Gallery resource. This property is updatable.
Description *string `json:"description,omitempty"`
Identifier *GalleryIdentifier `json:"identifier,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating'
- ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
- SharingProfile *SharingProfile `json:"sharingProfile,omitempty"`
- SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"`
+ // ProvisioningState - READ-ONLY; Possible values include: 'GalleryProvisioningStateCreating', 'GalleryProvisioningStateUpdating', 'GalleryProvisioningStateFailed', 'GalleryProvisioningStateSucceeded', 'GalleryProvisioningStateDeleting', 'GalleryProvisioningStateMigrating'
+ ProvisioningState GalleryProvisioningState `json:"provisioningState,omitempty"`
+ SharingProfile *SharingProfile `json:"sharingProfile,omitempty"`
+ SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"`
// SharingStatus - READ-ONLY
SharingStatus *SharingStatus `json:"sharingStatus,omitempty"`
}
@@ -9447,8 +9845,12 @@ type ImageDisk struct {
// ImageDiskReference the source image used for creating the disk.
type ImageDiskReference struct {
- // ID - A relative uri containing either a Platform Image Repository or user image reference.
+ // ID - A relative uri containing either a Platform Image Repository, user image, or Azure Compute Gallery image reference.
ID *string `json:"id,omitempty"`
+ // SharedGalleryImageID - A relative uri containing a direct shared Azure Compute Gallery image reference.
+ SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"`
+ // CommunityGalleryImageID - A relative uri containing a community Azure Compute Gallery image reference.
+ CommunityGalleryImageID *string `json:"communityGalleryImageId,omitempty"`
// Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null.
Lun *int32 `json:"lun,omitempty"`
}
@@ -9913,7 +10315,7 @@ type InnerError struct {
Errordetail *string `json:"errordetail,omitempty"`
}
-// InstanceSku ...
+// InstanceSku the role instance SKU.
type InstanceSku struct {
// Name - READ-ONLY; The sku name.
Name *string `json:"name,omitempty"`
@@ -9943,7 +10345,7 @@ type InstanceViewStatus struct {
// InstanceViewStatusesSummary instance view statuses.
type InstanceViewStatusesSummary struct {
- // StatusesSummary - READ-ONLY
+ // StatusesSummary - READ-ONLY; The summary.
StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"`
}
@@ -10039,6 +10441,8 @@ type LinuxConfiguration struct {
ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"`
// PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux.
PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"`
+ // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Linux virtual machine. Default value is false.
+ EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"`
}
// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API
@@ -10251,13 +10655,15 @@ type LoadBalancerConfiguration struct {
Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"`
}
-// LoadBalancerConfigurationProperties ...
+// LoadBalancerConfigurationProperties describes the properties of the load balancer configuration.
type LoadBalancerConfigurationProperties struct {
// FrontendIPConfigurations - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration.
FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
}
-// LoadBalancerFrontendIPConfiguration ...
+// LoadBalancerFrontendIPConfiguration specifies the frontend IP to be used for the load balancer. Only
+// IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend
+// IP configuration.
type LoadBalancerFrontendIPConfiguration struct {
// Name - The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource.
Name *string `json:"name,omitempty"`
@@ -10647,7 +11053,7 @@ type OSDisk struct {
DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"`
// CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// ManagedDisk - The managed disk parameters.
ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"`
@@ -10700,11 +11106,13 @@ func (of OSFamily) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// OSFamilyListResult ...
+// OSFamilyListResult the list operation result.
type OSFamilyListResult struct {
autorest.Response `json:"-"`
- Value *[]OSFamily `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]OSFamily `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// OSFamilyListResultIterator provides access to a complete listing of OSFamily values.
@@ -10919,11 +11327,13 @@ func (ov OSVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// OSVersionListResult ...
+// OSVersionListResult the list operation result.
type OSVersionListResult struct {
autorest.Response `json:"-"`
- Value *[]OSVersion `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]OSVersion `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// OSVersionListResultIterator provides access to a complete listing of OSVersion values.
@@ -11312,6 +11722,17 @@ type Plan struct {
PromotionCode *string `json:"promotionCode,omitempty"`
}
+// PriorityMixPolicy specifies the target splits for Spot and Regular priority VMs within a scale set with
+// flexible orchestration mode.
With this property the customer is able to specify the base number
+// of regular priority VMs created as the VMSS flex instance scales out and the split between Spot and
+// Regular priority VMs after this base target has been reached.
+type PriorityMixPolicy struct {
+ // BaseRegularPriorityCount - The base number of regular priority VMs that will be created in this scale set as it scales out.
+ BaseRegularPriorityCount *int32 `json:"baseRegularPriorityCount,omitempty"`
+ // RegularPriorityPercentageAboveBase - The percentage of VM instances, after the base regular priority count has been reached, that are expected to use regular priority.
+ RegularPriorityPercentageAboveBase *int32 `json:"regularPriorityPercentageAboveBase,omitempty"`
+}
+
// PrivateEndpoint the Private Endpoint resource.
type PrivateEndpoint struct {
// ID - READ-ONLY; The ARM identifier for Private Endpoint
@@ -13379,7 +13800,7 @@ func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// RoleInstance ...
+// RoleInstance describes the cloud service role instance.
type RoleInstance struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; Resource Id
@@ -13427,11 +13848,13 @@ func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// RoleInstanceListResult ...
+// RoleInstanceListResult the list operation result.
type RoleInstanceListResult struct {
autorest.Response `json:"-"`
- Value *[]RoleInstance `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]RoleInstance `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values.
@@ -13596,7 +14019,7 @@ func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// RoleInstanceProperties ...
+// RoleInstanceProperties role instance properties.
type RoleInstanceProperties struct {
NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"`
InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"`
@@ -14110,6 +14533,45 @@ func (sg *SharedGallery) UnmarshalJSON(body []byte) error {
return nil
}
+// SharedGalleryDataDiskImage this is the data disk image.
+type SharedGalleryDataDiskImage struct {
+ // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine.
+ Lun *int32 `json:"lun,omitempty"`
+ // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite'
+ HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SharedGalleryDataDiskImage.
+func (sgddi SharedGalleryDataDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sgddi.Lun != nil {
+ objectMap["lun"] = sgddi.Lun
+ }
+ if sgddi.HostCaching != "" {
+ objectMap["hostCaching"] = sgddi.HostCaching
+ }
+ return json.Marshal(objectMap)
+}
+
+// SharedGalleryDiskImage this is the disk image base class.
+type SharedGalleryDiskImage struct {
+ // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite'
+ HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SharedGalleryDiskImage.
+func (sgdi SharedGalleryDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sgdi.HostCaching != "" {
+ objectMap["hostCaching"] = sgdi.HostCaching
+ }
+ return json.Marshal(objectMap)
+}
+
// SharedGalleryIdentifier the identifier information of shared gallery.
type SharedGalleryIdentifier struct {
// UniqueID - The unique id of this shared gallery.
@@ -14366,6 +14828,8 @@ type SharedGalleryImageProperties struct {
// Features - A list of gallery image features.
Features *[]GalleryImageFeature `json:"features,omitempty"`
PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"`
+ // Architecture - Possible values include: 'X64', 'Arm64'
+ Architecture Architecture `json:"architecture,omitempty"`
}
// SharedGalleryImageVersion specifies information about the gallery image version that you want to create
@@ -14609,6 +15073,17 @@ type SharedGalleryImageVersionProperties struct {
PublishedDate *date.Time `json:"publishedDate,omitempty"`
// EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable.
EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"`
+ // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version.
+ ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"`
+ // StorageProfile - Describes the storage profile of the image version.
+ StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"`
+}
+
+// SharedGalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version.
+type SharedGalleryImageVersionStorageProfile struct {
+ OsDiskImage *SharedGalleryOSDiskImage `json:"osDiskImage,omitempty"`
+ // DataDiskImages - A list of data disk images.
+ DataDiskImages *[]SharedGalleryDataDiskImage `json:"dataDiskImages,omitempty"`
}
// SharedGalleryList the List Shared Galleries operation response.
@@ -14770,6 +15245,23 @@ func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Co
}
}
+// SharedGalleryOSDiskImage this is the OS disk image.
+type SharedGalleryOSDiskImage struct {
+ // DiskSizeGB - READ-ONLY; This property indicates the size of the VHD to be created.
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'SharedGalleryHostCachingNone', 'SharedGalleryHostCachingReadOnly', 'SharedGalleryHostCachingReadWrite'
+ HostCaching SharedGalleryHostCaching `json:"hostCaching,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SharedGalleryOSDiskImage.
+func (sgodi SharedGalleryOSDiskImage) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if sgodi.HostCaching != "" {
+ objectMap["hostCaching"] = sgodi.HostCaching
+ }
+ return json.Marshal(objectMap)
+}
+
// ShareInfoElement ...
type ShareInfoElement struct {
// VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
@@ -14784,7 +15276,7 @@ func (sie ShareInfoElement) MarshalJSON() ([]byte, error) {
// SharingProfile profile for gallery sharing to subscription or tenant
type SharingProfile struct {
- // Permissions - This property allows you to specify the permission of sharing gallery.
Possible values are:
**Private**
**Groups**. Possible values include: 'Private', 'Groups'
+ // Permissions - This property allows you to specify the permission of sharing gallery.
Possible values are:
**Private**
**Groups**
**Community**. Possible values include: 'Private', 'Groups', 'Community'
Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"`
// Groups - READ-ONLY; A list of sharing profile groups.
Groups *[]SharingProfileGroup `json:"groups,omitempty"`
@@ -14806,7 +15298,7 @@ func (sp SharingProfile) MarshalJSON() ([]byte, error) {
// SharingProfileGroup group of the gallery sharing profile
type SharingProfileGroup struct {
- // Type - This property allows you to specify the type of sharing group.
Possible values are:
**Subscriptions**
**AADTenants**
**Community**. Possible values include: 'Subscriptions', 'AADTenants', 'Community'
+ // Type - This property allows you to specify the type of sharing group.
Possible values are:
**Subscriptions**
**AADTenants**. Possible values include: 'Subscriptions', 'AADTenants'
Type SharingProfileGroupTypes `json:"type,omitempty"`
// Ids - A list of subscription/tenant ids the gallery is aimed to be shared to.
Ids *[]string `json:"ids,omitempty"`
@@ -15166,6 +15658,8 @@ type SnapshotProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
// Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed.
Incremental *bool `json:"incremental,omitempty"`
+ // IncrementalSnapshotFamilyID - READ-ONLY; Incremental snapshots for a disk share an incremental snapshot family id. The Get Page Range Diff API can only be called on incremental snapshots with the same family id.
+ IncrementalSnapshotFamilyID *string `json:"incrementalSnapshotFamilyId,omitempty"`
// Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys.
Encryption *Encryption `json:"encryption,omitempty"`
// NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll'
@@ -15180,6 +15674,8 @@ type SnapshotProperties struct {
PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation.
CompletionPercent *float64 `json:"completionPercent,omitempty"`
+ // CopyCompletionError - Indicates the error details if the background copy of a resource created via the CopyStart operation fails.
+ CopyCompletionError *CopyCompletionError `json:"copyCompletionError,omitempty"`
// DataAccessAuthMode - Possible values include: 'DataAccessAuthModeAzureActiveDirectory', 'DataAccessAuthModeNone'
DataAccessAuthMode DataAccessAuthMode `json:"dataAccessAuthMode,omitempty"`
}
@@ -15235,6 +15731,9 @@ func (sp SnapshotProperties) MarshalJSON() ([]byte, error) {
if sp.CompletionPercent != nil {
objectMap["completionPercent"] = sp.CompletionPercent
}
+ if sp.CopyCompletionError != nil {
+ objectMap["copyCompletionError"] = sp.CopyCompletionError
+ }
if sp.DataAccessAuthMode != "" {
objectMap["dataAccessAuthMode"] = sp.DataAccessAuthMode
}
@@ -15921,7 +16420,7 @@ func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error {
return nil
}
-// StatusCodeCount ...
+// StatusCodeCount the status code and count of the cloud service instance view statuses
type StatusCodeCount struct {
// Code - READ-ONLY; The instance view status code
Code *string `json:"code,omitempty"`
@@ -15943,6 +16442,8 @@ type StorageProfile struct {
OsDisk *OSDisk `json:"osDisk,omitempty"`
// DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
DataDisks *[]DataDisk `json:"dataDisks,omitempty"`
+ // DiskControllerType - Specifies the disk controller type configured for the VM.
NOTE: This property will be set to the default disk controller type if not specified provided virtual machine is being created as a hyperVGeneration: V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version.
You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM.
Minimum api-version: 2022-08-01. Possible values include: 'SCSI', 'NVMe'
+ DiskControllerType DiskControllerTypes `json:"diskControllerType,omitempty"`
}
// SubResource ...
@@ -15973,12 +16474,28 @@ type SubResourceWithColocationStatus struct {
// SupportedCapabilities list of supported capabilities persisted on the disk resource for VM use.
type SupportedCapabilities struct {
+ // DiskControllerTypes - The disk controllers that an OS disk supports. If set it can be SCSI or SCSI, NVME or NVME, SCSI.
+ DiskControllerTypes *string `json:"diskControllerTypes,omitempty"`
// AcceleratedNetwork - True if the image from which the OS disk is created supports accelerated networking.
AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"`
// Architecture - CPU architecture supported by an OS disk. Possible values include: 'X64', 'Arm64'
Architecture Architecture `json:"architecture,omitempty"`
}
+// SystemData the system meta data relating to this resource.
+type SystemData struct {
+ // CreatedAt - READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was created.
Minimum api-version: 2022-04-04.
+ CreatedAt *date.Time `json:"createdAt,omitempty"`
+ // LastModifiedAt - READ-ONLY; Specifies the time in UTC at which the Cloud Service (extended support) resource was last modified.
Minimum api-version: 2022-04-04.
+ LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for SystemData.
+func (sd SystemData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ return json.Marshal(objectMap)
+}
+
// TargetRegion describes the target region information.
type TargetRegion struct {
// Name - The name of the region.
@@ -16042,11 +16559,13 @@ func (ud UpdateDomain) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
-// UpdateDomainListResult ...
+// UpdateDomainListResult the list operation result.
type UpdateDomainListResult struct {
autorest.Response `json:"-"`
- Value *[]UpdateDomain `json:"value,omitempty"`
- NextLink *string `json:"nextLink,omitempty"`
+ // Value - The list of resources.
+ Value *[]UpdateDomain `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of resources. Use this to get the next page of resources. Do this till nextLink is null to fetch all the resources.
+ NextLink *string `json:"nextLink,omitempty"`
}
// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values.
@@ -16330,6 +16849,15 @@ type UserArtifactManage struct {
Update *string `json:"update,omitempty"`
}
+// UserArtifactSettings additional settings for the VM app that contains the target package and config file
+// name when it is deployed to target VM or VM scale set.
+type UserArtifactSettings struct {
+ // PackageFileName - Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, the package file will be named the same as the Gallery Application name.
+ PackageFileName *string `json:"packageFileName,omitempty"`
+ // ConfigFileName - Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, the config file will be named the Gallery Application name appended with "_config".
+ ConfigFileName *string `json:"configFileName,omitempty"`
+}
+
// UserArtifactSource the source image from which the Image Version is going to be created.
type UserArtifactSource struct {
// MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob.
@@ -16876,7 +17404,7 @@ type VirtualMachineExtensionProperties struct {
// SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false.
SuppressFailures *bool `json:"suppressFailures,omitempty"`
// ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault
- ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"`
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"`
}
// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties.
@@ -17121,7 +17649,7 @@ type VirtualMachineExtensionUpdateProperties struct {
// SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false.
SuppressFailures *bool `json:"suppressFailures,omitempty"`
// ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault
- ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"`
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"`
}
// VirtualMachineHealthStatus the health status of the VM.
@@ -17688,6 +18216,8 @@ type VirtualMachineNetworkInterfaceConfigurationProperties struct {
DeleteOption DeleteOptions `json:"deleteOption,omitempty"`
// EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled.
EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
+ // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"`
// EnableFpga - Specifies whether the network interface is FPGA networking-enabled.
EnableFpga *bool `json:"enableFpga,omitempty"`
// EnableIPForwarding - Whether IP forwarding enabled on this NIC.
@@ -17854,7 +18384,7 @@ type VirtualMachineProperties struct {
CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"`
// ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS
ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"`
- // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine resource was created.
Minimum api-version: 2022-03-01.
+ // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine resource was created.
Minimum api-version: 2021-11-01.
TimeCreated *date.Time `json:"timeCreated,omitempty"`
}
@@ -18778,7 +19308,7 @@ type VirtualMachineScaleSetDataDisk struct {
WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
// CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
- // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// ManagedDisk - The managed disk parameters.
ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"`
@@ -19059,7 +19589,7 @@ type VirtualMachineScaleSetExtensionProperties struct {
// SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false.
SuppressFailures *bool `json:"suppressFailures,omitempty"`
// ProtectedSettingsFromKeyVault - The extensions protected settings that are passed by reference, and consumed from key vault
- ProtectedSettingsFromKeyVault interface{} `json:"protectedSettingsFromKeyVault,omitempty"`
+ ProtectedSettingsFromKeyVault *KeyVaultSecretReference `json:"protectedSettingsFromKeyVault,omitempty"`
}
// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties.
@@ -19297,7 +19827,7 @@ func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte)
// VirtualMachineScaleSetHardwareProfile specifies the hardware settings for the virtual machine scale set.
type VirtualMachineScaleSetHardwareProfile struct {
- // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2022-03-01.
Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details.
+ // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01.
Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details.
VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"`
}
@@ -20189,6 +20719,8 @@ type VirtualMachineScaleSetNetworkConfigurationProperties struct {
Primary *bool `json:"primary,omitempty"`
// EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled.
EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
+ // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"`
// EnableFpga - Specifies whether the network interface is FPGA networking-enabled.
EnableFpga *bool `json:"enableFpga,omitempty"`
// NetworkSecurityGroup - The network security group.
@@ -20225,7 +20757,7 @@ type VirtualMachineScaleSetOSDisk struct {
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
// DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set.
DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"`
- // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.
Possible values are:
**Windows**
**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux'
OsType OperatingSystemTypes `json:"osType,omitempty"`
@@ -20293,7 +20825,9 @@ type VirtualMachineScaleSetProperties struct {
OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"`
// SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set.
SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"`
- // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created.
Minimum api-version: 2022-03-01.
+ // PriorityMixPolicy - Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance.
+ PriorityMixPolicy *PriorityMixPolicy `json:"priorityMixPolicy,omitempty"`
+ // TimeCreated - READ-ONLY; Specifies the time at which the Virtual Machine Scale Set resource was created.
Minimum api-version: 2021-11-01.
TimeCreated *date.Time `json:"timeCreated,omitempty"`
}
@@ -20342,6 +20876,9 @@ func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) {
if vmssp.SpotRestorePolicy != nil {
objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy
}
+ if vmssp.PriorityMixPolicy != nil {
+ objectMap["priorityMixPolicy"] = vmssp.PriorityMixPolicy
+ }
return json.Marshal(objectMap)
}
@@ -21045,7 +21582,8 @@ type VirtualMachineScaleSetStorageProfile struct {
// OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"`
// DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
- DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
+ DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
+ DiskControllerType *string `json:"diskControllerType,omitempty"`
}
// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a
@@ -21386,6 +21924,8 @@ type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct {
Primary *bool `json:"primary,omitempty"`
// EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled.
EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"`
+ // DisableTCPStateTracking - Specifies whether the network interface is disabled for tcp state tracking.
+ DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"`
// EnableFpga - Specifies whether the network interface is FPGA networking-enabled.
EnableFpga *bool `json:"enableFpga,omitempty"`
// NetworkSecurityGroup - The network security group.
@@ -21417,7 +21957,7 @@ type VirtualMachineScaleSetUpdateOSDisk struct {
Caching CachingTypes `json:"caching,omitempty"`
// WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
// Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist.
Image *VirtualHardDisk `json:"image,omitempty"`
@@ -21536,7 +22076,8 @@ type VirtualMachineScaleSetUpdateStorageProfile struct {
// OsDisk - The OS disk.
OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"`
// DataDisks - The data disks.
- DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
+ DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"`
+ DiskControllerType *string `json:"diskControllerType,omitempty"`
}
// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile.
@@ -21561,6 +22102,8 @@ type VirtualMachineScaleSetUpdateVMProfile struct {
ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"`
// UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.
Minimum api-version: 2021-03-01
UserData *string `json:"userData,omitempty"`
+ // HardwareProfile - Specifies the hardware profile related details of a scale set.
Minimum api-version: 2021-11-01.
+ HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"`
}
// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine.
@@ -22299,7 +22842,7 @@ type VirtualMachineScaleSetVMProfile struct {
CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"`
// ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS
ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"`
- // HardwareProfile - Specifies the hardware profile related details of a scale set.
Minimum api-version: 2022-03-01.
+ // HardwareProfile - Specifies the hardware profile related details of a scale set.
Minimum api-version: 2021-11-01.
HardwareProfile *VirtualMachineScaleSetHardwareProfile `json:"hardwareProfile,omitempty"`
}
@@ -23750,6 +24293,8 @@ type WindowsConfiguration struct {
PatchSettings *PatchSettings `json:"patchSettings,omitempty"`
// WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.
WinRM *WinRMConfiguration `json:"winRM,omitempty"`
+ // EnableVMAgentPlatformUpdates - Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false.
+ EnableVMAgentPlatformUpdates *bool `json:"enableVMAgentPlatformUpdates,omitempty"`
}
// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/operations.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go
index 8974d4ff0..3f4a51a3f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/operations.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/operations.go
@@ -66,7 +66,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe
// ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/proximityplacementgroups.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/proximityplacementgroups.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go
index 0b1363412..cc7766f7c 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/proximityplacementgroups.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/proximityplacementgroups.go
@@ -77,7 +77,7 @@ func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +155,7 @@ func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -232,7 +232,7 @@ func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -314,7 +314,7 @@ func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx con
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -427,7 +427,7 @@ func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -541,7 +541,7 @@ func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go
similarity index 100%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/resourceskus.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/resourceskus.go
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepointcollections.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepointcollections.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go
index d1997811b..469f8e2b3 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepointcollections.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepointcollections.go
@@ -78,7 +78,7 @@ func (client RestorePointCollectionsClient) CreateOrUpdatePreparer(ctx context.C
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -150,7 +150,7 @@ func (client RestorePointCollectionsClient) DeletePreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -237,7 +237,7 @@ func (client RestorePointCollectionsClient) GetPreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -319,7 +319,7 @@ func (client RestorePointCollectionsClient) ListPreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -434,7 +434,7 @@ func (client RestorePointCollectionsClient) ListAllPreparer(ctx context.Context)
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -548,7 +548,7 @@ func (client RestorePointCollectionsClient) UpdatePreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepoints.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepoints.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go
index ac171854f..5e00d6ffe 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/restorepoints.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/restorepoints.go
@@ -95,7 +95,7 @@ func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -178,7 +178,7 @@ func (client RestorePointsClient) DeletePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -267,7 +267,7 @@ func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleries.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go
index 261ed0770..e15a36d7b 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleries.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleries.go
@@ -75,7 +75,7 @@ func (client SharedGalleriesClient) GetPreparer(ctx context.Context, location st
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +155,7 @@ func (client SharedGalleriesClient) ListPreparer(ctx context.Context, location s
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimages.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go
index 5378b4f89..70c7cde60 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimages.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimages.go
@@ -79,7 +79,7 @@ func (client SharedGalleryImagesClient) GetPreparer(ctx context.Context, locatio
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -161,7 +161,7 @@ func (client SharedGalleryImagesClient) ListPreparer(ctx context.Context, locati
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimageversions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go
index 325d3f48b..ea3a76bb1 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sharedgalleryimageversions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sharedgalleryimageversions.go
@@ -83,7 +83,7 @@ func (client SharedGalleryImageVersionsClient) GetPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -168,7 +168,7 @@ func (client SharedGalleryImageVersionsClient) ListPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-07-01"
+ const APIVersion = "2022-01-03"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go
similarity index 97%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/snapshots.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go
index 792c3d82e..54eb26c52 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/snapshots.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/snapshots.go
@@ -57,14 +57,13 @@ func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupN
{Target: "snapshot.SnapshotProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.SnapshotProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil},
}},
- {Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- {Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false,
- Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
- }},
+ {Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, Chain: nil},
{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}},
+ {Target: "snapshot.SnapshotProperties.CopyCompletionError", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorCode", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "snapshot.SnapshotProperties.CopyCompletionError.ErrorMessage", Name: validation.Null, Rule: true, Chain: nil},
+ }},
}}}}}); err != nil {
return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error())
}
@@ -92,7 +91,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -176,7 +175,7 @@ func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -263,7 +262,7 @@ func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -341,7 +340,7 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -429,7 +428,7 @@ func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -545,7 +544,7 @@ func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -653,7 +652,7 @@ func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resource
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -734,7 +733,7 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2021-12-01"
+ const APIVersion = "2022-07-02"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sshpublickeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sshpublickeys.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go
index 0e554727d..f293af111 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/sshpublickeys.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/sshpublickeys.go
@@ -76,7 +76,7 @@ func (client SSHPublicKeysClient) CreatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -154,7 +154,7 @@ func (client SSHPublicKeysClient) DeletePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -231,7 +231,7 @@ func (client SSHPublicKeysClient) GenerateKeyPairPreparer(ctx context.Context, r
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -307,7 +307,7 @@ func (client SSHPublicKeysClient) GetPreparer(ctx context.Context, resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -387,7 +387,7 @@ func (client SSHPublicKeysClient) ListByResourceGroupPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -501,7 +501,7 @@ func (client SSHPublicKeysClient) ListBySubscriptionPreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -615,7 +615,7 @@ func (client SSHPublicKeysClient) UpdatePreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/usage.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go
index 8adea6c26..8af0c7de4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/usage.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/usage.go
@@ -86,7 +86,7 @@ func (client UsageClient) ListPreparer(ctx context.Context, location string) (*h
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go
similarity index 90%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/version.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go
index 56165b817..d7dcad9c4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/version.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/version.go
@@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version"
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return "Azure-SDK-For-Go/" + Version() + " compute/2022-03-01"
+ return "Azure-SDK-For-Go/" + Version() + " compute/2022-08-01"
}
// Version returns the semantic version (see http://semver.org) of the client.
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensionimages.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go
index 8055eded8..5ebc7b481 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensionimages.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensionimages.go
@@ -77,7 +77,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Contex
"version": autorest.Encode("path", version),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -152,7 +152,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -229,7 +229,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx conte
"type": autorest.Encode("path", typeParameter),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go
similarity index 94%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go
index bf768eca7..4835d9d64 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineextensions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineextensions.go
@@ -10,6 +10,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -48,6 +49,17 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context,
tracing.EndSpan(ctx, sc, err)
}()
}
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: extensionParameters,
+ Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("compute.VirtualMachineExtensionsClient", "CreateOrUpdate", err.Error())
+ }
+
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -72,7 +84,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +167,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context,
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -243,7 +255,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, re
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -323,7 +335,7 @@ func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, r
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -398,7 +410,7 @@ func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context,
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimages.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go
index 8c07cf5e5..65b20c304 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimages.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimages.go
@@ -82,7 +82,7 @@ func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, locati
"version": autorest.Encode("path", version),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -163,7 +163,7 @@ func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, locat
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -248,7 +248,7 @@ func (client VirtualMachineImagesClient) ListByEdgeZonePreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -324,7 +324,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -398,7 +398,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -476,7 +476,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, l
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimagesedgezone.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimagesedgezone.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go
index 576a70b53..33ca2cbe8 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineimagesedgezone.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineimagesedgezone.go
@@ -84,7 +84,7 @@ func (client VirtualMachineImagesEdgeZoneClient) GetPreparer(ctx context.Context
"version": autorest.Encode("path", version),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -170,7 +170,7 @@ func (client VirtualMachineImagesEdgeZoneClient) ListPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -257,7 +257,7 @@ func (client VirtualMachineImagesEdgeZoneClient) ListOffersPreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -333,7 +333,7 @@ func (client VirtualMachineImagesEdgeZoneClient) ListPublishersPreparer(ctx cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -413,7 +413,7 @@ func (client VirtualMachineImagesEdgeZoneClient) ListSkusPreparer(ctx context.Co
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineruncommands.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go
index 3935fd45a..be46b192e 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachineruncommands.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachineruncommands.go
@@ -73,7 +73,7 @@ func (client VirtualMachineRunCommandsClient) CreateOrUpdatePreparer(ctx context
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -156,7 +156,7 @@ func (client VirtualMachineRunCommandsClient) DeletePreparer(ctx context.Context
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -247,7 +247,7 @@ func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, l
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -326,7 +326,7 @@ func (client VirtualMachineRunCommandsClient) GetByVirtualMachinePreparer(ctx co
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -414,7 +414,7 @@ func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -533,7 +533,7 @@ func (client VirtualMachineRunCommandsClient) ListByVirtualMachinePreparer(ctx c
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -645,7 +645,7 @@ func (client VirtualMachineRunCommandsClient) UpdatePreparer(ctx context.Context
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachines.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go
index 934842c07..d9c7043e7 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachines.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachines.go
@@ -69,7 +69,7 @@ func (client VirtualMachinesClient) AssessPatchesPreparer(ctx context.Context, r
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -158,7 +158,7 @@ func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourc
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -240,7 +240,7 @@ func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Co
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -341,7 +341,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context,
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -425,7 +425,7 @@ func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, reso
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -507,7 +507,7 @@ func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resource
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -599,7 +599,7 @@ func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, reso
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -678,7 +678,7 @@ func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGro
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -751,7 +751,7 @@ func (client VirtualMachinesClient) InstallPatchesPreparer(ctx context.Context,
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -839,7 +839,7 @@ func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, re
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -922,7 +922,7 @@ func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGr
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1044,7 +1044,7 @@ func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusO
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1163,7 +1163,7 @@ func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Conte
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1248,7 +1248,7 @@ func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1354,7 +1354,7 @@ func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Conte
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1436,7 +1436,7 @@ func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resour
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1519,7 +1519,7 @@ func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourc
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1597,7 +1597,7 @@ func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resour
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1676,7 +1676,7 @@ func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourc
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1759,7 +1759,7 @@ func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourc
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1847,7 +1847,7 @@ func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataPreparer(ctx cont
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1926,7 +1926,7 @@ func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, reso
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -2014,7 +2014,7 @@ func (client VirtualMachinesClient) SimulateEvictionPreparer(ctx context.Context
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -2082,7 +2082,7 @@ func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceG
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -2161,7 +2161,7 @@ func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resource
"vmName": autorest.Encode("path", VMName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go
similarity index 94%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetextensions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go
index d9b42d118..d790ab517 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetextensions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetextensions.go
@@ -10,6 +10,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -48,6 +49,17 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.
tracing.EndSpan(ctx, sc, err)
}()
}
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: extensionParameters,
+ Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "extensionParameters.VirtualMachineScaleSetExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", err.Error())
+ }
+
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -72,7 +84,7 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -156,7 +168,7 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -244,7 +256,7 @@ func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Con
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -328,7 +340,7 @@ func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Co
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -437,7 +449,7 @@ func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetrollingupgrades.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go
index a1b349866..f1fe61962 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetrollingupgrades.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetrollingupgrades.go
@@ -70,7 +70,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -155,7 +155,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -226,7 +226,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeP
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -305,7 +305,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go
similarity index 98%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesets.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go
index 5e8af862f..6d0f4c523 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesets.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesets.go
@@ -79,7 +79,7 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPrepare
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -146,6 +146,14 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context,
}},
}},
}},
+ {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.BaseRegularPriorityCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}},
+ {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil},
+ {Target: "parameters.VirtualMachineScaleSetProperties.PriorityMixPolicy.RegularPriorityPercentageAboveBase", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil},
+ }},
+ }},
}}}}}); err != nil {
return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error())
}
@@ -173,7 +181,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.C
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -256,7 +264,7 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -340,7 +348,7 @@ func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context,
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -430,7 +438,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -524,7 +532,7 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"platformUpdateDomain": autorest.Encode("query", platformUpdateDomain),
@@ -609,7 +617,7 @@ func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, res
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -688,7 +696,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -769,7 +777,7 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx cont
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -885,7 +893,7 @@ func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, re
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1000,7 +1008,7 @@ func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context)
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1122,7 +1130,7 @@ func (client VirtualMachineScaleSetsClient) ListByLocationPreparer(ctx context.C
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1241,7 +1249,7 @@ func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1350,7 +1358,7 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1438,7 +1446,7 @@ func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1528,7 +1536,7 @@ func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1613,7 +1621,7 @@ func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context,
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1698,7 +1706,7 @@ func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1782,7 +1790,7 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context,
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1866,7 +1874,7 @@ func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStatePreparer
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1947,7 +1955,7 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, r
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -2031,7 +2039,7 @@ func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context,
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -2119,7 +2127,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go
similarity index 94%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmextensions.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go
index 37b146255..72992a545 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmextensions.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmextensions.go
@@ -10,6 +10,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -50,6 +51,17 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx contex
tracing.EndSpan(ctx, sc, err)
}()
}
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: extensionParameters,
+ Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "extensionParameters.VirtualMachineExtensionProperties.ProtectedSettingsFromKeyVault.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", err.Error())
+ }
+
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -75,7 +87,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ct
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -162,7 +174,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx contex
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -252,7 +264,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.C
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -334,7 +346,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -411,7 +423,7 @@ func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx contex
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmruncommands.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go
index 34f298e84..fb95c143f 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvmruncommands.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvmruncommands.go
@@ -75,7 +75,7 @@ func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdatePreparer(c
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -160,7 +160,7 @@ func (client VirtualMachineScaleSetVMRunCommandsClient) DeletePreparer(ctx conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -250,7 +250,7 @@ func (client VirtualMachineScaleSetVMRunCommandsClient) GetPreparer(ctx context.
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -337,7 +337,7 @@ func (client VirtualMachineScaleSetVMRunCommandsClient) ListPreparer(ctx context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -451,7 +451,7 @@ func (client VirtualMachineScaleSetVMRunCommandsClient) UpdatePreparer(ctx conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvms.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go
index f155885f9..6514dd7c4 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinescalesetvms.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinescalesetvms.go
@@ -74,7 +74,7 @@ func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -156,7 +156,7 @@ func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -248,7 +248,7 @@ func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, r
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -329,7 +329,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx contex
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -414,7 +414,7 @@ func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context,
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -531,7 +531,7 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -615,7 +615,7 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -701,7 +701,7 @@ func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -782,7 +782,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Contex
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -868,7 +868,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -948,7 +948,7 @@ func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Contex
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1039,7 +1039,7 @@ func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataPrepare
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1120,7 +1120,7 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1210,7 +1210,7 @@ func (client VirtualMachineScaleSetVMsClient) SimulateEvictionPreparer(ctx conte
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1280,7 +1280,7 @@ func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context,
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -1382,7 +1382,7 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go
similarity index 99%
rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinesizes.go
rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go
index 90a976ce0..cdbf65792 100644
--- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute/virtualmachinesizes.go
+++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute/virtualmachinesizes.go
@@ -81,7 +81,7 @@ func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, locati
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2022-03-01"
+ const APIVersion = "2022-08-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/autorest.go b/vendor/github.com/Azure/go-autorest/autorest/autorest.go
index aafdf021f..211c98d1e 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/autorest.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/autorest.go
@@ -6,33 +6,33 @@ generated Go code.
The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending,
and Responding. A typical pattern is:
- req, err := Prepare(&http.Request{},
- token.WithAuthorization())
+ req, err := Prepare(&http.Request{},
+ token.WithAuthorization())
- resp, err := Send(req,
- WithLogging(logger),
- DoErrorIfStatusCode(http.StatusInternalServerError),
- DoCloseIfError(),
- DoRetryForAttempts(5, time.Second))
+ resp, err := Send(req,
+ WithLogging(logger),
+ DoErrorIfStatusCode(http.StatusInternalServerError),
+ DoCloseIfError(),
+ DoRetryForAttempts(5, time.Second))
- err = Respond(resp,
- ByDiscardingBody(),
- ByClosing())
+ err = Respond(resp,
+ ByDiscardingBody(),
+ ByClosing())
Each phase relies on decorators to modify and / or manage processing. Decorators may first modify
and then pass the data along, pass the data first and then modify the result, or wrap themselves
around passing the data (such as a logger might do). Decorators run in the order provided. For
example, the following:
- req, err := Prepare(&http.Request{},
- WithBaseURL("https://microsoft.com/"),
- WithPath("a"),
- WithPath("b"),
- WithPath("c"))
+ req, err := Prepare(&http.Request{},
+ WithBaseURL("https://microsoft.com/"),
+ WithPath("a"),
+ WithPath("b"),
+ WithPath("c"))
will set the URL to:
- https://microsoft.com/a/b/c
+ https://microsoft.com/a/b/c
Preparers and Responders may be shared and re-used (assuming the underlying decorators support
sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
index 1328f1764..868345db6 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
@@ -214,7 +214,7 @@ func (r Resource) String() string {
// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#resourceid.
func ParseResourceID(resourceID string) (Resource, error) {
- const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)`
+ const resourceIDPatternText = `(?i)^/subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)$`
resourceIDPattern := regexp.MustCompile(resourceIDPatternText)
match := resourceIDPattern.FindStringSubmatch(resourceID)
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go
index 3467b8fa6..d35b3850a 100644
--- a/vendor/github.com/Azure/go-autorest/autorest/utility.go
+++ b/vendor/github.com/Azure/go-autorest/autorest/utility.go
@@ -60,9 +60,9 @@ func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder {
// is especially useful if there is a chance the data will fail to decode.
// encodedAs specifies the expected encoding, r provides the io.Reader to the data, and v
// is the decoding destination.
-func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (bytes.Buffer, error) {
- b := bytes.Buffer{}
- return b, NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v)
+func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (b bytes.Buffer, err error) {
+ err = NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v)
+ return
}
// TeeReadCloser returns a ReadCloser that writes to w what it reads from rc.
diff --git a/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
index b1811884b..f06d37740 100644
--- a/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
+++ b/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
@@ -1,3 +1,28 @@
+## 2.10.0
+
+### Features
+- feat(ginkgo/generators): add --tags flag (#1216) [a782a77]
+ adds a new --tags flag to ginkgo generate
+
+### Fixes
+- Fix broken link of MIGRATING_TO_V2.md (#1217) [548d78e]
+
+### Maintenance
+- Bump golang.org/x/tools from 0.9.1 to 0.9.3 (#1215) [2b76a5e]
+
+## 2.9.7
+
+### Fixes
+- fix race when multiple defercleanups are called in goroutines [07fc3a0]
+
+## 2.9.6
+
+### Fixes
+- fix: create parent directory before report files (#1212) [0ac65de]
+
+### Maintenance
+- Bump github.com/onsi/gomega from 1.27.6 to 1.27.7 (#1202) [3e39231]
+
## 2.9.5
### Fixes
diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go
index 48d23f919..be01dec97 100644
--- a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go
+++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go
@@ -32,6 +32,9 @@ func BuildGenerateCommand() command.Command {
{Name: "template-data", KeyPath: "CustomTemplateData",
UsageArgument: "template-data-file",
Usage: "If specified, generate will use the contents of the file passed as data to be rendered in the test file template"},
+ {Name: "tags", KeyPath: "Tags",
+ UsageArgument: "build-tags",
+ Usage: "If specified, generate will create a test file that uses the given build tags (i.e. `--tags e2e,!unit` will add `//go:build e2e,!unit`)"},
},
&conf,
types.GinkgoFlagSections{},
@@ -59,6 +62,7 @@ You can also pass a of the form "file.go" and generate will emit "fil
}
type specData struct {
+ BuildTags string
Package string
Subject string
PackageImportPath string
@@ -93,6 +97,7 @@ func generateTestFileForSubject(subject string, conf GeneratorsConfig) {
}
data := specData{
+ BuildTags: getBuildTags(conf.Tags),
Package: determinePackageName(packageName, conf.Internal),
Subject: formattedName,
PackageImportPath: getPackageImportPath(),
diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go
index c3470adbf..4dab07d03 100644
--- a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go
+++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_templates.go
@@ -1,6 +1,7 @@
package generators
-var specText = `package {{.Package}}
+var specText = `{{.BuildTags}}
+package {{.Package}}
import (
{{.GinkgoImport}}
@@ -14,7 +15,8 @@ var _ = {{.GinkgoPackage}}Describe("{{.Subject}}", func() {
})
`
-var agoutiSpecText = `package {{.Package}}
+var agoutiSpecText = `{{.BuildTags}}
+package {{.Package}}
import (
{{.GinkgoImport}}
diff --git a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go
index 3046a4487..28c7aa6f4 100644
--- a/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go
+++ b/vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go
@@ -1,6 +1,7 @@
package generators
import (
+ "fmt"
"go/build"
"os"
"path/filepath"
@@ -14,6 +15,7 @@ type GeneratorsConfig struct {
Agouti, NoDot, Internal bool
CustomTemplate string
CustomTemplateData string
+ Tags string
}
func getPackageAndFormattedName() (string, string, string) {
@@ -62,3 +64,13 @@ func determinePackageName(name string, internal bool) string {
return name + "_test"
}
+
+// getBuildTags returns the resultant string to be added.
+// If the input string is not empty, then returns a `//go:build {}` string,
+// otherwise returns an empty string.
+func getBuildTags(tags string) string {
+ if tags != "" {
+ return fmt.Sprintf("//go:build %s\n", tags)
+ }
+ return ""
+}
diff --git a/vendor/github.com/onsi/ginkgo/v2/internal/suite.go b/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
index 60c913d89..ea0d259d9 100644
--- a/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
+++ b/vendor/github.com/onsi/ginkgo/v2/internal/suite.go
@@ -245,7 +245,9 @@ func (suite *Suite) pushCleanupNode(node Node) error {
node.NodeIDWhereCleanupWasGenerated = suite.currentNode.ID
node.NestingLevel = suite.currentNode.NestingLevel
+ suite.selectiveLock.Lock()
suite.cleanupNodes = append(suite.cleanupNodes, node)
+ suite.selectiveLock.Unlock()
return nil
}
diff --git a/vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go b/vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go
index 7f96c450f..be506f9b4 100644
--- a/vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go
+++ b/vendor/github.com/onsi/ginkgo/v2/reporters/json_report.go
@@ -4,12 +4,16 @@ import (
"encoding/json"
"fmt"
"os"
+ "path"
"github.com/onsi/ginkgo/v2/types"
)
-//GenerateJSONReport produces a JSON-formatted report at the passed in destination
+// GenerateJSONReport produces a JSON-formatted report at the passed in destination
func GenerateJSONReport(report types.Report, destination string) error {
+ if err := os.MkdirAll(path.Dir(destination), 0770); err != nil {
+ return err
+ }
f, err := os.Create(destination)
if err != nil {
return err
@@ -25,8 +29,8 @@ func GenerateJSONReport(report types.Report, destination string) error {
return f.Close()
}
-//MergeJSONReports produces a single JSON-formatted report at the passed in destination by merging the JSON-formatted reports provided in sources
-//It skips over reports that fail to decode but reports on them via the returned messages []string
+// MergeJSONReports produces a single JSON-formatted report at the passed in destination by merging the JSON-formatted reports provided in sources
+// It skips over reports that fail to decode but reports on them via the returned messages []string
func MergeAndCleanupJSONReports(sources []string, destination string) ([]string, error) {
messages := []string{}
allReports := []types.Report{}
@@ -46,6 +50,9 @@ func MergeAndCleanupJSONReports(sources []string, destination string) ([]string,
allReports = append(allReports, reports...)
}
+ if err := os.MkdirAll(path.Dir(destination), 0770); err != nil {
+ return messages, err
+ }
f, err := os.Create(destination)
if err != nil {
return messages, err
diff --git a/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go b/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
index 592d7f614..816042208 100644
--- a/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
+++ b/vendor/github.com/onsi/ginkgo/v2/reporters/junit_report.go
@@ -14,6 +14,7 @@ import (
"encoding/xml"
"fmt"
"os"
+ "path"
"strings"
"github.com/onsi/ginkgo/v2/config"
@@ -285,6 +286,9 @@ func GenerateJUnitReportWithConfig(report types.Report, dst string, config Junit
TestSuites: []JUnitTestSuite{suite},
}
+ if err := os.MkdirAll(path.Dir(dst), 0770); err != nil {
+ return err
+ }
f, err := os.Create(dst)
if err != nil {
return err
@@ -322,6 +326,9 @@ func MergeAndCleanupJUnitReports(sources []string, dst string) ([]string, error)
mergedReport.TestSuites = append(mergedReport.TestSuites, report.TestSuites...)
}
+ if err := os.MkdirAll(path.Dir(dst), 0770); err != nil {
+ return messages, err
+ }
f, err := os.Create(dst)
if err != nil {
return messages, err
diff --git a/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go b/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
index c1863496d..e990ad82e 100644
--- a/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
+++ b/vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
@@ -11,6 +11,7 @@ package reporters
import (
"fmt"
"os"
+ "path"
"strings"
"github.com/onsi/ginkgo/v2/types"
@@ -27,6 +28,9 @@ func tcEscape(s string) string {
}
func GenerateTeamcityReport(report types.Report, dst string) error {
+ if err := os.MkdirAll(path.Dir(dst), 0770); err != nil {
+ return err
+ }
f, err := os.Create(dst)
if err != nil {
return err
diff --git a/vendor/github.com/onsi/ginkgo/v2/types/version.go b/vendor/github.com/onsi/ginkgo/v2/types/version.go
index 43066341e..b7ed8ff79 100644
--- a/vendor/github.com/onsi/ginkgo/v2/types/version.go
+++ b/vendor/github.com/onsi/ginkgo/v2/types/version.go
@@ -1,3 +1,3 @@
package types
-const VERSION = "2.9.5"
+const VERSION = "2.10.0"
diff --git a/vendor/github.com/onsi/gomega/.gitignore b/vendor/github.com/onsi/gomega/.gitignore
index 52266eae1..425d0a509 100644
--- a/vendor/github.com/onsi/gomega/.gitignore
+++ b/vendor/github.com/onsi/gomega/.gitignore
@@ -3,5 +3,5 @@
.
.idea
gomega.iml
-TODO.md
+TODO
.vscode
\ No newline at end of file
diff --git a/vendor/github.com/onsi/gomega/CHANGELOG.md b/vendor/github.com/onsi/gomega/CHANGELOG.md
index ef428f6f6..9b83dd6d4 100644
--- a/vendor/github.com/onsi/gomega/CHANGELOG.md
+++ b/vendor/github.com/onsi/gomega/CHANGELOG.md
@@ -1,3 +1,27 @@
+## 1.27.8
+
+### Fixes
+- HaveExactElement should not call FailureMessage if a submatcher returned an error [096f392]
+
+### Maintenance
+- Bump github.com/onsi/ginkgo/v2 from 2.9.5 to 2.9.7 (#669) [8884bee]
+
+## 1.27.7
+
+### Fixes
+- fix: gcustom.MakeMatcher accepts nil as actual value (#666) [57054d5]
+
+### Maintenance
+- update gitignore [05c1bc6]
+- Bump github.com/onsi/ginkgo/v2 from 2.9.4 to 2.9.5 (#663) [7cadcf6]
+- Bump golang.org/x/net from 0.9.0 to 0.10.0 (#662) [b524839]
+- Bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.4 (#661) [5f44694]
+- Bump commonmarker from 0.23.8 to 0.23.9 in /docs (#657) [05dc99a]
+- Bump nokogiri from 1.14.1 to 1.14.3 in /docs (#658) [3a033d1]
+- Replace deprecated NewGomegaWithT with NewWithT (#659) [a19238f]
+- Bump golang.org/x/net from 0.8.0 to 0.9.0 (#656) [29ed041]
+- Bump actions/setup-go from 3 to 4 (#651) [11b2080]
+
## 1.27.6
### Fixes
diff --git a/vendor/github.com/onsi/gomega/gcustom/make_matcher.go b/vendor/github.com/onsi/gomega/gcustom/make_matcher.go
index 0c782e464..5372fa441 100644
--- a/vendor/github.com/onsi/gomega/gcustom/make_matcher.go
+++ b/vendor/github.com/onsi/gomega/gcustom/make_matcher.go
@@ -97,7 +97,9 @@ func MakeMatcher(matchFunc any, args ...any) CustomGomegaMatcher {
finalMatchFunc = reflect.MakeFunc(reflect.TypeOf(finalMatchFunc),
func(args []reflect.Value) []reflect.Value {
actual := args[0].Interface()
- if reflect.TypeOf(actual).AssignableTo(t.In(0)) {
+ if actual == nil && reflect.TypeOf(actual) == reflect.TypeOf(nil) {
+ return matchFuncValue.Call([]reflect.Value{reflect.New(t.In(0)).Elem()})
+ } else if reflect.TypeOf(actual).AssignableTo(t.In(0)) {
return matchFuncValue.Call([]reflect.Value{reflect.ValueOf(actual)})
} else {
return []reflect.Value{
diff --git a/vendor/github.com/onsi/gomega/gomega_dsl.go b/vendor/github.com/onsi/gomega/gomega_dsl.go
index 872592bfb..bc7ec293d 100644
--- a/vendor/github.com/onsi/gomega/gomega_dsl.go
+++ b/vendor/github.com/onsi/gomega/gomega_dsl.go
@@ -22,7 +22,7 @@ import (
"github.com/onsi/gomega/types"
)
-const GOMEGA_VERSION = "1.27.6"
+const GOMEGA_VERSION = "1.27.8"
const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler.
If you're using Ginkgo then you probably forgot to put your assertion in an It().
diff --git a/vendor/github.com/onsi/gomega/matchers/have_exact_elements.go b/vendor/github.com/onsi/gomega/matchers/have_exact_elements.go
index 7cce776c1..dca5b9446 100644
--- a/vendor/github.com/onsi/gomega/matchers/have_exact_elements.go
+++ b/vendor/github.com/onsi/gomega/matchers/have_exact_elements.go
@@ -44,7 +44,12 @@ func (matcher *HaveExactElementsMatcher) Match(actual interface{}) (success bool
elemMatcher := matchers[i].(omegaMatcher)
match, err := elemMatcher.Match(values[i])
- if err != nil || !match {
+ if err != nil {
+ matcher.mismatchFailures = append(matcher.mismatchFailures, mismatchFailure{
+ index: i,
+ failure: err.Error(),
+ })
+ } else if !match {
matcher.mismatchFailures = append(matcher.mismatchFailures, mismatchFailure{
index: i,
failure: elemMatcher.FailureMessage(values[i]),
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/vendor/github.com/stretchr/testify/assert/assertion_compare.go
index 95d8e59da..b774da88d 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_compare.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_compare.go
@@ -352,9 +352,9 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
// Greater asserts that the first element is greater than the second
//
-// assert.Greater(t, 2, 1)
-// assert.Greater(t, float64(2), float64(1))
-// assert.Greater(t, "b", "a")
+// assert.Greater(t, 2, 1)
+// assert.Greater(t, float64(2), float64(1))
+// assert.Greater(t, "b", "a")
func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -364,10 +364,10 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface
// GreaterOrEqual asserts that the first element is greater than or equal to the second
//
-// assert.GreaterOrEqual(t, 2, 1)
-// assert.GreaterOrEqual(t, 2, 2)
-// assert.GreaterOrEqual(t, "b", "a")
-// assert.GreaterOrEqual(t, "b", "b")
+// assert.GreaterOrEqual(t, 2, 1)
+// assert.GreaterOrEqual(t, 2, 2)
+// assert.GreaterOrEqual(t, "b", "a")
+// assert.GreaterOrEqual(t, "b", "b")
func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -377,9 +377,9 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in
// Less asserts that the first element is less than the second
//
-// assert.Less(t, 1, 2)
-// assert.Less(t, float64(1), float64(2))
-// assert.Less(t, "a", "b")
+// assert.Less(t, 1, 2)
+// assert.Less(t, float64(1), float64(2))
+// assert.Less(t, "a", "b")
func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -389,10 +389,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{})
// LessOrEqual asserts that the first element is less than or equal to the second
//
-// assert.LessOrEqual(t, 1, 2)
-// assert.LessOrEqual(t, 2, 2)
-// assert.LessOrEqual(t, "a", "b")
-// assert.LessOrEqual(t, "b", "b")
+// assert.LessOrEqual(t, 1, 2)
+// assert.LessOrEqual(t, 2, 2)
+// assert.LessOrEqual(t, "a", "b")
+// assert.LessOrEqual(t, "b", "b")
func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -402,8 +402,8 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter
// Positive asserts that the specified element is positive
//
-// assert.Positive(t, 1)
-// assert.Positive(t, 1.23)
+// assert.Positive(t, 1)
+// assert.Positive(t, 1.23)
func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -414,8 +414,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
// Negative asserts that the specified element is negative
//
-// assert.Negative(t, -1)
-// assert.Negative(t, -1.23)
+// assert.Negative(t, -1)
+// assert.Negative(t, -1.23)
func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_format.go b/vendor/github.com/stretchr/testify/assert/assertion_format.go
index 7880b8f94..84dbd6c79 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_format.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_format.go
@@ -22,9 +22,9 @@ func Conditionf(t TestingT, comp Comparison, msg string, args ...interface{}) bo
// Containsf asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted")
-// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
-// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
+// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted")
+// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
+// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -56,7 +56,7 @@ func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string
// Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// assert.Emptyf(t, obj, "error message %s", "formatted")
+// assert.Emptyf(t, obj, "error message %s", "formatted")
func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -66,7 +66,7 @@ func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) boo
// Equalf asserts that two objects are equal.
//
-// assert.Equalf(t, 123, 123, "error message %s", "formatted")
+// assert.Equalf(t, 123, 123, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -81,8 +81,8 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar
// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -90,10 +90,27 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...)
}
+// EqualExportedValuesf asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true
+// assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false
+func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return EqualExportedValues(t, expected, actual, append([]interface{}{msg}, args...)...)
+}
+
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
+// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -103,10 +120,10 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri
// Errorf asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.Errorf(t, err, "error message %s", "formatted") {
-// assert.Equal(t, expectedErrorf, err)
-// }
+// actualObj, err := SomeFunction()
+// if assert.Errorf(t, err, "error message %s", "formatted") {
+// assert.Equal(t, expectedErrorf, err)
+// }
func Errorf(t TestingT, err error, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -126,8 +143,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -147,7 +164,7 @@ func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface
// Eventuallyf asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -155,9 +172,34 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick
return Eventually(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...)
}
+// EventuallyWithTf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ return EventuallyWithT(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...)
+}
+
// Exactlyf asserts that two objects are equal in value and type.
//
-// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
+// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -183,7 +225,7 @@ func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{}
// Falsef asserts that the specified value is false.
//
-// assert.Falsef(t, myBool, "error message %s", "formatted")
+// assert.Falsef(t, myBool, "error message %s", "formatted")
func Falsef(t TestingT, value bool, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -202,9 +244,9 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool
// Greaterf asserts that the first element is greater than the second
//
-// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
-// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted")
-// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
+// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
+// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted")
+// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -214,10 +256,10 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in
// GreaterOrEqualf asserts that the first element is greater than or equal to the second
//
-// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -228,7 +270,7 @@ func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, arg
// HTTPBodyContainsf asserts that a specified handler returns a
// body that contains a string.
//
-// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
@@ -241,7 +283,7 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url
// HTTPBodyNotContainsf asserts that a specified handler returns a
// body that does not contain a string.
//
-// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
@@ -253,7 +295,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u
// HTTPErrorf asserts that a specified handler returns an error status code.
//
-// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -265,7 +307,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string,
// HTTPRedirectf asserts that a specified handler returns a redirect status code.
//
-// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -277,7 +319,7 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri
// HTTPStatusCodef asserts that a specified handler returns a specified status code.
//
-// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
@@ -289,7 +331,7 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st
// HTTPSuccessf asserts that a specified handler returns a success status code.
//
-// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
+// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -301,7 +343,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin
// Implementsf asserts that an object is implemented by the specified interface.
//
-// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
+// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -311,7 +353,7 @@ func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, ms
// InDeltaf asserts that the two numerals are within delta of each other.
//
-// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
+// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -353,9 +395,9 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil
// IsDecreasingf asserts that the collection is decreasing
//
-// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")
-// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")
-// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -365,9 +407,9 @@ func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface
// IsIncreasingf asserts that the collection is increasing
//
-// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")
-// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")
-// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -377,9 +419,9 @@ func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface
// IsNonDecreasingf asserts that the collection is not decreasing
//
-// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")
-// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")
-// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -389,9 +431,9 @@ func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interf
// IsNonIncreasingf asserts that the collection is not increasing
//
-// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")
-// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")
-// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -409,7 +451,7 @@ func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg strin
// JSONEqf asserts that two JSON strings are equivalent.
//
-// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
+// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -420,7 +462,7 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int
// Lenf asserts that the specified object has specific length.
// Lenf also fails if the object has a type that len() not accept.
//
-// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")
+// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")
func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -430,9 +472,9 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf
// Lessf asserts that the first element is less than the second
//
-// assert.Lessf(t, 1, 2, "error message %s", "formatted")
-// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted")
-// assert.Lessf(t, "a", "b", "error message %s", "formatted")
+// assert.Lessf(t, 1, 2, "error message %s", "formatted")
+// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted")
+// assert.Lessf(t, "a", "b", "error message %s", "formatted")
func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -442,10 +484,10 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter
// LessOrEqualf asserts that the first element is less than or equal to the second
//
-// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
-// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
-// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
-// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -455,8 +497,8 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args .
// Negativef asserts that the specified element is negative
//
-// assert.Negativef(t, -1, "error message %s", "formatted")
-// assert.Negativef(t, -1.23, "error message %s", "formatted")
+// assert.Negativef(t, -1, "error message %s", "formatted")
+// assert.Negativef(t, -1.23, "error message %s", "formatted")
func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -467,7 +509,7 @@ func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool
// Neverf asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -477,7 +519,7 @@ func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.
// Nilf asserts that the specified object is nil.
//
-// assert.Nilf(t, err, "error message %s", "formatted")
+// assert.Nilf(t, err, "error message %s", "formatted")
func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -496,10 +538,10 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) bool
// NoErrorf asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.NoErrorf(t, err, "error message %s", "formatted") {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if assert.NoErrorf(t, err, "error message %s", "formatted") {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -519,9 +561,9 @@ func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) boo
// NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted")
-// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")
-// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")
func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -532,9 +574,9 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a
// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if assert.NotEmptyf(t, obj, "error message %s", "formatted") {
-// assert.Equal(t, "two", obj[1])
-// }
+// if assert.NotEmptyf(t, obj, "error message %s", "formatted") {
+// assert.Equal(t, "two", obj[1])
+// }
func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -544,7 +586,7 @@ func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{})
// NotEqualf asserts that the specified values are NOT equal.
//
-// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted")
+// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -557,7 +599,7 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string,
// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
//
-// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")
+// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")
func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -576,7 +618,7 @@ func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interf
// NotNilf asserts that the specified object is not nil.
//
-// assert.NotNilf(t, err, "error message %s", "formatted")
+// assert.NotNilf(t, err, "error message %s", "formatted")
func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -586,7 +628,7 @@ func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bo
// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")
+// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")
func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -596,8 +638,8 @@ func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bo
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
-// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
+// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
+// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -607,7 +649,7 @@ func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ..
// NotSamef asserts that two pointers do not reference the same object.
//
-// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted")
+// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -621,7 +663,7 @@ func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string,
// NotSubsetf asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
+// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -639,7 +681,7 @@ func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) bool {
// Panicsf asserts that the code inside the specified PanicTestFunc panics.
//
-// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
func Panicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -651,7 +693,7 @@ func Panicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -662,7 +704,7 @@ func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string,
// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -672,8 +714,8 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str
// Positivef asserts that the specified element is positive
//
-// assert.Positivef(t, 1, "error message %s", "formatted")
-// assert.Positivef(t, 1.23, "error message %s", "formatted")
+// assert.Positivef(t, 1, "error message %s", "formatted")
+// assert.Positivef(t, 1.23, "error message %s", "formatted")
func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -683,8 +725,8 @@ func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool
// Regexpf asserts that a specified regexp matches a string.
//
-// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
-// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
+// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
+// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -694,7 +736,7 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in
// Samef asserts that two pointers reference the same object.
//
-// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
+// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -708,7 +750,7 @@ func Samef(t TestingT, expected interface{}, actual interface{}, msg string, arg
// Subsetf asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
+// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -718,7 +760,7 @@ func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args
// Truef asserts that the specified value is true.
//
-// assert.Truef(t, myBool, "error message %s", "formatted")
+// assert.Truef(t, myBool, "error message %s", "formatted")
func Truef(t TestingT, value bool, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -728,7 +770,7 @@ func Truef(t TestingT, value bool, msg string, args ...interface{}) bool {
// WithinDurationf asserts that the two times are within duration delta of each other.
//
-// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
+// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -738,7 +780,7 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim
// WithinRangef asserts that a time is within a time range (inclusive).
//
-// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
+// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
index 339515b8b..b1d94aec5 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_forward.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_forward.go
@@ -30,9 +30,9 @@ func (a *Assertions) Conditionf(comp Comparison, msg string, args ...interface{}
// Contains asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// a.Contains("Hello World", "World")
-// a.Contains(["Hello", "World"], "World")
-// a.Contains({"Hello": "World"}, "Hello")
+// a.Contains("Hello World", "World")
+// a.Contains(["Hello", "World"], "World")
+// a.Contains({"Hello": "World"}, "Hello")
func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -43,9 +43,9 @@ func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ..
// Containsf asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// a.Containsf("Hello World", "World", "error message %s", "formatted")
-// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted")
-// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted")
+// a.Containsf("Hello World", "World", "error message %s", "formatted")
+// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted")
+// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted")
func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -98,7 +98,7 @@ func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg st
// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// a.Empty(obj)
+// a.Empty(obj)
func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -109,7 +109,7 @@ func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool {
// Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// a.Emptyf(obj, "error message %s", "formatted")
+// a.Emptyf(obj, "error message %s", "formatted")
func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -119,7 +119,7 @@ func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{})
// Equal asserts that two objects are equal.
//
-// a.Equal(123, 123)
+// a.Equal(123, 123)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -134,8 +134,8 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs
// EqualError asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// a.EqualError(err, expectedErrorString)
+// actualObj, err := SomeFunction()
+// a.EqualError(err, expectedErrorString)
func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -146,8 +146,8 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...
// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -155,10 +155,44 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a
return EqualErrorf(a.t, theError, errString, msg, args...)
}
+// EqualExportedValues asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// a.EqualExportedValues(S{1, 2}, S{1, 3}) => true
+// a.EqualExportedValues(S{1, 2}, S{2, 3}) => false
+func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return EqualExportedValues(a.t, expected, actual, msgAndArgs...)
+}
+
+// EqualExportedValuesf asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true
+// a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false
+func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return EqualExportedValuesf(a.t, expected, actual, msg, args...)
+}
+
// EqualValues asserts that two objects are equal or convertable to the same types
// and equal.
//
-// a.EqualValues(uint32(123), int32(123))
+// a.EqualValues(uint32(123), int32(123))
func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -169,7 +203,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
+// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -179,7 +213,7 @@ func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg
// Equalf asserts that two objects are equal.
//
-// a.Equalf(123, 123, "error message %s", "formatted")
+// a.Equalf(123, 123, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -193,10 +227,10 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string
// Error asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.Error(err) {
-// assert.Equal(t, expectedError, err)
-// }
+// actualObj, err := SomeFunction()
+// if a.Error(err) {
+// assert.Equal(t, expectedError, err)
+// }
func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -225,8 +259,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ..
// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// a.ErrorContains(err, expectedErrorSubString)
+// actualObj, err := SomeFunction()
+// a.ErrorContains(err, expectedErrorSubString)
func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -237,8 +271,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs .
// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -266,10 +300,10 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter
// Errorf asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.Errorf(err, "error message %s", "formatted") {
-// assert.Equal(t, expectedErrorf, err)
-// }
+// actualObj, err := SomeFunction()
+// if a.Errorf(err, "error message %s", "formatted") {
+// assert.Equal(t, expectedErrorf, err)
+// }
func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -280,7 +314,7 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool {
// Eventually asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
+// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -288,10 +322,60 @@ func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, ti
return Eventually(a.t, condition, waitFor, tick, msgAndArgs...)
}
+// EventuallyWithT asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// a.EventuallyWithT(func(c *assert.CollectT) {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...)
+}
+
+// EventuallyWithTf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ return EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...)
+}
+
// Eventuallyf asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -301,7 +385,7 @@ func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, t
// Exactly asserts that two objects are equal in value and type.
//
-// a.Exactly(int32(123), int64(123))
+// a.Exactly(int32(123), int64(123))
func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -311,7 +395,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg
// Exactlyf asserts that two objects are equal in value and type.
//
-// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted")
+// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted")
func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -353,7 +437,7 @@ func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{
// False asserts that the specified value is false.
//
-// a.False(myBool)
+// a.False(myBool)
func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -363,7 +447,7 @@ func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool {
// Falsef asserts that the specified value is false.
//
-// a.Falsef(myBool, "error message %s", "formatted")
+// a.Falsef(myBool, "error message %s", "formatted")
func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -391,9 +475,9 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) b
// Greater asserts that the first element is greater than the second
//
-// a.Greater(2, 1)
-// a.Greater(float64(2), float64(1))
-// a.Greater("b", "a")
+// a.Greater(2, 1)
+// a.Greater(float64(2), float64(1))
+// a.Greater("b", "a")
func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -403,10 +487,10 @@ func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...inter
// GreaterOrEqual asserts that the first element is greater than or equal to the second
//
-// a.GreaterOrEqual(2, 1)
-// a.GreaterOrEqual(2, 2)
-// a.GreaterOrEqual("b", "a")
-// a.GreaterOrEqual("b", "b")
+// a.GreaterOrEqual(2, 1)
+// a.GreaterOrEqual(2, 2)
+// a.GreaterOrEqual("b", "a")
+// a.GreaterOrEqual("b", "b")
func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -416,10 +500,10 @@ func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs .
// GreaterOrEqualf asserts that the first element is greater than or equal to the second
//
-// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
-// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
-// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
-// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -429,9 +513,9 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string,
// Greaterf asserts that the first element is greater than the second
//
-// a.Greaterf(2, 1, "error message %s", "formatted")
-// a.Greaterf(float64(2), float64(1), "error message %s", "formatted")
-// a.Greaterf("b", "a", "error message %s", "formatted")
+// a.Greaterf(2, 1, "error message %s", "formatted")
+// a.Greaterf(float64(2), float64(1), "error message %s", "formatted")
+// a.Greaterf("b", "a", "error message %s", "formatted")
func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -442,7 +526,7 @@ func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args .
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
-// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
@@ -455,7 +539,7 @@ func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, u
// HTTPBodyContainsf asserts that a specified handler returns a
// body that contains a string.
//
-// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
@@ -468,7 +552,7 @@ func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string,
// HTTPBodyNotContains asserts that a specified handler returns a
// body that does not contain a string.
//
-// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
@@ -481,7 +565,7 @@ func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string
// HTTPBodyNotContainsf asserts that a specified handler returns a
// body that does not contain a string.
//
-// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool {
@@ -493,7 +577,7 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin
// HTTPError asserts that a specified handler returns an error status code.
//
-// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -505,7 +589,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri
// HTTPErrorf asserts that a specified handler returns an error status code.
//
-// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -517,7 +601,7 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str
// HTTPRedirect asserts that a specified handler returns a redirect status code.
//
-// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -529,7 +613,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s
// HTTPRedirectf asserts that a specified handler returns a redirect status code.
//
-// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -541,7 +625,7 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url
// HTTPStatusCode asserts that a specified handler returns a specified status code.
//
-// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501)
+// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501)
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool {
@@ -553,7 +637,7 @@ func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url
// HTTPStatusCodef asserts that a specified handler returns a specified status code.
//
-// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool {
@@ -565,7 +649,7 @@ func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, ur
// HTTPSuccess asserts that a specified handler returns a success status code.
//
-// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
+// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -577,7 +661,7 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st
// HTTPSuccessf asserts that a specified handler returns a success status code.
//
-// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
+// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool {
@@ -589,7 +673,7 @@ func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url s
// Implements asserts that an object is implemented by the specified interface.
//
-// a.Implements((*MyInterface)(nil), new(MyObject))
+// a.Implements((*MyInterface)(nil), new(MyObject))
func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -599,7 +683,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{},
// Implementsf asserts that an object is implemented by the specified interface.
//
-// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
+// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -609,7 +693,7 @@ func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}
// InDelta asserts that the two numerals are within delta of each other.
//
-// a.InDelta(math.Pi, 22/7.0, 0.01)
+// a.InDelta(math.Pi, 22/7.0, 0.01)
func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -651,7 +735,7 @@ func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, del
// InDeltaf asserts that the two numerals are within delta of each other.
//
-// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
+// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -693,9 +777,9 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo
// IsDecreasing asserts that the collection is decreasing
//
-// a.IsDecreasing([]int{2, 1, 0})
-// a.IsDecreasing([]float{2, 1})
-// a.IsDecreasing([]string{"b", "a"})
+// a.IsDecreasing([]int{2, 1, 0})
+// a.IsDecreasing([]float{2, 1})
+// a.IsDecreasing([]string{"b", "a"})
func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -705,9 +789,9 @@ func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{})
// IsDecreasingf asserts that the collection is decreasing
//
-// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted")
-// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted")
-// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted")
+// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted")
+// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted")
func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -717,9 +801,9 @@ func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...inter
// IsIncreasing asserts that the collection is increasing
//
-// a.IsIncreasing([]int{1, 2, 3})
-// a.IsIncreasing([]float{1, 2})
-// a.IsIncreasing([]string{"a", "b"})
+// a.IsIncreasing([]int{1, 2, 3})
+// a.IsIncreasing([]float{1, 2})
+// a.IsIncreasing([]string{"a", "b"})
func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -729,9 +813,9 @@ func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{})
// IsIncreasingf asserts that the collection is increasing
//
-// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted")
-// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted")
-// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted")
+// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted")
+// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted")
func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -741,9 +825,9 @@ func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...inter
// IsNonDecreasing asserts that the collection is not decreasing
//
-// a.IsNonDecreasing([]int{1, 1, 2})
-// a.IsNonDecreasing([]float{1, 2})
-// a.IsNonDecreasing([]string{"a", "b"})
+// a.IsNonDecreasing([]int{1, 1, 2})
+// a.IsNonDecreasing([]float{1, 2})
+// a.IsNonDecreasing([]string{"a", "b"})
func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -753,9 +837,9 @@ func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface
// IsNonDecreasingf asserts that the collection is not decreasing
//
-// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted")
-// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted")
-// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted")
func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -765,9 +849,9 @@ func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...in
// IsNonIncreasing asserts that the collection is not increasing
//
-// a.IsNonIncreasing([]int{2, 1, 1})
-// a.IsNonIncreasing([]float{2, 1})
-// a.IsNonIncreasing([]string{"b", "a"})
+// a.IsNonIncreasing([]int{2, 1, 1})
+// a.IsNonIncreasing([]float{2, 1})
+// a.IsNonIncreasing([]string{"b", "a"})
func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -777,9 +861,9 @@ func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface
// IsNonIncreasingf asserts that the collection is not increasing
//
-// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted")
-// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted")
-// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted")
func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -805,7 +889,7 @@ func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg s
// JSONEq asserts that two JSON strings are equivalent.
//
-// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
+// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -815,7 +899,7 @@ func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interf
// JSONEqf asserts that two JSON strings are equivalent.
//
-// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
+// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -826,7 +910,7 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ..
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
-// a.Len(mySlice, 3)
+// a.Len(mySlice, 3)
func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -837,7 +921,7 @@ func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface
// Lenf asserts that the specified object has specific length.
// Lenf also fails if the object has a type that len() not accept.
//
-// a.Lenf(mySlice, 3, "error message %s", "formatted")
+// a.Lenf(mySlice, 3, "error message %s", "formatted")
func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -847,9 +931,9 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in
// Less asserts that the first element is less than the second
//
-// a.Less(1, 2)
-// a.Less(float64(1), float64(2))
-// a.Less("a", "b")
+// a.Less(1, 2)
+// a.Less(float64(1), float64(2))
+// a.Less("a", "b")
func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -859,10 +943,10 @@ func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interfac
// LessOrEqual asserts that the first element is less than or equal to the second
//
-// a.LessOrEqual(1, 2)
-// a.LessOrEqual(2, 2)
-// a.LessOrEqual("a", "b")
-// a.LessOrEqual("b", "b")
+// a.LessOrEqual(1, 2)
+// a.LessOrEqual(2, 2)
+// a.LessOrEqual("a", "b")
+// a.LessOrEqual("b", "b")
func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -872,10 +956,10 @@ func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...i
// LessOrEqualf asserts that the first element is less than or equal to the second
//
-// a.LessOrEqualf(1, 2, "error message %s", "formatted")
-// a.LessOrEqualf(2, 2, "error message %s", "formatted")
-// a.LessOrEqualf("a", "b", "error message %s", "formatted")
-// a.LessOrEqualf("b", "b", "error message %s", "formatted")
+// a.LessOrEqualf(1, 2, "error message %s", "formatted")
+// a.LessOrEqualf(2, 2, "error message %s", "formatted")
+// a.LessOrEqualf("a", "b", "error message %s", "formatted")
+// a.LessOrEqualf("b", "b", "error message %s", "formatted")
func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -885,9 +969,9 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar
// Lessf asserts that the first element is less than the second
//
-// a.Lessf(1, 2, "error message %s", "formatted")
-// a.Lessf(float64(1), float64(2), "error message %s", "formatted")
-// a.Lessf("a", "b", "error message %s", "formatted")
+// a.Lessf(1, 2, "error message %s", "formatted")
+// a.Lessf(float64(1), float64(2), "error message %s", "formatted")
+// a.Lessf("a", "b", "error message %s", "formatted")
func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -897,8 +981,8 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i
// Negative asserts that the specified element is negative
//
-// a.Negative(-1)
-// a.Negative(-1.23)
+// a.Negative(-1)
+// a.Negative(-1.23)
func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -908,8 +992,8 @@ func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool {
// Negativef asserts that the specified element is negative
//
-// a.Negativef(-1, "error message %s", "formatted")
-// a.Negativef(-1.23, "error message %s", "formatted")
+// a.Negativef(-1, "error message %s", "formatted")
+// a.Negativef(-1.23, "error message %s", "formatted")
func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -920,7 +1004,7 @@ func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) b
// Never asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond)
+// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond)
func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -931,7 +1015,7 @@ func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick ti
// Neverf asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -941,7 +1025,7 @@ func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick t
// Nil asserts that the specified object is nil.
//
-// a.Nil(err)
+// a.Nil(err)
func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -951,7 +1035,7 @@ func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool {
// Nilf asserts that the specified object is nil.
//
-// a.Nilf(err, "error message %s", "formatted")
+// a.Nilf(err, "error message %s", "formatted")
func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -979,10 +1063,10 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{})
// NoError asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.NoError(err) {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if a.NoError(err) {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -992,10 +1076,10 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool {
// NoErrorf asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.NoErrorf(err, "error message %s", "formatted") {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if a.NoErrorf(err, "error message %s", "formatted") {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1024,9 +1108,9 @@ func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{})
// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// a.NotContains("Hello World", "Earth")
-// a.NotContains(["Hello", "World"], "Earth")
-// a.NotContains({"Hello": "World"}, "Earth")
+// a.NotContains("Hello World", "Earth")
+// a.NotContains(["Hello", "World"], "Earth")
+// a.NotContains({"Hello": "World"}, "Earth")
func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1037,9 +1121,9 @@ func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs
// NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted")
-// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted")
-// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted")
+// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted")
+// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted")
+// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted")
func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1050,9 +1134,9 @@ func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg strin
// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if a.NotEmpty(obj) {
-// assert.Equal(t, "two", obj[1])
-// }
+// if a.NotEmpty(obj) {
+// assert.Equal(t, "two", obj[1])
+// }
func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1063,9 +1147,9 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) boo
// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if a.NotEmptyf(obj, "error message %s", "formatted") {
-// assert.Equal(t, "two", obj[1])
-// }
+// if a.NotEmptyf(obj, "error message %s", "formatted") {
+// assert.Equal(t, "two", obj[1])
+// }
func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1075,7 +1159,7 @@ func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface
// NotEqual asserts that the specified values are NOT equal.
//
-// a.NotEqual(obj1, obj2)
+// a.NotEqual(obj1, obj2)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1088,7 +1172,7 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr
// NotEqualValues asserts that two objects are not equal even when converted to the same type
//
-// a.NotEqualValues(obj1, obj2)
+// a.NotEqualValues(obj1, obj2)
func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1098,7 +1182,7 @@ func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, ms
// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
//
-// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted")
+// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted")
func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1108,7 +1192,7 @@ func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, m
// NotEqualf asserts that the specified values are NOT equal.
//
-// a.NotEqualf(obj1, obj2, "error message %s", "formatted")
+// a.NotEqualf(obj1, obj2, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1139,7 +1223,7 @@ func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...in
// NotNil asserts that the specified object is not nil.
//
-// a.NotNil(err)
+// a.NotNil(err)
func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1149,7 +1233,7 @@ func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool
// NotNilf asserts that the specified object is not nil.
//
-// a.NotNilf(err, "error message %s", "formatted")
+// a.NotNilf(err, "error message %s", "formatted")
func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1159,7 +1243,7 @@ func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}
// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// a.NotPanics(func(){ RemainCalm() })
+// a.NotPanics(func(){ RemainCalm() })
func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1169,7 +1253,7 @@ func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool
// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted")
+// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted")
func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1179,8 +1263,8 @@ func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{}
// NotRegexp asserts that a specified regexp does not match a string.
//
-// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
-// a.NotRegexp("^start", "it's not starting")
+// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
+// a.NotRegexp("^start", "it's not starting")
func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1190,8 +1274,8 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
-// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted")
+// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
+// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted")
func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1201,7 +1285,7 @@ func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, arg
// NotSame asserts that two pointers do not reference the same object.
//
-// a.NotSame(ptr1, ptr2)
+// a.NotSame(ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1214,7 +1298,7 @@ func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArg
// NotSamef asserts that two pointers do not reference the same object.
//
-// a.NotSamef(ptr1, ptr2, "error message %s", "formatted")
+// a.NotSamef(ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1228,7 +1312,7 @@ func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg stri
// NotSubset asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
+// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1239,7 +1323,7 @@ func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs
// NotSubsetf asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
+// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1265,7 +1349,7 @@ func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) bo
// Panics asserts that the code inside the specified PanicTestFunc panics.
//
-// a.Panics(func(){ GoCrazy() })
+// a.Panics(func(){ GoCrazy() })
func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1277,7 +1361,7 @@ func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool {
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// a.PanicsWithError("crazy error", func(){ GoCrazy() })
+// a.PanicsWithError("crazy error", func(){ GoCrazy() })
func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1289,7 +1373,7 @@ func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndAr
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1300,7 +1384,7 @@ func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg str
// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// a.PanicsWithValue("crazy error", func(){ GoCrazy() })
+// a.PanicsWithValue("crazy error", func(){ GoCrazy() })
func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1311,7 +1395,7 @@ func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgA
// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1321,7 +1405,7 @@ func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg
// Panicsf asserts that the code inside the specified PanicTestFunc panics.
//
-// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted")
+// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1331,8 +1415,8 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b
// Positive asserts that the specified element is positive
//
-// a.Positive(1)
-// a.Positive(1.23)
+// a.Positive(1)
+// a.Positive(1.23)
func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1342,8 +1426,8 @@ func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool {
// Positivef asserts that the specified element is positive
//
-// a.Positivef(1, "error message %s", "formatted")
-// a.Positivef(1.23, "error message %s", "formatted")
+// a.Positivef(1, "error message %s", "formatted")
+// a.Positivef(1.23, "error message %s", "formatted")
func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1353,8 +1437,8 @@ func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) b
// Regexp asserts that a specified regexp matches a string.
//
-// a.Regexp(regexp.MustCompile("start"), "it's starting")
-// a.Regexp("start...$", "it's not starting")
+// a.Regexp(regexp.MustCompile("start"), "it's starting")
+// a.Regexp("start...$", "it's not starting")
func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1364,8 +1448,8 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter
// Regexpf asserts that a specified regexp matches a string.
//
-// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
-// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted")
+// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
+// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted")
func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1375,7 +1459,7 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args .
// Same asserts that two pointers reference the same object.
//
-// a.Same(ptr1, ptr2)
+// a.Same(ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1388,7 +1472,7 @@ func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs .
// Samef asserts that two pointers reference the same object.
//
-// a.Samef(ptr1, ptr2, "error message %s", "formatted")
+// a.Samef(ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1402,7 +1486,7 @@ func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string,
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
+// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1413,7 +1497,7 @@ func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...
// Subsetf asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
+// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1423,7 +1507,7 @@ func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, a
// True asserts that the specified value is true.
//
-// a.True(myBool)
+// a.True(myBool)
func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1433,7 +1517,7 @@ func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool {
// Truef asserts that the specified value is true.
//
-// a.Truef(myBool, "error message %s", "formatted")
+// a.Truef(myBool, "error message %s", "formatted")
func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1443,7 +1527,7 @@ func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool {
// WithinDuration asserts that the two times are within duration delta of each other.
//
-// a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
+// a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1453,7 +1537,7 @@ func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta
// WithinDurationf asserts that the two times are within duration delta of each other.
//
-// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
+// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1463,7 +1547,7 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta
// WithinRange asserts that a time is within a time range (inclusive).
//
-// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
+// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1473,7 +1557,7 @@ func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Tim
// WithinRangef asserts that a time is within a time range (inclusive).
//
-// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
+// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool {
if h, ok := a.t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/assertion_order.go b/vendor/github.com/stretchr/testify/assert/assertion_order.go
index 759448783..00df62a05 100644
--- a/vendor/github.com/stretchr/testify/assert/assertion_order.go
+++ b/vendor/github.com/stretchr/testify/assert/assertion_order.go
@@ -46,36 +46,36 @@ func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareT
// IsIncreasing asserts that the collection is increasing
//
-// assert.IsIncreasing(t, []int{1, 2, 3})
-// assert.IsIncreasing(t, []float{1, 2})
-// assert.IsIncreasing(t, []string{"a", "b"})
+// assert.IsIncreasing(t, []int{1, 2, 3})
+// assert.IsIncreasing(t, []float{1, 2})
+// assert.IsIncreasing(t, []string{"a", "b"})
func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...)
}
// IsNonIncreasing asserts that the collection is not increasing
//
-// assert.IsNonIncreasing(t, []int{2, 1, 1})
-// assert.IsNonIncreasing(t, []float{2, 1})
-// assert.IsNonIncreasing(t, []string{"b", "a"})
+// assert.IsNonIncreasing(t, []int{2, 1, 1})
+// assert.IsNonIncreasing(t, []float{2, 1})
+// assert.IsNonIncreasing(t, []string{"b", "a"})
func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...)
}
// IsDecreasing asserts that the collection is decreasing
//
-// assert.IsDecreasing(t, []int{2, 1, 0})
-// assert.IsDecreasing(t, []float{2, 1})
-// assert.IsDecreasing(t, []string{"b", "a"})
+// assert.IsDecreasing(t, []int{2, 1, 0})
+// assert.IsDecreasing(t, []float{2, 1})
+// assert.IsDecreasing(t, []string{"b", "a"})
func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...)
}
// IsNonDecreasing asserts that the collection is not decreasing
//
-// assert.IsNonDecreasing(t, []int{1, 1, 2})
-// assert.IsNonDecreasing(t, []float{1, 2})
-// assert.IsNonDecreasing(t, []string{"a", "b"})
+// assert.IsNonDecreasing(t, []int{1, 1, 2})
+// assert.IsNonDecreasing(t, []float{1, 2})
+// assert.IsNonDecreasing(t, []string{"a", "b"})
func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...)
}
diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go
index 2924cf3a1..a55d1bba9 100644
--- a/vendor/github.com/stretchr/testify/assert/assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/assertions.go
@@ -75,6 +75,77 @@ func ObjectsAreEqual(expected, actual interface{}) bool {
return bytes.Equal(exp, act)
}
+// copyExportedFields iterates downward through nested data structures and creates a copy
+// that only contains the exported struct fields.
+func copyExportedFields(expected interface{}) interface{} {
+ if isNil(expected) {
+ return expected
+ }
+
+ expectedType := reflect.TypeOf(expected)
+ expectedKind := expectedType.Kind()
+ expectedValue := reflect.ValueOf(expected)
+
+ switch expectedKind {
+ case reflect.Struct:
+ result := reflect.New(expectedType).Elem()
+ for i := 0; i < expectedType.NumField(); i++ {
+ field := expectedType.Field(i)
+ isExported := field.IsExported()
+ if isExported {
+ fieldValue := expectedValue.Field(i)
+ if isNil(fieldValue) || isNil(fieldValue.Interface()) {
+ continue
+ }
+ newValue := copyExportedFields(fieldValue.Interface())
+ result.Field(i).Set(reflect.ValueOf(newValue))
+ }
+ }
+ return result.Interface()
+
+ case reflect.Ptr:
+ result := reflect.New(expectedType.Elem())
+ unexportedRemoved := copyExportedFields(expectedValue.Elem().Interface())
+ result.Elem().Set(reflect.ValueOf(unexportedRemoved))
+ return result.Interface()
+
+ case reflect.Array, reflect.Slice:
+ result := reflect.MakeSlice(expectedType, expectedValue.Len(), expectedValue.Len())
+ for i := 0; i < expectedValue.Len(); i++ {
+ index := expectedValue.Index(i)
+ if isNil(index) {
+ continue
+ }
+ unexportedRemoved := copyExportedFields(index.Interface())
+ result.Index(i).Set(reflect.ValueOf(unexportedRemoved))
+ }
+ return result.Interface()
+
+ case reflect.Map:
+ result := reflect.MakeMap(expectedType)
+ for _, k := range expectedValue.MapKeys() {
+ index := expectedValue.MapIndex(k)
+ unexportedRemoved := copyExportedFields(index.Interface())
+ result.SetMapIndex(k, reflect.ValueOf(unexportedRemoved))
+ }
+ return result.Interface()
+
+ default:
+ return expected
+ }
+}
+
+// ObjectsExportedFieldsAreEqual determines if the exported (public) fields of two objects are
+// considered equal. This comparison of only exported fields is applied recursively to nested data
+// structures.
+//
+// This function does no assertion of any kind.
+func ObjectsExportedFieldsAreEqual(expected, actual interface{}) bool {
+ expectedCleaned := copyExportedFields(expected)
+ actualCleaned := copyExportedFields(actual)
+ return ObjectsAreEqualValues(expectedCleaned, actualCleaned)
+}
+
// ObjectsAreEqualValues gets whether two objects are equal, or if their
// values are equal.
func ObjectsAreEqualValues(expected, actual interface{}) bool {
@@ -271,7 +342,7 @@ type labeledContent struct {
// labeledOutput returns a string consisting of the provided labeledContent. Each labeled output is appended in the following manner:
//
-// \t{{label}}:{{align_spaces}}\t{{content}}\n
+// \t{{label}}:{{align_spaces}}\t{{content}}\n
//
// The initial carriage return is required to undo/erase any padding added by testing.T.Errorf. The "\t{{label}}:" is for the label.
// If a label is shorter than the longest label provided, padding spaces are added to make all the labels match in length. Once this
@@ -294,7 +365,7 @@ func labeledOutput(content ...labeledContent) string {
// Implements asserts that an object is implemented by the specified interface.
//
-// assert.Implements(t, (*MyInterface)(nil), new(MyObject))
+// assert.Implements(t, (*MyInterface)(nil), new(MyObject))
func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -326,7 +397,7 @@ func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs
// Equal asserts that two objects are equal.
//
-// assert.Equal(t, 123, 123)
+// assert.Equal(t, 123, 123)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -367,7 +438,7 @@ func validateEqualArgs(expected, actual interface{}) error {
// Same asserts that two pointers reference the same object.
//
-// assert.Same(t, ptr1, ptr2)
+// assert.Same(t, ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -387,7 +458,7 @@ func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) b
// NotSame asserts that two pointers do not reference the same object.
//
-// assert.NotSame(t, ptr1, ptr2)
+// assert.NotSame(t, ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -455,7 +526,7 @@ func truncatingFormat(data interface{}) string {
// EqualValues asserts that two objects are equal or convertable to the same types
// and equal.
//
-// assert.EqualValues(t, uint32(123), int32(123))
+// assert.EqualValues(t, uint32(123), int32(123))
func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -473,9 +544,53 @@ func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interfa
}
+// EqualExportedValues asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// assert.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true
+// assert.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false
+func EqualExportedValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ aType := reflect.TypeOf(expected)
+ bType := reflect.TypeOf(actual)
+
+ if aType != bType {
+ return Fail(t, fmt.Sprintf("Types expected to match exactly\n\t%v != %v", aType, bType), msgAndArgs...)
+ }
+
+ if aType.Kind() != reflect.Struct {
+ return Fail(t, fmt.Sprintf("Types expected to both be struct \n\t%v != %v", aType.Kind(), reflect.Struct), msgAndArgs...)
+ }
+
+ if bType.Kind() != reflect.Struct {
+ return Fail(t, fmt.Sprintf("Types expected to both be struct \n\t%v != %v", bType.Kind(), reflect.Struct), msgAndArgs...)
+ }
+
+ expected = copyExportedFields(expected)
+ actual = copyExportedFields(actual)
+
+ if !ObjectsAreEqualValues(expected, actual) {
+ diff := diff(expected, actual)
+ expected, actual = formatUnequalValues(expected, actual)
+ return Fail(t, fmt.Sprintf("Not equal (comparing only exported fields): \n"+
+ "expected: %s\n"+
+ "actual : %s%s", expected, actual, diff), msgAndArgs...)
+ }
+
+ return true
+}
+
// Exactly asserts that two objects are equal in value and type.
//
-// assert.Exactly(t, int32(123), int64(123))
+// assert.Exactly(t, int32(123), int64(123))
func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -494,7 +609,7 @@ func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}
// NotNil asserts that the specified object is not nil.
//
-// assert.NotNil(t, err)
+// assert.NotNil(t, err)
func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
if !isNil(object) {
return true
@@ -540,7 +655,7 @@ func isNil(object interface{}) bool {
// Nil asserts that the specified object is nil.
//
-// assert.Nil(t, err)
+// assert.Nil(t, err)
func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
if isNil(object) {
return true
@@ -583,7 +698,7 @@ func isEmpty(object interface{}) bool {
// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// assert.Empty(t, obj)
+// assert.Empty(t, obj)
func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
pass := isEmpty(object)
if !pass {
@@ -600,9 +715,9 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if assert.NotEmpty(t, obj) {
-// assert.Equal(t, "two", obj[1])
-// }
+// if assert.NotEmpty(t, obj) {
+// assert.Equal(t, "two", obj[1])
+// }
func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool {
pass := !isEmpty(object)
if !pass {
@@ -631,7 +746,7 @@ func getLen(x interface{}) (ok bool, length int) {
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
-// assert.Len(t, mySlice, 3)
+// assert.Len(t, mySlice, 3)
func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -649,7 +764,7 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
// True asserts that the specified value is true.
//
-// assert.True(t, myBool)
+// assert.True(t, myBool)
func True(t TestingT, value bool, msgAndArgs ...interface{}) bool {
if !value {
if h, ok := t.(tHelper); ok {
@@ -664,7 +779,7 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) bool {
// False asserts that the specified value is false.
//
-// assert.False(t, myBool)
+// assert.False(t, myBool)
func False(t TestingT, value bool, msgAndArgs ...interface{}) bool {
if value {
if h, ok := t.(tHelper); ok {
@@ -679,7 +794,7 @@ func False(t TestingT, value bool, msgAndArgs ...interface{}) bool {
// NotEqual asserts that the specified values are NOT equal.
//
-// assert.NotEqual(t, obj1, obj2)
+// assert.NotEqual(t, obj1, obj2)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -702,7 +817,7 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{
// NotEqualValues asserts that two objects are not equal even when converted to the same type
//
-// assert.NotEqualValues(t, obj1, obj2)
+// assert.NotEqualValues(t, obj1, obj2)
func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -761,9 +876,9 @@ func containsElement(list interface{}, element interface{}) (ok, found bool) {
// Contains asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// assert.Contains(t, "Hello World", "World")
-// assert.Contains(t, ["Hello", "World"], "World")
-// assert.Contains(t, {"Hello": "World"}, "Hello")
+// assert.Contains(t, "Hello World", "World")
+// assert.Contains(t, ["Hello", "World"], "World")
+// assert.Contains(t, {"Hello": "World"}, "Hello")
func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -784,9 +899,9 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// assert.NotContains(t, "Hello World", "Earth")
-// assert.NotContains(t, ["Hello", "World"], "Earth")
-// assert.NotContains(t, {"Hello": "World"}, "Earth")
+// assert.NotContains(t, "Hello World", "Earth")
+// assert.NotContains(t, ["Hello", "World"], "Earth")
+// assert.NotContains(t, {"Hello": "World"}, "Earth")
func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -794,10 +909,10 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
ok, found := containsElement(s, contains)
if !ok {
- return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
}
if found {
- return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...)
+ return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...)
}
return true
@@ -807,7 +922,7 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{})
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
+// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -863,7 +978,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok
// NotSubset asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
+// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1048,7 +1163,7 @@ func didPanic(f PanicTestFunc) (didPanic bool, message interface{}, stack string
// Panics asserts that the code inside the specified PanicTestFunc panics.
//
-// assert.Panics(t, func(){ GoCrazy() })
+// assert.Panics(t, func(){ GoCrazy() })
func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1064,7 +1179,7 @@ func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
+// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1085,7 +1200,7 @@ func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndAr
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
+// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1105,7 +1220,7 @@ func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs .
// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// assert.NotPanics(t, func(){ RemainCalm() })
+// assert.NotPanics(t, func(){ RemainCalm() })
func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1120,7 +1235,7 @@ func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
// WithinDuration asserts that the two times are within duration delta of each other.
//
-// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
+// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1136,7 +1251,7 @@ func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration,
// WithinRange asserts that a time is within a time range (inclusive).
//
-// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
+// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func WithinRange(t TestingT, actual, start, end time.Time, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1195,7 +1310,7 @@ func toFloat(x interface{}) (float64, bool) {
// InDelta asserts that the two numerals are within delta of each other.
//
-// assert.InDelta(t, math.Pi, 22/7.0, 0.01)
+// assert.InDelta(t, math.Pi, 22/7.0, 0.01)
func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1368,10 +1483,10 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m
// NoError asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.NoError(t, err) {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if assert.NoError(t, err) {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
if err != nil {
if h, ok := t.(tHelper); ok {
@@ -1385,10 +1500,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
// Error asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err) {
-// assert.Equal(t, expectedError, err)
-// }
+// actualObj, err := SomeFunction()
+// if assert.Error(t, err) {
+// assert.Equal(t, expectedError, err)
+// }
func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
if err == nil {
if h, ok := t.(tHelper); ok {
@@ -1403,8 +1518,8 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool {
// EqualError asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// assert.EqualError(t, err, expectedErrorString)
+// actualObj, err := SomeFunction()
+// assert.EqualError(t, err, expectedErrorString)
func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1426,8 +1541,8 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// assert.ErrorContains(t, err, expectedErrorSubString)
+// actualObj, err := SomeFunction()
+// assert.ErrorContains(t, err, expectedErrorSubString)
func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1460,8 +1575,8 @@ func matchRegexp(rx interface{}, str interface{}) bool {
// Regexp asserts that a specified regexp matches a string.
//
-// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
-// assert.Regexp(t, "start...$", "it's not starting")
+// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
+// assert.Regexp(t, "start...$", "it's not starting")
func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1478,8 +1593,8 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface
// NotRegexp asserts that a specified regexp does not match a string.
//
-// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
-// assert.NotRegexp(t, "^start", "it's not starting")
+// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
+// assert.NotRegexp(t, "^start", "it's not starting")
func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1591,7 +1706,7 @@ func NoDirExists(t TestingT, path string, msgAndArgs ...interface{}) bool {
// JSONEq asserts that two JSON strings are equivalent.
//
-// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
+// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1714,7 +1829,7 @@ type tHelper interface {
// Eventually asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
+// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1744,10 +1859,93 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t
}
}
+// CollectT implements the TestingT interface and collects all errors.
+type CollectT struct {
+ errors []error
+}
+
+// Errorf collects the error.
+func (c *CollectT) Errorf(format string, args ...interface{}) {
+ c.errors = append(c.errors, fmt.Errorf(format, args...))
+}
+
+// FailNow panics.
+func (c *CollectT) FailNow() {
+ panic("Assertion failed")
+}
+
+// Reset clears the collected errors.
+func (c *CollectT) Reset() {
+ c.errors = nil
+}
+
+// Copy copies the collected errors to the supplied t.
+func (c *CollectT) Copy(t TestingT) {
+ if tt, ok := t.(tHelper); ok {
+ tt.Helper()
+ }
+ for _, err := range c.errors {
+ t.Errorf("%v", err)
+ }
+}
+
+// EventuallyWithT asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// assert.EventuallyWithT(t, func(c *assert.CollectT) {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func EventuallyWithT(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+
+ collect := new(CollectT)
+ ch := make(chan bool, 1)
+
+ timer := time.NewTimer(waitFor)
+ defer timer.Stop()
+
+ ticker := time.NewTicker(tick)
+ defer ticker.Stop()
+
+ for tick := ticker.C; ; {
+ select {
+ case <-timer.C:
+ collect.Copy(t)
+ return Fail(t, "Condition never satisfied", msgAndArgs...)
+ case <-tick:
+ tick = nil
+ collect.Reset()
+ go func() {
+ condition(collect)
+ ch <- len(collect.errors) == 0
+ }()
+ case v := <-ch:
+ if v {
+ return true
+ }
+ tick = ticker.C
+ }
+ }
+}
+
// Never asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond)
+// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond)
func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool {
if h, ok := t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/assert/doc.go b/vendor/github.com/stretchr/testify/assert/doc.go
index c9dccc4d6..4953981d3 100644
--- a/vendor/github.com/stretchr/testify/assert/doc.go
+++ b/vendor/github.com/stretchr/testify/assert/doc.go
@@ -1,39 +1,40 @@
// Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
//
-// Example Usage
+// # Example Usage
//
// The following is a complete example using assert in a standard test function:
-// import (
-// "testing"
-// "github.com/stretchr/testify/assert"
-// )
//
-// func TestSomething(t *testing.T) {
+// import (
+// "testing"
+// "github.com/stretchr/testify/assert"
+// )
//
-// var a string = "Hello"
-// var b string = "Hello"
+// func TestSomething(t *testing.T) {
//
-// assert.Equal(t, a, b, "The two words should be the same.")
+// var a string = "Hello"
+// var b string = "Hello"
//
-// }
+// assert.Equal(t, a, b, "The two words should be the same.")
+//
+// }
//
// if you assert many times, use the format below:
//
-// import (
-// "testing"
-// "github.com/stretchr/testify/assert"
-// )
+// import (
+// "testing"
+// "github.com/stretchr/testify/assert"
+// )
//
-// func TestSomething(t *testing.T) {
-// assert := assert.New(t)
+// func TestSomething(t *testing.T) {
+// assert := assert.New(t)
//
-// var a string = "Hello"
-// var b string = "Hello"
+// var a string = "Hello"
+// var b string = "Hello"
//
-// assert.Equal(a, b, "The two words should be the same.")
-// }
+// assert.Equal(a, b, "The two words should be the same.")
+// }
//
-// Assertions
+// # Assertions
//
// Assertions allow you to easily write test code, and are global funcs in the `assert` package.
// All assertion functions take, as the first argument, the `*testing.T` object provided by the
diff --git a/vendor/github.com/stretchr/testify/assert/http_assertions.go b/vendor/github.com/stretchr/testify/assert/http_assertions.go
index 4ed341dd2..d8038c28a 100644
--- a/vendor/github.com/stretchr/testify/assert/http_assertions.go
+++ b/vendor/github.com/stretchr/testify/assert/http_assertions.go
@@ -23,7 +23,7 @@ func httpCode(handler http.HandlerFunc, method, url string, values url.Values) (
// HTTPSuccess asserts that a specified handler returns a success status code.
//
-// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
+// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -45,7 +45,7 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, value
// HTTPRedirect asserts that a specified handler returns a redirect status code.
//
-// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -67,7 +67,7 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, valu
// HTTPError asserts that a specified handler returns an error status code.
//
-// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool {
@@ -89,7 +89,7 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values
// HTTPStatusCode asserts that a specified handler returns a specified status code.
//
-// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
+// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool {
@@ -124,7 +124,7 @@ func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) s
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
-// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
@@ -144,7 +144,7 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string,
// HTTPBodyNotContains asserts that a specified handler returns a
// body that does not contain a string.
//
-// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool {
diff --git a/vendor/github.com/stretchr/testify/require/doc.go b/vendor/github.com/stretchr/testify/require/doc.go
index 169de3922..968434724 100644
--- a/vendor/github.com/stretchr/testify/require/doc.go
+++ b/vendor/github.com/stretchr/testify/require/doc.go
@@ -1,24 +1,25 @@
// Package require implements the same assertions as the `assert` package but
// stops test execution when a test fails.
//
-// Example Usage
+// # Example Usage
//
// The following is a complete example using require in a standard test function:
-// import (
-// "testing"
-// "github.com/stretchr/testify/require"
-// )
//
-// func TestSomething(t *testing.T) {
+// import (
+// "testing"
+// "github.com/stretchr/testify/require"
+// )
//
-// var a string = "Hello"
-// var b string = "Hello"
+// func TestSomething(t *testing.T) {
//
-// require.Equal(t, a, b, "The two words should be the same.")
+// var a string = "Hello"
+// var b string = "Hello"
//
-// }
+// require.Equal(t, a, b, "The two words should be the same.")
//
-// Assertions
+// }
+//
+// # Assertions
//
// The `require` package have same global functions as in the `assert` package,
// but instead of returning a boolean result they call `t.FailNow()`.
diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go
index 880853f5a..63f852147 100644
--- a/vendor/github.com/stretchr/testify/require/require.go
+++ b/vendor/github.com/stretchr/testify/require/require.go
@@ -37,9 +37,9 @@ func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interfac
// Contains asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// assert.Contains(t, "Hello World", "World")
-// assert.Contains(t, ["Hello", "World"], "World")
-// assert.Contains(t, {"Hello": "World"}, "Hello")
+// assert.Contains(t, "Hello World", "World")
+// assert.Contains(t, ["Hello", "World"], "World")
+// assert.Contains(t, {"Hello": "World"}, "Hello")
func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -53,9 +53,9 @@ func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...int
// Containsf asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted")
-// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
-// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
+// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted")
+// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted")
+// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted")
func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -123,7 +123,7 @@ func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string
// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// assert.Empty(t, obj)
+// assert.Empty(t, obj)
func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -137,7 +137,7 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// assert.Emptyf(t, obj, "error message %s", "formatted")
+// assert.Emptyf(t, obj, "error message %s", "formatted")
func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -150,7 +150,7 @@ func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
// Equal asserts that two objects are equal.
//
-// assert.Equal(t, 123, 123)
+// assert.Equal(t, 123, 123)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -168,8 +168,8 @@ func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...i
// EqualError asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// assert.EqualError(t, err, expectedErrorString)
+// actualObj, err := SomeFunction()
+// assert.EqualError(t, err, expectedErrorString)
func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -183,8 +183,8 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte
// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted")
func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -195,10 +195,50 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args
t.FailNow()
}
+// EqualExportedValues asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// assert.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true
+// assert.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false
+func EqualExportedValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.EqualExportedValues(t, expected, actual, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// EqualExportedValuesf asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true
+// assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false
+func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.EqualExportedValuesf(t, expected, actual, msg, args...) {
+ return
+ }
+ t.FailNow()
+}
+
// EqualValues asserts that two objects are equal or convertable to the same types
// and equal.
//
-// assert.EqualValues(t, uint32(123), int32(123))
+// assert.EqualValues(t, uint32(123), int32(123))
func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -212,7 +252,7 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
+// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted")
func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -225,7 +265,7 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri
// Equalf asserts that two objects are equal.
//
-// assert.Equalf(t, 123, 123, "error message %s", "formatted")
+// assert.Equalf(t, 123, 123, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -242,10 +282,10 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar
// Error asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.Error(t, err) {
-// assert.Equal(t, expectedError, err)
-// }
+// actualObj, err := SomeFunction()
+// if assert.Error(t, err) {
+// assert.Equal(t, expectedError, err)
+// }
func Error(t TestingT, err error, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -283,8 +323,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int
// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// assert.ErrorContains(t, err, expectedErrorSubString)
+// actualObj, err := SomeFunction()
+// assert.ErrorContains(t, err, expectedErrorSubString)
func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -298,8 +338,8 @@ func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...in
// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted")
func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -336,10 +376,10 @@ func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface
// Errorf asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.Errorf(t, err, "error message %s", "formatted") {
-// assert.Equal(t, expectedErrorf, err)
-// }
+// actualObj, err := SomeFunction()
+// if assert.Errorf(t, err, "error message %s", "formatted") {
+// assert.Equal(t, expectedErrorf, err)
+// }
func Errorf(t TestingT, err error, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -353,7 +393,7 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) {
// Eventually asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
+// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -364,10 +404,66 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t
t.FailNow()
}
+// EventuallyWithT asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// assert.EventuallyWithT(t, func(c *assert.CollectT) {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.EventuallyWithT(t, condition, waitFor, tick, msgAndArgs...) {
+ return
+ }
+ t.FailNow()
+}
+
+// EventuallyWithTf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
+ if h, ok := t.(tHelper); ok {
+ h.Helper()
+ }
+ if assert.EventuallyWithTf(t, condition, waitFor, tick, msg, args...) {
+ return
+ }
+ t.FailNow()
+}
+
// Eventuallyf asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -380,7 +476,7 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick
// Exactly asserts that two objects are equal in value and type.
//
-// assert.Exactly(t, int32(123), int64(123))
+// assert.Exactly(t, int32(123), int64(123))
func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -393,7 +489,7 @@ func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ..
// Exactlyf asserts that two objects are equal in value and type.
//
-// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
+// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted")
func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -450,7 +546,7 @@ func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) {
// False asserts that the specified value is false.
//
-// assert.False(t, myBool)
+// assert.False(t, myBool)
func False(t TestingT, value bool, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -463,7 +559,7 @@ func False(t TestingT, value bool, msgAndArgs ...interface{}) {
// Falsef asserts that the specified value is false.
//
-// assert.Falsef(t, myBool, "error message %s", "formatted")
+// assert.Falsef(t, myBool, "error message %s", "formatted")
func Falsef(t TestingT, value bool, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -500,9 +596,9 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) {
// Greater asserts that the first element is greater than the second
//
-// assert.Greater(t, 2, 1)
-// assert.Greater(t, float64(2), float64(1))
-// assert.Greater(t, "b", "a")
+// assert.Greater(t, 2, 1)
+// assert.Greater(t, float64(2), float64(1))
+// assert.Greater(t, "b", "a")
func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -515,10 +611,10 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface
// GreaterOrEqual asserts that the first element is greater than or equal to the second
//
-// assert.GreaterOrEqual(t, 2, 1)
-// assert.GreaterOrEqual(t, 2, 2)
-// assert.GreaterOrEqual(t, "b", "a")
-// assert.GreaterOrEqual(t, "b", "b")
+// assert.GreaterOrEqual(t, 2, 1)
+// assert.GreaterOrEqual(t, 2, 2)
+// assert.GreaterOrEqual(t, "b", "a")
+// assert.GreaterOrEqual(t, "b", "b")
func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -531,10 +627,10 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in
// GreaterOrEqualf asserts that the first element is greater than or equal to the second
//
-// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
-// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted")
+// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted")
func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -547,9 +643,9 @@ func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, arg
// Greaterf asserts that the first element is greater than the second
//
-// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
-// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted")
-// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
+// assert.Greaterf(t, 2, 1, "error message %s", "formatted")
+// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted")
+// assert.Greaterf(t, "b", "a", "error message %s", "formatted")
func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -563,7 +659,7 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
-// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
@@ -579,7 +675,7 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url s
// HTTPBodyContainsf asserts that a specified handler returns a
// body that contains a string.
//
-// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
@@ -595,7 +691,7 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url
// HTTPBodyNotContains asserts that a specified handler returns a
// body that does not contain a string.
//
-// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
@@ -611,7 +707,7 @@ func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, ur
// HTTPBodyNotContainsf asserts that a specified handler returns a
// body that does not contain a string.
//
-// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
@@ -626,7 +722,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u
// HTTPError asserts that a specified handler returns an error status code.
//
-// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -641,7 +737,7 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string,
// HTTPErrorf asserts that a specified handler returns an error status code.
//
-// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -656,7 +752,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string,
// HTTPRedirect asserts that a specified handler returns a redirect status code.
//
-// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -671,7 +767,7 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin
// HTTPRedirectf asserts that a specified handler returns a redirect status code.
//
-// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -686,7 +782,7 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri
// HTTPStatusCode asserts that a specified handler returns a specified status code.
//
-// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
+// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501)
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) {
@@ -701,7 +797,7 @@ func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url str
// HTTPStatusCodef asserts that a specified handler returns a specified status code.
//
-// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) {
@@ -716,7 +812,7 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st
// HTTPSuccess asserts that a specified handler returns a success status code.
//
-// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
+// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil)
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -731,7 +827,7 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string
// HTTPSuccessf asserts that a specified handler returns a success status code.
//
-// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
+// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -746,7 +842,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin
// Implements asserts that an object is implemented by the specified interface.
//
-// assert.Implements(t, (*MyInterface)(nil), new(MyObject))
+// assert.Implements(t, (*MyInterface)(nil), new(MyObject))
func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -759,7 +855,7 @@ func Implements(t TestingT, interfaceObject interface{}, object interface{}, msg
// Implementsf asserts that an object is implemented by the specified interface.
//
-// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
+// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -772,7 +868,7 @@ func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, ms
// InDelta asserts that the two numerals are within delta of each other.
//
-// assert.InDelta(t, math.Pi, 22/7.0, 0.01)
+// assert.InDelta(t, math.Pi, 22/7.0, 0.01)
func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -829,7 +925,7 @@ func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta f
// InDeltaf asserts that the two numerals are within delta of each other.
//
-// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
+// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -886,9 +982,9 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl
// IsDecreasing asserts that the collection is decreasing
//
-// assert.IsDecreasing(t, []int{2, 1, 0})
-// assert.IsDecreasing(t, []float{2, 1})
-// assert.IsDecreasing(t, []string{"b", "a"})
+// assert.IsDecreasing(t, []int{2, 1, 0})
+// assert.IsDecreasing(t, []float{2, 1})
+// assert.IsDecreasing(t, []string{"b", "a"})
func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -901,9 +997,9 @@ func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// IsDecreasingf asserts that the collection is decreasing
//
-// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")
-// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")
-// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -916,9 +1012,9 @@ func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface
// IsIncreasing asserts that the collection is increasing
//
-// assert.IsIncreasing(t, []int{1, 2, 3})
-// assert.IsIncreasing(t, []float{1, 2})
-// assert.IsIncreasing(t, []string{"a", "b"})
+// assert.IsIncreasing(t, []int{1, 2, 3})
+// assert.IsIncreasing(t, []float{1, 2})
+// assert.IsIncreasing(t, []string{"a", "b"})
func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -931,9 +1027,9 @@ func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// IsIncreasingf asserts that the collection is increasing
//
-// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")
-// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")
-// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -946,9 +1042,9 @@ func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface
// IsNonDecreasing asserts that the collection is not decreasing
//
-// assert.IsNonDecreasing(t, []int{1, 1, 2})
-// assert.IsNonDecreasing(t, []float{1, 2})
-// assert.IsNonDecreasing(t, []string{"a", "b"})
+// assert.IsNonDecreasing(t, []int{1, 1, 2})
+// assert.IsNonDecreasing(t, []float{1, 2})
+// assert.IsNonDecreasing(t, []string{"a", "b"})
func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -961,9 +1057,9 @@ func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{})
// IsNonDecreasingf asserts that the collection is not decreasing
//
-// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")
-// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")
-// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted")
+// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted")
func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -976,9 +1072,9 @@ func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interf
// IsNonIncreasing asserts that the collection is not increasing
//
-// assert.IsNonIncreasing(t, []int{2, 1, 1})
-// assert.IsNonIncreasing(t, []float{2, 1})
-// assert.IsNonIncreasing(t, []string{"b", "a"})
+// assert.IsNonIncreasing(t, []int{2, 1, 1})
+// assert.IsNonIncreasing(t, []float{2, 1})
+// assert.IsNonIncreasing(t, []string{"b", "a"})
func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -991,9 +1087,9 @@ func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{})
// IsNonIncreasingf asserts that the collection is not increasing
//
-// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")
-// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")
-// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted")
+// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted")
func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1028,7 +1124,7 @@ func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg strin
// JSONEq asserts that two JSON strings are equivalent.
//
-// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
+// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1041,7 +1137,7 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{
// JSONEqf asserts that two JSON strings are equivalent.
//
-// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
+// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1055,7 +1151,7 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
-// assert.Len(t, mySlice, 3)
+// assert.Len(t, mySlice, 3)
func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1069,7 +1165,7 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{})
// Lenf asserts that the specified object has specific length.
// Lenf also fails if the object has a type that len() not accept.
//
-// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")
+// assert.Lenf(t, mySlice, 3, "error message %s", "formatted")
func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1082,9 +1178,9 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf
// Less asserts that the first element is less than the second
//
-// assert.Less(t, 1, 2)
-// assert.Less(t, float64(1), float64(2))
-// assert.Less(t, "a", "b")
+// assert.Less(t, 1, 2)
+// assert.Less(t, float64(1), float64(2))
+// assert.Less(t, "a", "b")
func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1097,10 +1193,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{})
// LessOrEqual asserts that the first element is less than or equal to the second
//
-// assert.LessOrEqual(t, 1, 2)
-// assert.LessOrEqual(t, 2, 2)
-// assert.LessOrEqual(t, "a", "b")
-// assert.LessOrEqual(t, "b", "b")
+// assert.LessOrEqual(t, 1, 2)
+// assert.LessOrEqual(t, 2, 2)
+// assert.LessOrEqual(t, "a", "b")
+// assert.LessOrEqual(t, "b", "b")
func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1113,10 +1209,10 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter
// LessOrEqualf asserts that the first element is less than or equal to the second
//
-// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
-// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
-// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
-// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted")
+// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted")
+// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted")
func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1129,9 +1225,9 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args .
// Lessf asserts that the first element is less than the second
//
-// assert.Lessf(t, 1, 2, "error message %s", "formatted")
-// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted")
-// assert.Lessf(t, "a", "b", "error message %s", "formatted")
+// assert.Lessf(t, 1, 2, "error message %s", "formatted")
+// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted")
+// assert.Lessf(t, "a", "b", "error message %s", "formatted")
func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1144,8 +1240,8 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter
// Negative asserts that the specified element is negative
//
-// assert.Negative(t, -1)
-// assert.Negative(t, -1.23)
+// assert.Negative(t, -1)
+// assert.Negative(t, -1.23)
func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1158,8 +1254,8 @@ func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) {
// Negativef asserts that the specified element is negative
//
-// assert.Negativef(t, -1, "error message %s", "formatted")
-// assert.Negativef(t, -1.23, "error message %s", "formatted")
+// assert.Negativef(t, -1, "error message %s", "formatted")
+// assert.Negativef(t, -1.23, "error message %s", "formatted")
func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1173,7 +1269,7 @@ func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) {
// Never asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond)
+// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond)
func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1187,7 +1283,7 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D
// Neverf asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1200,7 +1296,7 @@ func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.
// Nil asserts that the specified object is nil.
//
-// assert.Nil(t, err)
+// assert.Nil(t, err)
func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1213,7 +1309,7 @@ func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// Nilf asserts that the specified object is nil.
//
-// assert.Nilf(t, err, "error message %s", "formatted")
+// assert.Nilf(t, err, "error message %s", "formatted")
func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1250,10 +1346,10 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) {
// NoError asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.NoError(t, err) {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if assert.NoError(t, err) {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1266,10 +1362,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) {
// NoErrorf asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if assert.NoErrorf(t, err, "error message %s", "formatted") {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if assert.NoErrorf(t, err, "error message %s", "formatted") {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func NoErrorf(t TestingT, err error, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1307,9 +1403,9 @@ func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) {
// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// assert.NotContains(t, "Hello World", "Earth")
-// assert.NotContains(t, ["Hello", "World"], "Earth")
-// assert.NotContains(t, {"Hello": "World"}, "Earth")
+// assert.NotContains(t, "Hello World", "Earth")
+// assert.NotContains(t, ["Hello", "World"], "Earth")
+// assert.NotContains(t, {"Hello": "World"}, "Earth")
func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1323,9 +1419,9 @@ func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...
// NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted")
-// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")
-// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted")
+// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted")
func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1339,9 +1435,9 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a
// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if assert.NotEmpty(t, obj) {
-// assert.Equal(t, "two", obj[1])
-// }
+// if assert.NotEmpty(t, obj) {
+// assert.Equal(t, "two", obj[1])
+// }
func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1355,9 +1451,9 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if assert.NotEmptyf(t, obj, "error message %s", "formatted") {
-// assert.Equal(t, "two", obj[1])
-// }
+// if assert.NotEmptyf(t, obj, "error message %s", "formatted") {
+// assert.Equal(t, "two", obj[1])
+// }
func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1370,7 +1466,7 @@ func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{})
// NotEqual asserts that the specified values are NOT equal.
//
-// assert.NotEqual(t, obj1, obj2)
+// assert.NotEqual(t, obj1, obj2)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1386,7 +1482,7 @@ func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs .
// NotEqualValues asserts that two objects are not equal even when converted to the same type
//
-// assert.NotEqualValues(t, obj1, obj2)
+// assert.NotEqualValues(t, obj1, obj2)
func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1399,7 +1495,7 @@ func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAnd
// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
//
-// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")
+// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted")
func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1412,7 +1508,7 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s
// NotEqualf asserts that the specified values are NOT equal.
//
-// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted")
+// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1452,7 +1548,7 @@ func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interf
// NotNil asserts that the specified object is not nil.
//
-// assert.NotNil(t, err)
+// assert.NotNil(t, err)
func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1465,7 +1561,7 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) {
// NotNilf asserts that the specified object is not nil.
//
-// assert.NotNilf(t, err, "error message %s", "formatted")
+// assert.NotNilf(t, err, "error message %s", "formatted")
func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1478,7 +1574,7 @@ func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) {
// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// assert.NotPanics(t, func(){ RemainCalm() })
+// assert.NotPanics(t, func(){ RemainCalm() })
func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1491,7 +1587,7 @@ func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")
+// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted")
func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1504,8 +1600,8 @@ func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interfac
// NotRegexp asserts that a specified regexp does not match a string.
//
-// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
-// assert.NotRegexp(t, "^start", "it's not starting")
+// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting")
+// assert.NotRegexp(t, "^start", "it's not starting")
func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1518,8 +1614,8 @@ func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interf
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
-// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
+// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
+// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted")
func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1532,7 +1628,7 @@ func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ..
// NotSame asserts that two pointers do not reference the same object.
//
-// assert.NotSame(t, ptr1, ptr2)
+// assert.NotSame(t, ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1548,7 +1644,7 @@ func NotSame(t TestingT, expected interface{}, actual interface{}, msgAndArgs ..
// NotSamef asserts that two pointers do not reference the same object.
//
-// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted")
+// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1565,7 +1661,7 @@ func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string,
// NotSubset asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
+// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1579,7 +1675,7 @@ func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...i
// NotSubsetf asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
+// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1614,7 +1710,7 @@ func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) {
// Panics asserts that the code inside the specified PanicTestFunc panics.
//
-// assert.Panics(t, func(){ GoCrazy() })
+// assert.Panics(t, func(){ GoCrazy() })
func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1629,7 +1725,7 @@ func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
+// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() })
func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1644,7 +1740,7 @@ func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAn
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1658,7 +1754,7 @@ func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg
// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
+// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() })
func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1672,7 +1768,7 @@ func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, m
// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1685,7 +1781,7 @@ func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc,
// Panicsf asserts that the code inside the specified PanicTestFunc panics.
//
-// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
+// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted")
func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1698,8 +1794,8 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}
// Positive asserts that the specified element is positive
//
-// assert.Positive(t, 1)
-// assert.Positive(t, 1.23)
+// assert.Positive(t, 1)
+// assert.Positive(t, 1.23)
func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1712,8 +1808,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) {
// Positivef asserts that the specified element is positive
//
-// assert.Positivef(t, 1, "error message %s", "formatted")
-// assert.Positivef(t, 1.23, "error message %s", "formatted")
+// assert.Positivef(t, 1, "error message %s", "formatted")
+// assert.Positivef(t, 1.23, "error message %s", "formatted")
func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1726,8 +1822,8 @@ func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) {
// Regexp asserts that a specified regexp matches a string.
//
-// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
-// assert.Regexp(t, "start...$", "it's not starting")
+// assert.Regexp(t, regexp.MustCompile("start"), "it's starting")
+// assert.Regexp(t, "start...$", "it's not starting")
func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1740,8 +1836,8 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface
// Regexpf asserts that a specified regexp matches a string.
//
-// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
-// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
+// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
+// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted")
func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1754,7 +1850,7 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in
// Same asserts that two pointers reference the same object.
//
-// assert.Same(t, ptr1, ptr2)
+// assert.Same(t, ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1770,7 +1866,7 @@ func Same(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...in
// Samef asserts that two pointers reference the same object.
//
-// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
+// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1787,7 +1883,7 @@ func Samef(t TestingT, expected interface{}, actual interface{}, msg string, arg
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
+// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1801,7 +1897,7 @@ func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...inte
// Subsetf asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
+// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1814,7 +1910,7 @@ func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args
// True asserts that the specified value is true.
//
-// assert.True(t, myBool)
+// assert.True(t, myBool)
func True(t TestingT, value bool, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1827,7 +1923,7 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) {
// Truef asserts that the specified value is true.
//
-// assert.Truef(t, myBool, "error message %s", "formatted")
+// assert.Truef(t, myBool, "error message %s", "formatted")
func Truef(t TestingT, value bool, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1840,7 +1936,7 @@ func Truef(t TestingT, value bool, msg string, args ...interface{}) {
// WithinDuration asserts that the two times are within duration delta of each other.
//
-// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
+// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second)
func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1853,7 +1949,7 @@ func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time
// WithinDurationf asserts that the two times are within duration delta of each other.
//
-// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
+// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1866,7 +1962,7 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim
// WithinRange asserts that a time is within a time range (inclusive).
//
-// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
+// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
@@ -1879,7 +1975,7 @@ func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, m
// WithinRangef asserts that a time is within a time range (inclusive).
//
-// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
+// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) {
if h, ok := t.(tHelper); ok {
h.Helper()
diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go
index 960bf6f2c..3b5b09330 100644
--- a/vendor/github.com/stretchr/testify/require/require_forward.go
+++ b/vendor/github.com/stretchr/testify/require/require_forward.go
@@ -31,9 +31,9 @@ func (a *Assertions) Conditionf(comp assert.Comparison, msg string, args ...inte
// Contains asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// a.Contains("Hello World", "World")
-// a.Contains(["Hello", "World"], "World")
-// a.Contains({"Hello": "World"}, "Hello")
+// a.Contains("Hello World", "World")
+// a.Contains(["Hello", "World"], "World")
+// a.Contains({"Hello": "World"}, "Hello")
func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -44,9 +44,9 @@ func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ..
// Containsf asserts that the specified string, list(array, slice...) or map contains the
// specified substring or element.
//
-// a.Containsf("Hello World", "World", "error message %s", "formatted")
-// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted")
-// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted")
+// a.Containsf("Hello World", "World", "error message %s", "formatted")
+// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted")
+// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted")
func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -99,7 +99,7 @@ func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg st
// Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// a.Empty(obj)
+// a.Empty(obj)
func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -110,7 +110,7 @@ func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) {
// Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// a.Emptyf(obj, "error message %s", "formatted")
+// a.Emptyf(obj, "error message %s", "formatted")
func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -120,7 +120,7 @@ func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{})
// Equal asserts that two objects are equal.
//
-// a.Equal(123, 123)
+// a.Equal(123, 123)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -135,8 +135,8 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs
// EqualError asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// a.EqualError(err, expectedErrorString)
+// actualObj, err := SomeFunction()
+// a.EqualError(err, expectedErrorString)
func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -147,8 +147,8 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...
// EqualErrorf asserts that a function returned an error (i.e. not `nil`)
// and that it is equal to the provided error.
//
-// actualObj, err := SomeFunction()
-// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted")
func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -156,10 +156,44 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a
EqualErrorf(a.t, theError, errString, msg, args...)
}
+// EqualExportedValues asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// a.EqualExportedValues(S{1, 2}, S{1, 3}) => true
+// a.EqualExportedValues(S{1, 2}, S{2, 3}) => false
+func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ EqualExportedValues(a.t, expected, actual, msgAndArgs...)
+}
+
+// EqualExportedValuesf asserts that the types of two objects are equal and their public
+// fields are also equal. This is useful for comparing structs that have private fields
+// that could potentially differ.
+//
+// type S struct {
+// Exported int
+// notExported int
+// }
+// a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true
+// a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false
+func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ EqualExportedValuesf(a.t, expected, actual, msg, args...)
+}
+
// EqualValues asserts that two objects are equal or convertable to the same types
// and equal.
//
-// a.EqualValues(uint32(123), int32(123))
+// a.EqualValues(uint32(123), int32(123))
func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -170,7 +204,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn
// EqualValuesf asserts that two objects are equal or convertable to the same types
// and equal.
//
-// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
+// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted")
func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -180,7 +214,7 @@ func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg
// Equalf asserts that two objects are equal.
//
-// a.Equalf(123, 123, "error message %s", "formatted")
+// a.Equalf(123, 123, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses). Function equality
@@ -194,10 +228,10 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string
// Error asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.Error(err) {
-// assert.Equal(t, expectedError, err)
-// }
+// actualObj, err := SomeFunction()
+// if a.Error(err) {
+// assert.Equal(t, expectedError, err)
+// }
func (a *Assertions) Error(err error, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -226,8 +260,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ..
// ErrorContains asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// a.ErrorContains(err, expectedErrorSubString)
+// actualObj, err := SomeFunction()
+// a.ErrorContains(err, expectedErrorSubString)
func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -238,8 +272,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs .
// ErrorContainsf asserts that a function returned an error (i.e. not `nil`)
// and that the error contains the specified substring.
//
-// actualObj, err := SomeFunction()
-// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
+// actualObj, err := SomeFunction()
+// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted")
func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -267,10 +301,10 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter
// Errorf asserts that a function returned an error (i.e. not `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.Errorf(err, "error message %s", "formatted") {
-// assert.Equal(t, expectedErrorf, err)
-// }
+// actualObj, err := SomeFunction()
+// if a.Errorf(err, "error message %s", "formatted") {
+// assert.Equal(t, expectedErrorf, err)
+// }
func (a *Assertions) Errorf(err error, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -281,7 +315,7 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) {
// Eventually asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
+// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond)
func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -289,10 +323,60 @@ func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, ti
Eventually(a.t, condition, waitFor, tick, msgAndArgs...)
}
+// EventuallyWithT asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// a.EventuallyWithT(func(c *assert.CollectT) {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...)
+}
+
+// EventuallyWithTf asserts that given condition will be met in waitFor time,
+// periodically checking target function each tick. In contrast to Eventually,
+// it supplies a CollectT to the condition function, so that the condition
+// function can use the CollectT to call other assertions.
+// The condition is considered "met" if no errors are raised in a tick.
+// The supplied CollectT collects all errors from one tick (if there are any).
+// If the condition is not met before waitFor, the collected errors of
+// the last tick are copied to t.
+//
+// externalValue := false
+// go func() {
+// time.Sleep(8*time.Second)
+// externalValue = true
+// }()
+// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") {
+// // add assertions as needed; any assertion failure will fail the current tick
+// assert.True(c, externalValue, "expected 'externalValue' to be true")
+// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false")
+func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
+ if h, ok := a.t.(tHelper); ok {
+ h.Helper()
+ }
+ EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...)
+}
+
// Eventuallyf asserts that given condition will be met in waitFor time,
// periodically checking target function each tick.
//
-// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -302,7 +386,7 @@ func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, t
// Exactly asserts that two objects are equal in value and type.
//
-// a.Exactly(int32(123), int64(123))
+// a.Exactly(int32(123), int64(123))
func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -312,7 +396,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg
// Exactlyf asserts that two objects are equal in value and type.
//
-// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted")
+// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted")
func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -354,7 +438,7 @@ func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{
// False asserts that the specified value is false.
//
-// a.False(myBool)
+// a.False(myBool)
func (a *Assertions) False(value bool, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -364,7 +448,7 @@ func (a *Assertions) False(value bool, msgAndArgs ...interface{}) {
// Falsef asserts that the specified value is false.
//
-// a.Falsef(myBool, "error message %s", "formatted")
+// a.Falsef(myBool, "error message %s", "formatted")
func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -392,9 +476,9 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) {
// Greater asserts that the first element is greater than the second
//
-// a.Greater(2, 1)
-// a.Greater(float64(2), float64(1))
-// a.Greater("b", "a")
+// a.Greater(2, 1)
+// a.Greater(float64(2), float64(1))
+// a.Greater("b", "a")
func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -404,10 +488,10 @@ func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...inter
// GreaterOrEqual asserts that the first element is greater than or equal to the second
//
-// a.GreaterOrEqual(2, 1)
-// a.GreaterOrEqual(2, 2)
-// a.GreaterOrEqual("b", "a")
-// a.GreaterOrEqual("b", "b")
+// a.GreaterOrEqual(2, 1)
+// a.GreaterOrEqual(2, 2)
+// a.GreaterOrEqual("b", "a")
+// a.GreaterOrEqual("b", "b")
func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -417,10 +501,10 @@ func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs .
// GreaterOrEqualf asserts that the first element is greater than or equal to the second
//
-// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
-// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
-// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
-// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 1, "error message %s", "formatted")
+// a.GreaterOrEqualf(2, 2, "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "a", "error message %s", "formatted")
+// a.GreaterOrEqualf("b", "b", "error message %s", "formatted")
func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -430,9 +514,9 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string,
// Greaterf asserts that the first element is greater than the second
//
-// a.Greaterf(2, 1, "error message %s", "formatted")
-// a.Greaterf(float64(2), float64(1), "error message %s", "formatted")
-// a.Greaterf("b", "a", "error message %s", "formatted")
+// a.Greaterf(2, 1, "error message %s", "formatted")
+// a.Greaterf(float64(2), float64(1), "error message %s", "formatted")
+// a.Greaterf("b", "a", "error message %s", "formatted")
func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -443,7 +527,7 @@ func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args .
// HTTPBodyContains asserts that a specified handler returns a
// body that contains a string.
//
-// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
@@ -456,7 +540,7 @@ func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, u
// HTTPBodyContainsf asserts that a specified handler returns a
// body that contains a string.
//
-// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
@@ -469,7 +553,7 @@ func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string,
// HTTPBodyNotContains asserts that a specified handler returns a
// body that does not contain a string.
//
-// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
+// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) {
@@ -482,7 +566,7 @@ func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string
// HTTPBodyNotContainsf asserts that a specified handler returns a
// body that does not contain a string.
//
-// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
+// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) {
@@ -494,7 +578,7 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin
// HTTPError asserts that a specified handler returns an error status code.
//
-// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -506,7 +590,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri
// HTTPErrorf asserts that a specified handler returns an error status code.
//
-// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -518,7 +602,7 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str
// HTTPRedirect asserts that a specified handler returns a redirect status code.
//
-// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -530,7 +614,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s
// HTTPRedirectf asserts that a specified handler returns a redirect status code.
//
-// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
+// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}}
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -542,7 +626,7 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url
// HTTPStatusCode asserts that a specified handler returns a specified status code.
//
-// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501)
+// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501)
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) {
@@ -554,7 +638,7 @@ func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url
// HTTPStatusCodef asserts that a specified handler returns a specified status code.
//
-// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
+// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) {
@@ -566,7 +650,7 @@ func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, ur
// HTTPSuccess asserts that a specified handler returns a success status code.
//
-// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
+// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil)
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) {
@@ -578,7 +662,7 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st
// HTTPSuccessf asserts that a specified handler returns a success status code.
//
-// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
+// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted")
//
// Returns whether the assertion was successful (true) or not (false).
func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) {
@@ -590,7 +674,7 @@ func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url s
// Implements asserts that an object is implemented by the specified interface.
//
-// a.Implements((*MyInterface)(nil), new(MyObject))
+// a.Implements((*MyInterface)(nil), new(MyObject))
func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -600,7 +684,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{},
// Implementsf asserts that an object is implemented by the specified interface.
//
-// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
+// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted")
func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -610,7 +694,7 @@ func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}
// InDelta asserts that the two numerals are within delta of each other.
//
-// a.InDelta(math.Pi, 22/7.0, 0.01)
+// a.InDelta(math.Pi, 22/7.0, 0.01)
func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -652,7 +736,7 @@ func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, del
// InDeltaf asserts that the two numerals are within delta of each other.
//
-// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
+// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted")
func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -694,9 +778,9 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo
// IsDecreasing asserts that the collection is decreasing
//
-// a.IsDecreasing([]int{2, 1, 0})
-// a.IsDecreasing([]float{2, 1})
-// a.IsDecreasing([]string{"b", "a"})
+// a.IsDecreasing([]int{2, 1, 0})
+// a.IsDecreasing([]float{2, 1})
+// a.IsDecreasing([]string{"b", "a"})
func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -706,9 +790,9 @@ func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{})
// IsDecreasingf asserts that the collection is decreasing
//
-// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted")
-// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted")
-// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted")
+// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted")
+// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted")
func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -718,9 +802,9 @@ func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...inter
// IsIncreasing asserts that the collection is increasing
//
-// a.IsIncreasing([]int{1, 2, 3})
-// a.IsIncreasing([]float{1, 2})
-// a.IsIncreasing([]string{"a", "b"})
+// a.IsIncreasing([]int{1, 2, 3})
+// a.IsIncreasing([]float{1, 2})
+// a.IsIncreasing([]string{"a", "b"})
func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -730,9 +814,9 @@ func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{})
// IsIncreasingf asserts that the collection is increasing
//
-// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted")
-// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted")
-// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted")
+// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted")
+// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted")
func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -742,9 +826,9 @@ func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...inter
// IsNonDecreasing asserts that the collection is not decreasing
//
-// a.IsNonDecreasing([]int{1, 1, 2})
-// a.IsNonDecreasing([]float{1, 2})
-// a.IsNonDecreasing([]string{"a", "b"})
+// a.IsNonDecreasing([]int{1, 1, 2})
+// a.IsNonDecreasing([]float{1, 2})
+// a.IsNonDecreasing([]string{"a", "b"})
func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -754,9 +838,9 @@ func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface
// IsNonDecreasingf asserts that the collection is not decreasing
//
-// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted")
-// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted")
-// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted")
+// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted")
func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -766,9 +850,9 @@ func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...in
// IsNonIncreasing asserts that the collection is not increasing
//
-// a.IsNonIncreasing([]int{2, 1, 1})
-// a.IsNonIncreasing([]float{2, 1})
-// a.IsNonIncreasing([]string{"b", "a"})
+// a.IsNonIncreasing([]int{2, 1, 1})
+// a.IsNonIncreasing([]float{2, 1})
+// a.IsNonIncreasing([]string{"b", "a"})
func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -778,9 +862,9 @@ func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface
// IsNonIncreasingf asserts that the collection is not increasing
//
-// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted")
-// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted")
-// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted")
+// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted")
func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -806,7 +890,7 @@ func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg s
// JSONEq asserts that two JSON strings are equivalent.
//
-// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
+// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`)
func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -816,7 +900,7 @@ func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interf
// JSONEqf asserts that two JSON strings are equivalent.
//
-// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
+// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted")
func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -827,7 +911,7 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ..
// Len asserts that the specified object has specific length.
// Len also fails if the object has a type that len() not accept.
//
-// a.Len(mySlice, 3)
+// a.Len(mySlice, 3)
func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -838,7 +922,7 @@ func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface
// Lenf asserts that the specified object has specific length.
// Lenf also fails if the object has a type that len() not accept.
//
-// a.Lenf(mySlice, 3, "error message %s", "formatted")
+// a.Lenf(mySlice, 3, "error message %s", "formatted")
func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -848,9 +932,9 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in
// Less asserts that the first element is less than the second
//
-// a.Less(1, 2)
-// a.Less(float64(1), float64(2))
-// a.Less("a", "b")
+// a.Less(1, 2)
+// a.Less(float64(1), float64(2))
+// a.Less("a", "b")
func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -860,10 +944,10 @@ func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interfac
// LessOrEqual asserts that the first element is less than or equal to the second
//
-// a.LessOrEqual(1, 2)
-// a.LessOrEqual(2, 2)
-// a.LessOrEqual("a", "b")
-// a.LessOrEqual("b", "b")
+// a.LessOrEqual(1, 2)
+// a.LessOrEqual(2, 2)
+// a.LessOrEqual("a", "b")
+// a.LessOrEqual("b", "b")
func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -873,10 +957,10 @@ func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...i
// LessOrEqualf asserts that the first element is less than or equal to the second
//
-// a.LessOrEqualf(1, 2, "error message %s", "formatted")
-// a.LessOrEqualf(2, 2, "error message %s", "formatted")
-// a.LessOrEqualf("a", "b", "error message %s", "formatted")
-// a.LessOrEqualf("b", "b", "error message %s", "formatted")
+// a.LessOrEqualf(1, 2, "error message %s", "formatted")
+// a.LessOrEqualf(2, 2, "error message %s", "formatted")
+// a.LessOrEqualf("a", "b", "error message %s", "formatted")
+// a.LessOrEqualf("b", "b", "error message %s", "formatted")
func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -886,9 +970,9 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar
// Lessf asserts that the first element is less than the second
//
-// a.Lessf(1, 2, "error message %s", "formatted")
-// a.Lessf(float64(1), float64(2), "error message %s", "formatted")
-// a.Lessf("a", "b", "error message %s", "formatted")
+// a.Lessf(1, 2, "error message %s", "formatted")
+// a.Lessf(float64(1), float64(2), "error message %s", "formatted")
+// a.Lessf("a", "b", "error message %s", "formatted")
func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -898,8 +982,8 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i
// Negative asserts that the specified element is negative
//
-// a.Negative(-1)
-// a.Negative(-1.23)
+// a.Negative(-1)
+// a.Negative(-1.23)
func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -909,8 +993,8 @@ func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) {
// Negativef asserts that the specified element is negative
//
-// a.Negativef(-1, "error message %s", "formatted")
-// a.Negativef(-1.23, "error message %s", "formatted")
+// a.Negativef(-1, "error message %s", "formatted")
+// a.Negativef(-1.23, "error message %s", "formatted")
func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -921,7 +1005,7 @@ func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) {
// Never asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond)
+// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond)
func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -932,7 +1016,7 @@ func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick ti
// Neverf asserts that the given condition doesn't satisfy in waitFor time,
// periodically checking the target function each tick.
//
-// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
+// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -942,7 +1026,7 @@ func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick t
// Nil asserts that the specified object is nil.
//
-// a.Nil(err)
+// a.Nil(err)
func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -952,7 +1036,7 @@ func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) {
// Nilf asserts that the specified object is nil.
//
-// a.Nilf(err, "error message %s", "formatted")
+// a.Nilf(err, "error message %s", "formatted")
func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -980,10 +1064,10 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{})
// NoError asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.NoError(err) {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if a.NoError(err) {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -993,10 +1077,10 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) {
// NoErrorf asserts that a function returned no error (i.e. `nil`).
//
-// actualObj, err := SomeFunction()
-// if a.NoErrorf(err, "error message %s", "formatted") {
-// assert.Equal(t, expectedObj, actualObj)
-// }
+// actualObj, err := SomeFunction()
+// if a.NoErrorf(err, "error message %s", "formatted") {
+// assert.Equal(t, expectedObj, actualObj)
+// }
func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1025,9 +1109,9 @@ func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{})
// NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// a.NotContains("Hello World", "Earth")
-// a.NotContains(["Hello", "World"], "Earth")
-// a.NotContains({"Hello": "World"}, "Earth")
+// a.NotContains("Hello World", "Earth")
+// a.NotContains(["Hello", "World"], "Earth")
+// a.NotContains({"Hello": "World"}, "Earth")
func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1038,9 +1122,9 @@ func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs
// NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the
// specified substring or element.
//
-// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted")
-// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted")
-// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted")
+// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted")
+// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted")
+// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted")
func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1051,9 +1135,9 @@ func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg strin
// NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if a.NotEmpty(obj) {
-// assert.Equal(t, "two", obj[1])
-// }
+// if a.NotEmpty(obj) {
+// assert.Equal(t, "two", obj[1])
+// }
func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1064,9 +1148,9 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) {
// NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either
// a slice or a channel with len == 0.
//
-// if a.NotEmptyf(obj, "error message %s", "formatted") {
-// assert.Equal(t, "two", obj[1])
-// }
+// if a.NotEmptyf(obj, "error message %s", "formatted") {
+// assert.Equal(t, "two", obj[1])
+// }
func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1076,7 +1160,7 @@ func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface
// NotEqual asserts that the specified values are NOT equal.
//
-// a.NotEqual(obj1, obj2)
+// a.NotEqual(obj1, obj2)
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1089,7 +1173,7 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr
// NotEqualValues asserts that two objects are not equal even when converted to the same type
//
-// a.NotEqualValues(obj1, obj2)
+// a.NotEqualValues(obj1, obj2)
func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1099,7 +1183,7 @@ func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, ms
// NotEqualValuesf asserts that two objects are not equal even when converted to the same type
//
-// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted")
+// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted")
func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1109,7 +1193,7 @@ func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, m
// NotEqualf asserts that the specified values are NOT equal.
//
-// a.NotEqualf(obj1, obj2, "error message %s", "formatted")
+// a.NotEqualf(obj1, obj2, "error message %s", "formatted")
//
// Pointer variable equality is determined based on the equality of the
// referenced values (as opposed to the memory addresses).
@@ -1140,7 +1224,7 @@ func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...in
// NotNil asserts that the specified object is not nil.
//
-// a.NotNil(err)
+// a.NotNil(err)
func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1150,7 +1234,7 @@ func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) {
// NotNilf asserts that the specified object is not nil.
//
-// a.NotNilf(err, "error message %s", "formatted")
+// a.NotNilf(err, "error message %s", "formatted")
func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1160,7 +1244,7 @@ func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}
// NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// a.NotPanics(func(){ RemainCalm() })
+// a.NotPanics(func(){ RemainCalm() })
func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1170,7 +1254,7 @@ func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}
// NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic.
//
-// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted")
+// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted")
func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1180,8 +1264,8 @@ func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...inte
// NotRegexp asserts that a specified regexp does not match a string.
//
-// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
-// a.NotRegexp("^start", "it's not starting")
+// a.NotRegexp(regexp.MustCompile("starts"), "it's starting")
+// a.NotRegexp("^start", "it's not starting")
func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1191,8 +1275,8 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in
// NotRegexpf asserts that a specified regexp does not match a string.
//
-// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
-// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted")
+// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted")
+// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted")
func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1202,7 +1286,7 @@ func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, arg
// NotSame asserts that two pointers do not reference the same object.
//
-// a.NotSame(ptr1, ptr2)
+// a.NotSame(ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1215,7 +1299,7 @@ func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArg
// NotSamef asserts that two pointers do not reference the same object.
//
-// a.NotSamef(ptr1, ptr2, "error message %s", "formatted")
+// a.NotSamef(ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1229,7 +1313,7 @@ func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg stri
// NotSubset asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
+// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]")
func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1240,7 +1324,7 @@ func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs
// NotSubsetf asserts that the specified list(array, slice...) contains not all
// elements given in the specified subset(array, slice...).
//
-// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
+// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted")
func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1266,7 +1350,7 @@ func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) {
// Panics asserts that the code inside the specified PanicTestFunc panics.
//
-// a.Panics(func(){ GoCrazy() })
+// a.Panics(func(){ GoCrazy() })
func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1278,7 +1362,7 @@ func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) {
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// a.PanicsWithError("crazy error", func(){ GoCrazy() })
+// a.PanicsWithError("crazy error", func(){ GoCrazy() })
func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1290,7 +1374,7 @@ func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, m
// panics, and that the recovered panic value is an error that satisfies the
// EqualError comparison.
//
-// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) PanicsWithErrorf(errString string, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1301,7 +1385,7 @@ func (a *Assertions) PanicsWithErrorf(errString string, f assert.PanicTestFunc,
// PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// a.PanicsWithValue("crazy error", func(){ GoCrazy() })
+// a.PanicsWithValue("crazy error", func(){ GoCrazy() })
func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1312,7 +1396,7 @@ func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFun
// PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that
// the recovered panic value equals the expected panic value.
//
-// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
+// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1322,7 +1406,7 @@ func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFu
// Panicsf asserts that the code inside the specified PanicTestFunc panics.
//
-// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted")
+// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted")
func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1332,8 +1416,8 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa
// Positive asserts that the specified element is positive
//
-// a.Positive(1)
-// a.Positive(1.23)
+// a.Positive(1)
+// a.Positive(1.23)
func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1343,8 +1427,8 @@ func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) {
// Positivef asserts that the specified element is positive
//
-// a.Positivef(1, "error message %s", "formatted")
-// a.Positivef(1.23, "error message %s", "formatted")
+// a.Positivef(1, "error message %s", "formatted")
+// a.Positivef(1.23, "error message %s", "formatted")
func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1354,8 +1438,8 @@ func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) {
// Regexp asserts that a specified regexp matches a string.
//
-// a.Regexp(regexp.MustCompile("start"), "it's starting")
-// a.Regexp("start...$", "it's not starting")
+// a.Regexp(regexp.MustCompile("start"), "it's starting")
+// a.Regexp("start...$", "it's not starting")
func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1365,8 +1449,8 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter
// Regexpf asserts that a specified regexp matches a string.
//
-// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
-// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted")
+// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted")
+// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted")
func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1376,7 +1460,7 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args .
// Same asserts that two pointers reference the same object.
//
-// a.Same(ptr1, ptr2)
+// a.Same(ptr1, ptr2)
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1389,7 +1473,7 @@ func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs .
// Samef asserts that two pointers reference the same object.
//
-// a.Samef(ptr1, ptr2, "error message %s", "formatted")
+// a.Samef(ptr1, ptr2, "error message %s", "formatted")
//
// Both arguments must be pointer variables. Pointer variable sameness is
// determined based on the equality of both type and value.
@@ -1403,7 +1487,7 @@ func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string,
// Subset asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
+// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]")
func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1414,7 +1498,7 @@ func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...
// Subsetf asserts that the specified list(array, slice...) contains all
// elements given in the specified subset(array, slice...).
//
-// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
+// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted")
func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1424,7 +1508,7 @@ func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, a
// True asserts that the specified value is true.
//
-// a.True(myBool)
+// a.True(myBool)
func (a *Assertions) True(value bool, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1434,7 +1518,7 @@ func (a *Assertions) True(value bool, msgAndArgs ...interface{}) {
// Truef asserts that the specified value is true.
//
-// a.Truef(myBool, "error message %s", "formatted")
+// a.Truef(myBool, "error message %s", "formatted")
func (a *Assertions) Truef(value bool, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1444,7 +1528,7 @@ func (a *Assertions) Truef(value bool, msg string, args ...interface{}) {
// WithinDuration asserts that the two times are within duration delta of each other.
//
-// a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
+// a.WithinDuration(time.Now(), time.Now(), 10*time.Second)
func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1454,7 +1538,7 @@ func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta
// WithinDurationf asserts that the two times are within duration delta of each other.
//
-// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
+// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted")
func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1464,7 +1548,7 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta
// WithinRange asserts that a time is within a time range (inclusive).
//
-// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
+// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second))
func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
@@ -1474,7 +1558,7 @@ func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Tim
// WithinRangef asserts that a time is within a time range (inclusive).
//
-// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
+// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted")
func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) {
if h, ok := a.t.(tHelper); ok {
h.Helper()
diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/vendor/golang.org/x/crypto/cryptobyte/asn1.go
index 3141a7f1b..6fc2838a3 100644
--- a/vendor/golang.org/x/crypto/cryptobyte/asn1.go
+++ b/vendor/golang.org/x/crypto/cryptobyte/asn1.go
@@ -431,6 +431,14 @@ func (s *String) readBase128Int(out *int) bool {
}
ret <<= 7
b := s.read(1)[0]
+
+ // ITU-T X.690, section 8.19.2:
+ // The subidentifier shall be encoded in the fewest possible octets,
+ // that is, the leading octet of the subidentifier shall not have the value 0x80.
+ if i == 0 && b == 0x80 {
+ return false
+ }
+
ret |= int(b & 0x7f)
if b&0x80 == 0 {
*out = ret
diff --git a/vendor/golang.org/x/sys/cpu/endian_little.go b/vendor/golang.org/x/sys/cpu/endian_little.go
index fe545966b..55db853ef 100644
--- a/vendor/golang.org/x/sys/cpu/endian_little.go
+++ b/vendor/golang.org/x/sys/cpu/endian_little.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
-// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
+//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm
+// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh wasm
package cpu
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
index 8e3947c36..e6f31d374 100644
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/vendor/golang.org/x/sys/unix/mkall.sh
@@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then
# Use the Docker-based build system
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
$cmd docker build --tag generate:$GOOS $GOOS
- $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && /bin/pwd):/build generate:$GOOS
+ $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
exit
fi
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index be0423e68..315646271 100644
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -741,7 +741,8 @@ main(void)
e = errors[i].num;
if(i > 0 && errors[i-1].num == e)
continue;
- strcpy(buf, strerror(e));
+ strncpy(buf, strerror(e), sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
buf[0] += a - A;
@@ -760,7 +761,8 @@ main(void)
e = signals[i].num;
if(i > 0 && signals[i-1].num == e)
continue;
- strcpy(buf, strsignal(e));
+ strncpy(buf, strsignal(e), sizeof(buf) - 1);
+ buf[sizeof(buf) - 1] = '\0';
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
buf[0] += a - A;
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index fbaeb5fff..6de486bef 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -1699,12 +1699,23 @@ func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
}
+// elfNT_PRSTATUS is a copy of the debug/elf.NT_PRSTATUS constant so
+// x/sys/unix doesn't need to depend on debug/elf and thus
+// compress/zlib, debug/dwarf, and other packages.
+const elfNT_PRSTATUS = 1
+
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
- return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout))
+ var iov Iovec
+ iov.Base = (*byte)(unsafe.Pointer(regsout))
+ iov.SetLen(int(unsafe.Sizeof(*regsout)))
+ return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
}
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
- return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs))
+ var iov Iovec
+ iov.Base = (*byte)(unsafe.Pointer(regs))
+ iov.SetLen(int(unsafe.Sizeof(*regs)))
+ return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
}
func PtraceSetOptions(pid int, options int) (err error) {
@@ -2420,6 +2431,21 @@ func PthreadSigmask(how int, set, oldset *Sigset_t) error {
return rtSigprocmask(how, set, oldset, _C__NSIG/8)
}
+//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int)
+//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int)
+
+func Getresuid() (ruid, euid, suid int) {
+ var r, e, s _C_int
+ getresuid(&r, &e, &s)
+ return int(r), int(e), int(s)
+}
+
+func Getresgid() (rgid, egid, sgid int) {
+ var r, e, s _C_int
+ getresgid(&r, &e, &s)
+ return int(r), int(e), int(s)
+}
+
/*
* Unimplemented
*/
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index f9c7a9663..c5f166a11 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -151,6 +151,21 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
return
}
+//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int)
+//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int)
+
+func Getresuid() (ruid, euid, suid int) {
+ var r, e, s _C_int
+ getresuid(&r, &e, &s)
+ return int(r), int(e), int(s)
+}
+
+func Getresgid() (rgid, egid, sgid int) {
+ var r, e, s _C_int
+ getresgid(&r, &e, &s)
+ return int(r), int(e), int(s)
+}
+
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL
@@ -338,8 +353,6 @@ func Uname(uname *Utsname) error {
// getgid
// getitimer
// getlogin
-// getresgid
-// getresuid
// getthrid
// ktrace
// lfs_bmapv
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
index f61925269..48984202c 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
@@ -329,6 +329,54 @@ const (
SCM_WIFI_STATUS = 0x25
SFD_CLOEXEC = 0x400000
SFD_NONBLOCK = 0x4000
+ SF_FP = 0x38
+ SF_I0 = 0x20
+ SF_I1 = 0x24
+ SF_I2 = 0x28
+ SF_I3 = 0x2c
+ SF_I4 = 0x30
+ SF_I5 = 0x34
+ SF_L0 = 0x0
+ SF_L1 = 0x4
+ SF_L2 = 0x8
+ SF_L3 = 0xc
+ SF_L4 = 0x10
+ SF_L5 = 0x14
+ SF_L6 = 0x18
+ SF_L7 = 0x1c
+ SF_PC = 0x3c
+ SF_RETP = 0x40
+ SF_V9_FP = 0x70
+ SF_V9_I0 = 0x40
+ SF_V9_I1 = 0x48
+ SF_V9_I2 = 0x50
+ SF_V9_I3 = 0x58
+ SF_V9_I4 = 0x60
+ SF_V9_I5 = 0x68
+ SF_V9_L0 = 0x0
+ SF_V9_L1 = 0x8
+ SF_V9_L2 = 0x10
+ SF_V9_L3 = 0x18
+ SF_V9_L4 = 0x20
+ SF_V9_L5 = 0x28
+ SF_V9_L6 = 0x30
+ SF_V9_L7 = 0x38
+ SF_V9_PC = 0x78
+ SF_V9_RETP = 0x80
+ SF_V9_XARG0 = 0x88
+ SF_V9_XARG1 = 0x90
+ SF_V9_XARG2 = 0x98
+ SF_V9_XARG3 = 0xa0
+ SF_V9_XARG4 = 0xa8
+ SF_V9_XARG5 = 0xb0
+ SF_V9_XXARG = 0xb8
+ SF_XARG0 = 0x44
+ SF_XARG1 = 0x48
+ SF_XARG2 = 0x4c
+ SF_XARG3 = 0x50
+ SF_XARG4 = 0x54
+ SF_XARG5 = 0x58
+ SF_XXARG = 0x5c
SIOCATMARK = 0x8905
SIOCGPGRP = 0x8904
SIOCGSTAMPNS_NEW = 0x40108907
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
index da63d9d78..722c29a00 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go
@@ -2172,3 +2172,17 @@ func rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr)
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ RawSyscallNoError(SYS_GETRESUID, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ RawSyscallNoError(SYS_GETRESGID, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
index 6699a783e..9ab9abf72 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
index 04f0de34b..3dcacd30d 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4
DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4
+DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4
+DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
index 1e775fe05..915761eab 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
@@ -527,6 +549,12 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
return
}
+var libc_ioctl_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
@@ -535,10 +563,6 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) {
return
}
-var libc_ioctl_trampoline_addr uintptr
-
-//go:cgo_import_dynamic libc_ioctl ioctl "libc.so"
-
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
index 27b6f4df7..2763620b0 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
index 7f6427899..8e87fdf15 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
index b797045fd..c92231404 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $4
DATA ·libc_getcwd_trampoline_addr(SB)/4, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $4
+DATA ·libc_getresuid_trampoline_addr(SB)/4, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $4
+DATA ·libc_getresgid_trampoline_addr(SB)/4, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $4
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
index 756ef7b17..12a7a2160 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
index a87126622..a6bc32c92 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
index 7bc2e24eb..b19e8aa03 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
index 05d4bffd7..b4e7bceab 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
index 739be6217..fb99594c9 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
index 74a25f8d6..ca3f76600 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
@@ -189,6 +189,18 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ CALL libc_getresuid(SB)
+ RET
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ CALL libc_getresgid(SB)
+ RET
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_ioctl(SB)
RET
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
index 7d95a1978..32cbbbc52 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
@@ -519,6 +519,28 @@ var libc_getcwd_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) {
+ syscall_rawSyscall(libc_getresuid_trampoline_addr, uintptr(unsafe.Pointer(ruid)), uintptr(unsafe.Pointer(euid)), uintptr(unsafe.Pointer(suid)))
+ return
+}
+
+var libc_getresuid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresuid getresuid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int) {
+ syscall_rawSyscall(libc_getresgid_trampoline_addr, uintptr(unsafe.Pointer(rgid)), uintptr(unsafe.Pointer(egid)), uintptr(unsafe.Pointer(sgid)))
+ return
+}
+
+var libc_getresgid_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_getresgid getresgid "libc.so"
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := syscall_syscall(libc_ioctl_trampoline_addr, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
index 990be2457..477a7d5b2 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
@@ -158,6 +158,16 @@ TEXT libc_getcwd_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_getcwd_trampoline_addr(SB), RODATA, $8
DATA ·libc_getcwd_trampoline_addr(SB)/8, $libc_getcwd_trampoline<>(SB)
+TEXT libc_getresuid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresuid(SB)
+GLOBL ·libc_getresuid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresuid_trampoline_addr(SB)/8, $libc_getresuid_trampoline<>(SB)
+
+TEXT libc_getresgid_trampoline<>(SB),NOSPLIT,$0-0
+ JMP libc_getresgid(SB)
+GLOBL ·libc_getresgid_trampoline_addr(SB), RODATA, $8
+DATA ·libc_getresgid_trampoline_addr(SB)/8, $libc_getresgid_trampoline<>(SB)
+
TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_ioctl(SB)
GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go
index ca84727cf..00c3b8c20 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go
@@ -2555,6 +2555,11 @@ const (
BPF_REG_8 = 0x8
BPF_REG_9 = 0x9
BPF_REG_10 = 0xa
+ BPF_CGROUP_ITER_ORDER_UNSPEC = 0x0
+ BPF_CGROUP_ITER_SELF_ONLY = 0x1
+ BPF_CGROUP_ITER_DESCENDANTS_PRE = 0x2
+ BPF_CGROUP_ITER_DESCENDANTS_POST = 0x3
+ BPF_CGROUP_ITER_ANCESTORS_UP = 0x4
BPF_MAP_CREATE = 0x0
BPF_MAP_LOOKUP_ELEM = 0x1
BPF_MAP_UPDATE_ELEM = 0x2
@@ -2566,6 +2571,7 @@ const (
BPF_PROG_ATTACH = 0x8
BPF_PROG_DETACH = 0x9
BPF_PROG_TEST_RUN = 0xa
+ BPF_PROG_RUN = 0xa
BPF_PROG_GET_NEXT_ID = 0xb
BPF_MAP_GET_NEXT_ID = 0xc
BPF_PROG_GET_FD_BY_ID = 0xd
@@ -2610,6 +2616,7 @@ const (
BPF_MAP_TYPE_CPUMAP = 0x10
BPF_MAP_TYPE_XSKMAP = 0x11
BPF_MAP_TYPE_SOCKHASH = 0x12
+ BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED = 0x13
BPF_MAP_TYPE_CGROUP_STORAGE = 0x13
BPF_MAP_TYPE_REUSEPORT_SOCKARRAY = 0x14
BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE = 0x15
@@ -2620,6 +2627,10 @@ const (
BPF_MAP_TYPE_STRUCT_OPS = 0x1a
BPF_MAP_TYPE_RINGBUF = 0x1b
BPF_MAP_TYPE_INODE_STORAGE = 0x1c
+ BPF_MAP_TYPE_TASK_STORAGE = 0x1d
+ BPF_MAP_TYPE_BLOOM_FILTER = 0x1e
+ BPF_MAP_TYPE_USER_RINGBUF = 0x1f
+ BPF_MAP_TYPE_CGRP_STORAGE = 0x20
BPF_PROG_TYPE_UNSPEC = 0x0
BPF_PROG_TYPE_SOCKET_FILTER = 0x1
BPF_PROG_TYPE_KPROBE = 0x2
@@ -2651,6 +2662,7 @@ const (
BPF_PROG_TYPE_EXT = 0x1c
BPF_PROG_TYPE_LSM = 0x1d
BPF_PROG_TYPE_SK_LOOKUP = 0x1e
+ BPF_PROG_TYPE_SYSCALL = 0x1f
BPF_CGROUP_INET_INGRESS = 0x0
BPF_CGROUP_INET_EGRESS = 0x1
BPF_CGROUP_INET_SOCK_CREATE = 0x2
@@ -2689,6 +2701,12 @@ const (
BPF_XDP_CPUMAP = 0x23
BPF_SK_LOOKUP = 0x24
BPF_XDP = 0x25
+ BPF_SK_SKB_VERDICT = 0x26
+ BPF_SK_REUSEPORT_SELECT = 0x27
+ BPF_SK_REUSEPORT_SELECT_OR_MIGRATE = 0x28
+ BPF_PERF_EVENT = 0x29
+ BPF_TRACE_KPROBE_MULTI = 0x2a
+ BPF_LSM_CGROUP = 0x2b
BPF_LINK_TYPE_UNSPEC = 0x0
BPF_LINK_TYPE_RAW_TRACEPOINT = 0x1
BPF_LINK_TYPE_TRACING = 0x2
@@ -2696,6 +2714,9 @@ const (
BPF_LINK_TYPE_ITER = 0x4
BPF_LINK_TYPE_NETNS = 0x5
BPF_LINK_TYPE_XDP = 0x6
+ BPF_LINK_TYPE_PERF_EVENT = 0x7
+ BPF_LINK_TYPE_KPROBE_MULTI = 0x8
+ BPF_LINK_TYPE_STRUCT_OPS = 0x9
BPF_ANY = 0x0
BPF_NOEXIST = 0x1
BPF_EXIST = 0x2
@@ -2733,6 +2754,7 @@ const (
BPF_F_ZERO_CSUM_TX = 0x2
BPF_F_DONT_FRAGMENT = 0x4
BPF_F_SEQ_NUMBER = 0x8
+ BPF_F_TUNINFO_FLAGS = 0x10
BPF_F_INDEX_MASK = 0xffffffff
BPF_F_CURRENT_CPU = 0xffffffff
BPF_F_CTXLEN_MASK = 0xfffff00000000
@@ -2747,6 +2769,7 @@ const (
BPF_F_ADJ_ROOM_ENCAP_L4_GRE = 0x8
BPF_F_ADJ_ROOM_ENCAP_L4_UDP = 0x10
BPF_F_ADJ_ROOM_NO_CSUM_RESET = 0x20
+ BPF_F_ADJ_ROOM_ENCAP_L2_ETH = 0x40
BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff
BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 0x38
BPF_F_SYSCTL_BASE_NAME = 0x1
@@ -2771,10 +2794,16 @@ const (
BPF_LWT_ENCAP_SEG6 = 0x0
BPF_LWT_ENCAP_SEG6_INLINE = 0x1
BPF_LWT_ENCAP_IP = 0x2
+ BPF_F_BPRM_SECUREEXEC = 0x1
+ BPF_F_BROADCAST = 0x8
+ BPF_F_EXCLUDE_INGRESS = 0x10
+ BPF_SKB_TSTAMP_UNSPEC = 0x0
+ BPF_SKB_TSTAMP_DELIVERY_MONO = 0x1
BPF_OK = 0x0
BPF_DROP = 0x2
BPF_REDIRECT = 0x7
BPF_LWT_REROUTE = 0x80
+ BPF_FLOW_DISSECTOR_CONTINUE = 0x81
BPF_SOCK_OPS_RTO_CB_FLAG = 0x1
BPF_SOCK_OPS_RETRANS_CB_FLAG = 0x2
BPF_SOCK_OPS_STATE_CB_FLAG = 0x4
@@ -2838,6 +2867,10 @@ const (
BPF_FIB_LKUP_RET_UNSUPP_LWT = 0x6
BPF_FIB_LKUP_RET_NO_NEIGH = 0x7
BPF_FIB_LKUP_RET_FRAG_NEEDED = 0x8
+ BPF_MTU_CHK_SEGS = 0x1
+ BPF_MTU_CHK_RET_SUCCESS = 0x0
+ BPF_MTU_CHK_RET_FRAG_NEEDED = 0x1
+ BPF_MTU_CHK_RET_SEGS_TOOBIG = 0x2
BPF_FD_TYPE_RAW_TRACEPOINT = 0x0
BPF_FD_TYPE_TRACEPOINT = 0x1
BPF_FD_TYPE_KPROBE = 0x2
@@ -2847,6 +2880,19 @@ const (
BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG = 0x1
BPF_FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL = 0x2
BPF_FLOW_DISSECTOR_F_STOP_AT_ENCAP = 0x4
+ BPF_CORE_FIELD_BYTE_OFFSET = 0x0
+ BPF_CORE_FIELD_BYTE_SIZE = 0x1
+ BPF_CORE_FIELD_EXISTS = 0x2
+ BPF_CORE_FIELD_SIGNED = 0x3
+ BPF_CORE_FIELD_LSHIFT_U64 = 0x4
+ BPF_CORE_FIELD_RSHIFT_U64 = 0x5
+ BPF_CORE_TYPE_ID_LOCAL = 0x6
+ BPF_CORE_TYPE_ID_TARGET = 0x7
+ BPF_CORE_TYPE_EXISTS = 0x8
+ BPF_CORE_TYPE_SIZE = 0x9
+ BPF_CORE_ENUMVAL_EXISTS = 0xa
+ BPF_CORE_ENUMVAL_VALUE = 0xb
+ BPF_CORE_TYPE_MATCHES = 0xc
)
const (
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index 3723b2c22..964590075 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -405,7 +405,7 @@ func NewCallbackCDecl(fn interface{}) uintptr {
//sys VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) = version.VerQueryValueW
// Process Status API (PSAPI)
-//sys EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses
+//sys enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) = psapi.EnumProcesses
//sys EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) = psapi.EnumProcessModules
//sys EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) = psapi.EnumProcessModulesEx
//sys GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) = psapi.GetModuleInformation
@@ -1354,6 +1354,17 @@ func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) {
return syscall.EWINDOWS
}
+func EnumProcesses(processIds []uint32, bytesReturned *uint32) error {
+ // EnumProcesses syscall expects the size parameter to be in bytes, but the code generated with mksyscall uses
+ // the length of the processIds slice instead. Hence, this wrapper function is added to fix the discrepancy.
+ var p *uint32
+ if len(processIds) > 0 {
+ p = &processIds[0]
+ }
+ size := uint32(len(processIds) * 4)
+ return enumProcesses(p, size, bytesReturned)
+}
+
func Getpid() (pid int) { return int(GetCurrentProcessId()) }
func FindFirstFile(name *uint16, data *Win32finddata) (handle Handle, err error) {
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index a81ea2c70..566dd3e31 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -3516,12 +3516,8 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u
return
}
-func EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error) {
- var _p0 *uint32
- if len(processIds) > 0 {
- _p0 = &processIds[0]
- }
- r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(_p0)), uintptr(len(processIds)), uintptr(unsafe.Pointer(bytesReturned)))
+func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) {
+ r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned)))
if r1 == 0 {
err = errnoErr(e1)
}
diff --git a/vendor/k8s.io/klog/v2/format.go b/vendor/k8s.io/klog/v2/format.go
new file mode 100644
index 000000000..63995ca6d
--- /dev/null
+++ b/vendor/k8s.io/klog/v2/format.go
@@ -0,0 +1,65 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package klog
+
+import (
+ "encoding/json"
+ "fmt"
+ "strings"
+
+ "github.com/go-logr/logr"
+)
+
+// Format wraps a value of an arbitrary type and implement fmt.Stringer and
+// logr.Marshaler for them. Stringer returns pretty-printed JSON. MarshalLog
+// returns the original value with a type that has no special methods, in
+// particular no MarshalLog or MarshalJSON.
+//
+// Wrapping values like that is useful when the value has a broken
+// implementation of these special functions (for example, a type which
+// inherits String from TypeMeta, but then doesn't re-implement String) or the
+// implementation produces output that is less readable or unstructured (for
+// example, the generated String functions for Kubernetes API types).
+func Format(obj interface{}) interface{} {
+ return formatAny{Object: obj}
+}
+
+type formatAny struct {
+ Object interface{}
+}
+
+func (f formatAny) String() string {
+ var buffer strings.Builder
+ encoder := json.NewEncoder(&buffer)
+ encoder.SetIndent("", " ")
+ if err := encoder.Encode(&f.Object); err != nil {
+ return fmt.Sprintf("error marshaling %T to JSON: %v", f, err)
+ }
+ return buffer.String()
+}
+
+func (f formatAny) MarshalLog() interface{} {
+ // Returning a pointer to a pointer ensures that zapr doesn't find a
+ // fmt.Stringer or logr.Marshaler when it checks the type of the
+ // value. It then falls back to reflection, which dumps the value being
+ // pointed to (JSON doesn't have pointers).
+ ptr := &f.Object
+ return &ptr
+}
+
+var _ fmt.Stringer = formatAny{}
+var _ logr.Marshaler = formatAny{}
diff --git a/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go b/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go
index 1dc81a15f..bcdf5f8ee 100644
--- a/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go
+++ b/vendor/k8s.io/klog/v2/internal/serialize/keyvalues.go
@@ -18,6 +18,7 @@ package serialize
import (
"bytes"
+ "encoding/json"
"fmt"
"strconv"
@@ -196,11 +197,11 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) {
case textWriter:
writeTextWriterValue(b, v)
case fmt.Stringer:
- writeStringValue(b, true, StringerToString(v))
+ writeStringValue(b, StringerToString(v))
case string:
- writeStringValue(b, true, v)
+ writeStringValue(b, v)
case error:
- writeStringValue(b, true, ErrorToString(v))
+ writeStringValue(b, ErrorToString(v))
case logr.Marshaler:
value := MarshalerToValue(v)
// A marshaler that returns a string is useful for
@@ -215,9 +216,9 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) {
// value directly.
switch value := value.(type) {
case string:
- writeStringValue(b, true, value)
+ writeStringValue(b, value)
default:
- writeStringValue(b, false, f.AnyToString(value))
+ f.formatAny(b, value)
}
case []byte:
// In https://github.com/kubernetes/klog/pull/237 it was decided
@@ -234,7 +235,7 @@ func (f Formatter) KVFormat(b *bytes.Buffer, k, v interface{}) {
b.WriteByte('=')
b.WriteString(fmt.Sprintf("%+q", v))
default:
- writeStringValue(b, false, f.AnyToString(v))
+ f.formatAny(b, v)
}
}
@@ -242,12 +243,25 @@ func KVFormat(b *bytes.Buffer, k, v interface{}) {
Formatter{}.KVFormat(b, k, v)
}
-// AnyToString is the historic fallback formatter.
-func (f Formatter) AnyToString(v interface{}) string {
+// formatAny is the fallback formatter for a value. It supports a hook (for
+// example, for YAML encoding) and itself uses JSON encoding.
+func (f Formatter) formatAny(b *bytes.Buffer, v interface{}) {
+ b.WriteRune('=')
if f.AnyToStringHook != nil {
- return f.AnyToStringHook(v)
+ b.WriteString(f.AnyToStringHook(v))
+ return
+ }
+ encoder := json.NewEncoder(b)
+ l := b.Len()
+ if err := encoder.Encode(v); err != nil {
+ // This shouldn't happen. We discard whatever the encoder
+ // wrote and instead dump an error string.
+ b.Truncate(l)
+ b.WriteString(fmt.Sprintf(`""`, err))
+ return
}
- return fmt.Sprintf("%+v", v)
+ // Remove trailing newline.
+ b.Truncate(b.Len() - 1)
}
// StringerToString converts a Stringer to a string,
@@ -287,7 +301,7 @@ func ErrorToString(err error) (ret string) {
}
func writeTextWriterValue(b *bytes.Buffer, v textWriter) {
- b.WriteRune('=')
+ b.WriteByte('=')
defer func() {
if err := recover(); err != nil {
fmt.Fprintf(b, `""`, err)
@@ -296,18 +310,13 @@ func writeTextWriterValue(b *bytes.Buffer, v textWriter) {
v.WriteText(b)
}
-func writeStringValue(b *bytes.Buffer, quote bool, v string) {
+func writeStringValue(b *bytes.Buffer, v string) {
data := []byte(v)
index := bytes.IndexByte(data, '\n')
if index == -1 {
b.WriteByte('=')
- if quote {
- // Simple string, quote quotation marks and non-printable characters.
- b.WriteString(strconv.Quote(v))
- return
- }
- // Non-string with no line breaks.
- b.WriteString(v)
+ // Simple string, quote quotation marks and non-printable characters.
+ b.WriteString(strconv.Quote(v))
return
}
diff --git a/vendor/k8s.io/klog/v2/k8s_references.go b/vendor/k8s.io/klog/v2/k8s_references.go
index ecd3f8b69..786af74bf 100644
--- a/vendor/k8s.io/klog/v2/k8s_references.go
+++ b/vendor/k8s.io/klog/v2/k8s_references.go
@@ -178,14 +178,14 @@ func (ks kobjSlice) process() (objs []interface{}, err string) {
return objectRefs, ""
}
-var nilToken = []byte("")
+var nilToken = []byte("null")
func (ks kobjSlice) WriteText(out *bytes.Buffer) {
s := reflect.ValueOf(ks.arg)
switch s.Kind() {
case reflect.Invalid:
- // nil parameter, print as empty slice.
- out.WriteString("[]")
+ // nil parameter, print as null.
+ out.Write(nilToken)
return
case reflect.Slice:
// Okay, handle below.
@@ -197,15 +197,15 @@ func (ks kobjSlice) WriteText(out *bytes.Buffer) {
defer out.Write([]byte{']'})
for i := 0; i < s.Len(); i++ {
if i > 0 {
- out.Write([]byte{' '})
+ out.Write([]byte{','})
}
item := s.Index(i).Interface()
if item == nil {
out.Write(nilToken)
} else if v, ok := item.(KMetadata); ok {
- KObj(v).writeUnquoted(out)
+ KObj(v).WriteText(out)
} else {
- fmt.Fprintf(out, "", item)
+ fmt.Fprintf(out, `""`, item)
return
}
}
diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go
index 466eeaf26..152f8a6bd 100644
--- a/vendor/k8s.io/klog/v2/klog.go
+++ b/vendor/k8s.io/klog/v2/klog.go
@@ -1228,6 +1228,19 @@ func CopyStandardLogTo(name string) {
stdLog.SetOutput(logBridge(sev))
}
+// NewStandardLogger returns a Logger that writes to the klog logs for the
+// named and lower severities.
+//
+// Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not
+// recognized, NewStandardLogger panics.
+func NewStandardLogger(name string) *stdLog.Logger {
+ sev, ok := severity.ByName(name)
+ if !ok {
+ panic(fmt.Sprintf("klog.NewStandardLogger(%q): unknown severity", name))
+ }
+ return stdLog.New(logBridge(sev), "", stdLog.Lshortfile)
+}
+
// logBridge provides the Write method that enables CopyStandardLogTo to connect
// Go's standard logs to the logs provided by this package.
type logBridge severity.Severity
diff --git a/vendor/k8s.io/kube-openapi/pkg/handler/handler.go b/vendor/k8s.io/kube-openapi/pkg/handler/handler.go
index 84e902646..37cb96f1b 100644
--- a/vendor/k8s.io/kube-openapi/pkg/handler/handler.go
+++ b/vendor/k8s.io/kube-openapi/pkg/handler/handler.go
@@ -22,6 +22,7 @@ import (
"fmt"
"net/http"
"strconv"
+ "sync"
"time"
"github.com/NYTimes/gziphandler"
@@ -98,16 +99,6 @@ func NewOpenAPIServiceLazy(swagger cached.Data[*spec.Swagger]) *OpenAPIService {
return o
}
-func (o *OpenAPIService) getSwaggerBytes() (timedSpec, string, error) {
- result := o.jsonCache.Get()
- return result.Data, result.Etag, result.Err
-}
-
-func (o *OpenAPIService) getSwaggerPbBytes() (timedSpec, string, error) {
- result := o.protoCache.Get()
- return result.Data, result.Etag, result.Err
-}
-
func (o *OpenAPIService) UpdateSpec(swagger *spec.Swagger) error {
o.UpdateSpecLazy(cached.NewResultOK(swagger, uuid.New().String()))
return nil
@@ -135,6 +126,9 @@ func RegisterOpenAPIVersionedService(spec *spec.Swagger, servePath string, handl
// RegisterOpenAPIVersionedService registers a handler to provide access to provided swagger spec.
func (o *OpenAPIService) RegisterOpenAPIVersionedService(servePath string, handler common.PathHandler) error {
+ // Mutex protects the cache chain
+ var mutex sync.Mutex
+
accepted := []struct {
Type string
SubType string
@@ -163,7 +157,9 @@ func (o *OpenAPIService) RegisterOpenAPIVersionedService(servePath string, handl
continue
}
// serve the first matching media type in the sorted clause list
+ mutex.Lock()
result := accepts.GetDataAndEtag.Get()
+ mutex.Unlock()
if result.Err != nil {
klog.Errorf("Error in OpenAPI handler: %s", result.Err)
// only return a 503 if we have no older cache data to serve
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 6b3c80e1d..14dd8cee2 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1,6 +1,6 @@
# github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
## explicit
-github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute
+github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute
github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice
github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac
github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault
@@ -64,7 +64,7 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/service
# github.com/Azure/go-autorest v14.2.0+incompatible
## explicit
github.com/Azure/go-autorest
-# github.com/Azure/go-autorest/autorest v0.11.28
+# github.com/Azure/go-autorest/autorest v0.11.29
## explicit; go 1.15
github.com/Azure/go-autorest/autorest
github.com/Azure/go-autorest/autorest/azure
@@ -314,7 +314,7 @@ github.com/modern-go/reflect2
# github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
## explicit
github.com/munnerz/goautoneg
-# github.com/onsi/ginkgo/v2 v2.9.5
+# github.com/onsi/ginkgo/v2 v2.10.0
## explicit; go 1.18
github.com/onsi/ginkgo/v2
github.com/onsi/ginkgo/v2/config
@@ -336,7 +336,7 @@ github.com/onsi/ginkgo/v2/internal/parallel_support
github.com/onsi/ginkgo/v2/internal/testingtproxy
github.com/onsi/ginkgo/v2/reporters
github.com/onsi/ginkgo/v2/types
-# github.com/onsi/gomega v1.27.6
+# github.com/onsi/gomega v1.27.8
## explicit; go 1.18
github.com/onsi/gomega
github.com/onsi/gomega/format
@@ -406,8 +406,8 @@ github.com/spf13/pflag
# github.com/stoewer/go-strcase v1.2.0
## explicit; go 1.11
github.com/stoewer/go-strcase
-# github.com/stretchr/testify v1.8.2
-## explicit; go 1.13
+# github.com/stretchr/testify v1.8.4
+## explicit; go 1.20
github.com/stretchr/testify/assert
github.com/stretchr/testify/require
# go.etcd.io/etcd/api/v3 v3.5.7
@@ -506,7 +506,7 @@ go.uber.org/zap/internal/color
go.uber.org/zap/internal/exit
go.uber.org/zap/zapcore
go.uber.org/zap/zapgrpc
-# golang.org/x/crypto v0.8.0
+# golang.org/x/crypto v0.9.0
## explicit; go 1.17
golang.org/x/crypto/blowfish
golang.org/x/crypto/chacha20
@@ -546,7 +546,7 @@ golang.org/x/oauth2/internal
# golang.org/x/sync v0.2.0
## explicit
golang.org/x/sync/singleflight
-# golang.org/x/sys v0.8.0
+# golang.org/x/sys v0.9.0
## explicit; go 1.17
golang.org/x/sys/cpu
golang.org/x/sys/internal/unsafeheader
@@ -557,7 +557,7 @@ golang.org/x/sys/windows/registry
# golang.org/x/term v0.8.0
## explicit; go 1.17
golang.org/x/term
-# golang.org/x/text v0.9.0
+# golang.org/x/text v0.10.0
## explicit; go 1.17
golang.org/x/text/encoding
golang.org/x/text/encoding/charmap
@@ -583,7 +583,7 @@ golang.org/x/text/width
# golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
## explicit
golang.org/x/time/rate
-# golang.org/x/tools v0.9.1
+# golang.org/x/tools v0.9.3
## explicit; go 1.18
golang.org/x/tools/go/ast/inspector
golang.org/x/tools/internal/typeparams
@@ -707,7 +707,7 @@ gopkg.in/yaml.v2
# gopkg.in/yaml.v3 v3.0.1
## explicit
gopkg.in/yaml.v3
-# k8s.io/api v0.27.1 => k8s.io/api v0.27.1
+# k8s.io/api v0.27.2 => k8s.io/api v0.27.1
## explicit; go 1.20
k8s.io/api/admission/v1
k8s.io/api/admission/v1beta1
@@ -767,7 +767,7 @@ k8s.io/api/storage/v1beta1
## explicit; go 1.20
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions
k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
-# k8s.io/apimachinery v0.27.1 => k8s.io/apimachinery v0.27.1
+# k8s.io/apimachinery v0.27.2 => k8s.io/apimachinery v0.27.1
## explicit; go 1.20
k8s.io/apimachinery/pkg/api/equality
k8s.io/apimachinery/pkg/api/errors
@@ -827,7 +827,7 @@ 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/apiserver v0.27.1 => k8s.io/apiserver v0.27.1
+# k8s.io/apiserver v0.27.2 => k8s.io/apiserver v0.27.1
## explicit; go 1.20
k8s.io/apiserver/pkg/admission
k8s.io/apiserver/pkg/admission/cel
@@ -969,7 +969,7 @@ k8s.io/apiserver/plugin/pkg/audit/truncate
k8s.io/apiserver/plugin/pkg/audit/webhook
k8s.io/apiserver/plugin/pkg/authenticator/token/webhook
k8s.io/apiserver/plugin/pkg/authorizer/webhook
-# k8s.io/client-go v0.27.1 => k8s.io/client-go v0.27.1
+# k8s.io/client-go v0.27.2 => k8s.io/client-go v0.27.1
## explicit; go 1.20
k8s.io/client-go/applyconfigurations/admissionregistration/v1
k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1
@@ -1290,7 +1290,7 @@ k8s.io/client-go/util/homedir
k8s.io/client-go/util/keyutil
k8s.io/client-go/util/retry
k8s.io/client-go/util/workqueue
-# k8s.io/cloud-provider v0.27.1 => k8s.io/cloud-provider v0.27.1
+# k8s.io/cloud-provider v0.27.2 => k8s.io/cloud-provider v0.27.1
## explicit; go 1.20
k8s.io/cloud-provider
k8s.io/cloud-provider/api
@@ -1308,7 +1308,7 @@ k8s.io/cloud-provider/service/helpers
k8s.io/cloud-provider/volume
k8s.io/cloud-provider/volume/errors
k8s.io/cloud-provider/volume/helpers
-# k8s.io/component-base v0.27.1 => k8s.io/component-base v0.27.1
+# k8s.io/component-base v0.27.2 => k8s.io/component-base v0.27.1
## explicit; go 1.20
k8s.io/component-base/cli/flag
k8s.io/component-base/config
@@ -1330,14 +1330,14 @@ k8s.io/component-base/metrics/testutil
k8s.io/component-base/tracing
k8s.io/component-base/tracing/api/v1
k8s.io/component-base/version
-# k8s.io/component-helpers v0.27.1 => k8s.io/component-helpers v0.27.1
+# k8s.io/component-helpers v0.27.2 => k8s.io/component-helpers v0.27.1
## explicit; go 1.20
k8s.io/component-helpers/node/util
k8s.io/component-helpers/node/util/sysctl
k8s.io/component-helpers/scheduling/corev1
k8s.io/component-helpers/scheduling/corev1/nodeaffinity
k8s.io/component-helpers/storage/volume
-# k8s.io/controller-manager v0.27.1 => k8s.io/controller-manager v0.27.1
+# k8s.io/controller-manager v0.27.2 => k8s.io/controller-manager v0.27.1
## explicit; go 1.20
k8s.io/controller-manager/config
k8s.io/controller-manager/config/v1
@@ -1349,7 +1349,7 @@ k8s.io/controller-manager/pkg/features
k8s.io/controller-manager/pkg/features/register
k8s.io/controller-manager/pkg/leadermigration/config
k8s.io/controller-manager/pkg/leadermigration/options
-# k8s.io/klog/v2 v2.90.1
+# k8s.io/klog/v2 v2.100.1
## explicit; go 1.13
k8s.io/klog/v2
k8s.io/klog/v2/internal/buffer
@@ -1357,14 +1357,14 @@ k8s.io/klog/v2/internal/clock
k8s.io/klog/v2/internal/dbg
k8s.io/klog/v2/internal/serialize
k8s.io/klog/v2/internal/severity
-# k8s.io/kms v0.27.1
+# k8s.io/kms v0.27.2
## explicit; go 1.20
k8s.io/kms/apis/v1beta1
k8s.io/kms/apis/v2
k8s.io/kms/pkg/service
k8s.io/kms/pkg/util
-# k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a
-## explicit; go 1.18
+# k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
+## explicit; go 1.19
k8s.io/kube-openapi/pkg/builder
k8s.io/kube-openapi/pkg/builder3
k8s.io/kube-openapi/pkg/builder3/util
@@ -1389,7 +1389,7 @@ k8s.io/kube-openapi/pkg/validation/strfmt/bson
## explicit; go 1.20
k8s.io/kubectl/pkg/scale
k8s.io/kubectl/pkg/util/podutils
-# k8s.io/kubelet v0.27.1 => k8s.io/kubelet v0.27.1
+# k8s.io/kubelet v0.27.2 => k8s.io/kubelet v0.27.1
## explicit; go 1.20
k8s.io/kubelet/pkg/apis
k8s.io/kubelet/pkg/apis/stats/v1alpha1
@@ -1490,13 +1490,13 @@ k8s.io/utils/pointer
k8s.io/utils/strings
k8s.io/utils/strings/slices
k8s.io/utils/trace
-# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.1
+# sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2
## explicit; go 1.17
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics
sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client
-# sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230423180712-b979bea29b6a
+# sigs.k8s.io/cloud-provider-azure v1.27.1-0.20230613061957-d0cd51201edc
## explicit; go 1.20
sigs.k8s.io/cloud-provider-azure/pkg/azureclients
sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient
diff --git a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go
index 68a3ebf12..541e6a5aa 100644
--- a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go
+++ b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/client.go
@@ -132,6 +132,11 @@ type grpcTunnel struct {
// serving.
done chan struct{}
+ // started is an atomic bool represented as a 0 or 1, and set to true when a single-use tunnel has been started (dialed).
+ // started should only be accessed through atomic methods.
+ // TODO: switch this to an atomic.Bool once the client is exclusively buit with go1.19+
+ started uint32
+
// closing is an atomic bool represented as a 0 or 1, and set to true when the tunnel is being closed.
// closing should only be accessed through atomic methods.
// TODO: switch this to an atomic.Bool once the client is exclusively buit with go1.19+
@@ -197,6 +202,7 @@ func newUnstartedTunnel(stream client.ProxyService_ProxyClient, c clientConn) *g
conns: connectionManager{conns: make(map[int64]*conn)},
readTimeoutSeconds: 10,
done: make(chan struct{}),
+ started: 0,
}
s := metrics.ClientConnectionStatusCreated
t.prevStatus.Store(s)
@@ -393,6 +399,11 @@ func (t *grpcTunnel) DialContext(requestCtx context.Context, protocol, address s
}
func (t *grpcTunnel) dialContext(requestCtx context.Context, protocol, address string) (net.Conn, error) {
+ prevStarted := atomic.SwapUint32(&t.started, 1)
+ if prevStarted != 0 {
+ return nil, &dialFailure{"single-use dialer already dialed", metrics.DialFailureAlreadyStarted}
+ }
+
select {
case <-t.done:
return nil, errors.New("tunnel is closed")
@@ -515,11 +526,11 @@ func (t *grpcTunnel) Recv() (*client.Packet, error) {
const segment = commonmetrics.SegmentToClient
pkt, err := t.stream.Recv()
- if err != nil && err != io.EOF {
- metrics.Metrics.ObserveStreamErrorNoPacket(segment, err)
- }
if err != nil {
- return pkt, err
+ if err != io.EOF {
+ metrics.Metrics.ObserveStreamErrorNoPacket(segment, err)
+ }
+ return nil, err
}
metrics.Metrics.ObservePacket(segment, pkt.Type)
return pkt, nil
diff --git a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics/metrics.go b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics/metrics.go
index 03e9d94da..ce942e3eb 100644
--- a/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics/metrics.go
+++ b/vendor/sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics/metrics.go
@@ -62,6 +62,8 @@ const (
// DialFailureTunnelClosed indicates that the client connection was closed before the dial could
// complete.
DialFailureTunnelClosed DialFailureReason = "tunnelclosed"
+ // DialFailureAlreadyStarted indicates that a single-use tunnel dialer was already used once.
+ DialFailureAlreadyStarted DialFailureReason = "tunnelstarted"
)
type ClientConnectionStatus string
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go
index 291fa13b8..985004000 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go
index a1fd9f121..4259213b6 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/interface.go
@@ -19,14 +19,14 @@ package diskclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
const (
// APIVersion is the API version for compute.
- APIVersion = "2022-03-02"
+ APIVersion = "2022-07-02"
// AzureStackCloudAPIVersion is the API version for Azure Stack
AzureStackCloudAPIVersion = "2019-03-01"
// AzureStackCloudName is the cloud name of Azure Stack
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go
index 295423864..405f1efc0 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/mockdiskclient/interface.go
@@ -25,7 +25,7 @@ import (
context "context"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
gomock "github.com/golang/mock/gomock"
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go
index 5c41f79b8..f641d2b44 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go
@@ -55,6 +55,10 @@ type Client struct {
RetryAfterWriter time.Time
}
+type backendPoolsToBeMigrated struct {
+ BackendPoolNames []string `json:"pools"`
+}
+
// New creates a new LoadBalancer client with ratelimiting.
func New(config *azclients.ClientConfig) *Client {
baseURI := config.ResourceManagerEndpoint
@@ -421,6 +425,69 @@ func (page LoadBalancerListResultPage) Values() []network.LoadBalancer {
return *page.lblr.Value
}
+// GetLBBackendPool gets a LoadBalancer backend pool.
+func (c *Client) GetLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error) {
+ mc := metrics.NewMetricContext("load_balancers", "get_backend_pool", resourceGroupName, c.subscriptionID, "")
+
+ // Report errors if the client is rate limited.
+ if !c.rateLimiterReader.TryAccept() {
+ mc.RateLimitedCount()
+ return network.BackendAddressPool{}, retry.GetRateLimitError(false, "LBGet")
+ }
+
+ // Report errors if the client is throttled.
+ if c.RetryAfterReader.After(time.Now()) {
+ mc.ThrottledCount()
+ rerr := retry.GetThrottlingError("LBBackendPoolGet", "client throttled", c.RetryAfterReader)
+ return network.BackendAddressPool{}, rerr
+ }
+
+ result, rerr := c.getLBBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolName, expand)
+ mc.Observe(rerr)
+ if rerr != nil {
+ if rerr.IsThrottled() {
+ // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires.
+ c.RetryAfterReader = rerr.RetryAfter
+ }
+
+ return result, rerr
+ }
+
+ return result, nil
+}
+
+// getLBBackendPool gets a LoadBalancer backend pool.
+func (c *Client) getLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error) {
+ resourceID := armclient.GetChildResourceID(
+ c.subscriptionID,
+ resourceGroupName,
+ lbResourceType,
+ loadBalancerName,
+ "backendAddressPools",
+ backendPoolName,
+ )
+ result := network.BackendAddressPool{}
+
+ response, rerr := c.armClient.GetResourceWithExpandQuery(ctx, resourceID, expand)
+ defer c.armClient.CloseResponse(ctx, response)
+ if rerr != nil {
+ klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.get.request", resourceID, rerr.Error())
+ return result, rerr
+ }
+
+ err := autorest.Respond(
+ response,
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result))
+ if err != nil {
+ klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.get.respond", resourceID, err)
+ return result, retry.GetError(response, err)
+ }
+
+ result.Response = autorest.Response{Response: response}
+ return result, nil
+}
+
// CreateOrUpdateBackendPools creates or updates a LoadBalancer backend pool.
func (c *Client) CreateOrUpdateBackendPools(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, parameters network.BackendAddressPool, etag string) *retry.Error {
mc := metrics.NewMetricContext("load_balancers", "create_or_update_backend_pools", resourceGroupName, c.subscriptionID, "")
@@ -470,14 +537,14 @@ func (c *Client) createOrUpdateLBBackendPool(ctx context.Context, resourceGroupN
response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...)
defer c.armClient.CloseResponse(ctx, response)
if rerr != nil {
- klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.put.request", resourceID, rerr.Error())
+ klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.put.request", resourceID, rerr.Error())
return rerr
}
if response != nil && response.StatusCode != http.StatusNoContent {
_, rerr = c.createOrUpdateBackendPoolResponder(response)
if rerr != nil {
- klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.put.respond", resourceID, rerr.Error())
+ klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.put.respond", resourceID, rerr.Error())
return rerr
}
}
@@ -537,3 +604,56 @@ func (c *Client) createOrUpdateBackendPoolResponder(resp *http.Response) (*netwo
result.Response = autorest.Response{Response: resp}
return result, retry.GetError(resp, err)
}
+
+// MigrateToIPBasedBackendPool migrates a NIC-based backend pool to IP-based.
+func (c *Client) MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolNames []string) *retry.Error {
+ mc := metrics.NewMetricContext("load_balancers", "migrate_to_ip_based_backend_pool", resourceGroupName, c.subscriptionID, "")
+
+ // Report errors if the client is rate limited.
+ if !c.rateLimiterWriter.TryAccept() {
+ mc.RateLimitedCount()
+ return retry.GetRateLimitError(true, "LBMigrateToIPBasedBackendPool")
+ }
+
+ // Report errors if the client is throttled.
+ if c.RetryAfterWriter.After(time.Now()) {
+ mc.ThrottledCount()
+ rerr := retry.GetThrottlingError("LBMigrateToIPBasedBackendPool", "client throttled", c.RetryAfterWriter)
+ return rerr
+ }
+
+ parameters := backendPoolsToBeMigrated{
+ BackendPoolNames: backendPoolNames,
+ }
+ rerr := c.migrateToIPBasedBackendPool(ctx, resourceGroupName, loadBalancerName, parameters)
+ mc.Observe(rerr)
+ if rerr != nil {
+ if rerr.IsThrottled() {
+ // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires.
+ c.RetryAfterWriter = rerr.RetryAfter
+ }
+
+ return rerr
+ }
+
+ return nil
+}
+
+func (c *Client) migrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters backendPoolsToBeMigrated) *retry.Error {
+ resourceID := armclient.GetResourceID(
+ c.subscriptionID,
+ resourceGroupName,
+ lbResourceType,
+ loadBalancerName,
+ )
+
+ response, rerr := c.armClient.PostResource(ctx, resourceID, "migrateToIpBased", parameters, map[string]interface{}{})
+ defer c.armClient.CloseResponse(ctx, response)
+ if rerr != nil {
+ klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.migrate.request", resourceID, rerr.Error())
+ return rerr
+ }
+
+ klog.Infof("Response: %v", response)
+ return nil
+}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go
index 7a1a88f7d..6f0feb22f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go
@@ -51,6 +51,12 @@ type Interface interface {
// Delete deletes a LoadBalancer by name.
Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) *retry.Error
+ // GetLBBackendPool gets a LoadBalancer backend pool.
+ GetLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error)
+
// DeleteLBBackendPool deletes a LoadBalancer backend pool by name.
DeleteLBBackendPool(ctx context.Context, resourceGroupName, loadBalancerName, backendPoolName string) *retry.Error
+
+ // MigrateToIPBasedBackendPool migrates a NIC-based backend pool to IP-based.
+ MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolNames []string) *retry.Error
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go
index 9397a9782..c32c8a230 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go
@@ -124,6 +124,21 @@ func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, loadBalancerNam
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, loadBalancerName, expand)
}
+// GetLBBackendPool mocks base method.
+func (m *MockInterface) GetLBBackendPool(ctx context.Context, resourceGroupName, loadBalancerName, backendPoolName, expand string) (network.BackendAddressPool, *retry.Error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetLBBackendPool", ctx, resourceGroupName, loadBalancerName, backendPoolName, expand)
+ ret0, _ := ret[0].(network.BackendAddressPool)
+ ret1, _ := ret[1].(*retry.Error)
+ return ret0, ret1
+}
+
+// GetLBBackendPool indicates an expected call of GetLBBackendPool.
+func (mr *MockInterfaceMockRecorder) GetLBBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolName, expand interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLBBackendPool", reflect.TypeOf((*MockInterface)(nil).GetLBBackendPool), ctx, resourceGroupName, loadBalancerName, backendPoolName, expand)
+}
+
// List mocks base method.
func (m *MockInterface) List(ctx context.Context, resourceGroupName string) ([]network.LoadBalancer, *retry.Error) {
m.ctrl.T.Helper()
@@ -138,3 +153,17 @@ func (mr *MockInterfaceMockRecorder) List(ctx, resourceGroupName interface{}) *g
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockInterface)(nil).List), ctx, resourceGroupName)
}
+
+// MigrateToIPBasedBackendPool mocks base method.
+func (m *MockInterface) MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName, loadBalancerName string, backendPoolNames []string) *retry.Error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "MigrateToIPBasedBackendPool", ctx, resourceGroupName, loadBalancerName, backendPoolNames)
+ ret0, _ := ret[0].(*retry.Error)
+ return ret0
+}
+
+// MigrateToIPBasedBackendPool indicates an expected call of MigrateToIPBasedBackendPool.
+func (mr *MockInterfaceMockRecorder) MigrateToIPBasedBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolNames interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateToIPBasedBackendPool", reflect.TypeOf((*MockInterface)(nil).MigrateToIPBasedBackendPool), ctx, resourceGroupName, loadBalancerName, backendPoolNames)
+}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go
index ddb58f4b4..f5c24bfa4 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go
index cfd1236d7..1cf0ead02 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/interface.go
@@ -19,7 +19,7 @@ package snapshotclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go
index b72f36ef2..b206f22e1 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/mocksnapshotclient/interface.go
@@ -25,7 +25,7 @@ import (
context "context"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
gomock "github.com/golang/mock/gomock"
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go
index 03f84acdf..2bb8ceafb 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/interface.go
index 4e303f16b..0206a204f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/interface.go
@@ -19,7 +19,7 @@ package vmasclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go
index eef92eed4..b429c6c9d 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go
index 20058fa98..c67de0c42 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go
@@ -19,7 +19,7 @@ package vmclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go
index 29845eec0..3384ce808 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go
@@ -25,7 +25,7 @@ import (
context "context"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/azure_vmsizeclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/azure_vmsizeclient.go
index b6da2d422..bf9510985 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/azure_vmsizeclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/azure_vmsizeclient.go
@@ -23,7 +23,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/interface.go
index 8c595d0f3..16f920713 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmsizeclient/interface.go
@@ -19,7 +19,7 @@ package vmsizeclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go
index 165c0b902..e24a435a2 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/interface.go
index 12f414e1c..c88e1ad06 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/interface.go
@@ -20,7 +20,7 @@ import (
"context"
"net/http"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/mockvmssclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/mockvmssclient/interface.go
index bba12610a..9cddb2d29 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/mockvmssclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/mockvmssclient/interface.go
@@ -26,7 +26,7 @@ import (
http "net/http"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go
index 8694022b7..6ab02bdce 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/interface.go
index 22ec029c1..352c3aa64 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/interface.go
@@ -19,7 +19,7 @@ package vmssvmclient
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/mockvmssvmclient/interface.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/mockvmssvmclient/interface.go
index 962c349f8..ae571b4c7 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/mockvmssvmclient/interface.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/mockvmssvmclient/interface.go
@@ -25,7 +25,7 @@ import (
context "context"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
retry "sigs.k8s.io/cloud-provider-azure/pkg/retry"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go
index 1f0b1b40f..286a950ff 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go
@@ -19,7 +19,6 @@ package consts
import (
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage"
)
@@ -128,8 +127,10 @@ const (
TagKeyValueDelimiter = "="
// VMSetNamesSharingPrimarySLBDelimiter is the delimiter of vmSet names sharing the primary SLB
VMSetNamesSharingPrimarySLBDelimiter = ","
- // PremiumV2_LRS type for Azure Disk
- PremiumV2LRS = compute.DiskStorageAccountTypes("PremiumV2_LRS")
+ // ProvisioningStateDeleting ...
+ ProvisioningStateDeleting = "Deleting"
+ // ProvisioningStateSucceeded ...
+ ProvisioningStateSucceeded = "Succeeded"
)
// cache
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go
index 0d08ece67..ec42a5bd8 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go
@@ -60,6 +60,16 @@ func IsLBRuleOnK8sServicePortDisabled(annotations map[string]string, port int32)
return expectAttributeInSvcAnnotationBeEqualTo(annotations, BuildAnnotationKeyForPort(port, PortAnnotationNoLBRule), TrueAnnotationValue), nil
}
+// IsPLSProxyProtocolEnabled return true if ServiceAnnotationPLSProxyProtocol is true
+func IsPLSProxyProtocolEnabled(annotations map[string]string) bool {
+ return expectAttributeInSvcAnnotationBeEqualTo(annotations, ServiceAnnotationPLSProxyProtocol, TrueAnnotationValue)
+}
+
+// IsPLSEnabled return true if ServiceAnnotationPLSCreation is true
+func IsPLSEnabled(annotations map[string]string) bool {
+ return expectAttributeInSvcAnnotationBeEqualTo(annotations, ServiceAnnotationPLSCreation, TrueAnnotationValue)
+}
+
// Getint32ValueFromK8sSvcAnnotation get health probe configuration for port
func Getint32ValueFromK8sSvcAnnotation(annotations map[string]string, key string, validators ...Int32BusinessValidator) (*int32, error) {
val, err := GetAttributeValueInSvcAnnotation(annotations, key)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go
index 2781c6a2c..077600e82 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go
@@ -63,17 +63,44 @@ type NodeProvider interface {
GetPlatformSubFaultDomain() (string, error)
}
-// labelReconcileInfo lists Node labels to reconcile, and how to reconcile them.
+// labelReconcile holds information about a label to reconcile and how to reconcile it.
// primaryKey and secondaryKey are keys of labels to reconcile.
// - If both keys exist, but their values don't match. Use the value from the
// primaryKey as the source of truth to reconcile.
// - If ensureSecondaryExists is true, and the secondaryKey does not
// exist, secondaryKey will be added with the value of the primaryKey.
-var labelReconcileInfo = []struct {
+type labelReconcile struct {
primaryKey string
secondaryKey string
ensureSecondaryExists bool
-}{}
+}
+
+// betaToplogyLabels lists beta topology labels that are deprecated and will
+// be removed in a future release.
+// For now we reconcile them optionally onto nodes.
+var betaToplogyLabels = []labelReconcile{
+ {
+ // Reconcile the beta and the GA zone label using the GA label as
+ // the source of truth
+ primaryKey: v1.LabelZoneFailureDomainStable,
+ secondaryKey: v1.LabelZoneFailureDomain,
+ ensureSecondaryExists: true,
+ },
+ {
+ // Reconcile the beta and the stable region label using the GA label as
+ // the source of truth
+ primaryKey: v1.LabelZoneRegionStable,
+ secondaryKey: v1.LabelZoneRegion,
+ ensureSecondaryExists: true,
+ },
+ {
+ // Reconcile the beta and the stable instance-type label using the GA label as
+ // the source of truth
+ primaryKey: v1.LabelInstanceTypeStable,
+ secondaryKey: v1.LabelInstanceType,
+ ensureSecondaryExists: true,
+ },
+}
// UpdateNodeSpecBackoff is the back configure for node update.
var UpdateNodeSpecBackoff = wait.Backoff{
@@ -103,6 +130,10 @@ type CloudNodeController struct {
recorder record.EventRecorder
nodeStatusUpdateFrequency time.Duration
+
+ labelReconcileInfo []labelReconcile
+
+ enableBetaTopologyLabels bool
}
// NewCloudNodeController creates a CloudNodeController object
@@ -112,7 +143,7 @@ func NewCloudNodeController(
kubeClient clientset.Interface,
nodeProvider NodeProvider,
nodeStatusUpdateFrequency time.Duration,
- waitForRoutes bool) *CloudNodeController {
+ waitForRoutes, enableBetaTopologyLabels bool) *CloudNodeController {
eventBroadcaster := record.NewBroadcaster()
recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "cloud-node-controller"})
@@ -132,6 +163,12 @@ func NewCloudNodeController(
nodeProvider: nodeProvider,
waitForRoutes: waitForRoutes,
nodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
+ enableBetaTopologyLabels: enableBetaTopologyLabels,
+ }
+
+ // Only reconcile the beta toplogy labels when the feature flag is enabled.
+ if cnc.enableBetaTopologyLabels {
+ cnc.labelReconcileInfo = append(cnc.labelReconcileInfo, betaToplogyLabels...)
}
// Use shared informer to listen to add/update of nodes. Note that any nodes
@@ -190,7 +227,7 @@ func (cnc *CloudNodeController) reconcileNodeLabels(node *v1.Node) error {
}
labelsToUpdate := map[string]string{}
- for _, r := range labelReconcileInfo {
+ for _, r := range cnc.labelReconcileInfo {
primaryValue, primaryExists := node.Labels[r.primaryKey]
secondaryValue, secondaryExists := node.Labels[r.secondaryKey]
@@ -445,53 +482,51 @@ func (cnc *CloudNodeController) getNodeModifiersFromCloudProvider(ctx context.Co
if instanceType, err := cnc.getInstanceTypeByName(ctx, node); err != nil {
return nil, err
} else if instanceType != "" {
- klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelInstanceTypeStable, instanceType)
- nodeModifiers = append(nodeModifiers, func(n *v1.Node) {
- if n.Labels == nil {
- n.Labels = map[string]string{}
- }
- n.Labels[v1.LabelInstanceTypeStable] = instanceType
- })
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelInstanceTypeStable, instanceType))
+ if cnc.enableBetaTopologyLabels {
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelInstanceType, instanceType))
+ }
}
+
zone, err := cnc.getZoneByName(ctx, node)
if err != nil {
return nil, fmt.Errorf("failed to get zone from cloud provider: %w", err)
}
if zone.FailureDomain != "" {
- klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelZoneFailureDomainStable, zone.FailureDomain)
- nodeModifiers = append(nodeModifiers, func(n *v1.Node) {
- if n.Labels == nil {
- n.Labels = map[string]string{}
- }
- n.Labels[v1.LabelZoneFailureDomainStable] = zone.FailureDomain
- })
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneFailureDomainStable, zone.FailureDomain))
+ if cnc.enableBetaTopologyLabels {
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneFailureDomain, zone.FailureDomain))
+ }
}
if zone.Region != "" {
- klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelZoneRegionStable, zone.Region)
- nodeModifiers = append(nodeModifiers, func(n *v1.Node) {
- if n.Labels == nil {
- n.Labels = map[string]string{}
- }
- n.Labels[v1.LabelZoneRegionStable] = zone.Region
- })
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneRegionStable, zone.Region))
+ if cnc.enableBetaTopologyLabels {
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneRegion, zone.Region))
+ }
}
+
platformSubFaultDomain, err := cnc.getPlatformSubFaultDomain()
if err != nil {
return nil, fmt.Errorf("failed to get platformSubFaultDomain: %w", err)
}
if platformSubFaultDomain != "" {
- klog.V(2).Infof("Adding node label from cloud provider: %s=%s", consts.LabelPlatformSubFaultDomain, platformSubFaultDomain)
- nodeModifiers = append(nodeModifiers, func(n *v1.Node) {
- if n.Labels == nil {
- n.Labels = map[string]string{}
- }
- n.Labels[consts.LabelPlatformSubFaultDomain] = platformSubFaultDomain
- })
+ nodeModifiers = append(nodeModifiers, addCloudNodeLabel(consts.LabelPlatformSubFaultDomain, platformSubFaultDomain))
}
return nodeModifiers, nil
}
+// addCloudNodeLabel creates a nodeModifier that adds a label to a node.
+func addCloudNodeLabel(key, value string) func(*v1.Node) {
+ klog.V(2).Infof("Adding node label from cloud provider: %s=%s", key, value)
+ return func(node *v1.Node) {
+ if node.Labels == nil {
+ node.Labels = map[string]string{}
+ }
+ node.Labels[key] = value
+ }
+}
+
func GetCloudTaint(taints []v1.Taint) *v1.Taint {
for _, taint := range taints {
taint := taint
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go
index 50c15f683..a572ad06d 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go
@@ -185,16 +185,6 @@ type Config struct {
// Use instance metadata service where possible
UseInstanceMetadata bool `json:"useInstanceMetadata,omitempty" yaml:"useInstanceMetadata,omitempty"`
- // EnableMultipleStandardLoadBalancers determines the behavior of the standard load balancer. If set to true
- // there would be one standard load balancer per VMAS or VMSS, which is similar with the behavior of the basic
- // load balancer. Users could select the specific standard load balancer for their service by the service
- // annotation `service.beta.kubernetes.io/azure-load-balancer-mode`, If set to false, the same standard load balancer
- // would be shared by all services in the cluster. In this case, the mode selection annotation would be ignored.
- EnableMultipleStandardLoadBalancers bool `json:"enableMultipleStandardLoadBalancers,omitempty" yaml:"enableMultipleStandardLoadBalancers,omitempty"`
- // NodePoolsWithoutDedicatedSLB stores the VMAS/VMSS names that share the primary standard load balancer instead
- // of having a dedicated one. This is useful only when EnableMultipleStandardLoadBalancers is set to true.
- NodePoolsWithoutDedicatedSLB string `json:"nodePoolsWithoutDedicatedSLB,omitempty" yaml:"nodePoolsWithoutDedicatedSLB,omitempty"`
-
// Backoff exponent
CloudProviderBackoffExponent float64 `json:"cloudProviderBackoffExponent,omitempty" yaml:"cloudProviderBackoffExponent,omitempty"`
// Backoff jitter
@@ -259,6 +249,12 @@ type Config struct {
PutVMSSVMBatchSize int `json:"putVMSSVMBatchSize" yaml:"putVMSSVMBatchSize"`
// PrivateLinkServiceResourceGroup determines the specific resource group of the private link services user want to use
PrivateLinkServiceResourceGroup string `json:"privateLinkServiceResourceGroup,omitempty" yaml:"privateLinkServiceResourceGroup,omitempty"`
+
+ // EnableMigrateToIPBasedBackendPoolAPI uses the migration API to migrate from NIC-based to IP-based backend pool.
+ // The migration API can provide a migration from NIC-based to IP-based backend pool without service downtime.
+ // If the API is not used, the migration will be done by decoupling all nodes on the backend pool and then re-attaching
+ // node IPs, which will introduce service downtime. The downtime increases with the number of nodes in the backend pool.
+ EnableMigrateToIPBasedBackendPoolAPI bool `json:"enableMigrateToIPBasedBackendPoolAPI" yaml:"enableMigrateToIPBasedBackendPoolAPI"`
}
type InitSecretConfig struct {
@@ -320,8 +316,6 @@ type Cloud struct {
// ipv6DualStack allows overriding for unit testing. It's normally initialized from featuregates
ipv6DualStackEnabled bool
- // isSHaredLoadBalancerSynced indicates if the reconcileSharedLoadBalancer has been run
- isSharedLoadBalancerSynced bool
// Lock for access to node caches, includes nodeZones, nodeResourceGroups, and unmanagedNodes.
nodeCachesLock sync.RWMutex
// nodeNames holds current nodes for tracking added nodes in VM caches.
@@ -1083,7 +1077,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
az.nodeNames.Delete(prevNode.ObjectMeta.Name)
// Remove from nodeZones cache.
- prevZone, ok := prevNode.ObjectMeta.Labels[consts.LabelFailureDomainBetaZone]
+ prevZone, ok := prevNode.ObjectMeta.Labels[v1.LabelTopologyZone]
if ok && az.isAvailabilityZone(prevZone) {
az.nodeZones[prevZone].Delete(prevNode.ObjectMeta.Name)
if az.nodeZones[prevZone].Len() == 0 {
@@ -1125,7 +1119,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) {
az.nodeNames.Insert(newNode.ObjectMeta.Name)
// Add to nodeZones cache.
- newZone, ok := newNode.ObjectMeta.Labels[consts.LabelFailureDomainBetaZone]
+ newZone, ok := newNode.ObjectMeta.Labels[v1.LabelTopologyZone]
if ok && az.isAvailabilityZone(newZone) {
if az.nodeZones[newZone] == nil {
az.nodeZones[newZone] = sets.New[string]()
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go
index f855be538..c351c1054 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go
@@ -17,14 +17,16 @@ limitations under the License.
package provider
import (
+ "context"
"encoding/json"
"errors"
"fmt"
"net/http"
"regexp"
"strings"
+ "time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
v1 "k8s.io/api/core/v1"
@@ -652,3 +654,54 @@ func (az *Cloud) CreateOrUpdateSubnet(service *v1.Service, subnet network.Subnet
return nil
}
+
+// MigrateToIPBasedBackendPoolAndWaitForCompletion use the migration API to migrate from
+// NIC-based to IP-based LB backend pools. It also makes sure the number of IP addresses
+// in the backend pools is expected.
+func (az *Cloud) MigrateToIPBasedBackendPoolAndWaitForCompletion(
+ lbName string, backendPoolNames []string, nicsCountMap map[string]int,
+) error {
+ if rerr := az.LoadBalancerClient.MigrateToIPBasedBackendPool(context.Background(), az.ResourceGroup, lbName, backendPoolNames); rerr != nil {
+ backendPoolNamesStr := strings.Join(backendPoolNames, ",")
+ klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to migrate to IP based backend pool for lb %s, backend pool %s: %s", lbName, backendPoolNamesStr, rerr.Error().Error())
+ return rerr.Error()
+ }
+
+ succeeded := make(map[string]bool)
+ for bpName := range nicsCountMap {
+ succeeded[bpName] = false
+ }
+
+ err := wait.PollImmediate(5*time.Second, 10*time.Minute, func() (done bool, err error) {
+ for bpName, nicsCount := range nicsCountMap {
+ if succeeded[bpName] {
+ continue
+ }
+
+ bp, rerr := az.LoadBalancerClient.GetLBBackendPool(context.Background(), az.ResourceGroup, lbName, bpName, "")
+ if rerr != nil {
+ klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to get backend pool %s for lb %s: %s", bpName, lbName, rerr.Error().Error())
+ return false, rerr.Error()
+ }
+
+ if countIPsOnBackendPool(bp) != nicsCount {
+ klog.V(4).Infof("MigrateToIPBasedBackendPoolAndWaitForCompletion: Expected IPs %s, current IPs %d, will retry in 5s", nicsCount, countIPsOnBackendPool(bp))
+ return false, nil
+ }
+ succeeded[bpName] = true
+ }
+ return true, nil
+ })
+
+ if err != nil {
+ if errors.Is(err, wait.ErrWaitTimeout) {
+ klog.Warningf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Timeout waiting for migration to IP based backend pool for lb %s, backend pool %s", lbName, strings.Join(backendPoolNames, ","))
+ return nil
+ }
+
+ klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to wait for migration to IP based backend pool for lb %s, backend pool %s: %s", lbName, strings.Join(backendPoolNames, ","), err.Error())
+ return err
+ }
+
+ return nil
+}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go
index 3d9cb4007..59705bac9 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go
@@ -27,7 +27,7 @@ import (
"sync"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"k8s.io/apimachinery/pkg/types"
@@ -724,14 +724,15 @@ func vmUpdateRequired(future *azure.Future, err error) bool {
return configAccepted(future) && errCode == consts.OperationPreemptedErrorCode
}
-func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourceType string) (compute.CreationData, error) {
- if sourceResourceID == "" {
+func getValidCreationData(subscriptionID, resourceGroup string, options *ManagedDiskOptions) (compute.CreationData, error) {
+ if options.SourceResourceID == "" {
return compute.CreationData{
CreateOption: compute.Empty,
}, nil
}
- switch sourceType {
+ sourceResourceID := options.SourceResourceID
+ switch options.SourceType {
case sourceSnapshot:
if match := diskSnapshotPathRE.FindString(sourceResourceID); match == "" {
sourceResourceID = fmt.Sprintf(diskSnapshotPath, subscriptionID, resourceGroup, sourceResourceID)
@@ -749,7 +750,7 @@ func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourc
splits := strings.Split(sourceResourceID, "/")
if len(splits) > 9 {
- if sourceType == sourceSnapshot {
+ if options.SourceType == sourceSnapshot {
return compute.CreationData{}, fmt.Errorf("sourceResourceID(%s) is invalid, correct format: %s", sourceResourceID, diskSnapshotPathRE)
}
return compute.CreationData{}, fmt.Errorf("sourceResourceID(%s) is invalid, correct format: %s", sourceResourceID, managedDiskPathRE)
@@ -757,6 +758,7 @@ func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourc
return compute.CreationData{
CreateOption: compute.Copy,
SourceResourceID: &sourceResourceID,
+ PerformancePlus: options.PerformancePlus,
}, nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go
index 6d760f562..3a494ecdf 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go
@@ -22,7 +22,7 @@ import (
"net/http"
"strings"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"k8s.io/apimachinery/pkg/types"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go
index 7240784ca..2a2e2c227 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go
@@ -22,7 +22,7 @@ import (
"net/http"
"strings"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"k8s.io/apimachinery/pkg/types"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go
index d3dd62592..e3ad7a9b7 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go
@@ -23,7 +23,7 @@ import (
"strings"
"sync"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/go-autorest/autorest/azure"
"k8s.io/apimachinery/pkg/types"
"k8s.io/klog/v2"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instances.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instances.go
index 6a95eee05..8b1e54ed4 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instances.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instances.go
@@ -28,8 +28,6 @@ import (
cloudprovider "k8s.io/cloud-provider"
"k8s.io/klog/v2"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
-
azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache"
"sigs.k8s.io/cloud-provider-azure/pkg/consts"
)
@@ -287,7 +285,7 @@ func (az *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID st
klog.V(3).Infof("InstanceShutdownByProviderID gets provisioning state %q for node %q", provisioningState, nodeName)
status := strings.ToLower(powerStatus)
- provisioningSucceeded := strings.EqualFold(strings.ToLower(provisioningState), strings.ToLower(string(compute.ProvisioningStateSucceeded)))
+ provisioningSucceeded := strings.EqualFold(strings.ToLower(provisioningState), strings.ToLower(string(consts.ProvisioningStateSucceeded)))
return provisioningSucceeded && (status == vmPowerStateStopped || status == vmPowerStateDeallocated || status == vmPowerStateDeallocating), nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go
index 60ee2ffac..663fb0d45 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go
@@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"math"
+ "net"
"net/netip"
"reflect"
"sort"
@@ -120,6 +121,9 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi
return nil, err
}
+ resourceBaseName := az.GetLoadBalancerName(context.TODO(), "", service)
+ klog.V(2).Infof("reconcileService: Start reconciling Service %q with its resource basename %q", serviceName, resourceBaseName)
+
lbStatus, fipConfig, err := az.getServiceLoadBalancerStatus(service, lb)
if err != nil {
klog.Errorf("getServiceLoadBalancerStatus(%s) failed: %v", serviceName, err)
@@ -332,8 +336,7 @@ func (az *Cloud) shouldChangeLoadBalancer(service *v1.Service, currLBName, clust
}
// if using the single standard load balancer, the current LB should be kept
- useSingleSLB := az.useStandardLoadBalancer() && !az.EnableMultipleStandardLoadBalancers
- if useSingleSLB {
+ if az.useStandardLoadBalancer() {
return false
}
@@ -351,15 +354,6 @@ func (az *Cloud) shouldChangeLoadBalancer(service *v1.Service, currLBName, clust
return false
}
- // if the vmSet selected by the annotation is sharing the primary slb, and the service
- // has been associated to the primary slb, keep it
- useMultipleSLBs := az.useStandardLoadBalancer() && az.EnableMultipleStandardLoadBalancers
- if useMultipleSLBs &&
- az.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmSetName)) &&
- strings.EqualFold(lbName, clusterName) {
- return false
- }
-
// if the VMSS/VMAS of the current LB is different from the mode, change the LB
// to another one
klog.V(2).Infof("shouldChangeLoadBalancer(%s, %s, %s): change the LB to another one", service.Name, currLBName, clusterName)
@@ -429,10 +423,9 @@ func (az *Cloud) cleanOrphanedLoadBalancer(lb *network.LoadBalancer, existingLBs
lbName := pointer.StringDeref(lb.Name, "")
serviceName := getServiceName(service)
isBackendPoolPreConfigured := az.isBackendPoolPreConfigured(service)
- lbResourceGroup := az.getLoadBalancerResourceGroup()
isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP)
lbBackendPoolName := getBackendPoolName(clusterName, isIPv6)
- lbBackendPoolID := az.getBackendPoolID(lbName, lbResourceGroup, lbBackendPoolName)
+ lbBackendPoolID := az.getBackendPoolID(lbName, lbBackendPoolName)
if isBackendPoolPreConfigured {
klog.V(2).Infof("cleanOrphanedLoadBalancer(%s, %s, %s): ignore cleanup of dirty lb because the lb is pre-configured", lbName, serviceName, clusterName)
} else {
@@ -504,7 +497,7 @@ func (az *Cloud) cleanOrphanedLoadBalancer(lb *network.LoadBalancer, existingLBs
// safeDeleteLoadBalancer deletes the load balancer after decoupling it from the vmSet
func (az *Cloud) safeDeleteLoadBalancer(lb network.LoadBalancer, clusterName, vmSetName string, service *v1.Service) *retry.Error {
isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP)
- lbBackendPoolID := az.getBackendPoolID(pointer.StringDeref(lb.Name, ""), az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, isIPv6))
+ lbBackendPoolID := az.getBackendPoolID(pointer.StringDeref(lb.Name, ""), getBackendPoolName(clusterName, isIPv6))
_, err := az.VMSet.EnsureBackendPoolDeleted(service, []string{lbBackendPoolID}, vmSetName, lb.BackendAddressPools, true)
if err != nil {
return retry.NewError(false, fmt.Errorf("safeDeleteLoadBalancer: failed to EnsureBackendPoolDeleted: %w", err))
@@ -520,91 +513,6 @@ func (az *Cloud) safeDeleteLoadBalancer(lb network.LoadBalancer, clusterName, vm
return nil
}
-// reconcileSharedLoadBalancer deletes the dedicated SLBs of the non-primary vmSets. There are
-// two scenarios where this operation is needed:
-// 1. Using multiple slbs and the vmSet is supposed to share the primary slb.
-// 2. When migrating from multiple slbs to single slb mode.
-// It also ensures those vmSets are joint the backend pools of the primary SLBs.
-// It runs only once every time the cloud controller manager restarts.
-func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName string, nodes []*v1.Node) ([]network.LoadBalancer, error) {
- var (
- existingLBs []network.LoadBalancer
- err error
- )
-
- existingLBs, err = az.ListManagedLBs(service, nodes, clusterName)
- if err != nil {
- return nil, fmt.Errorf("reconcileSharedLoadBalancer: failed to list managed LB: %w", err)
- }
-
- // only run once since the controller manager rebooted
- if az.isSharedLoadBalancerSynced {
- return existingLBs, nil
- }
- defer func() {
- if err == nil {
- az.isSharedLoadBalancerSynced = true
- }
- }()
-
- // skip if the cluster is using basic LB
- if !az.useStandardLoadBalancer() {
- return existingLBs, nil
- }
-
- // Skip if nodes is nil, which means the service is being deleted.
- // When nodes is nil, all LBs included unmanaged LBs will be returned,
- // if we don't skip this function, the unmanaged ones may be deleted later.
- if nodes == nil {
- klog.V(4).Infof("reconcileSharedLoadBalancer: returning early because the service %s is being deleted", service.Name)
- return existingLBs, nil
- }
-
- lbNamesToBeDeleted := sets.New[string]()
- // delete unwanted LBs
- for _, lb := range existingLBs {
- klog.V(4).Infof("reconcileSharedLoadBalancer: checking LB %s", pointer.StringDeref(lb.Name, ""))
- // skip the internal or external primary load balancer
- lbNamePrefix := strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix)
- if strings.EqualFold(lbNamePrefix, clusterName) {
- continue
- }
-
- // skip if the multiple slbs mode is enabled and
- // the vmSet is supposed to have dedicated SLBs
- vmSetName := strings.ToLower(az.mapLoadBalancerNameToVMSet(pointer.StringDeref(lb.Name, ""), clusterName))
- if az.EnableMultipleStandardLoadBalancers && !az.getVMSetNamesSharingPrimarySLB().Has(vmSetName) {
- klog.V(4).Infof("reconcileSharedLoadBalancer: skip deleting the LB %s because the vmSet %s needs a dedicated SLB", pointer.StringDeref(lb.Name, ""), vmSetName)
- continue
- }
-
- // For non-primary load balancer, the lb name is the name of the VMSet.
- // If the VMSet name is in az.NodePoolsWithoutDedicatedSLB, we should
- // decouple the VMSet from the lb and delete the lb. Then adding the VMSet
- // to the backend pool of the primary slb.
- klog.V(2).Infof("reconcileSharedLoadBalancer: deleting LB %s because the corresponding vmSet is supposed to be in the primary SLB", pointer.StringDeref(lb.Name, ""))
- rerr := az.safeDeleteLoadBalancer(lb, clusterName, vmSetName, service)
- if rerr != nil {
- return nil, rerr.Error()
- }
-
- // remove the deleted lb from the list and construct a new primary
- // lb, so that getServiceLoadBalancer doesn't have to call list api again
- lbNamesToBeDeleted.Insert(strings.ToLower(pointer.StringDeref(lb.Name, "")))
- }
-
- for i := len(existingLBs) - 1; i >= 0; i-- {
- lb := existingLBs[i]
- if !lbNamesToBeDeleted.Has(strings.ToLower(pointer.StringDeref(lb.Name, ""))) {
- continue
- }
- // remove the deleted LB from the list
- existingLBs = append(existingLBs[:i], existingLBs[i+1:]...)
- }
-
- return existingLBs, nil
-}
-
// getServiceLoadBalancer gets the loadbalancer for the service if it already exists.
// If wantLb is TRUE then -it selects a new load balancer.
// In case the selected load balancer does not exist it returns network.LoadBalancer struct
@@ -615,7 +523,6 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
var defaultLB *network.LoadBalancer
primaryVMSetName := az.VMSet.GetPrimaryVMSetName()
defaultLBName := az.getAzureLoadBalancerName(clusterName, primaryVMSetName, isInternal)
- useMultipleSLBs := az.useStandardLoadBalancer() && az.EnableMultipleStandardLoadBalancers
// reuse the lb list from reconcileSharedLoadBalancer to reduce the api call
if len(existingLBs) == 0 {
@@ -628,32 +535,7 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
// check if the service already has a load balancer
for i := range existingLBs {
existingLB := existingLBs[i]
- existingLBNamePrefix := strings.TrimSuffix(pointer.StringDeref(existingLB.Name, ""), consts.InternalLoadBalancerNameSuffix)
-
- // for the primary standard load balancer (internal or external), when enabled multiple slbs
- if strings.EqualFold(existingLBNamePrefix, clusterName) && useMultipleSLBs {
- shouldRemoveVMSetFromSLB := func(vmSetName string) bool {
- // not removing the vmSet from the primary SLB
- // if it is supposed to share the primary SLB.
- if az.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmSetName)) {
- return false
- }
- // removing the vmSet from the primary SLB if
- // it is not the primary vmSet. There are two situations:
- // 1. when migrating from single SLB to multiple SLBs, we
- // need to remove all non-primary vmSets from the primary SLB;
- // 2. when migrating from shared mode to dedicated SLB, we
- // need to remove the specific vmSet from the primary SLB.
- return !strings.EqualFold(vmSetName, primaryVMSetName) && vmSetName != ""
- }
- cleanedLB, err := az.LoadBalancerBackendPool.CleanupVMSetFromBackendPoolByCondition(&existingLB, service, nodes, clusterName, shouldRemoveVMSetFromSLB)
- if err != nil {
- return nil, nil, false, err
- }
- existingLB = *cleanedLB
- existingLBs[i] = *cleanedLB
- }
if strings.EqualFold(*existingLB.Name, defaultLBName) {
defaultLB = &existingLB
}
@@ -687,8 +569,7 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
// Service does not have a load balancer, select one.
// Single standard load balancer doesn't need this because
// all backends nodes should be added to same LB.
- useSingleSLB := az.useStandardLoadBalancer() && !az.EnableMultipleStandardLoadBalancers
- if wantLb && !useSingleSLB {
+ if wantLb && !az.useStandardLoadBalancer() {
// select new load balancer for service
selectedLB, exists, err := az.selectLoadBalancer(clusterName, service, &existingLBs, nodes)
if err != nil {
@@ -808,10 +689,7 @@ func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.L
serviceName := getServiceName(service)
for _, ipConfiguration := range *lb.FrontendIPConfigurations {
ipConfiguration := ipConfiguration
- owns, isPrimaryService, err := az.serviceOwnsFrontendIP(ipConfiguration, service)
- if err != nil {
- return nil, nil, fmt.Errorf("get(%s): lb(%s) - failed to filter frontend IP configs with error: %w", serviceName, pointer.StringDeref(lb.Name, ""), err)
- }
+ owns, isPrimaryService, _ := az.serviceOwnsFrontendIP(ipConfiguration, service)
if owns {
klog.V(2).Infof("get(%s): lb(%s) - found frontend IP config, primary service: %v", serviceName, pointer.StringDeref(lb.Name, ""), isPrimaryService)
@@ -869,7 +747,7 @@ func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service,
pipResourceGroup := az.getPublicIPAddressResourceGroup(service)
if id := getServicePIPPrefixID(service, isIPv6); id != "" {
- pipName, err := az.getPublicIPName(clusterName, service, pipResourceGroup, isIPv6)
+ pipName, err := az.getPublicIPName(clusterName, service, isIPv6)
return pipName, false, err
}
@@ -878,7 +756,7 @@ func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service,
// Assume that the service without loadBalancerIP set is a primary service.
// If a secondary service doesn't set the loadBalancerIP, it is not allowed to share the IP.
if len(loadBalancerIP) == 0 {
- pipName, err := az.getPublicIPName(clusterName, service, pipResourceGroup, isIPv6)
+ pipName, err := az.getPublicIPName(clusterName, service, isIPv6)
return pipName, false, err
}
@@ -896,38 +774,37 @@ func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service,
return "", false, fmt.Errorf("user supplied IP Address %s was not found in resource group %s", loadBalancerIP, pipResourceGroup)
}
-// findMatchedPIPByIPFamilyAndServiceName is for IPv6. It tries to find a matching PIP whose name doesn't have IPv6 suffix.
-// Such PIP comes from old CCM without dual-stack support.
-func (az *Cloud) findMatchedPIPByIPFamilyAndServiceName(clusterName string, service *v1.Service, pipResourceGroup string) (*network.PublicIPAddress, error) {
- pips, err := az.listPIP(pipResourceGroup)
+func (az *Cloud) findMatchedPIPByLoadBalancerIP(service *v1.Service, loadBalancerIP, pipResourceGroup string) (*network.PublicIPAddress, error) {
+ pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault)
if err != nil {
- return nil, fmt.Errorf("findMatchedPIPByIPFamilyAndServiceName: failed to listPIP: %w", err)
+ return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP: %w", err)
}
- baseName := az.GetLoadBalancerName(context.TODO(), clusterName, service)
- for _, pip := range pips {
- pip := pip
- if pointer.StringDeref(pip.Name, "") == baseName && pip.PublicIPAddressPropertiesFormat != nil &&
- pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv6 {
- return &pip, nil
+
+ pip, err := getExpectedPIPFromListByIPAddress(pips, loadBalancerIP)
+ if err != nil {
+ pips, err = az.listPIP(pipResourceGroup, azcache.CacheReadTypeForceRefresh)
+ if err != nil {
+ return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP force refresh: %w", err)
+ }
+
+ pip, err = getExpectedPIPFromListByIPAddress(pips, loadBalancerIP)
+ if err != nil {
+ return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: cannot find public IP with IP address %s in resource group %s", loadBalancerIP, pipResourceGroup)
}
}
- return nil, nil
+
+ return pip, nil
}
-func (az *Cloud) findMatchedPIPByLoadBalancerIP(service *v1.Service, loadBalancerIP, pipResourceGroup string) (*network.PublicIPAddress, error) {
- pips, err := az.listPIP(pipResourceGroup)
- if err != nil {
- return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP: %w", err)
- }
+func getExpectedPIPFromListByIPAddress(pips []network.PublicIPAddress, ip string) (*network.PublicIPAddress, error) {
for _, pip := range pips {
- pip := pip
if pip.PublicIPAddressPropertiesFormat.IPAddress != nil &&
- *pip.PublicIPAddressPropertiesFormat.IPAddress == loadBalancerIP {
+ *pip.PublicIPAddressPropertiesFormat.IPAddress == ip {
return &pip, nil
}
}
- return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: cannot find public IP with IP address %s in resource group %s", loadBalancerIP, pipResourceGroup)
+ return nil, fmt.Errorf("getExpectedPIPFromListByIPAddress: cannot find public IP with IP address %s", ip)
}
func flipServiceInternalAnnotation(service *v1.Service) *v1.Service {
@@ -1098,7 +975,7 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai
}
if foundDNSLabelAnnotation {
- updatedDNSSettings, err := reconcileDNSSettings(&pip, domainNameLabel, serviceName, pipName)
+ updatedDNSSettings, err := reconcileDNSSettings(&pip, domainNameLabel, serviceName, pipName, isUserAssignedPIP)
if err != nil {
return nil, fmt.Errorf("ensurePublicIPExists for service(%s): failed to reconcileDNSSettings: %w", serviceName, err)
}
@@ -1167,7 +1044,11 @@ func (az *Cloud) reconcileIPSettings(pip *network.PublicIPAddress, service *v1.S
return changed
}
-func reconcileDNSSettings(pip *network.PublicIPAddress, domainNameLabel, serviceName, pipName string) (bool, error) {
+func reconcileDNSSettings(
+ pip *network.PublicIPAddress,
+ domainNameLabel, serviceName, pipName string,
+ isUserAssignedPIP bool,
+) (bool, error) {
var changed bool
if existingServiceName := getServiceFromPIPDNSTags(pip.Tags); existingServiceName != "" && !strings.EqualFold(existingServiceName, serviceName) {
@@ -1196,8 +1077,10 @@ func reconcileDNSSettings(pip *network.PublicIPAddress, domainNameLabel, service
}
if svc := getServiceFromPIPDNSTags(pip.Tags); svc == "" || !strings.EqualFold(svc, serviceName) {
- pip.Tags[consts.ServiceUsingDNSKey] = &serviceName
- changed = true
+ if !isUserAssignedPIP {
+ pip.Tags[consts.ServiceUsingDNSKey] = &serviceName
+ changed = true
+ }
}
}
@@ -1345,30 +1228,39 @@ func getDomainNameLabel(pip *network.PublicIPAddress) string {
return pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.DNSSettings.DomainNameLabel, "")
}
-func (az *Cloud) isFrontendIPChanged(clusterName string, config network.FrontendIPConfiguration, service *v1.Service, lbFrontendIPConfigName string) (bool, error) {
- isServiceOwnsFrontendIP, isPrimaryService, err := az.serviceOwnsFrontendIP(config, service)
- if err != nil {
- return false, err
- }
+// subnet is reused to reduce API calls when dualstack.
+func (az *Cloud) isFrontendIPChanged(
+ clusterName string,
+ config network.FrontendIPConfiguration,
+ service *v1.Service,
+ lbFrontendIPConfigName string,
+ subnet *network.Subnet,
+) (bool, error) {
+ isServiceOwnsFrontendIP, isPrimaryService, fipIPVersion := az.serviceOwnsFrontendIP(config, service)
if isServiceOwnsFrontendIP && isPrimaryService && !strings.EqualFold(pointer.StringDeref(config.Name, ""), lbFrontendIPConfigName) {
return true, nil
}
if !strings.EqualFold(pointer.StringDeref(config.Name, ""), lbFrontendIPConfigName) {
return false, nil
}
- isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP)
+ pipRG := az.getPublicIPAddressResourceGroup(service)
+ var isIPv6 bool
+ var err error
+ if fipIPVersion != "" {
+ isIPv6 = fipIPVersion == network.IPv6
+ } else {
+ if isIPv6, err = az.isFIPIPv6(service, pipRG, &config); err != nil {
+ return false, err
+ }
+ }
loadBalancerIP := getServiceLoadBalancerIP(service, isIPv6)
isInternal := requiresInternalLoadBalancer(service)
if isInternal {
// Judge subnet
- subnetName := subnet(service)
+ subnetName := getInternalSubnet(service)
if subnetName != nil {
- subnet, existsSubnet, err := az.getSubnet(az.VnetName, *subnetName)
- if err != nil {
- return false, err
- }
- if !existsSubnet {
- return false, fmt.Errorf("failed to get subnet")
+ if subnet == nil {
+ return false, fmt.Errorf("isFrontendIPChanged: Unexpected nil subnet")
}
if config.Subnet != nil && !strings.EqualFold(pointer.StringDeref(config.Subnet.ID, ""), pointer.StringDeref(subnet.ID, "")) {
return true, nil
@@ -1380,8 +1272,7 @@ func (az *Cloud) isFrontendIPChanged(clusterName string, config network.Frontend
if err != nil {
return false, err
}
- pipResourceGroup := az.getPublicIPAddressResourceGroup(service)
- pip, existsPip, err := az.getPublicIPAddress(pipResourceGroup, pipName, azcache.CacheReadTypeDefault)
+ pip, existsPip, err := az.getPublicIPAddress(pipRG, pipName, azcache.CacheReadTypeDefault)
if err != nil {
return false, err
}
@@ -1502,22 +1393,31 @@ func findMatchedOutboundRuleFIPConfig(fipConfigID *string, outboundRuleFIPConfig
return found
}
-func (az *Cloud) findFrontendIPConfigOfService(
+func (az *Cloud) findFrontendIPConfigsOfService(
fipConfigs *[]network.FrontendIPConfiguration,
service *v1.Service,
-) (*network.FrontendIPConfiguration, error) {
+) (map[bool]*network.FrontendIPConfiguration, error) {
+ fipsOfServiceMap := map[bool]*network.FrontendIPConfiguration{}
+ pipRG := az.getPublicIPAddressResourceGroup(service)
for _, config := range *fipConfigs {
config := config
- owns, _, err := az.serviceOwnsFrontendIP(config, service)
- if err != nil {
- return nil, err
- }
+ owns, _, fipIPVersion := az.serviceOwnsFrontendIP(config, service)
if owns {
- return &config, nil
+ var fipIsIPv6 bool
+ var err error
+ if fipIPVersion != "" {
+ fipIsIPv6 = fipIPVersion == network.IPv6
+ } else {
+ if fipIsIPv6, err = az.isFIPIPv6(service, pipRG, &config); err != nil {
+ return nil, err
+ }
+ }
+
+ fipsOfServiceMap[fipIsIPv6] = &config
}
}
- return nil, nil
+ return fipsOfServiceMap, nil
}
// reconcileLoadBalancer ensures load balancer exists and the frontend ip config is setup.
@@ -1529,10 +1429,9 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
serviceName := getServiceName(service)
klog.V(2).Infof("reconcileLoadBalancer for service(%s) - wantLb(%t): started", serviceName, wantLb)
- existingLBs, err := az.reconcileSharedLoadBalancer(service, clusterName, nodes)
+ existingLBs, err := az.ListManagedLBs(service, nodes, clusterName)
if err != nil {
- klog.Errorf("reconcileLoadBalancer: failed to reconcile shared load balancer: %v", err)
- return nil, err
+ return nil, fmt.Errorf("reconcileLoadBalancer: failed to list managed LB: %w", err)
}
lb, lbStatus, _, err := az.getServiceLoadBalancer(service, clusterName, nodes, wantLb, existingLBs)
@@ -1543,16 +1442,19 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
lbName := *lb.Name
lbResourceGroup := az.getLoadBalancerResourceGroup()
- isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP)
- lbBackendPoolID := az.getBackendPoolID(lbName, az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, isIPv6))
- klog.V(2).Infof("reconcileLoadBalancer for service(%s): lb(%s/%s) wantLb(%t) resolved load balancer name", serviceName, lbResourceGroup, lbName, wantLb)
- defaultLBFrontendIPConfigName := az.getDefaultFrontendIPConfigName(service)
- defaultLBFrontendIPConfigID := az.getFrontendIPConfigID(lbName, lbResourceGroup, defaultLBFrontendIPConfigName)
+ lbBackendPoolIDs := az.getBackendPoolIDs(clusterName, lbName)
+ klog.V(2).Infof("reconcileLoadBalancer for service(%s): lb(%s/%s) wantLb(%t) resolved load balancer name",
+ serviceName, lbResourceGroup, lbName, wantLb)
+ lbFrontendIPConfigNames := az.getFrontendIPConfigNames(service)
+ lbFrontendIPConfigIDs := map[bool]string{
+ false: az.getFrontendIPConfigID(lbName, lbFrontendIPConfigNames[false]),
+ true: az.getFrontendIPConfigID(lbName, lbFrontendIPConfigNames[true]),
+ }
dirtyLb := false
// reconcile the load balancer's backend pool configuration.
if wantLb {
- preConfig, changed, err := az.LoadBalancerBackendPool.ReconcileBackendPools(clusterName, service, lb)
+ preConfig, changed, shouldRefreshLB, err := az.LoadBalancerBackendPool.ReconcileBackendPools(clusterName, service, lb)
if err != nil {
return lb, err
}
@@ -1560,10 +1462,20 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
dirtyLb = true
}
isBackendPoolPreConfigured = preConfig
+
+ // If the LB is changed, refresh it to avoid etag mismatch error
+ // later when create or update the LB.
+ if shouldRefreshLB {
+ klog.V(4).Infof("reconcileLoadBalancer for service(%s): refreshing load balancer %s", serviceName, lbName)
+ lb, _, err = az.getAzureLoadBalancer(lbName, azcache.CacheReadTypeForceRefresh)
+ if err != nil {
+ return lb, fmt.Errorf("reconcileLoadBalancer for service (%s): failed to get load balancer %s: %w", serviceName, lbName, err)
+ }
+ }
}
// reconcile the load balancer's frontend IP configurations.
- ownedFIPConfig, toDeleteConfigs, changed, err := az.reconcileFrontendIPConfigs(clusterName, service, lb, lbStatus, wantLb, defaultLBFrontendIPConfigName)
+ ownedFIPConfigs, toDeleteConfigs, changed, err := az.reconcileFrontendIPConfigs(clusterName, service, lb, lbStatus, wantLb, lbFrontendIPConfigNames)
if err != nil {
return lb, err
}
@@ -1572,26 +1484,53 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
}
// update probes/rules
- if ownedFIPConfig != nil {
- if ownedFIPConfig.ID != nil {
- defaultLBFrontendIPConfigID = *ownedFIPConfig.ID
- } else {
+ pipRG := az.getPublicIPAddressResourceGroup(service)
+ for _, ownedFIPConfig := range ownedFIPConfigs {
+ if ownedFIPConfig == nil {
+ continue
+ }
+ if ownedFIPConfig.ID == nil {
return nil, fmt.Errorf("reconcileLoadBalancer for service (%s)(%t): nil ID for frontend IP config", serviceName, wantLb)
}
- }
- if wantLb {
- err = az.checkLoadBalancerResourcesConflicts(lb, defaultLBFrontendIPConfigID, service)
- if err != nil {
- return nil, err
+ var isIPv6 bool
+ var err error
+ _, _, fipIPVersion := az.serviceOwnsFrontendIP(*ownedFIPConfig, service)
+ if fipIPVersion != "" {
+ isIPv6 = fipIPVersion == network.IPv6
+ } else {
+ if isIPv6, err = az.isFIPIPv6(service, pipRG, ownedFIPConfig); err != nil {
+ return nil, err
+ }
}
+ lbFrontendIPConfigIDs[isIPv6] = *ownedFIPConfig.ID
}
var expectedProbes []network.Probe
var expectedRules []network.LoadBalancingRule
- if wantLb {
- expectedProbes, expectedRules, err = az.getExpectedLBRules(service, defaultLBFrontendIPConfigID, lbBackendPoolID, lbName)
+ getExpectedLBRule := func(isIPv6 bool) error {
+ expectedProbesSingleStack, expectedRulesSingleStack, err := az.getExpectedLBRules(service, lbFrontendIPConfigIDs[isIPv6], lbBackendPoolIDs[isIPv6], lbName, isIPv6)
if err != nil {
+ return err
+ }
+ expectedProbes = append(expectedProbes, expectedProbesSingleStack...)
+ expectedRules = append(expectedRules, expectedRulesSingleStack...)
+ return nil
+ }
+ v4Enabled, v6Enabled := getIPFamiliesEnabled(service)
+ if wantLb && v4Enabled {
+ if err = az.checkLoadBalancerResourcesConflicts(lb, lbFrontendIPConfigIDs[false], service); err != nil {
+ return nil, err
+ }
+ if err := getExpectedLBRule(false); err != nil {
+ return nil, err
+ }
+ }
+ if wantLb && v6Enabled {
+ if err = az.checkLoadBalancerResourcesConflicts(lb, lbFrontendIPConfigIDs[true], service); err != nil {
+ return nil, err
+ }
+ if err := getExpectedLBRule(true); err != nil {
return nil, err
}
}
@@ -1663,12 +1602,11 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
_ = az.lbCache.Delete(lbName)
}()
- if lb.LoadBalancerPropertiesFormat != nil && lb.BackendAddressPools != nil {
- backendPools := *lb.BackendAddressPools
- for _, backendPool := range backendPools {
+ if lb.LoadBalancerPropertiesFormat != nil && lb.LoadBalancerPropertiesFormat.BackendAddressPools != nil {
+ for _, backendPool := range *lb.LoadBalancerPropertiesFormat.BackendAddressPools {
isIPv6 := isBackendPoolIPv6(pointer.StringDeref(backendPool.Name, ""))
if strings.EqualFold(pointer.StringDeref(backendPool.Name, ""), getBackendPoolName(clusterName, isIPv6)) {
- if err := az.LoadBalancerBackendPool.EnsureHostsInPool(service, nodes, lbBackendPoolID, vmSetName, clusterName, lbName, backendPool); err != nil {
+ if err := az.LoadBalancerBackendPool.EnsureHostsInPool(service, nodes, lbBackendPoolIDs[isIPv6], vmSetName, clusterName, lbName, backendPool); err != nil {
return nil, err
}
}
@@ -1770,7 +1708,12 @@ func (az *Cloud) reconcileLBRules(lb *network.LoadBalancer, service *v1.Service,
return dirtyRules
}
-func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Service, lb *network.LoadBalancer, status *v1.LoadBalancerStatus, wantLb bool, defaultLBFrontendIPConfigName string) (*network.FrontendIPConfiguration, []network.FrontendIPConfiguration, bool, error) {
+func (az *Cloud) reconcileFrontendIPConfigs(clusterName string,
+ service *v1.Service,
+ lb *network.LoadBalancer,
+ status *v1.LoadBalancerStatus,
+ wantLb bool,
+ lbFrontendIPConfigNames map[bool]string) ([]*network.FrontendIPConfiguration, []network.FrontendIPConfiguration, bool, error) {
var err error
lbName := *lb.Name
serviceName := getServiceName(service)
@@ -1782,14 +1725,11 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
newConfigs = *lb.FrontendIPConfigurations
}
- var ownedFIPConfig *network.FrontendIPConfiguration
+ var ownedFIPConfigs []*network.FrontendIPConfiguration
if !wantLb {
for i := len(newConfigs) - 1; i >= 0; i-- {
config := newConfigs[i]
- isServiceOwnsFrontendIP, _, err := az.serviceOwnsFrontendIP(config, service)
- if err != nil {
- return nil, toDeleteConfigs, false, err
- }
+ isServiceOwnsFrontendIP, _, _ := az.serviceOwnsFrontendIP(config, service)
if isServiceOwnsFrontendIP {
unsafe, err := az.isFrontendIPConfigUnsafeToDelete(lb, service, config.ID)
if err != nil {
@@ -1821,16 +1761,45 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
var (
previousZone *[]string
isFipChanged bool
+ subnet network.Subnet
+ existsSubnet bool
)
+
+ if isInternal {
+ subnetName := getInternalSubnet(service)
+ if subnetName == nil {
+ subnetName = &az.SubnetName
+ }
+ subnet, existsSubnet, err = az.getSubnet(az.VnetName, *subnetName)
+ if err != nil {
+ return nil, toDeleteConfigs, false, err
+ }
+ if !existsSubnet {
+ return nil, toDeleteConfigs, false, fmt.Errorf("ensure(%s): lb(%s) - failed to get subnet: %s/%s", serviceName, lbName, az.VnetName, *subnetName)
+ }
+ }
+
+ pipRG := az.getPublicIPAddressResourceGroup(service)
+
for i := len(newConfigs) - 1; i >= 0; i-- {
config := newConfigs[i]
- isServiceOwnsFrontendIP, _, _ := az.serviceOwnsFrontendIP(config, service)
+ isServiceOwnsFrontendIP, _, fipIPVersion := az.serviceOwnsFrontendIP(config, service)
if !isServiceOwnsFrontendIP {
klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): the frontend IP configuration %s does not belong to the service", serviceName, pointer.StringDeref(config.Name, ""))
continue
}
klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): checking owned frontend IP configuration %s", serviceName, pointer.StringDeref(config.Name, ""))
- isFipChanged, err = az.isFrontendIPChanged(clusterName, config, service, defaultLBFrontendIPConfigName)
+ var isIPv6 bool
+ var err error
+ if fipIPVersion != "" {
+ isIPv6 = fipIPVersion == network.IPv6
+ } else {
+ if isIPv6, err = az.isFIPIPv6(service, pipRG, &config); err != nil {
+ return nil, toDeleteConfigs, false, err
+ }
+ }
+
+ isFipChanged, err = az.isFrontendIPChanged(clusterName, config, service, lbFrontendIPConfigNames[isIPv6], &subnet)
if err != nil {
return nil, toDeleteConfigs, false, err
}
@@ -1841,50 +1810,50 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
dirtyConfigs = true
previousZone = config.Zones
}
- break
}
- ownedFIPConfig, err = az.findFrontendIPConfigOfService(&newConfigs, service)
+ ownedFIPConfigMap, err := az.findFrontendIPConfigsOfService(&newConfigs, service)
if err != nil {
return nil, toDeleteConfigs, false, err
}
+ for _, config := range ownedFIPConfigMap {
+ ownedFIPConfigs = append(ownedFIPConfigs, config)
+ }
- if ownedFIPConfig == nil {
- klog.V(4).Infof("ensure(%s): lb(%s) - creating a new frontend IP config", serviceName, lbName)
+ addNewFIPOfService := func(isIPv6 bool) error {
+ klog.V(4).Infof("ensure(%s): lb(%s) - creating a new frontend IP config (isIPv6=%t)", serviceName, lbName, isIPv6)
// construct FrontendIPConfigurationPropertiesFormat
var fipConfigurationProperties *network.FrontendIPConfigurationPropertiesFormat
if isInternal {
- subnetName := subnet(service)
- if subnetName == nil {
- subnetName = &az.SubnetName
- }
- subnet, existsSubnet, err := az.getSubnet(az.VnetName, *subnetName)
- if err != nil {
- return nil, toDeleteConfigs, false, err
- }
-
- if !existsSubnet {
- return nil, toDeleteConfigs, false, fmt.Errorf("ensure(%s): lb(%s) - failed to get subnet: %s/%s", serviceName, lbName, az.VnetName, *subnetName)
- }
-
configProperties := network.FrontendIPConfigurationPropertiesFormat{
Subnet: &subnet,
}
- isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP)
if isIPv6 {
configProperties.PrivateIPAddressVersion = network.IPv6
}
loadBalancerIP := getServiceLoadBalancerIP(service, isIPv6)
+ privateIP := ""
+ ingressIPInSubnet := func(ingresses []v1.LoadBalancerIngress) bool {
+ for _, ingress := range ingresses {
+ ingressIP := ingress.IP
+ if (net.ParseIP(ingressIP).To4() == nil) == isIPv6 && ipInSubnet(ingressIP, &subnet) {
+ privateIP = ingressIP
+ break
+ }
+ }
+ return privateIP != ""
+ }
if loadBalancerIP != "" {
+ klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): use loadBalancerIP %q from Service spec", serviceName, loadBalancerIP)
configProperties.PrivateIPAllocationMethod = network.Static
configProperties.PrivateIPAddress = &loadBalancerIP
- } else if status != nil && len(status.Ingress) > 0 && ipInSubnet(status.Ingress[0].IP, &subnet) {
- klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): keep the original private IP %s", serviceName, status.Ingress[0].IP)
+ } else if status != nil && len(status.Ingress) > 0 && ingressIPInSubnet(status.Ingress) {
+ klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): keep the original private IP %s", serviceName, privateIP)
configProperties.PrivateIPAllocationMethod = network.Static
- configProperties.PrivateIPAddress = pointer.String(status.Ingress[0].IP)
+ configProperties.PrivateIPAddress = pointer.String(privateIP)
} else {
// We'll need to call GetLoadBalancer later to retrieve allocated IP.
klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): dynamically allocate the private IP", serviceName)
@@ -1893,15 +1862,14 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
fipConfigurationProperties = &configProperties
} else {
- isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) // TODO: dualstack support
pipName, shouldPIPExisted, err := az.determinePublicIPName(clusterName, service, isIPv6)
if err != nil {
- return nil, toDeleteConfigs, false, err
+ return err
}
domainNameLabel, found := getPublicIPDomainNameLabel(service)
pip, err := az.ensurePublicIPExists(service, pipName, domainNameLabel, clusterName, shouldPIPExisted, found, isIPv6)
if err != nil {
- return nil, toDeleteConfigs, false, err
+ return err
}
fipConfigurationProperties = &network.FrontendIPConfigurationPropertiesFormat{
PublicIPAddress: &network.PublicIPAddress{ID: pip.ID},
@@ -1909,20 +1877,33 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
}
newConfig := network.FrontendIPConfiguration{
- Name: pointer.String(defaultLBFrontendIPConfigName),
- ID: pointer.String(fmt.Sprintf(consts.FrontendIPConfigIDTemplate, az.getNetworkResourceSubscriptionID(), az.ResourceGroup, *lb.Name, defaultLBFrontendIPConfigName)),
+ Name: pointer.String(lbFrontendIPConfigNames[isIPv6]),
+ ID: pointer.String(fmt.Sprintf(consts.FrontendIPConfigIDTemplate, az.getNetworkResourceSubscriptionID(), az.ResourceGroup, pointer.StringDeref(lb.Name, ""), lbFrontendIPConfigNames[isIPv6])),
FrontendIPConfigurationPropertiesFormat: fipConfigurationProperties,
}
if isInternal {
- if err := az.getFrontendZones(&newConfig, previousZone, isFipChanged, serviceName, defaultLBFrontendIPConfigName); err != nil {
+ if err := az.getFrontendZones(&newConfig, previousZone, isFipChanged, serviceName, lbFrontendIPConfigNames[isIPv6]); err != nil {
klog.Errorf("reconcileLoadBalancer for service (%s)(%t): failed to getFrontendZones: %s", serviceName, wantLb, err.Error())
- return nil, toDeleteConfigs, false, err
+ return err
}
}
newConfigs = append(newConfigs, newConfig)
- klog.V(2).Infof("reconcileLoadBalancer for service (%s)(%t): lb frontendconfig(%s) - adding", serviceName, wantLb, defaultLBFrontendIPConfigName)
+ klog.V(2).Infof("reconcileLoadBalancer for service (%s)(%t): lb frontendconfig(%s) - adding", serviceName, wantLb, lbFrontendIPConfigNames[isIPv6])
dirtyConfigs = true
+ return nil
+ }
+
+ v4Enabled, v6Enabled := getIPFamiliesEnabled(service)
+ if v4Enabled && ownedFIPConfigMap[false] == nil {
+ if err := addNewFIPOfService(false); err != nil {
+ return nil, toDeleteConfigs, false, err
+ }
+ }
+ if v6Enabled && ownedFIPConfigMap[true] == nil {
+ if err := addNewFIPOfService(true); err != nil {
+ return nil, toDeleteConfigs, false, err
+ }
}
}
@@ -1930,7 +1911,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv
lb.FrontendIPConfigurations = &newConfigs
}
- return ownedFIPConfig, toDeleteConfigs, dirtyConfigs, err
+ return ownedFIPConfigs, toDeleteConfigs, dirtyConfigs, err
}
func (az *Cloud) getFrontendZones(
@@ -2271,7 +2252,8 @@ func (az *Cloud) getExpectedLBRules(
service *v1.Service,
lbFrontendIPConfigID string,
lbBackendPoolID string,
- lbName string) ([]network.Probe, []network.LoadBalancingRule, error) {
+ lbName string,
+ isIPv6 bool) ([]network.Probe, []network.LoadBalancingRule, error) {
var expectedRules []network.LoadBalancingRule
var expectedProbes []network.Probe
@@ -2281,9 +2263,9 @@ func (az *Cloud) getExpectedLBRules(
// healthcheck proxy server serves http requests
// https://github.com/kubernetes/kubernetes/blob/7c013c3f64db33cf19f38bb2fc8d9182e42b0b7b/pkg/proxy/healthcheck/service_health.go#L236
var nodeEndpointHealthprobe *network.Probe
- if servicehelpers.NeedsHealthCheck(service) {
+ if servicehelpers.NeedsHealthCheck(service) && !(consts.IsPLSEnabled(service.Annotations) && consts.IsPLSProxyProtocolEnabled(service.Annotations)) {
podPresencePath, podPresencePort := servicehelpers.GetServiceHealthCheckPathPort(service)
- lbRuleName := az.getLoadBalancerRuleName(service, v1.ProtocolTCP, podPresencePort, utilnet.IsIPv6String(service.Spec.ClusterIP))
+ lbRuleName := az.getLoadBalancerRuleName(service, v1.ProtocolTCP, podPresencePort, isIPv6)
nodeEndpointHealthprobe = &network.Probe{
Name: &lbRuleName,
@@ -2304,7 +2286,7 @@ func (az *Cloud) getExpectedLBRules(
az.useStandardLoadBalancer() &&
consts.IsK8sServiceHasHAModeEnabled(service) {
- lbRuleName := az.getloadbalancerHAmodeRuleName(service, utilnet.IsIPv6String(service.Spec.ClusterIP))
+ lbRuleName := az.getloadbalancerHAmodeRuleName(service, isIPv6)
klog.V(2).Infof("getExpectedLBRules lb name (%s) rule name (%s)", lbName, lbRuleName)
props, err := az.getExpectedHAModeLoadBalancingRuleProperties(service, lbFrontendIPConfigID, lbBackendPoolID)
@@ -2323,7 +2305,7 @@ func (az *Cloud) getExpectedLBRules(
}
if portprobe != nil {
props.Probe = &network.SubResource{
- ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)),
+ ID: pointer.String(az.getLoadBalancerProbeID(lbName, *portprobe.Name)),
}
expectedProbes = append(expectedProbes, *portprobe)
break
@@ -2331,7 +2313,7 @@ func (az *Cloud) getExpectedLBRules(
}
} else {
props.Probe = &network.SubResource{
- ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)),
+ ID: pointer.String(az.getLoadBalancerProbeID(lbName, *nodeEndpointHealthprobe.Name)),
}
}
@@ -2344,7 +2326,7 @@ func (az *Cloud) getExpectedLBRules(
// generate lb rule for each port defined in svc object
for _, port := range service.Spec.Ports {
- lbRuleName := az.getLoadBalancerRuleName(service, port.Protocol, port.Port, utilnet.IsIPv6String(service.Spec.ClusterIP))
+ lbRuleName := az.getLoadBalancerRuleName(service, port.Protocol, port.Port, isIPv6)
klog.V(2).Infof("getExpectedLBRules lb name (%s) rule name (%s)", lbName, lbRuleName)
isNoLBRuleRequired, err := consts.IsLBRuleOnK8sServicePortDisabled(service.Annotations, port.Port)
if err != nil {
@@ -2385,13 +2367,13 @@ func (az *Cloud) getExpectedLBRules(
}
if portprobe != nil {
props.Probe = &network.SubResource{
- ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)),
+ ID: pointer.String(az.getLoadBalancerProbeID(lbName, *portprobe.Name)),
}
expectedProbes = append(expectedProbes, *portprobe)
}
} else {
props.Probe = &network.SubResource{
- ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)),
+ ID: pointer.String(az.getLoadBalancerProbeID(lbName, *nodeEndpointHealthprobe.Name)),
}
}
}
@@ -2984,6 +2966,8 @@ func shouldReleaseExistingOwnedPublicIP(existingPip *network.PublicIPAddress, lb
// #2 - If the load balancer is internal, and thus doesn't require public exposure
lbIsInternal ||
// #3 - If the name of this public ip does not match the desired name,
+ // NOTICE: For IPv6 Service created with CCM v1.27.1, the created PIP has IPv6 suffix.
+ // We need to recreate such PIP and current logic to delete needs no change.
(pipName != desiredPipName) ||
// #4 If the service annotations have specified the ip tags that the public ip must have, but they do not match the ip tags of the existing instance
(ipTagRequest.IPTagsRequestedByAnnotation && !areIPTagsEquivalent(currentIPTags, ipTagRequest.IPTags))
@@ -3007,19 +2991,25 @@ func (az *Cloud) ensurePIPTagged(service *v1.Service, pip *network.PublicIPAddre
}
// include the cluster name and service names tags when comparing
- var clusterName, serviceNames *string
+ var clusterName, serviceNames, serviceNameUsingDNS *string
if v := getClusterFromPIPClusterTags(pip.Tags); v != "" {
clusterName = &v
}
if v := getServiceFromPIPServiceTags(pip.Tags); v != "" {
serviceNames = &v
}
+ if v := getServiceFromPIPDNSTags(pip.Tags); v != "" {
+ serviceNameUsingDNS = &v
+ }
if clusterName != nil {
configTags[consts.ClusterNameKey] = clusterName
}
if serviceNames != nil {
configTags[consts.ServiceTagKey] = serviceNames
}
+ if serviceNameUsingDNS != nil {
+ configTags[consts.ServiceUsingDNSKey] = serviceNameUsingDNS
+ }
tags, changed := az.reconcileTags(pip.Tags, configTags)
pip.Tags = tags
@@ -3032,7 +3022,7 @@ func (az *Cloud) reconcilePublicIPs(clusterName string, service *v1.Service, lbN
pipResourceGroup := az.getPublicIPAddressResourceGroup(service)
reconciledPIPs := []*network.PublicIPAddress{}
- pips, err := az.listPIP(pipResourceGroup)
+ pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault)
if err != nil {
return nil, err
}
@@ -3181,7 +3171,7 @@ func (az *Cloud) getPublicIPUpdates(
owns, isUserAssignedPIP := serviceOwnsPublicIP(service, &pip, clusterName)
if owns {
var dirtyPIP, toBeDeleted bool
- if !wantLb {
+ if !wantLb && !isUserAssignedPIP {
klog.V(2).Infof("reconcilePublicIP for service(%s): unbinding the service from pip %s", serviceName, *pip.Name)
if err = unbindServiceFromPIP(&pip, service, serviceName, clusterName, isUserAssignedPIP); err != nil {
return false, nil, false, nil, err
@@ -3226,65 +3216,77 @@ func (az *Cloud) getPublicIPUpdates(
func (az *Cloud) safeDeletePublicIP(service *v1.Service, pipResourceGroup string, pip *network.PublicIPAddress, lb *network.LoadBalancer) error {
// Remove references if pip.IPConfiguration is not nil.
if pip.PublicIPAddressPropertiesFormat != nil &&
- pip.PublicIPAddressPropertiesFormat.IPConfiguration != nil &&
- lb != nil && lb.LoadBalancerPropertiesFormat != nil &&
- lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations != nil {
- referencedLBRules := []network.SubResource{}
- frontendIPConfigUpdated := false
- loadBalancerRuleUpdated := false
-
- // Check whether there are still frontend IP configurations referring to it.
- ipConfigurationID := pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.IPConfiguration.ID, "")
- if ipConfigurationID != "" {
- lbFrontendIPConfigs := *lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations
- for i := len(lbFrontendIPConfigs) - 1; i >= 0; i-- {
- config := lbFrontendIPConfigs[i]
- if strings.EqualFold(ipConfigurationID, pointer.StringDeref(config.ID, "")) {
- if config.FrontendIPConfigurationPropertiesFormat != nil &&
- config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules != nil {
- referencedLBRules = *config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules
- }
+ pip.PublicIPAddressPropertiesFormat.IPConfiguration != nil {
+ // Fetch latest pip to check if the pip in the cache is stale.
+ // In some cases the public IP to be deleted is still referencing
+ // the frontend IP config on the LB. This is because the pip is
+ // stored in the cache and is not up-to-date.
+ latestPIP, ok, err := az.getPublicIPAddress(pipResourceGroup, *pip.Name, azcache.CacheReadTypeForceRefresh)
+ if err != nil {
+ klog.Errorf("safeDeletePublicIP: failed to get latest public IP %s/%s: %s", pipResourceGroup, *pip.Name, err.Error())
+ return err
+ }
+ if ok && latestPIP.PublicIPAddressPropertiesFormat != nil &&
+ latestPIP.PublicIPAddressPropertiesFormat.IPConfiguration != nil &&
+ lb != nil && lb.LoadBalancerPropertiesFormat != nil &&
+ lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations != nil {
+ referencedLBRules := []network.SubResource{}
+ frontendIPConfigUpdated := false
+ loadBalancerRuleUpdated := false
+
+ // Check whether there are still frontend IP configurations referring to it.
+ ipConfigurationID := pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.IPConfiguration.ID, "")
+ if ipConfigurationID != "" {
+ lbFrontendIPConfigs := *lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations
+ for i := len(lbFrontendIPConfigs) - 1; i >= 0; i-- {
+ config := lbFrontendIPConfigs[i]
+ if strings.EqualFold(ipConfigurationID, pointer.StringDeref(config.ID, "")) {
+ if config.FrontendIPConfigurationPropertiesFormat != nil &&
+ config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules != nil {
+ referencedLBRules = *config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules
+ }
- frontendIPConfigUpdated = true
- lbFrontendIPConfigs = append(lbFrontendIPConfigs[:i], lbFrontendIPConfigs[i+1:]...)
- break
+ frontendIPConfigUpdated = true
+ lbFrontendIPConfigs = append(lbFrontendIPConfigs[:i], lbFrontendIPConfigs[i+1:]...)
+ break
+ }
}
- }
- if frontendIPConfigUpdated {
- lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations = &lbFrontendIPConfigs
+ if frontendIPConfigUpdated {
+ lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations = &lbFrontendIPConfigs
+ }
}
- }
- // Check whether there are still load balancer rules referring to it.
- if len(referencedLBRules) > 0 {
- referencedLBRuleIDs := sets.New[string]()
- for _, refer := range referencedLBRules {
- referencedLBRuleIDs.Insert(pointer.StringDeref(refer.ID, ""))
- }
+ // Check whether there are still load balancer rules referring to it.
+ if len(referencedLBRules) > 0 {
+ referencedLBRuleIDs := sets.New[string]()
+ for _, refer := range referencedLBRules {
+ referencedLBRuleIDs.Insert(pointer.StringDeref(refer.ID, ""))
+ }
- if lb.LoadBalancerPropertiesFormat.LoadBalancingRules != nil {
- lbRules := *lb.LoadBalancerPropertiesFormat.LoadBalancingRules
- for i := len(lbRules) - 1; i >= 0; i-- {
- ruleID := pointer.StringDeref(lbRules[i].ID, "")
- if ruleID != "" && referencedLBRuleIDs.Has(ruleID) {
- loadBalancerRuleUpdated = true
- lbRules = append(lbRules[:i], lbRules[i+1:]...)
+ if lb.LoadBalancerPropertiesFormat.LoadBalancingRules != nil {
+ lbRules := *lb.LoadBalancerPropertiesFormat.LoadBalancingRules
+ for i := len(lbRules) - 1; i >= 0; i-- {
+ ruleID := pointer.StringDeref(lbRules[i].ID, "")
+ if ruleID != "" && referencedLBRuleIDs.Has(ruleID) {
+ loadBalancerRuleUpdated = true
+ lbRules = append(lbRules[:i], lbRules[i+1:]...)
+ }
}
- }
- if loadBalancerRuleUpdated {
- lb.LoadBalancerPropertiesFormat.LoadBalancingRules = &lbRules
+ if loadBalancerRuleUpdated {
+ lb.LoadBalancerPropertiesFormat.LoadBalancingRules = &lbRules
+ }
}
}
- }
- // Update load balancer when frontendIPConfigUpdated or loadBalancerRuleUpdated.
- if frontendIPConfigUpdated || loadBalancerRuleUpdated {
- err := az.CreateOrUpdateLB(service, *lb)
- if err != nil {
- klog.Errorf("safeDeletePublicIP for service(%s) failed with error: %v", getServiceName(service), err)
- return err
+ // Update load balancer when frontendIPConfigUpdated or loadBalancerRuleUpdated.
+ if frontendIPConfigUpdated || loadBalancerRuleUpdated {
+ err := az.CreateOrUpdateLB(service, *lb)
+ if err != nil {
+ klog.Errorf("safeDeletePublicIP for service(%s) failed with error: %v", getServiceName(service), err)
+ return err
+ }
}
}
}
@@ -3326,6 +3328,7 @@ func findRule(rules []network.LoadBalancingRule, rule network.LoadBalancingRule,
// equalLoadBalancingRulePropertiesFormat checks whether the provided LoadBalancingRulePropertiesFormat are equal.
// Note: only fields used in reconcileLoadBalancer are considered.
+// s: existing, t: target
func equalLoadBalancingRulePropertiesFormat(s *network.LoadBalancingRulePropertiesFormat, t *network.LoadBalancingRulePropertiesFormat, wantLB bool) bool {
if s == nil || t == nil {
return false
@@ -3442,7 +3445,7 @@ func requiresInternalLoadBalancer(service *v1.Service) bool {
return false
}
-func subnet(service *v1.Service) *string {
+func getInternalSubnet(service *v1.Service) *string {
if requiresInternalLoadBalancer(service) {
if l, found := service.Annotations[consts.ServiceAnnotationLoadBalancerInternalSubnet]; found && strings.TrimSpace(l) != "" {
return &l
@@ -3486,8 +3489,7 @@ func ipInSubnet(ip string, subnet *network.Subnet) bool {
// if anything else it returns the unique VM set names after trimming spaces.
func (az *Cloud) getServiceLoadBalancerMode(service *v1.Service) (bool, bool, string) {
mode, hasMode := service.Annotations[consts.ServiceAnnotationLoadBalancerMode]
- useSingleSLB := az.useStandardLoadBalancer() && !az.EnableMultipleStandardLoadBalancers
- if useSingleSLB && hasMode {
+ if az.useStandardLoadBalancer() && hasMode {
klog.Warningf("single standard load balancer doesn't work with annotation %q, would ignore it", consts.ServiceAnnotationLoadBalancerMode)
}
mode = strings.TrimSpace(mode)
@@ -3543,13 +3545,14 @@ func serviceOwnsPublicIP(service *v1.Service, pip *network.PublicIPAddress, clus
serviceName := getServiceName(service)
+ isIPv6 := pip.PublicIPAddressVersion == network.IPv6
if pip.Tags != nil {
serviceTag := getServiceFromPIPServiceTags(pip.Tags)
clusterTag := getClusterFromPIPClusterTags(pip.Tags)
// if there is no service tag on the pip, it is user-created pip
if serviceTag == "" {
- return strings.EqualFold(pointer.StringDeref(pip.IPAddress, ""), getServiceLoadBalancerIP(service, utilnet.IsIPv6String(service.Spec.ClusterIP))), true
+ return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), true
}
// if there is service tag on the pip, it is system-created pip
@@ -3561,17 +3564,20 @@ func serviceOwnsPublicIP(service *v1.Service, pip *network.PublicIPAddress, clus
}
// If cluster name tag is set, then return true if it matches.
- if clusterTag == clusterName {
- return true, false
- }
- } else {
- // if the service is not included in the tags of the system-created pip, check the ip address
- // this could happen for secondary services
- return strings.EqualFold(pointer.StringDeref(pip.IPAddress, ""), getServiceLoadBalancerIP(service, utilnet.IsIPv6String(service.Spec.ClusterIP))), false
+ return strings.EqualFold(clusterTag, clusterName), false
}
+
+ // if the service is not included in the tags of the system-created pip, check the ip address
+ // this could happen for secondary services
+ return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), false
}
- return false, false
+ // if the pip has no tags, it should be user-created
+ return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), true
+}
+
+func isServiceLoadBalancerIPMatchesPIP(service *v1.Service, pip *network.PublicIPAddress, isIPV6 bool) bool {
+ return strings.EqualFold(pointer.StringDeref(pip.IPAddress, ""), getServiceLoadBalancerIP(service, isIPV6))
}
func isSVCNameInPIPTag(tag, svcName string) bool {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go
index e7f75d29e..650e102b5 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go
@@ -33,7 +33,6 @@ import (
"k8s.io/utils/pointer"
"sigs.k8s.io/cloud-provider-azure/pkg/cache"
- "sigs.k8s.io/cloud-provider-azure/pkg/consts"
"sigs.k8s.io/cloud-provider-azure/pkg/metrics"
)
@@ -52,7 +51,7 @@ type BackendPool interface {
// ReconcileBackendPools creates the inbound backend pool if it is not existed, and removes nodes that are supposed to be
// excluded from the load balancers.
- ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error)
+ ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error)
// GetBackendPrivateIPs returns the private IPs of LoadBalancer's backend pool
GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string)
@@ -85,15 +84,8 @@ func isLBBackendPoolsExisting(lbBackendPoolNames map[bool]string, bpName *string
func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) {
v4Enabled, v6Enabled := getIPFamiliesEnabled(service)
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
- lbResourceGroup := bc.getLoadBalancerResourceGroup()
- lbBackendPoolIDs := map[bool]string{
- false: bc.getBackendPoolID(pointer.StringDeref(slb.Name, ""), lbResourceGroup, lbBackendPoolNames[false]),
- true: bc.getBackendPoolID(pointer.StringDeref(slb.Name, ""), lbResourceGroup, lbBackendPoolNames[true]),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
+ lbBackendPoolIDs := bc.getBackendPoolIDs(clusterName, pointer.StringDeref(slb.Name, ""))
newBackendPools := make([]network.BackendAddressPool, 0)
if slb.LoadBalancerPropertiesFormat != nil && slb.BackendAddressPools != nil {
newBackendPools = *slb.BackendAddressPools
@@ -164,7 +156,7 @@ func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(sl
return slb, nil
}
-func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) {
+func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) {
var newBackendPools []network.BackendAddressPool
var err error
if lb.BackendAddressPools != nil {
@@ -176,14 +168,8 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
lbName := *lb.Name
serviceName := getServiceName(service)
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
- lbBackendPoolIDs := map[bool]string{
- false: bc.getBackendPoolID(lbName, bc.getLoadBalancerResourceGroup(), lbBackendPoolNames[false]),
- true: bc.getBackendPoolID(lbName, bc.getLoadBalancerResourceGroup(), lbBackendPoolNames[true]),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
+ lbBackendPoolIDs := bc.getBackendPoolIDs(clusterName, lbName)
vmSetName := bc.mapLoadBalancerNameToVMSet(lbName, clusterName)
isBackendPoolPreConfigured := bc.isBackendPoolPreConfigured(service)
@@ -214,7 +200,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
bp.VirtualNetwork = nil
if err := bc.CreateOrUpdateLBBackendPool(lbName, bp); err != nil {
klog.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %s", serviceName, lbBackendPoolNames[isIPv6], err.Error())
- return false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %w", serviceName, lbBackendPoolNames[isIPv6], err)
+ return false, false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %w", serviceName, lbBackendPoolNames[isIPv6], err)
}
newBackendPools[i] = bp
lb.BackendAddressPools = &newBackendPools
@@ -232,7 +218,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
klog.V(2).Infof("bc.ReconcileBackendPools for service (%s): vm not found for ipConfID %s", serviceName, ipConfID)
bipConfigNotFound = append(bipConfigNotFound, ipConf)
} else {
- return false, false, err
+ return false, false, false, err
}
}
@@ -243,7 +229,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
shouldExcludeLoadBalancer, err := bc.ShouldNodeExcludedFromLoadBalancer(nodeName)
if err != nil {
klog.Errorf("bc.ReconcileBackendPools: ShouldNodeExcludedFromLoadBalancer(%s) failed with error: %v", nodeName, err)
- return false, false, err
+ return false, false, false, err
}
if shouldExcludeLoadBalancer {
klog.V(2).Infof("bc.ReconcileBackendPools for service (%s): lb backendpool - found unwanted node %s, decouple it from the LB %s", serviceName, nodeName, lbName)
@@ -271,7 +257,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
// decouple the backendPool from the node
updated, err := bc.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolIDsSlice, vmSetName, &backendpoolToBeDeleted, false)
if err != nil {
- return false, false, err
+ return false, false, false, err
}
if updated {
shouldRefreshLB = true
@@ -281,7 +267,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
if shouldRefreshLB {
lb, _, err = bc.getAzureLoadBalancer(lbName, cache.CacheReadTypeForceRefresh)
if err != nil {
- return false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to get loadbalancer %s: %w", serviceName, lbName, err)
+ return false, false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to get loadbalancer %s: %w", serviceName, lbName, err)
}
}
@@ -302,7 +288,7 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string,
}
isOperationSucceeded = true
- return isBackendPoolPreConfigured, changed, err
+ return isBackendPoolPreConfigured, changed, false, err
}
func getBackendIPConfigurationsToBeDeleted(
@@ -348,10 +334,7 @@ func getBackendIPConfigurationsToBeDeleted(
func (bc *backendPoolTypeNodeIPConfig) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) {
serviceName := getServiceName(service)
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
if lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.BackendAddressPools == nil {
return nil, nil
}
@@ -437,33 +420,6 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes []
continue
}
- var err error
- shouldSkip := false
- useSingleSLB := strings.EqualFold(bi.LoadBalancerSku, consts.LoadBalancerSkuStandard) && !bi.EnableMultipleStandardLoadBalancers
- if !useSingleSLB {
- vmSetName, err = bi.VMSet.GetNodeVMSetName(node)
- if err != nil {
- klog.Errorf("bi.EnsureHostsInPool: failed to get vmSet name by node name: %s", err.Error())
- return err
- }
-
- if !strings.EqualFold(vmSetName, bi.mapLoadBalancerNameToVMSet(lbName, clusterName)) {
- shouldSkip = true
-
- lbNamePrefix := strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix)
- if strings.EqualFold(lbNamePrefix, clusterName) &&
- strings.EqualFold(bi.LoadBalancerSku, consts.LoadBalancerSkuStandard) &&
- bi.getVMSetNamesSharingPrimarySLB().Has(vmSetName) {
- klog.V(4).Infof("bi.EnsureHostsInPool: the node %s in VMSet %s is supposed to share the primary SLB", node.Name, vmSetName)
- shouldSkip = false
- }
- }
- }
- if shouldSkip {
- klog.V(4).Infof("bi.EnsureHostsInPool: skipping attaching node %s to lb %s, because the vmSet of the node is %s", node.Name, lbName, vmSetName)
- continue
- }
-
privateIP := getNodePrivateIPAddress(node, isIPv6)
if !existingIPs.Has(privateIP) {
name := node.Name
@@ -494,10 +450,7 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes []
}
func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) {
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
newBackendPools := make([]network.BackendAddressPool, 0)
if slb.LoadBalancerPropertiesFormat != nil && slb.BackendAddressPools != nil {
newBackendPools = *slb.BackendAddressPools
@@ -555,7 +508,7 @@ func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *net
return slb, nil
}
-func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) {
+func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) {
var newBackendPools []network.BackendAddressPool
if lb.BackendAddressPools != nil {
newBackendPools = *lb.BackendAddressPools
@@ -565,29 +518,38 @@ func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, servi
foundBackendPools := map[bool]bool{}
lbName := *lb.Name
serviceName := getServiceName(service)
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
vmSetName := bi.mapLoadBalancerNameToVMSet(lbName, clusterName)
- lbBackendPoolIDs := map[bool]string{
- false: bi.getBackendPoolID(pointer.StringDeref(lb.Name, ""), bi.getLoadBalancerResourceGroup(), lbBackendPoolNames[false]),
- true: bi.getBackendPoolID(pointer.StringDeref(lb.Name, ""), bi.getLoadBalancerResourceGroup(), lbBackendPoolNames[true]),
- }
+ lbBackendPoolIDs := bi.getBackendPoolIDs(clusterName, pointer.StringDeref(lb.Name, ""))
isBackendPoolPreConfigured := bi.isBackendPoolPreConfigured(service)
mc := metrics.NewMetricContext("services", "migrate_to_ip_based_backend_pool", bi.ResourceGroup, bi.getNetworkResourceSubscriptionID(), serviceName)
- var err error
- bpIdxes := []int{}
- lbBackendPoolIDsSlice := []string{}
+
+ var (
+ err error
+ bpIdxes []int
+ lbBackendPoolIDsSlice []string
+ )
+ nicsCountMap := make(map[string]int)
for i := len(newBackendPools) - 1; i >= 0; i-- {
bp := newBackendPools[i]
found, isIPv6 := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name)
if found {
bpIdxes = append(bpIdxes, i)
- klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found wanted backendpool. not adding anything", serviceName)
+ klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found wanted backendpool. Not adding anything", serviceName)
foundBackendPools[isIPv6] = true
lbBackendPoolIDsSlice = append(lbBackendPoolIDsSlice, lbBackendPoolIDs[isIPv6])
+
+ if nicsCount := countNICsOnBackendPool(bp); nicsCount > 0 {
+ nicsCountMap[pointer.StringDeref(bp.Name, "")] = nicsCount
+ klog.V(4).Infof(
+ "bi.ReconcileBackendPools for service(%s): found NIC-based backendpool %s with %d NICs, will migrate to IP-based",
+ serviceName,
+ pointer.StringDeref(bp.Name, ""),
+ nicsCount,
+ )
+ isMigration = true
+ }
} else {
klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found unmanaged backendpool %s", serviceName, *bp.Name)
}
@@ -598,14 +560,45 @@ func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, servi
// If the LB backend pool type is configured from nodeIPConfiguration
// to nodeIP, we need to decouple the VM NICs from the LB
// before attaching nodeIPs/podIPs to the LB backend pool.
+ // If the migration API is enabled, we use the migration API to decouple
+ // the VM NICs from the LB. Then we manually decouple the VMSS
+ // and its VMs from the LB by EnsureBackendPoolDeleted. These manual operations
+ // cannot be omitted because we use the VMSS manual upgrade policy.
+ // If the migration API is not enabled, we manually decouple the VM NICs and
+ // the VMSS from the LB by EnsureBackendPoolDeleted. If no NIC-based backend
+ // pool is found (it is not a migration scenario), EnsureBackendPoolDeleted would be a no-op.
+ if isMigration && bi.EnableMigrateToIPBasedBackendPoolAPI {
+ var backendPoolNames []string
+ for _, id := range lbBackendPoolIDsSlice {
+ name, err := getLBNameFromBackendPoolID(id)
+ if err != nil {
+ klog.Errorf("bi.ReconcileBackendPools for service (%s): failed to get LB name from backend pool ID: %s", serviceName, err.Error())
+ return false, false, false, err
+ }
+ backendPoolNames = append(backendPoolNames, name)
+ }
+
+ if err := bi.MigrateToIPBasedBackendPoolAndWaitForCompletion(lbName, backendPoolNames, nicsCountMap); err != nil {
+ backendPoolNamesStr := strings.Join(backendPoolNames, ",")
+ klog.Errorf("Failed to migrate to IP based backend pool for lb %s, backend pool %s: %s", lbName, backendPoolNamesStr, err.Error())
+ return false, false, false, err
+ }
+ }
+
+ // EnsureBackendPoolDeleted is useful in the following scenarios:
+ // 1. Migrate from NIC-based to IP-based backend pool if the migration
+ // API is not enabled.
+ // 2. Migrate from NIC-based to IP-based backend pool when the migration
+ // API is enabled. This is needed because since we use the manual upgrade
+ // policy on VMSS so the migration API will not change the VMSS and VMSS
+ // VMs during the migration.
+ // 3. Decouple vmss from the lb if the backend pool is empty when using
+ // ip-based LB. Ref: https://github.com/kubernetes-sigs/cloud-provider-azure/pull/2829.
klog.V(2).Infof("bi.ReconcileBackendPools for service (%s) and vmSet (%s): ensuring the LB is decoupled from the VMSet", serviceName, vmSetName)
shouldRefreshLB, err = bi.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolIDsSlice, vmSetName, lb.BackendAddressPools, true)
if err != nil {
klog.Errorf("bi.ReconcileBackendPools for service (%s): failed to EnsureBackendPoolDeleted: %s", serviceName, err.Error())
- return false, false, err
- }
- if shouldRefreshLB {
- isMigration = true
+ return false, false, false, err
}
for _, i := range bpIdxes {
@@ -650,19 +643,14 @@ func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, servi
if updated {
(*lb.BackendAddressPools)[i] = bp
if err := bi.CreateOrUpdateLBBackendPool(lbName, bp); err != nil {
- return false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): lb backendpool - failed to update backend pool %s for load balancer %s: %w", serviceName, pointer.StringDeref(bp.Name, ""), lbName, err)
+ return false, false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): lb backendpool - failed to update backend pool %s for load balancer %s: %w", serviceName, pointer.StringDeref(bp.Name, ""), lbName, err)
}
shouldRefreshLB = true
}
}
}
- if shouldRefreshLB {
- lb, _, err = bi.getAzureLoadBalancer(lbName, cache.CacheReadTypeForceRefresh)
- if err != nil {
- return false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): failed to get load balancer %s: %w", serviceName, lbName, err)
- }
- }
+ shouldRefreshLB = shouldRefreshLB || isMigration
for _, ipFamily := range service.Spec.IPFamilies {
if foundBackendPools[ipFamily == v1.IPv6Protocol] {
@@ -681,15 +669,12 @@ func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, servi
}
isOperationSucceeded = true
- return isBackendPoolPreConfigured, changed, nil
+ return isBackendPoolPreConfigured, changed, shouldRefreshLB, nil
}
func (bi *backendPoolTypeNodeIP) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) {
serviceName := getServiceName(service)
- lbBackendPoolNames := map[bool]string{
- false: getBackendPoolName(clusterName, false),
- true: getBackendPoolName(clusterName, true),
- }
+ lbBackendPoolNames := getBackendPoolNames(clusterName)
if lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.BackendAddressPools == nil {
return nil, nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go
index 5e3a057e7..a0b8af849 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go
@@ -24,7 +24,7 @@ import (
"strconv"
"strings"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
@@ -76,6 +76,8 @@ type ManagedDiskOptions struct {
LogicalSectorSize int32
// SkipGetDiskOperation indicates whether skip GetDisk operation(mainly due to throttling)
SkipGetDiskOperation bool
+ // PublicNetworkAccess - Possible values include: 'Enabled', 'Disabled'
+ PublicNetworkAccess compute.PublicNetworkAccess
// NetworkAccessPolicy - Possible values include: 'AllowAll', 'AllowPrivate', 'DenyAll'
NetworkAccessPolicy compute.NetworkAccessPolicy
// DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks.
@@ -86,6 +88,8 @@ type ManagedDiskOptions struct {
SubscriptionID string
// Location - specify a different location
Location string
+ // PerformancePlus - Set this flag to true to get a boost on the performance target of the disk deployed
+ PerformancePlus *bool
}
// CreateManagedDisk: create managed disk
@@ -129,7 +133,7 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *
subsID = options.SubscriptionID
}
- creationData, err := getValidCreationData(subsID, rg, options.SourceResourceID, options.SourceType)
+ creationData, err := getValidCreationData(subsID, rg, options)
if err != nil {
return "", err
}
@@ -139,6 +143,10 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *
BurstingEnabled: options.BurstingEnabled,
}
+ if options.PublicNetworkAccess != "" {
+ diskProperties.PublicNetworkAccess = options.PublicNetworkAccess
+ }
+
if options.NetworkAccessPolicy != "" {
diskProperties.NetworkAccessPolicy = options.NetworkAccessPolicy
if options.NetworkAccessPolicy == compute.AllowPrivate {
@@ -153,7 +161,7 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options *
}
}
- if diskSku == compute.UltraSSDLRS || diskSku == consts.PremiumV2LRS {
+ if diskSku == compute.UltraSSDLRS || diskSku == compute.PremiumV2LRS {
if options.DiskIOPSReadWrite == "" {
if diskSku == compute.UltraSSDLRS {
diskIOPSReadWrite := int64(consts.DefaultDiskIOPSReadWrite)
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go
index 474eac6be..9d1911995 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go
@@ -21,48 +21,33 @@ import (
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
gomock "github.com/golang/mock/gomock"
-
v1 "k8s.io/api/core/v1"
)
-// MockBackendPool is a mock of BackendPool interface
+// MockBackendPool is a mock of BackendPool interface.
type MockBackendPool struct {
ctrl *gomock.Controller
recorder *MockBackendPoolMockRecorder
}
-// MockBackendPoolMockRecorder is the mock recorder for MockBackendPool
+// MockBackendPoolMockRecorder is the mock recorder for MockBackendPool.
type MockBackendPoolMockRecorder struct {
mock *MockBackendPool
}
-// NewMockBackendPool creates a new mock instance
+// NewMockBackendPool creates a new mock instance.
func NewMockBackendPool(ctrl *gomock.Controller) *MockBackendPool {
mock := &MockBackendPool{ctrl: ctrl}
mock.recorder = &MockBackendPoolMockRecorder{mock}
return mock
}
-// EXPECT returns an object that allows the caller to indicate expected use
+// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackendPool) EXPECT() *MockBackendPoolMockRecorder {
return m.recorder
}
-// EnsureHostsInPool mocks base method
-func (m *MockBackendPool) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName, clusterName, lbName string, backendPool network.BackendAddressPool) error {
- m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "EnsureHostsInPool", service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool)
- ret0, _ := ret[0].(error)
- return ret0
-}
-
-// EnsureHostsInPool indicates an expected call of EnsureHostsInPool
-func (mr *MockBackendPoolMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool interface{}) *gomock.Call {
- mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostsInPool", reflect.TypeOf((*MockBackendPool)(nil).EnsureHostsInPool), service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool)
-}
-
-// CleanupVMSetFromBackendPoolByCondition mocks base method
+// CleanupVMSetFromBackendPoolByCondition mocks base method.
func (m *MockBackendPool) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "CleanupVMSetFromBackendPoolByCondition", slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB)
@@ -71,29 +56,27 @@ func (m *MockBackendPool) CleanupVMSetFromBackendPoolByCondition(slb *network.Lo
return ret0, ret1
}
-// CleanupVMSetFromBackendPoolByCondition indicates an expected call of CleanupVMSetFromBackendPoolByCondition
+// CleanupVMSetFromBackendPoolByCondition indicates an expected call of CleanupVMSetFromBackendPoolByCondition.
func (mr *MockBackendPoolMockRecorder) CleanupVMSetFromBackendPoolByCondition(slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanupVMSetFromBackendPoolByCondition", reflect.TypeOf((*MockBackendPool)(nil).CleanupVMSetFromBackendPoolByCondition), slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB)
}
-// ReconcileBackendPools mocks base method
-func (m *MockBackendPool) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) {
+// EnsureHostsInPool mocks base method.
+func (m *MockBackendPool) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName, clusterName, lbName string, backendPool network.BackendAddressPool) error {
m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "ReconcileBackendPools", clusterName, service, lb)
- ret0, _ := ret[0].(bool)
- ret1, _ := ret[1].(bool)
- ret2, _ := ret[2].(error)
- return ret0, ret1, ret2
+ ret := m.ctrl.Call(m, "EnsureHostsInPool", service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool)
+ ret0, _ := ret[0].(error)
+ return ret0
}
-// ReconcileBackendPools indicates an expected call of ReconcileBackendPools
-func (mr *MockBackendPoolMockRecorder) ReconcileBackendPools(clusterName, service, lb interface{}) *gomock.Call {
+// EnsureHostsInPool indicates an expected call of EnsureHostsInPool.
+func (mr *MockBackendPoolMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileBackendPools", reflect.TypeOf((*MockBackendPool)(nil).ReconcileBackendPools), clusterName, service, lb)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostsInPool", reflect.TypeOf((*MockBackendPool)(nil).EnsureHostsInPool), service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool)
}
-// GetBackendPrivateIPs mocks base method
+// GetBackendPrivateIPs mocks base method.
func (m *MockBackendPool) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetBackendPrivateIPs", clusterName, service, lb)
@@ -102,8 +85,25 @@ func (m *MockBackendPool) GetBackendPrivateIPs(clusterName string, service *v1.S
return ret0, ret1
}
-// GetBackendPrivateIPs indicates an expected call of GetBackendPrivateIPs
+// GetBackendPrivateIPs indicates an expected call of GetBackendPrivateIPs.
func (mr *MockBackendPoolMockRecorder) GetBackendPrivateIPs(clusterName, service, lb interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackendPrivateIPs", reflect.TypeOf((*MockBackendPool)(nil).GetBackendPrivateIPs), clusterName, service, lb)
}
+
+// ReconcileBackendPools mocks base method.
+func (m *MockBackendPool) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "ReconcileBackendPools", clusterName, service, lb)
+ ret0, _ := ret[0].(bool)
+ ret1, _ := ret[1].(bool)
+ ret2, _ := ret[2].(bool)
+ ret3, _ := ret[3].(error)
+ return ret0, ret1, ret2, ret3
+}
+
+// ReconcileBackendPools indicates an expected call of ReconcileBackendPools.
+func (mr *MockBackendPoolMockRecorder) ReconcileBackendPools(clusterName, service, lb interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileBackendPools", reflect.TypeOf((*MockBackendPool)(nil).ReconcileBackendPools), clusterName, service, lb)
+}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go
index f461cb821..c4102e2e9 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go
@@ -20,10 +20,11 @@ import (
context "context"
reflect "reflect"
- compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
azure "github.com/Azure/go-autorest/autorest/azure"
gomock "github.com/golang/mock/gomock"
+
v1 "k8s.io/api/core/v1"
types "k8s.io/apimachinery/pkg/types"
cloud_provider "k8s.io/cloud-provider"
@@ -415,7 +416,7 @@ func (mr *MockVMSetMockRecorder) UpdateVM(ctx, nodeName interface{}) *gomock.Cal
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVM", reflect.TypeOf((*MockVMSet)(nil).UpdateVM), ctx, nodeName)
}
-// UpdateVMAsync mocks base method
+// UpdateVMAsync mocks base method.
func (m *MockVMSet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "UpdateVMAsync", ctx, nodeName)
@@ -424,7 +425,7 @@ func (m *MockVMSet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName)
return ret0, ret1
}
-// UpdateVMAsync indicates an expected call of UpdateVMAsync
+// UpdateVMAsync indicates an expected call of UpdateVMAsync.
func (mr *MockVMSetMockRecorder) UpdateVMAsync(ctx, nodeName interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVMAsync", reflect.TypeOf((*MockVMSet)(nil).UpdateVMAsync), ctx, nodeName)
@@ -433,7 +434,7 @@ func (mr *MockVMSetMockRecorder) UpdateVMAsync(ctx, nodeName interface{}) *gomoc
// WaitForUpdateResult mocks base method.
func (m *MockVMSet) WaitForUpdateResult(ctx context.Context, future *azure.Future, nodeName types.NodeName, source string) error {
m.ctrl.T.Helper()
- ret := m.ctrl.Call(m, "WaitForUpdateResult", ctx, future, source)
+ ret := m.ctrl.Call(m, "WaitForUpdateResult", ctx, future, nodeName, source)
ret0, _ := ret[0].(error)
return ret0
}
@@ -441,5 +442,5 @@ func (m *MockVMSet) WaitForUpdateResult(ctx context.Context, future *azure.Futur
// WaitForUpdateResult indicates an expected call of WaitForUpdateResult.
func (mr *MockVMSetMockRecorder) WaitForUpdateResult(ctx, future, nodeName, source interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
- return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForUpdateResult", reflect.TypeOf((*MockVMSet)(nil).WaitForUpdateResult), ctx, future, source)
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForUpdateResult", reflect.TypeOf((*MockVMSet)(nil).WaitForUpdateResult), ctx, future, nodeName, source)
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go
index bdd96d3f5..efd3772a5 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go
@@ -41,6 +41,25 @@ func (az *Cloud) reconcilePrivateLinkService(
fipConfig *network.FrontendIPConfiguration,
wantPLS bool,
) error {
+ isinternal := requiresInternalLoadBalancer(service)
+ pipRG := az.getPublicIPAddressResourceGroup(service)
+ _, _, fipIPVersion := az.serviceOwnsFrontendIP(*fipConfig, service)
+ var isIPv6 bool
+ var err error
+ if fipIPVersion != "" {
+ isIPv6 = fipIPVersion == network.IPv6
+ } else {
+ if isIPv6, err = az.isFIPIPv6(service, pipRG, fipConfig); err != nil {
+ klog.Errorf("reconcilePrivateLinkService for service(%s): failed to get FIP IP family: %v", service, err)
+ return err
+ }
+ }
+
+ if isIPv6 {
+ klog.V(2).Infof("IPv6 is not supported for private link service, skip reconcilePrivateLinkService for service(%s)", service)
+ return nil
+ }
+
createPLS := wantPLS && serviceRequiresPLS(service)
serviceName := getServiceName(service)
fipConfigID := fipConfig.ID
@@ -59,7 +78,7 @@ func (az *Cloud) reconcilePrivateLinkService(
if createPLS {
// Firstly, make sure it's internal service
- if !requiresInternalLoadBalancer(service) && !consts.IsK8sServiceDisableLoadBalancerFloatingIP(service) {
+ if !isinternal && !consts.IsK8sServiceDisableLoadBalancerFloatingIP(service) {
return fmt.Errorf("reconcilePrivateLinkService for service(%s): service requiring private link service must be internal or disable floating ip", serviceName)
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go
index b3ed6e488..33b3b4cb3 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go
@@ -21,16 +21,18 @@ import (
"errors"
"fmt"
"hash/crc32"
+ "net"
"regexp"
"strconv"
"strings"
"sync"
+ "sync/atomic"
"time"
"unicode"
"sigs.k8s.io/cloud-provider-azure/pkg/consts"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
v1 "k8s.io/api/core/v1"
@@ -59,6 +61,10 @@ const (
v6Suffix = "IPv6"
)
+var (
+ v6SuffixLower = strings.ToLower(v6Suffix)
+)
+
// returns the full identifier of an availabilitySet
func (az *Cloud) getAvailabilitySetID(resourceGroup, availabilitySetName string) string {
return fmt.Sprintf(
@@ -69,7 +75,11 @@ func (az *Cloud) getAvailabilitySetID(resourceGroup, availabilitySetName string)
}
// returns the full identifier of a loadbalancer frontendipconfiguration.
-func (az *Cloud) getFrontendIPConfigID(lbName, rgName, fipConfigName string) string {
+func (az *Cloud) getFrontendIPConfigID(lbName, fipConfigName string) string {
+ return az.getFrontendIPConfigIDWithRG(lbName, az.getLoadBalancerResourceGroup(), fipConfigName)
+}
+
+func (az *Cloud) getFrontendIPConfigIDWithRG(lbName, rgName, fipConfigName string) string {
return fmt.Sprintf(
consts.FrontendIPConfigIDTemplate,
az.getNetworkResourceSubscriptionID(),
@@ -79,7 +89,11 @@ func (az *Cloud) getFrontendIPConfigID(lbName, rgName, fipConfigName string) str
}
// returns the full identifier of a loadbalancer backendpool.
-func (az *Cloud) getBackendPoolID(lbName, rgName, backendPoolName string) string {
+func (az *Cloud) getBackendPoolID(lbName, backendPoolName string) string {
+ return az.getBackendPoolIDWithRG(lbName, az.getLoadBalancerResourceGroup(), backendPoolName)
+}
+
+func (az *Cloud) getBackendPoolIDWithRG(lbName, rgName, backendPoolName string) string {
return fmt.Sprintf(
consts.BackendPoolIDTemplate,
az.getNetworkResourceSubscriptionID(),
@@ -88,8 +102,19 @@ func (az *Cloud) getBackendPoolID(lbName, rgName, backendPoolName string) string
backendPoolName)
}
+func (az *Cloud) getBackendPoolIDs(clusterName, lbName string) map[bool]string {
+ return map[bool]string{
+ false: az.getBackendPoolID(lbName, getBackendPoolName(clusterName, false)),
+ true: az.getBackendPoolID(lbName, getBackendPoolName(clusterName, true)),
+ }
+}
+
// returns the full identifier of a loadbalancer probe.
-func (az *Cloud) getLoadBalancerProbeID(lbName, rgName, lbRuleName string) string {
+func (az *Cloud) getLoadBalancerProbeID(lbName, lbRuleName string) string {
+ return az.getLoadBalancerProbeIDWithRG(lbName, az.getLoadBalancerResourceGroup(), lbRuleName)
+}
+
+func (az *Cloud) getLoadBalancerProbeIDWithRG(lbName, rgName, lbRuleName string) string {
return fmt.Sprintf(
consts.LoadBalancerProbeIDTemplate,
az.getNetworkResourceSubscriptionID(),
@@ -127,15 +152,10 @@ func (az *Cloud) getAzureLoadBalancerName(clusterName string, vmSetName string,
// The LB name prefix is set to the name of the cluster when:
// 1. the LB belongs to the primary agent pool.
// 2. using the single SLB.
- useSingleSLB := az.useStandardLoadBalancer() && !az.EnableMultipleStandardLoadBalancers
- if strings.EqualFold(vmSetName, az.VMSet.GetPrimaryVMSetName()) || useSingleSLB {
- lbNamePrefix = clusterName
- }
- // 3. using multiple SLBs while the vmSet is sharing the primary SLB
- useMultipleSLB := az.useStandardLoadBalancer() && az.EnableMultipleStandardLoadBalancers
- if useMultipleSLB && az.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmSetName)) {
+ if strings.EqualFold(vmSetName, az.VMSet.GetPrimaryVMSetName()) || az.useStandardLoadBalancer() {
lbNamePrefix = clusterName
}
+
if isInternal {
return fmt.Sprintf("%s%s", lbNamePrefix, consts.InternalLoadBalancerNameSuffix)
}
@@ -274,18 +294,30 @@ func getBackendPoolName(clusterName string, isIPv6 bool) string {
return clusterName
}
+// getBackendPoolNames returns the IPv4 and IPv6 backend pool names.
+func getBackendPoolNames(clusterName string) map[bool]string {
+ return map[bool]string{
+ false: getBackendPoolName(clusterName, false),
+ true: getBackendPoolName(clusterName, true),
+ }
+}
+
// ifBackendPoolIPv6 checks if a backend pool is of IPv6 according to name/ID.
func isBackendPoolIPv6(name string) bool {
- return strings.HasSuffix(name, fmt.Sprintf("-%s", v6Suffix))
+ return managedResourceHasIPv6Suffix(name)
+}
+
+func managedResourceHasIPv6Suffix(name string) bool {
+ return strings.HasSuffix(strings.ToLower(name), fmt.Sprintf("-%s", v6SuffixLower))
}
func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protocol, port int32, isIPv6 bool) string {
prefix := az.getRulePrefix(service)
ruleName := fmt.Sprintf("%s-%s-%d", prefix, protocol, port)
- subnet := subnet(service)
+ subnet := getInternalSubnet(service)
+ isDualStack := isServiceDualStack(service)
if subnet == nil {
- // TODO: Use getResourceByIPFamily()
- return ruleName
+ return getResourceByIPFamily(ruleName, isDualStack, isIPv6)
}
// Load balancer rule name must be less or equal to 80 characters, so excluding the hyphen two segments cannot exceed 79
@@ -295,8 +327,7 @@ func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protoc
subnetSegment = subnetSegment[:maxLength-len(ruleName)-1]
}
- // TODO: Use getResourceByIPFamily()
- return fmt.Sprintf("%s-%s-%s-%d", prefix, subnetSegment, protocol, port)
+ return getResourceByIPFamily(fmt.Sprintf("%s-%s-%s-%d", prefix, subnetSegment, protocol, port), isDualStack, isIPv6)
}
func (az *Cloud) getloadbalancerHAmodeRuleName(service *v1.Service, isIPv6 bool) string {
@@ -326,18 +357,8 @@ func (az *Cloud) getRulePrefix(service *v1.Service) string {
return az.GetLoadBalancerName(context.TODO(), "", service)
}
-func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service, pipResourceGroup string, isIPv6 bool) (string, error) {
- // For IPv6, the PIP may not have IPv6 suffix because it may be one created before dual-stack support.
- if isIPv6 {
- pip, err := az.findMatchedPIPByIPFamilyAndServiceName(clusterName, service, pipResourceGroup)
- if err != nil {
- return "", err
- }
- if pip != nil {
- return pointer.StringDeref(pip.Name, ""), nil
- }
- }
-
+func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service, isIPv6 bool) (string, error) {
+ isDualStack := isServiceDualStack(service)
pipName := fmt.Sprintf("%s-%s", clusterName, az.GetLoadBalancerName(context.TODO(), clusterName, service))
if id := getServicePIPPrefixID(service, isIPv6); id != "" {
id, err := getLastSegment(id, "/")
@@ -345,7 +366,7 @@ func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service, pipRes
pipName = fmt.Sprintf("%s-%s", pipName, id)
}
}
- return getResourceByIPFamily(pipName, isIPv6), nil
+ return getResourceByIPFamily(pipName, isDualStack, isIPv6), nil
}
// TODO: UT
@@ -359,19 +380,20 @@ func (az *Cloud) serviceOwnsRule(service *v1.Service, rule string) bool {
// This means the name of the config can be tracked by the service UID.
// 2. The secondary services must have their loadBalancer IP set if they want to share the same config as the primary
// service. Hence, it can be tracked by the loadBalancer IP.
-func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, service *v1.Service) (bool, bool, error) {
+// If the IP version is not empty, which means it is the secondary Service, it returns IP version of the Service FIP.
+func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, service *v1.Service) (bool, bool, network.IPVersion) {
var isPrimaryService bool
baseName := az.GetLoadBalancerName(context.TODO(), "", service)
if strings.HasPrefix(pointer.StringDeref(fip.Name, ""), baseName) {
klog.V(6).Infof("serviceOwnsFrontendIP: found primary service %s of the frontend IP config %s", service.Name, *fip.Name)
isPrimaryService = true
- return true, isPrimaryService, nil
+ return true, isPrimaryService, ""
}
loadBalancerIPs := getServiceLoadBalancerIPs(service)
if len(loadBalancerIPs) == 0 {
// it is a must that the secondary services set the loadBalancer IP
- return false, isPrimaryService, nil
+ return false, isPrimaryService, ""
}
// for external secondary service the public IP address should be checked
@@ -381,7 +403,7 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv
pip, err := az.findMatchedPIPByLoadBalancerIP(service, loadBalancerIP, pipResourceGroup)
if err != nil {
klog.Warningf("serviceOwnsFrontendIP: unexpected error when finding match public IP of the service %s with loadBalancerIP %s: %v", service.Name, loadBalancerIP, err)
- return false, isPrimaryService, nil
+ return false, isPrimaryService, ""
}
if pip != nil &&
@@ -391,20 +413,24 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv
fip.FrontendIPConfigurationPropertiesFormat != nil &&
fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil {
if strings.EqualFold(pointer.StringDeref(pip.ID, ""), pointer.StringDeref(fip.PublicIPAddress.ID, "")) {
- klog.Infof("serviceOwnsFrontendIP: found secondary service %s of the frontend IP config %s", service.Name, *fip.Name)
- return true, isPrimaryService, nil
+ klog.V(6).Infof("serviceOwnsFrontendIP:found secondary service %s of the frontend IP config %s", service.Name, *fip.Name)
+ return true, isPrimaryService, pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion
}
}
- klog.Infof("serviceOwnsFrontendIP: the public IP with ID %s is being referenced by other service with public IP address %s "+
+ klog.V(6).Infof("serviceOwnsFrontendIP: the public IP with ID %s is being referenced by other service with public IP address %s "+
"OR it is of incorrect IP version", *pip.ID, *pip.IPAddress)
}
- return false, isPrimaryService, nil
+ return false, isPrimaryService, ""
}
// for internal secondary service the private IP address on the frontend IP config should be checked
if fip.PrivateIPAddress == nil {
- return false, isPrimaryService, nil
+ return false, isPrimaryService, ""
+ }
+ privateIPAddrVersion := network.IPv4
+ if net.ParseIP(*fip.PrivateIPAddress).To4() == nil {
+ privateIPAddrVersion = network.IPv6
}
privateIPEquals := false
@@ -414,12 +440,21 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv
break
}
}
- return privateIPEquals, isPrimaryService, nil
+ return privateIPEquals, isPrimaryService, privateIPAddrVersion
+}
+
+func (az *Cloud) getFrontendIPConfigNames(service *v1.Service) map[bool]string {
+ isDualStack := isServiceDualStack(service)
+ defaultLBFrontendIPConfigName := az.getDefaultFrontendIPConfigName(service)
+ return map[bool]string{
+ false: getResourceByIPFamily(defaultLBFrontendIPConfigName, isDualStack, false),
+ true: getResourceByIPFamily(defaultLBFrontendIPConfigName, isDualStack, true),
+ }
}
func (az *Cloud) getDefaultFrontendIPConfigName(service *v1.Service) string {
baseName := az.GetLoadBalancerName(context.TODO(), "", service)
- subnetName := subnet(service)
+ subnetName := getInternalSubnet(service)
if subnetName != nil {
ipcName := fmt.Sprintf("%s-%s", baseName, *subnetName)
@@ -765,8 +800,7 @@ func (as *availabilitySet) getAgentPoolAvailabilitySets(vms []compute.VirtualMac
// annotation would be ignored when using one SLB per cluster.
func (as *availabilitySet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (availabilitySetNames *[]string, err error) {
hasMode, isAuto, serviceAvailabilitySetName := as.getServiceLoadBalancerMode(service)
- useSingleSLB := as.useStandardLoadBalancer() && !as.EnableMultipleStandardLoadBalancers
- if !hasMode || useSingleSLB {
+ if !hasMode || as.useStandardLoadBalancer() {
// no mode specified in service annotation or use single SLB mode
// default to PrimaryAvailabilitySetName
availabilitySetNames = &[]string{as.Config.PrimaryAvailabilitySetName}
@@ -900,19 +934,6 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri
if !as.useStandardLoadBalancer() {
// need to check the vmSet name when using the basic LB
needCheck = true
- } else if as.EnableMultipleStandardLoadBalancers {
- // need to check the vmSet name when using multiple standard LBs
- needCheck = true
-
- // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB
- if machine.AvailabilitySet != nil {
- vmasName, _ := getLastSegment(pointer.StringDeref(machine.AvailabilitySet.ID, ""), "/")
- if strings.EqualFold(as.GetPrimaryVMSetName(), vmSetName) &&
- as.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmasName)) {
- klog.V(4).Infof("getPrimaryInterfaceWithVMSet: the vm %s in the vmSet %s is supposed to share the primary SLB", nodeName, vmasName)
- needCheck = false
- }
- }
}
if vmSetName != "" && needCheck {
expectedAvailabilitySetID := as.getAvailabilitySetID(nodeResourceGroup, vmSetName)
@@ -1107,7 +1128,6 @@ func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backend
}
nicUpdaters := make([]func() error, 0)
allErrs := make([]error, 0)
- var nicUpdated bool
ipconfigPrefixToNicMap := map[string]network.Interface{} // ipconfig prefix -> nic
for i := range ipConfigurationIDs {
@@ -1156,6 +1176,7 @@ func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backend
ipconfigPrefixToNicMap[ipConfigIDPrefix] = nic
}
}
+ var nicUpdated atomic.Bool
for k := range ipconfigPrefixToNicMap {
nic := ipconfigPrefixToNicMap[k]
newIPConfigs := *nic.IPConfigurations
@@ -1188,21 +1209,21 @@ func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backend
klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", as.ResourceGroup, pointer.StringDeref(nic.Name, ""), rerr.Error())
return rerr.Error()
}
- nicUpdated = true
+ nicUpdated.Store(true)
return nil
})
}
errs := utilerrors.AggregateGoroutines(nicUpdaters...)
if errs != nil {
- return nicUpdated, utilerrors.Flatten(errs)
+ return nicUpdated.Load(), utilerrors.Flatten(errs)
}
// Fail if there are other errors.
if len(allErrs) > 0 {
- return nicUpdated, utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
+ return nicUpdated.Load(), utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
}
isOperationSucceeded = true
- return nicUpdated, nil
+ return nicUpdated.Load(), nil
}
func getAvailabilitySetNameByID(asID string) (string, error) {
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go
index 1a0f6b717..6b4070391 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go
@@ -18,8 +18,11 @@ package provider
import (
"context"
+ "crypto/rand"
"fmt"
+ "math/big"
"strings"
+ "time"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
"github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns"
@@ -72,9 +75,12 @@ type AccountOptions struct {
SubnetName string
AccessTier string
MatchTags bool
+ GetLatestAccountKey bool
EnableBlobVersioning *bool
SoftDeleteBlobs int32
SoftDeleteContainers int32
+ // indicate whether to get a random matching account, if false, will get the first matching account
+ PickRandomMatchingAccount bool
}
type accountWithLocation struct {
@@ -121,7 +127,8 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account
}
// GetStorageAccesskey gets the storage account access key
-func (az *Cloud) GetStorageAccesskey(ctx context.Context, subsID, account, resourceGroup string) (string, error) {
+// getLatestAccountKey: get the latest account key per CreationTime if true, otherwise get the first account key
+func (az *Cloud) GetStorageAccesskey(ctx context.Context, subsID, account, resourceGroup string, getLatestAccountKey bool) (string, error) {
if az.StorageAccountClient == nil {
return "", fmt.Errorf("StorageAccountClient is nil")
}
@@ -134,16 +141,40 @@ func (az *Cloud) GetStorageAccesskey(ctx context.Context, subsID, account, resou
return "", fmt.Errorf("empty keys")
}
+ var key string
+ var creationTime time.Time
+
for _, k := range *result.Keys {
if k.Value != nil && *k.Value != "" {
v := *k.Value
if ind := strings.LastIndex(v, " "); ind >= 0 {
v = v[(ind + 1):]
}
- return v, nil
+ if !getLatestAccountKey {
+ // get first key
+ return v, nil
+ }
+ // get account key with latest CreationTime
+ if key == "" {
+ key = v
+ if k.CreationTime != nil {
+ creationTime = k.CreationTime.ToTime()
+ }
+ klog.V(2).Infof("got storage account key with creation time: %v", creationTime)
+ } else {
+ if k.CreationTime != nil && creationTime.Before(k.CreationTime.ToTime()) {
+ key = v
+ creationTime = k.CreationTime.ToTime()
+ klog.V(2).Infof("got storage account key with latest creation time: %v", creationTime)
+ }
+ }
}
}
- return "", fmt.Errorf("no valid keys")
+
+ if key == "" {
+ return "", fmt.Errorf("no valid keys")
+ }
+ return key, nil
}
// EnsureStorageAccount search storage account, create one storage account(with genAccountNamePrefix) if not found, return accountName, accountKey
@@ -212,7 +243,17 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou
}
if len(accounts) > 0 {
- accountName = accounts[0].Name
+ index := 0
+ if accountOptions.PickRandomMatchingAccount {
+ // randomly pick one matching account
+ n, err := rand.Int(rand.Reader, big.NewInt(int64(len(accounts))))
+ if err != nil || n == nil {
+ return "", "", err
+ }
+ index = int(n.Int64())
+ klog.V(4).Infof("randomly pick one matching account, index: %d", index)
+ }
+ accountName = accounts[index].Name
createNewAccount = false
klog.V(4).Infof("found a matching account %s type %s location %s", accounts[0].Name, accounts[0].StorageType, accounts[0].Location)
}
@@ -225,7 +266,7 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou
createNewAccount = false
if accountOptions.CreateAccount {
// check whether account exists
- if _, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup); err != nil {
+ if _, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup, accountOptions.GetLatestAccountKey); err != nil {
klog.V(2).Infof("get storage key for storage account %s returned with %v", accountName, err)
createNewAccount = true
}
@@ -455,7 +496,7 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou
}
// find the access key with this account
- accountKey, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup)
+ accountKey, err := az.GetStorageAccesskey(ctx, subsID, accountName, resourceGroup, accountOptions.GetLatestAccountKey)
if err != nil {
return "", "", fmt.Errorf("could not get storage key for storage account %s: %w", accountName, err)
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go
index c9dd45b78..a9c13f143 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go
@@ -26,7 +26,6 @@ import (
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
v1 "k8s.io/api/core/v1"
- "k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog/v2"
utilnet "k8s.io/utils/net"
"k8s.io/utils/pointer"
@@ -172,6 +171,7 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string
for k := range currentTagsOnResource {
if _, ok := newTags[k]; !ok {
if found, _ := findKeyInMapCaseInsensitive(systemTagsMap, k); !found {
+ klog.V(2).Infof("reconcileTags: delete tag %s: %s", k, pointer.StringDeref(currentTagsOnResource[k], ""))
delete(currentTagsOnResource, k)
changed = true
}
@@ -182,18 +182,6 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string
return currentTagsOnResource, changed
}
-func (az *Cloud) getVMSetNamesSharingPrimarySLB() sets.Set[string] {
- vmSetNames := make([]string, 0)
- if az.NodePoolsWithoutDedicatedSLB != "" {
- vmSetNames = strings.Split(az.Config.NodePoolsWithoutDedicatedSLB, consts.VMSetNamesSharingPrimarySLBDelimiter)
- for i := 0; i < len(vmSetNames); i++ {
- vmSetNames[i] = strings.ToLower(strings.TrimSpace(vmSetNames[i]))
- }
- }
-
- return sets.New(vmSetNames...)
-}
-
func getExtendedLocationTypeFromString(extendedLocationType string) network.ExtendedLocationTypes {
extendedLocationType = strings.ToLower(extendedLocationType)
if val, ok := strToExtendedLocationType[extendedLocationType]; ok {
@@ -435,51 +423,25 @@ func getServicePIPPrefixID(service *v1.Service, isIPv6 bool) string {
return service.Annotations[consts.ServiceAnnotationPIPPrefixIDDualStack[isIPv6]]
}
-func getResourceByIPFamily(resource string, isIPv6 bool) string {
- if isIPv6 {
+// getResourceByIPFamily returns the resource name of with IPv6 suffix when
+// it is a dual-stack Service and the resource is of IPv6.
+// NOTICE: For PIPs of IPv6 Services created with CCM v1.27.1, after the CCM is upgraded,
+// the old PIPs will be recreated.
+func getResourceByIPFamily(resource string, isDualStack, isIPv6 bool) string {
+ if isDualStack && isIPv6 {
return fmt.Sprintf("%s-%s", resource, v6Suffix)
}
return resource
}
// isFIPIPv6 checks if the frontend IP configuration is of IPv6.
-func (az *Cloud) isFIPIPv6(fip *network.FrontendIPConfiguration, pipResourceGroup string, isInternal bool) (isIPv6 bool, err error) {
- pips, err := az.listPIP(pipResourceGroup)
- if err != nil {
- return false, fmt.Errorf("isFIPIPv6: failed to list pip: %w", err)
- }
- if isInternal {
- if fip.FrontendIPConfigurationPropertiesFormat != nil {
- if fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddressVersion != "" {
- return fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddressVersion == network.IPv6, nil
- }
- return net.ParseIP(pointer.StringDeref(fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddress, "")).To4() == nil, nil
- }
- klog.Errorf("Checking IP Family of frontend IP configuration %q of internal Service but its"+
- " FrontendIPConfigurationPropertiesFormat is nil. It's considered to be IPv4",
- pointer.StringDeref(fip.Name, ""))
- return
- }
- var fipPIPID string
- if fip.FrontendIPConfigurationPropertiesFormat != nil && fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil {
- fipPIPID = pointer.StringDeref(fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.ID, "")
+// NOTICE: isFIPIPv6 assumes the FIP is owned by the Service and it is the primary Service.
+func (az *Cloud) isFIPIPv6(service *v1.Service, pipRG string, fip *network.FrontendIPConfiguration) (bool, error) {
+ isDualStack := isServiceDualStack(service)
+ if !isDualStack {
+ return service.Spec.IPFamilies[0] == v1.IPv6Protocol, nil
}
- for _, pip := range pips {
- id := pointer.StringDeref(pip.ID, "")
- if !strings.EqualFold(fipPIPID, id) {
- continue
- }
- if pip.PublicIPAddressPropertiesFormat != nil {
- // First check PublicIPAddressVersion, then IPAddress
- if pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv6 ||
- net.ParseIP(pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.IPAddress, "")).To4() == nil {
- isIPv6 = true
- break
- }
- }
- break
- }
- return isIPv6, nil
+ return managedResourceHasIPv6Suffix(pointer.StringDeref(fip.Name, "")), nil
}
// getResourceIDPrefix returns a substring from the provided one between beginning and the last "/".
@@ -490,3 +452,56 @@ func getResourceIDPrefix(id string) string {
}
return id[:idx]
}
+
+// fillSubnet fills subnet value into the variable.
+func (az *Cloud) fillSubnet(subnet *network.Subnet, subnetName string) error {
+ if subnet == nil {
+ return fmt.Errorf("subnet is nil, should not happen")
+ }
+ if subnet.ID == nil {
+ curSubnet, existsSubnet, err := az.getSubnet(az.VnetName, subnetName)
+ if err != nil {
+ return err
+ }
+ if !existsSubnet {
+ return fmt.Errorf("failed to get subnet: %s/%s", az.VnetName, subnetName)
+ }
+ *subnet = curSubnet
+ }
+ return nil
+}
+
+func getLBNameFromBackendPoolID(backendPoolID string) (string, error) {
+ matches := backendPoolIDRE.FindStringSubmatch(backendPoolID)
+ if len(matches) != 2 {
+ return "", fmt.Errorf("backendPoolID %q is in wrong format", backendPoolID)
+ }
+
+ return matches[1], nil
+}
+
+func countNICsOnBackendPool(backendPool network.BackendAddressPool) int {
+ if backendPool.BackendAddressPoolPropertiesFormat == nil ||
+ backendPool.BackendIPConfigurations == nil {
+ return 0
+ }
+
+ return len(*backendPool.BackendIPConfigurations)
+}
+
+func countIPsOnBackendPool(backendPool network.BackendAddressPool) int {
+ if backendPool.BackendAddressPoolPropertiesFormat == nil ||
+ backendPool.LoadBalancerBackendAddresses == nil {
+ return 0
+ }
+
+ var ipsCount int
+ for _, loadBalancerBackendAddress := range *backendPool.LoadBalancerBackendAddresses {
+ if loadBalancerBackendAddress.LoadBalancerBackendAddressPropertiesFormat != nil &&
+ pointer.StringDeref(loadBalancerBackendAddress.IPAddress, "") != "" {
+ ipsCount++
+ }
+ }
+
+ return ipsCount
+}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go
index f5a883f20..e405ef3a7 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go
@@ -19,7 +19,7 @@ package provider
import (
"context"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
"github.com/Azure/go-autorest/autorest/azure"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go
index 8e22e283b..469210f85 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go
@@ -24,8 +24,9 @@ import (
"strconv"
"strings"
"sync"
+ "sync/atomic"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
v1 "k8s.io/api/core/v1"
@@ -901,8 +902,7 @@ func (ss *ScaleSet) getAgentPoolScaleSets(nodes []*v1.Node) (*[]string, error) {
// for loadbalancer exists then return the eligible VMSet.
func (ss *ScaleSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[]string, error) {
hasMode, isAuto, serviceVMSetName := ss.getServiceLoadBalancerMode(service)
- useSingleSLB := ss.useStandardLoadBalancer() && !ss.EnableMultipleStandardLoadBalancers
- if !hasMode || useSingleSLB {
+ if !hasMode || ss.useStandardLoadBalancer() {
// no mode specified in service annotation or use single SLB mode
// default to PrimaryScaleSetName
scaleSetNames := &[]string{ss.Config.PrimaryScaleSetName}
@@ -1093,17 +1093,6 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam
if !ss.useStandardLoadBalancer() {
// need to check the vmSet name when using the basic LB
needCheck = true
- } else if ss.EnableMultipleStandardLoadBalancers {
- // need to check the vmSet name when using multiple standard LBs
- needCheck = true
-
- // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB
- if strings.EqualFold(ss.GetPrimaryVMSetName(), vmSetNameOfLB) &&
- ss.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vm.VMSSName)) {
- klog.V(4).Infof("EnsureHostInPool: the vm %s in the vmSet %s is supposed to share the primary SLB",
- nodeName, vm.VMSSName)
- needCheck = false
- }
}
if vmSetNameOfLB != "" && needCheck && !strings.EqualFold(vmSetNameOfLB, vm.VMSSName) {
@@ -1216,7 +1205,7 @@ func (ss *ScaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back
// the single standard load balancer supports multiple vmss in its backend while
// multiple standard load balancers and the basic load balancer doesn't
- if ss.useStandardLoadBalancer() && !ss.EnableMultipleStandardLoadBalancers {
+ if ss.useStandardLoadBalancer() {
for _, node := range nodes {
if ss.excludeMasterNodesFromStandardLB() && isControlPlaneNode(node) {
continue
@@ -1555,7 +1544,7 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName string, backendPoo
// Find primary network interface configuration.
if vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil {
- klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, "+
+ klog.V(4).Infof("ensureBackendPoolDeletedFromNode: cannot obtain the primary network interface configuration, of vm %s, "+
"probably because the vm's being deleted", nodeName)
return "", "", "", nil, nil
}
@@ -1711,7 +1700,7 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVmssUniform(backendPoolIDs []str
vmssNamesMap := make(map[string]bool)
// the standard load balancer supports multiple vmss in its backend while the basic sku doesn't
- if ss.useStandardLoadBalancer() && !ss.EnableMultipleStandardLoadBalancers {
+ if ss.useStandardLoadBalancer() {
cachedUniform, err := ss.vmssCache.Get(consts.VMSSKey, azcache.CacheReadTypeDefault)
if err != nil {
klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to get vmss uniform from cache: %v", err)
@@ -1889,7 +1878,7 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolIDs
}
// Update VMs with best effort that have already been added to nodeUpdates.
- var updatedVM bool
+ var updatedVM atomic.Bool
for meta, update := range nodeUpdates {
// create new instance of meta and update for passing to anonymous function
meta := meta
@@ -1918,22 +1907,22 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolIDs
return rerr.Error()
}
- updatedVM = true
+ updatedVM.Store(true)
return nil
})
}
errs := utilerrors.AggregateGoroutines(hostUpdates...)
if errs != nil {
- return updatedVM, utilerrors.Flatten(errs)
+ return updatedVM.Load(), utilerrors.Flatten(errs)
}
// Fail if there are other errors.
if len(allErrs) > 0 {
- return updatedVM, utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
+ return updatedVM.Load(), utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
}
isOperationSucceeded = true
- return updatedVM, nil
+ return updatedVM.Load(), nil
}
// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes.
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go
index 80c403dbb..2ab07adff 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go
@@ -23,7 +23,7 @@ import (
"sync"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog/v2"
@@ -196,7 +196,7 @@ func (ss *ScaleSet) newVMSSVirtualMachinesCache() (*azcache.TimedCache, error) {
}
// set cache entry to nil when the VM is under deleting.
if vm.VirtualMachineScaleSetVMProperties != nil &&
- strings.EqualFold(pointer.StringDeref(vm.VirtualMachineScaleSetVMProperties.ProvisioningState, ""), string(compute.ProvisioningStateDeleting)) {
+ strings.EqualFold(pointer.StringDeref(vm.VirtualMachineScaleSetVMProperties.ProvisioningState, ""), string(consts.ProvisioningStateDeleting)) {
klog.V(4).Infof("VMSS virtualMachine %q is under deleting, setting its cache to nil", computerName)
vmssVMCacheEntry.VirtualMachine = nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go
index ff55cacb1..2d760239c 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go
@@ -23,8 +23,9 @@ import (
"strconv"
"strings"
"sync"
+ "sync/atomic"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
@@ -125,8 +126,7 @@ func (fs *FlexScaleSet) GetAgentPoolVMSetNames(nodes []*v1.Node) (*[]string, err
// annotation would be ignored when using one SLB per cluster.
func (fs *FlexScaleSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[]string, error) {
hasMode, isAuto, serviceVMSetName := fs.getServiceLoadBalancerMode(service)
- useSingleSLB := fs.useStandardLoadBalancer() && !fs.EnableMultipleStandardLoadBalancers
- if !hasMode || useSingleSLB {
+ if !hasMode || fs.useStandardLoadBalancer() {
// no mode specified in service annotation or use single SLB mode
// default to PrimaryScaleSetName
vmssFlexNames := &[]string{fs.Config.PrimaryScaleSetName}
@@ -481,18 +481,6 @@ func (fs *FlexScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.Nod
if !fs.useStandardLoadBalancer() {
return "", "", "", nil, fmt.Errorf("EnsureHostInPool: VMSS Flex does not support Basic Load Balancer")
}
- if fs.EnableMultipleStandardLoadBalancers {
- // need to check the vmSet name when using multiple standard LBs
- needCheck = true
-
- // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB
- if strings.EqualFold(fs.GetPrimaryVMSetName(), vmSetNameOfLB) &&
- fs.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmssFlexName)) {
- klog.V(4).Infof("EnsureHostInPool: the vm %s in the vmSet %s is supposed to share the primary SLB",
- nodeName, vmssFlexName)
- needCheck = false
- }
- }
if vmSetNameOfLB != "" && needCheck && !strings.EqualFold(vmSetNameOfLB, vmssFlexName) {
klog.V(3).Infof("EnsureHostInPool skips node %s because it is not in the ScaleSet %s", name, vmSetNameOfLB)
return "", "", "", nil, errNotInVMSet
@@ -594,7 +582,7 @@ func (fs *FlexScaleSet) ensureVMSSFlexInPool(service *v1.Service, nodes []*v1.No
// the single standard load balancer supports multiple vmss in its backend while
// multiple standard load balancers doesn't
- if fs.useStandardLoadBalancer() && !fs.EnableMultipleStandardLoadBalancers {
+ if fs.useStandardLoadBalancer() {
for _, node := range nodes {
if fs.excludeMasterNodesFromStandardLB() && isControlPlaneNode(node) {
continue
@@ -787,7 +775,7 @@ func (fs *FlexScaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node,
func (fs *FlexScaleSet) ensureBackendPoolDeletedFromVmssFlex(backendPoolIDs []string, vmSetName string) error {
vmssNamesMap := make(map[string]bool)
- if fs.useStandardLoadBalancer() && !fs.EnableMultipleStandardLoadBalancers {
+ if fs.useStandardLoadBalancer() {
cached, err := fs.vmssFlexCache.Get(consts.VmssFlexKey, azcache.CacheReadTypeDefault)
if err != nil {
klog.Errorf("ensureBackendPoolDeletedFromVmssFlex: failed to get vmss flex from cache: %v", err)
@@ -936,7 +924,7 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo
}
// only vmsses in the resource group same as it's in azure config are included
if strings.EqualFold(resourceGroupName, fs.ResourceGroup) {
- if fs.useStandardLoadBalancer() && !fs.EnableMultipleStandardLoadBalancers {
+ if fs.useStandardLoadBalancer() {
vmssFlexVMNameMap[nodeName] = nicName
} else {
if strings.EqualFold(vmssFlexName, vmSetName) {
@@ -958,8 +946,8 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo
}
}
- klog.V(2).Infof("Ensure backendPoolIDs deleted from the VMSS VMs.", backendPoolIDs)
- klog.V(2).Infof("go into fs.ensureBackendPoolDeletedFromNode, vmssFlexVMNameMap: %s, size: %s", vmssFlexVMNameMap, len(vmssFlexVMNameMap))
+ klog.V(2).Infof("Ensure backendPoolIDs %q deleted from the VMSS VMs.", backendPoolIDs)
+ klog.V(2).Infof("go into fs.ensureBackendPoolDeletedFromNode, vmssFlexVMNameMap: %s, size: %d", vmssFlexVMNameMap, len(vmssFlexVMNameMap))
nicUpdated, err := fs.ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap, backendPoolIDs)
klog.V(2).Infof("exit from fs.ensureBackendPoolDeletedFromNode")
if err != nil {
@@ -978,7 +966,6 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo
func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[string]string, backendPoolIDs []string) (bool, error) {
nicUpdaters := make([]func() error, 0)
allErrs := make([]error, 0)
- var nicUpdated bool
nics := map[string]network.Interface{} // nicName -> nic
for nodeName, nicName := range vmssFlexVMNameMap {
if _, ok := nics[nicName]; ok {
@@ -1002,7 +989,9 @@ func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[s
nics[nicName] = nic
}
}
+ var nicUpdated atomic.Bool
for _, nic := range nics {
+ nic := nic
newIPConfigs := *nic.IPConfigurations
for j, ipConf := range newIPConfigs {
if !pointer.BoolDeref(ipConf.Primary, false) {
@@ -1033,18 +1022,18 @@ func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[s
klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", fs.ResourceGroup, pointer.StringDeref(nic.Name, ""), rerr.Error())
return rerr.Error()
}
- nicUpdated = true
+ nicUpdated.Store(true)
klog.V(2).Infof("EnsureBackendPoolDeleted done")
return nil
})
}
- klog.V(2).Infof("nicUpdaters size: %s", len(nicUpdaters))
+ klog.V(2).Infof("nicUpdaters size: %d", len(nicUpdaters))
errs := utilerrors.AggregateGoroutines(nicUpdaters...)
if errs != nil {
allErrs = append(allErrs, utilerrors.Flatten(errs))
}
if len(allErrs) > 0 {
- return nicUpdated, utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
+ return nicUpdated.Load(), utilerrors.Flatten(utilerrors.NewAggregate(allErrs))
}
- return nicUpdated, nil
+ return nicUpdated.Load(), nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go
index 126b39503..8db7b5f7f 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go
@@ -24,7 +24,7 @@ import (
"sync"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
cloudprovider "k8s.io/cloud-provider"
"k8s.io/klog/v2"
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go
index 6a883ba57..ea6e555e3 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go
@@ -24,7 +24,7 @@ import (
"sync"
"time"
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network"
"k8s.io/apimachinery/pkg/types"
@@ -125,8 +125,8 @@ func (az *Cloud) getPublicIPAddress(pipResourceGroup string, pipName string, crt
return *(deepcopy.Copy(pip).(*network.PublicIPAddress)), true, nil
}
-func (az *Cloud) listPIP(pipResourceGroup string) ([]network.PublicIPAddress, error) {
- cached, err := az.pipCache.Get(pipResourceGroup, azcache.CacheReadTypeDefault)
+func (az *Cloud) listPIP(pipResourceGroup string, crt azcache.AzureCacheReadType) ([]network.PublicIPAddress, error) {
+ cached, err := az.pipCache.Get(pipResourceGroup, crt)
if err != nil {
return nil, err
}
@@ -158,9 +158,7 @@ func (az *Cloud) getSubnet(virtualNetworkName string, subnetName string) (networ
if !exists {
klog.V(2).Infof("Subnet %q not found", subnetName)
- return subnet, false, nil
}
-
return subnet, exists, nil
}
@@ -231,7 +229,7 @@ func (az *Cloud) newVMCache() (*azcache.TimedCache, error) {
}
if vm.VirtualMachineProperties != nil &&
- strings.EqualFold(pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), string(compute.ProvisioningStateDeleting)) {
+ strings.EqualFold(pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), string(consts.ProvisioningStateDeleting)) {
klog.V(2).Infof("Virtual machine %q is under deleting", key)
return nil, nil
}
diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go
index 7e37c7036..bd6b77535 100644
--- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go
+++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go
@@ -17,7 +17,7 @@ limitations under the License.
package virtualmachine
import (
- "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute"
+ "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute"
"k8s.io/utils/pointer"
)