mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: bump the github-dependencies group with 5 updates
Bumps the github-dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.49.0` | `1.49.13` | | [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) | `1.26.5` | `1.26.6` | | [github.com/google/uuid](https://github.com/google/uuid) | `1.4.0` | `1.5.0` | | [github.com/kubernetes-csi/csi-lib-utils](https://github.com/kubernetes-csi/csi-lib-utils) | `0.14.0` | `0.17.0` | | [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) | `1.17.0` | `1.18.0` | Updates `github.com/aws/aws-sdk-go` from 1.49.0 to 1.49.13 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.49.0...v1.49.13) Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.26.5 to 1.26.6 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.26.5...service/s3/v1.26.6) Updates `github.com/google/uuid` from 1.4.0 to 1.5.0 - [Release notes](https://github.com/google/uuid/releases) - [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) Updates `github.com/kubernetes-csi/csi-lib-utils` from 0.14.0 to 0.17.0 - [Release notes](https://github.com/kubernetes-csi/csi-lib-utils/releases) - [Commits](https://github.com/kubernetes-csi/csi-lib-utils/compare/v0.14.0...v0.17.0) Updates `github.com/prometheus/client_golang` from 1.17.0 to 1.18.0 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/google/uuid dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/kubernetes-csi/csi-lib-utils dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
017dddcbfc
commit
b2ae48dc2d
4
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
||||
# v1.26.6 (2023-12-20)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.26.5 (2023-12-08)
|
||||
|
||||
* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.
|
||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
||||
package sts
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.26.5"
|
||||
const goModuleVersion = "1.26.6"
|
||||
|
3
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
@ -183,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-west-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
|
11
vendor/github.com/aws/aws-sdk-go/aws/config.go
generated
vendored
11
vendor/github.com/aws/aws-sdk-go/aws/config.go
generated
vendored
@ -442,6 +442,17 @@ func (c *Config) WithUseDualStack(enable bool) *Config {
|
||||
return c
|
||||
}
|
||||
|
||||
// WithUseFIPSEndpoint sets a config UseFIPSEndpoint value returning a Config
|
||||
// pointer for chaining.
|
||||
func (c *Config) WithUseFIPSEndpoint(enable bool) *Config {
|
||||
if enable {
|
||||
c.UseFIPSEndpoint = endpoints.FIPSEndpointStateEnabled
|
||||
} else {
|
||||
c.UseFIPSEndpoint = endpoints.FIPSEndpointStateDisabled
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
// WithEC2MetadataDisableTimeoutOverride sets a config EC2MetadataDisableTimeoutOverride value
|
||||
// returning a Config pointer for chaining.
|
||||
func (c *Config) WithEC2MetadataDisableTimeoutOverride(enable bool) *Config {
|
||||
|
1097
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
generated
vendored
1097
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go
generated
vendored
File diff suppressed because it is too large
Load Diff
2
vendor/github.com/aws/aws-sdk-go/aws/version.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/aws/version.go
generated
vendored
@ -5,4 +5,4 @@ package aws
|
||||
const SDKName = "aws-sdk-go"
|
||||
|
||||
// SDKVersion is the version of this SDK
|
||||
const SDKVersion = "1.49.0"
|
||||
const SDKVersion = "1.49.13"
|
||||
|
226
vendor/github.com/aws/aws-sdk-go/service/kms/api.go
generated
vendored
226
vendor/github.com/aws/aws-sdk-go/service/kms/api.go
generated
vendored
@ -75,6 +75,9 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ
|
||||
//
|
||||
// Related operations: ScheduleKeyDeletion
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -270,6 +273,9 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r
|
||||
//
|
||||
// - UpdateCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -470,6 +476,9 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request,
|
||||
//
|
||||
// - UpdateAlias
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -664,6 +673,9 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req
|
||||
//
|
||||
// - UpdateCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -791,7 +803,7 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req
|
||||
// - XksProxyVpcEndpointServiceInvalidConfigurationException
|
||||
// The request was rejected because the Amazon VPC endpoint service configuration
|
||||
// does not fulfill the requirements for an external key store proxy. For details,
|
||||
// see the exception message and review the requirements (kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// see the exception message and review the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// for Amazon VPC endpoint service connectivity for an external key store.
|
||||
//
|
||||
// - XksProxyInvalidResponseException
|
||||
@ -922,6 +934,9 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request,
|
||||
//
|
||||
// - RevokeGrant
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -1218,6 +1233,9 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out
|
||||
//
|
||||
// - ScheduleKeyDeletion
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -1462,10 +1480,10 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output
|
||||
// or any Amazon Web Services SDK. Use the Recipient parameter to provide the
|
||||
// attestation document for the enclave. Instead of the plaintext data, the
|
||||
// response includes the plaintext data encrypted with the public key from the
|
||||
// attestation document (CiphertextForRecipient).For information about the interaction
|
||||
// between KMS and Amazon Web Services Nitro Enclaves, see How Amazon Web Services
|
||||
// Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html)
|
||||
// in the Key Management Service Developer Guide..
|
||||
// attestation document (CiphertextForRecipient). For information about the
|
||||
// interaction between KMS and Amazon Web Services Nitro Enclaves, see How Amazon
|
||||
// Web Services Nitro Enclaves uses KMS (https://docs.aws.amazon.com/kms/latest/developerguide/services-nitro-enclaves.html)
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
// The KMS key that you use for this operation must be in a compatible key state.
|
||||
// For details, see Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
|
||||
@ -1488,6 +1506,9 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output
|
||||
//
|
||||
// - ReEncrypt
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -1672,6 +1693,9 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request,
|
||||
//
|
||||
// - UpdateAlias
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -1827,6 +1851,9 @@ func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req
|
||||
//
|
||||
// - UpdateCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -1971,6 +1998,9 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI
|
||||
//
|
||||
// - ImportKeyMaterial
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2140,6 +2170,9 @@ func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput
|
||||
//
|
||||
// - UpdateCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2288,11 +2321,11 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request,
|
||||
// signing, or generating and verifying MACs) and the algorithms that the KMS
|
||||
// key supports.
|
||||
//
|
||||
// For multi-Region keys (kms/latest/developerguide/multi-region-keys-overview.html),
|
||||
// For multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html),
|
||||
// DescribeKey displays the primary key and all related replica keys. For KMS
|
||||
// keys in CloudHSM key stores (kms/latest/developerguide/keystore-cloudhsm.html),
|
||||
// keys in CloudHSM key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-cloudhsm.html),
|
||||
// it includes information about the key store, such as the key store ID and
|
||||
// the CloudHSM cluster ID. For KMS keys in external key stores (kms/latest/developerguide/keystore-external.html),
|
||||
// the CloudHSM cluster ID. For KMS keys in external key stores (https://docs.aws.amazon.com/kms/latest/developerguide/keystore-external.html),
|
||||
// it includes the custom key store ID and the ID of the external key.
|
||||
//
|
||||
// DescribeKey does not return the following information:
|
||||
@ -2338,6 +2371,9 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request,
|
||||
//
|
||||
// - ListRetirableGrants
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2448,6 +2484,9 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o
|
||||
//
|
||||
// Related operations: EnableKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2593,6 +2632,9 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *re
|
||||
//
|
||||
// - GetKeyRotationStatus
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2752,6 +2794,9 @@ func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInp
|
||||
//
|
||||
// - UpdateCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2879,6 +2924,9 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, out
|
||||
//
|
||||
// Related operations: DisableKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -2994,7 +3042,7 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ
|
||||
// Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html)
|
||||
// of the specified symmetric encryption KMS key.
|
||||
//
|
||||
// When you enable automatic rotation of acustomer managed KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk),
|
||||
// When you enable automatic rotation of a customer managed KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk),
|
||||
// KMS rotates the key material of the KMS key one year (approximately 365 days)
|
||||
// from the enable date and every year thereafter. You can monitor rotation
|
||||
// of the key material for your KMS keys in CloudTrail and Amazon CloudWatch.
|
||||
@ -3043,6 +3091,9 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ
|
||||
//
|
||||
// - GetKeyRotationStatus
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -3220,6 +3271,9 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output
|
||||
//
|
||||
// - GenerateDataKeyPair
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -3445,6 +3499,9 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.
|
||||
//
|
||||
// - GenerateDataKeyWithoutPlaintext
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -3582,8 +3639,8 @@ func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *
|
||||
// private key that is encrypted under the symmetric encryption KMS key you
|
||||
// specify. You can use the data key pair to perform asymmetric cryptography
|
||||
// and implement digital signatures outside of KMS. The bytes in the keys are
|
||||
// random; they not related to the caller or to the KMS key that is used to
|
||||
// encrypt the private key.
|
||||
// random; they are not related to the caller or to the KMS key that is used
|
||||
// to encrypt the private key.
|
||||
//
|
||||
// You can use the public key that GenerateDataKeyPair returns to encrypt data
|
||||
// or verify a signature outside of KMS. Then, store the encrypted private key
|
||||
@ -3660,6 +3717,9 @@ func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *
|
||||
//
|
||||
// - GenerateDataKeyWithoutPlaintext
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -3854,6 +3914,9 @@ func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyP
|
||||
//
|
||||
// - GenerateDataKeyWithoutPlaintext
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -4060,6 +4123,9 @@ func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWitho
|
||||
//
|
||||
// - GenerateDataKeyPairWithoutPlaintext
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -4226,6 +4292,9 @@ func (c *KMS) GenerateMacRequest(input *GenerateMacInput) (req *request.Request,
|
||||
//
|
||||
// Related operations: VerifyMac
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -4383,6 +4452,9 @@ func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Re
|
||||
// Required permissions: kms:GenerateRandom (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html)
|
||||
// (IAM policy)
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -4510,7 +4582,10 @@ func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Reques
|
||||
// Required permissions: kms:GetKeyPolicy (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html)
|
||||
// (key policy)
|
||||
//
|
||||
// Related operations: PutKeyPolicy
|
||||
// Related operations: PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
@ -4676,6 +4751,9 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req
|
||||
//
|
||||
// - EnableKeyRotation
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -4800,11 +4878,11 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput)
|
||||
// Origin value of EXTERNAL to create a KMS key with no key material. You can
|
||||
// import key material for a symmetric encryption KMS key, HMAC KMS key, asymmetric
|
||||
// encryption KMS key, or asymmetric signing KMS key. You can also import key
|
||||
// material into a multi-Region key (kms/latest/developerguide/multi-region-keys-overview.html)
|
||||
// material into a multi-Region key (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html)
|
||||
// of any supported type. However, you can't import key material into a KMS
|
||||
// key in a custom key store (kms/latest/developerguide/custom-key-store-overview.html).
|
||||
// key in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
|
||||
// You can also use GetParametersForImport to get a public key and import token
|
||||
// to reimport the original key material (kms/latest/developerguide/importing-keys.html#reimport-key-material)
|
||||
// to reimport the original key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material)
|
||||
// into a KMS key whose key material expired or was deleted.
|
||||
//
|
||||
// GetParametersForImport returns the items that you need to import your key
|
||||
@ -4853,6 +4931,9 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput)
|
||||
//
|
||||
// - DeleteImportedKeyMaterial
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -5017,6 +5098,9 @@ func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Reques
|
||||
//
|
||||
// Related operations: CreateKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -5256,6 +5340,9 @@ func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *requ
|
||||
//
|
||||
// - GetParametersForImport
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -5431,6 +5518,9 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request,
|
||||
//
|
||||
// - UpdateAlias
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -5615,6 +5705,9 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o
|
||||
//
|
||||
// - RevokeGrant
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -5799,7 +5892,10 @@ func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.
|
||||
//
|
||||
// - GetKeyPolicy
|
||||
//
|
||||
// - PutKeyPolicy
|
||||
// - PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
@ -5983,6 +6079,9 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, outpu
|
||||
//
|
||||
// - ListResourceTags
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -6149,6 +6248,9 @@ func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *reques
|
||||
//
|
||||
// - UntagResource
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -6311,14 +6413,22 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *
|
||||
// grants in several programming languages, see Programming grants (https://docs.aws.amazon.com/kms/latest/developerguide/programming-grants.html).
|
||||
//
|
||||
// Cross-account use: You must specify a principal in your Amazon Web Services
|
||||
// account. However, this operation can return grants in any Amazon Web Services
|
||||
// account. You do not need kms:ListRetirableGrants permission (or any other
|
||||
// additional permission) in any Amazon Web Services account other than your
|
||||
// own.
|
||||
// account. This operation returns a list of grants where the retiring principal
|
||||
// specified in the ListRetirableGrants request is the same retiring principal
|
||||
// on the grant. This can include grants on KMS keys owned by other Amazon Web
|
||||
// Services accounts, but you do not need kms:ListRetirableGrants permission
|
||||
// (or any other additional permission) in any Amazon Web Services account other
|
||||
// than your own.
|
||||
//
|
||||
// Required permissions: kms:ListRetirableGrants (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html)
|
||||
// (IAM policy) in your Amazon Web Services account.
|
||||
//
|
||||
// KMS authorizes ListRetirableGrants requests by evaluating the caller account's
|
||||
// kms:ListRetirableGrants permissions. The authorized resource in ListRetirableGrants
|
||||
// calls is the retiring principal specified in the request. KMS does not evaluate
|
||||
// the caller's permissions to verify their access to any KMS keys or grants
|
||||
// that might be returned by the ListRetirableGrants call.
|
||||
//
|
||||
// Related operations:
|
||||
//
|
||||
// - CreateGrant
|
||||
@ -6329,6 +6439,9 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *
|
||||
//
|
||||
// - RevokeGrant
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -6493,6 +6606,9 @@ func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Reques
|
||||
//
|
||||
// Related operations: GetKeyPolicy
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -6697,6 +6813,9 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out
|
||||
//
|
||||
// - GenerateDataKeyPair
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -6900,7 +7019,7 @@ func (c *KMS) ReplicateKeyRequest(input *ReplicateKeyInput) (req *request.Reques
|
||||
// If you replicate a multi-Region primary key with imported key material, the
|
||||
// replica key is created with no key material. You must import the same key
|
||||
// material that you imported into the primary key. For details, see Importing
|
||||
// key material into multi-Region keys (kms/latest/developerguide/multi-region-keys-import.html)
|
||||
// key material into multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-import.html)
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
// To convert a replica key to a primary key, use the UpdatePrimaryRegion operation.
|
||||
@ -6927,6 +7046,9 @@ func (c *KMS) ReplicateKeyRequest(input *ReplicateKeyInput) (req *request.Reques
|
||||
//
|
||||
// - UpdatePrimaryRegion
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7073,7 +7195,7 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request,
|
||||
// Cross-account use: Yes. You can retire a grant on a KMS key in a different
|
||||
// Amazon Web Services account.
|
||||
//
|
||||
// Required permissions::Permission to retire a grant is determined primarily
|
||||
// Required permissions: Permission to retire a grant is determined primarily
|
||||
// by the grant. For details, see Retiring and revoking grants (https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#grant-delete)
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
@ -7087,6 +7209,9 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request,
|
||||
//
|
||||
// - RevokeGrant
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7236,6 +7361,9 @@ func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request,
|
||||
//
|
||||
// - RetireGrant
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7360,7 +7488,7 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *
|
||||
//
|
||||
// Deleting a KMS key is a destructive and potentially dangerous operation.
|
||||
// When a KMS key is deleted, all data that was encrypted under the KMS key
|
||||
// is unrecoverable. (The only exception is a multi-Region replica key (kms/latest/developerguide/multi-region-keys-delete.html),
|
||||
// is unrecoverable. (The only exception is a multi-Region replica key (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html),
|
||||
// or an asymmetric or HMAC KMS key with imported key material (kms/latest/developerguide/importing-keys-managing.html#import-delete-key).)
|
||||
// To prevent the use of a KMS key without deleting it, use DisableKey.
|
||||
//
|
||||
@ -7406,6 +7534,9 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *
|
||||
//
|
||||
// - DisableKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7566,6 +7697,9 @@ func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignO
|
||||
//
|
||||
// Related operations: Verify
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7744,6 +7878,9 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request,
|
||||
//
|
||||
// - UntagResource
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -7892,6 +8029,9 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ
|
||||
//
|
||||
// - TagResource
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8050,6 +8190,9 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request,
|
||||
//
|
||||
// - ListAliases
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8240,6 +8383,9 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req
|
||||
//
|
||||
// - DisconnectCustomKeyStore
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8390,7 +8536,7 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req
|
||||
// - XksProxyVpcEndpointServiceInvalidConfigurationException
|
||||
// The request was rejected because the Amazon VPC endpoint service configuration
|
||||
// does not fulfill the requirements for an external key store proxy. For details,
|
||||
// see the exception message and review the requirements (kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// see the exception message and review the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// for Amazon VPC endpoint service connectivity for an external key store.
|
||||
//
|
||||
// - XksProxyInvalidResponseException
|
||||
@ -8489,6 +8635,9 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req
|
||||
//
|
||||
// - DescribeKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8667,6 +8816,9 @@ func (c *KMS) UpdatePrimaryRegionRequest(input *UpdatePrimaryRegionInput) (req *
|
||||
//
|
||||
// - ReplicateKey
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8823,6 +8975,9 @@ func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *V
|
||||
//
|
||||
// Related operations: Sign
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -8988,6 +9143,9 @@ func (c *KMS) VerifyMacRequest(input *VerifyMacInput) (req *request.Request, out
|
||||
//
|
||||
// Related operations: GenerateMac
|
||||
//
|
||||
// Eventual consistency: The KMS API follows an eventual consistency model.
|
||||
// For more information, see KMS eventual consistency (https://docs.aws.amazon.com/kms/latest/developerguide/programming-eventual-consistency.html).
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
@ -10454,8 +10612,8 @@ type CreateKeyInput struct {
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
// Use this parameter only when you intend to prevent the principal that is
|
||||
// making the request from making a subsequent PutKeyPolicy request on the KMS
|
||||
// key.
|
||||
// making the request from making a subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)
|
||||
// request on the KMS key.
|
||||
BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
|
||||
|
||||
// Creates the KMS key in the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
|
||||
@ -11459,7 +11617,7 @@ type DecryptInput struct {
|
||||
// To get the alias name and alias ARN, use ListAliases.
|
||||
KeyId *string `min:"1" type:"string"`
|
||||
|
||||
// A signed attestation document (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nitro-enclave-how.html#term-attestdoc)
|
||||
// A signed attestation document (https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-concepts.html#term-attestdoc)
|
||||
// from an Amazon Web Services Nitro enclave and the encryption algorithm to
|
||||
// use with the enclave's public key. The only valid encryption algorithm is
|
||||
// RSAES_OAEP_SHA_256.
|
||||
@ -14537,8 +14695,8 @@ type GetParametersForImportInput struct {
|
||||
// algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key
|
||||
// material.
|
||||
//
|
||||
// * RSAES_PKCS1_V1_5 (Deprecated) — Supported only for symmetric encryption
|
||||
// key material (and only in legacy mode).
|
||||
// * RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not
|
||||
// support the RSAES_PKCS1_V1_5 wrapping algorithm.
|
||||
//
|
||||
// WrappingAlgorithm is a required field
|
||||
WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"`
|
||||
@ -17791,8 +17949,8 @@ type PutKeyPolicyInput struct {
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
// Use this parameter only when you intend to prevent the principal that is
|
||||
// making the request from making a subsequent PutKeyPolicy request on the KMS
|
||||
// key.
|
||||
// making the request from making a subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)
|
||||
// request on the KMS key.
|
||||
BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
|
||||
|
||||
// Sets the key policy on the specified KMS key.
|
||||
@ -18330,8 +18488,8 @@ type ReplicateKeyInput struct {
|
||||
// in the Key Management Service Developer Guide.
|
||||
//
|
||||
// Use this parameter only when you intend to prevent the principal that is
|
||||
// making the request from making a subsequent PutKeyPolicy request on the KMS
|
||||
// key.
|
||||
// making the request from making a subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)
|
||||
// request on the KMS key.
|
||||
BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
|
||||
|
||||
// A description of the KMS key. The default value is an empty string (no description).
|
||||
@ -21550,7 +21708,7 @@ func (s *XksProxyVpcEndpointServiceInUseException) RequestID() string {
|
||||
|
||||
// The request was rejected because the Amazon VPC endpoint service configuration
|
||||
// does not fulfill the requirements for an external key store proxy. For details,
|
||||
// see the exception message and review the requirements (kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// see the exception message and review the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// for Amazon VPC endpoint service connectivity for an external key store.
|
||||
type XksProxyVpcEndpointServiceInvalidConfigurationException struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
2
vendor/github.com/aws/aws-sdk-go/service/kms/errors.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go/service/kms/errors.go
generated
vendored
@ -466,7 +466,7 @@ const (
|
||||
//
|
||||
// The request was rejected because the Amazon VPC endpoint service configuration
|
||||
// does not fulfill the requirements for an external key store proxy. For details,
|
||||
// see the exception message and review the requirements (kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// see the exception message and review the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements)
|
||||
// for Amazon VPC endpoint service connectivity for an external key store.
|
||||
ErrCodeXksProxyVpcEndpointServiceInvalidConfigurationException = "XksProxyVpcEndpointServiceInvalidConfigurationException"
|
||||
|
||||
|
7
vendor/github.com/google/uuid/CHANGELOG.md
generated
vendored
7
vendor/github.com/google/uuid/CHANGELOG.md
generated
vendored
@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29))
|
||||
|
||||
## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26)
|
||||
|
||||
|
||||
|
21
vendor/github.com/google/uuid/time.go
generated
vendored
21
vendor/github.com/google/uuid/time.go
generated
vendored
@ -108,12 +108,23 @@ func setClockSequence(seq int) {
|
||||
}
|
||||
|
||||
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
|
||||
// uuid. The time is only defined for version 1 and 2 UUIDs.
|
||||
// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
|
||||
func (uuid UUID) Time() Time {
|
||||
time := int64(binary.BigEndian.Uint32(uuid[0:4]))
|
||||
time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
|
||||
time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
|
||||
return Time(time)
|
||||
var t Time
|
||||
switch uuid.Version() {
|
||||
case 6:
|
||||
time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110
|
||||
t = Time(time)
|
||||
case 7:
|
||||
time := binary.BigEndian.Uint64(uuid[:8])
|
||||
t = Time((time>>16)*10000 + g1582ns100)
|
||||
default: // forward compatible
|
||||
time := int64(binary.BigEndian.Uint32(uuid[0:4]))
|
||||
time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
|
||||
time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
|
||||
t = Time(time)
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
// ClockSequence returns the clock sequence encoded in uuid.
|
||||
|
53
vendor/github.com/google/uuid/uuid.go
generated
vendored
53
vendor/github.com/google/uuid/uuid.go
generated
vendored
@ -186,6 +186,59 @@ func Must(uuid UUID, err error) UUID {
|
||||
return uuid
|
||||
}
|
||||
|
||||
// Validate returns an error if s is not a properly formatted UUID in one of the following formats:
|
||||
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
|
||||
// It returns an error if the format is invalid, otherwise nil.
|
||||
func Validate(s string) error {
|
||||
switch len(s) {
|
||||
// Standard UUID format
|
||||
case 36:
|
||||
|
||||
// UUID with "urn:uuid:" prefix
|
||||
case 36 + 9:
|
||||
if !strings.EqualFold(s[:9], "urn:uuid:") {
|
||||
return fmt.Errorf("invalid urn prefix: %q", s[:9])
|
||||
}
|
||||
s = s[9:]
|
||||
|
||||
// UUID enclosed in braces
|
||||
case 36 + 2:
|
||||
if s[0] != '{' || s[len(s)-1] != '}' {
|
||||
return fmt.Errorf("invalid bracketed UUID format")
|
||||
}
|
||||
s = s[1 : len(s)-1]
|
||||
|
||||
// UUID without hyphens
|
||||
case 32:
|
||||
for i := 0; i < len(s); i += 2 {
|
||||
_, ok := xtob(s[i], s[i+1])
|
||||
if !ok {
|
||||
return errors.New("invalid UUID format")
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return invalidLengthError{len(s)}
|
||||
}
|
||||
|
||||
// Check for standard UUID format
|
||||
if len(s) == 36 {
|
||||
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
|
||||
return errors.New("invalid UUID format")
|
||||
}
|
||||
for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} {
|
||||
if _, ok := xtob(s[x], s[x+1]); !ok {
|
||||
return errors.New("invalid UUID format")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
// , or "" if uuid is invalid.
|
||||
func (uuid UUID) String() string {
|
||||
|
56
vendor/github.com/google/uuid/version6.go
generated
vendored
Normal file
56
vendor/github.com/google/uuid/version6.go
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
// Copyright 2023 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package uuid
|
||||
|
||||
import "encoding/binary"
|
||||
|
||||
// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality.
|
||||
// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs.
|
||||
// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead.
|
||||
//
|
||||
// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6
|
||||
//
|
||||
// NewV6 returns a Version 6 UUID based on the current NodeID and clock
|
||||
// sequence, and the current time. If the NodeID has not been set by SetNodeID
|
||||
// or SetNodeInterface then it will be set automatically. If the NodeID cannot
|
||||
// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by
|
||||
// SetClockSequence then it will be set automatically. If GetTime fails to
|
||||
// return the current NewV6 returns Nil and an error.
|
||||
func NewV6() (UUID, error) {
|
||||
var uuid UUID
|
||||
now, seq, err := GetTime()
|
||||
if err != nil {
|
||||
return uuid, err
|
||||
}
|
||||
|
||||
/*
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| time_high |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| time_mid | time_low_and_version |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|clk_seq_hi_res | clk_seq_low | node (0-1) |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| node (2-5) |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*/
|
||||
|
||||
binary.BigEndian.PutUint64(uuid[0:], uint64(now))
|
||||
binary.BigEndian.PutUint16(uuid[8:], seq)
|
||||
|
||||
uuid[6] = 0x60 | (uuid[6] & 0x0F)
|
||||
uuid[8] = 0x80 | (uuid[8] & 0x3F)
|
||||
|
||||
nodeMu.Lock()
|
||||
if nodeID == zeroID {
|
||||
setNodeInterface("")
|
||||
}
|
||||
copy(uuid[10:], nodeID[:])
|
||||
nodeMu.Unlock()
|
||||
|
||||
return uuid, nil
|
||||
}
|
75
vendor/github.com/google/uuid/version7.go
generated
vendored
Normal file
75
vendor/github.com/google/uuid/version7.go
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
// Copyright 2023 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package uuid
|
||||
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// UUID version 7 features a time-ordered value field derived from the widely
|
||||
// implemented and well known Unix Epoch timestamp source,
|
||||
// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded.
|
||||
// As well as improved entropy characteristics over versions 1 or 6.
|
||||
//
|
||||
// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7
|
||||
//
|
||||
// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible.
|
||||
//
|
||||
// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch).
|
||||
// Uses the randomness pool if it was enabled with EnableRandPool.
|
||||
// On error, NewV7 returns Nil and an error
|
||||
func NewV7() (UUID, error) {
|
||||
uuid, err := NewRandom()
|
||||
if err != nil {
|
||||
return uuid, err
|
||||
}
|
||||
makeV7(uuid[:])
|
||||
return uuid, nil
|
||||
}
|
||||
|
||||
// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch).
|
||||
// it use NewRandomFromReader fill random bits.
|
||||
// On error, NewV7FromReader returns Nil and an error.
|
||||
func NewV7FromReader(r io.Reader) (UUID, error) {
|
||||
uuid, err := NewRandomFromReader(r)
|
||||
if err != nil {
|
||||
return uuid, err
|
||||
}
|
||||
|
||||
makeV7(uuid[:])
|
||||
return uuid, nil
|
||||
}
|
||||
|
||||
// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6])
|
||||
// uuid[8] already has the right version number (Variant is 10)
|
||||
// see function NewV7 and NewV7FromReader
|
||||
func makeV7(uuid []byte) {
|
||||
/*
|
||||
0 1 2 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| unix_ts_ms |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| unix_ts_ms | ver | rand_a |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|var| rand_b |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| rand_b |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
*/
|
||||
_ = uuid[15] // bounds check
|
||||
|
||||
t := timeNow().UnixMilli()
|
||||
|
||||
uuid[0] = byte(t >> 40)
|
||||
uuid[1] = byte(t >> 32)
|
||||
uuid[2] = byte(t >> 24)
|
||||
uuid[3] = byte(t >> 16)
|
||||
uuid[4] = byte(t >> 8)
|
||||
uuid[5] = byte(t)
|
||||
|
||||
uuid[6] = 0x70 | (uuid[6] & 0x0F)
|
||||
// uuid[8] has already has right version
|
||||
}
|
83
vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go
generated
vendored
83
vendor/github.com/kubernetes-csi/csi-lib-utils/connection/connection.go
generated
vendored
@ -20,13 +20,14 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/kubernetes-csi/csi-lib-utils/metrics"
|
||||
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
||||
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
|
||||
"google.golang.org/grpc"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
@ -55,7 +56,10 @@ func SetMaxGRPCLogLength(characterCount int) {
|
||||
// https://github.com/grpc/grpc/blob/master/doc/naming.md.
|
||||
//
|
||||
// The function tries to connect for 30 seconds, and returns an error if no connection has been established at that point.
|
||||
// The connection has zero idle timeout, i.e. it is never closed because of inactivity.
|
||||
// The function automatically disables TLS and adds interceptor for logging of all gRPC messages at level 5.
|
||||
// If the metricsManager is 'nil', no metrics will be recorded on the gRPC calls.
|
||||
// The function behaviour can be tweaked with options.
|
||||
//
|
||||
// For a connection to a Unix Domain socket, the behavior after
|
||||
// loosing the connection is configurable. The default is to
|
||||
@ -70,7 +74,20 @@ func SetMaxGRPCLogLength(characterCount int) {
|
||||
// For other connections, the default behavior from gRPC is used and
|
||||
// loss of connection is not detected reliably.
|
||||
func Connect(address string, metricsManager metrics.CSIMetricsManager, options ...Option) (*grpc.ClientConn, error) {
|
||||
return connect(address, metricsManager, []grpc.DialOption{grpc.WithTimeout(time.Second * 30)}, options)
|
||||
// Prepend default options
|
||||
options = append([]Option{WithTimeout(time.Second * 30)}, options...)
|
||||
if metricsManager != nil {
|
||||
options = append([]Option{WithMetrics(metricsManager)}, options...)
|
||||
}
|
||||
return connect(address, options)
|
||||
}
|
||||
|
||||
// ConnectWithoutMetrics behaves exactly like Connect except no metrics are recorded.
|
||||
// This function is deprecated, prefer using Connect with `nil` as the metricsManager.
|
||||
func ConnectWithoutMetrics(address string, options ...Option) (*grpc.ClientConn, error) {
|
||||
// Prepend default options
|
||||
options = append([]Option{WithTimeout(time.Second * 30)}, options...)
|
||||
return connect(address, options)
|
||||
}
|
||||
|
||||
// Option is the type of all optional parameters for Connect.
|
||||
@ -91,7 +108,7 @@ func OnConnectionLoss(reconnect func() bool) Option {
|
||||
func ExitOnConnectionLoss() func() bool {
|
||||
return func() bool {
|
||||
terminationMsg := "Lost connection to CSI driver, exiting"
|
||||
if err := ioutil.WriteFile(terminationLogPath, []byte(terminationMsg), 0644); err != nil {
|
||||
if err := os.WriteFile(terminationLogPath, []byte(terminationMsg), 0644); err != nil {
|
||||
klog.Errorf("%s: %s", terminationLogPath, err)
|
||||
}
|
||||
klog.Exit(terminationMsg)
|
||||
@ -100,29 +117,63 @@ func ExitOnConnectionLoss() func() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// WithTimeout adds a configurable timeout on the gRPC calls.
|
||||
func WithTimeout(timeout time.Duration) Option {
|
||||
return func(o *options) {
|
||||
o.timeout = timeout
|
||||
}
|
||||
}
|
||||
|
||||
// WithMetrics enables the recording of metrics on the gRPC calls with the provided CSIMetricsManager.
|
||||
func WithMetrics(metricsManager metrics.CSIMetricsManager) Option {
|
||||
return func(o *options) {
|
||||
o.metricsManager = metricsManager
|
||||
}
|
||||
}
|
||||
|
||||
// WithOtelTracing enables the recording of traces on the gRPC calls with opentelemetry gRPC interceptor.
|
||||
func WithOtelTracing() Option {
|
||||
return func(o *options) {
|
||||
o.enableOtelTracing = true
|
||||
}
|
||||
}
|
||||
|
||||
type options struct {
|
||||
reconnect func() bool
|
||||
reconnect func() bool
|
||||
timeout time.Duration
|
||||
metricsManager metrics.CSIMetricsManager
|
||||
enableOtelTracing bool
|
||||
}
|
||||
|
||||
// connect is the internal implementation of Connect. It has more options to enable testing.
|
||||
func connect(
|
||||
address string,
|
||||
metricsManager metrics.CSIMetricsManager,
|
||||
dialOptions []grpc.DialOption, connectOptions []Option) (*grpc.ClientConn, error) {
|
||||
connectOptions []Option) (*grpc.ClientConn, error) {
|
||||
var o options
|
||||
for _, option := range connectOptions {
|
||||
option(&o)
|
||||
}
|
||||
|
||||
dialOptions = append(dialOptions,
|
||||
grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container.
|
||||
grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure.
|
||||
grpc.WithBlock(), // Block until connection succeeds.
|
||||
grpc.WithChainUnaryInterceptor(
|
||||
LogGRPC, // Log all messages.
|
||||
ExtendedCSIMetricsManager{metricsManager}.RecordMetricsClientInterceptor, // Record metrics for each gRPC call.
|
||||
),
|
||||
)
|
||||
dialOptions := []grpc.DialOption{
|
||||
grpc.WithInsecure(), // Don't use TLS, it's usually local Unix domain socket in a container.
|
||||
grpc.WithBackoffMaxDelay(time.Second), // Retry every second after failure.
|
||||
grpc.WithBlock(), // Block until connection succeeds.
|
||||
grpc.WithIdleTimeout(time.Duration(0)), // Never close connection because of inactivity.
|
||||
}
|
||||
|
||||
if o.timeout > 0 {
|
||||
dialOptions = append(dialOptions, grpc.WithTimeout(o.timeout))
|
||||
}
|
||||
|
||||
interceptors := []grpc.UnaryClientInterceptor{LogGRPC}
|
||||
if o.metricsManager != nil {
|
||||
interceptors = append(interceptors, ExtendedCSIMetricsManager{o.metricsManager}.RecordMetricsClientInterceptor)
|
||||
}
|
||||
if o.enableOtelTracing {
|
||||
interceptors = append(interceptors, otelgrpc.UnaryClientInterceptor())
|
||||
}
|
||||
dialOptions = append(dialOptions, grpc.WithChainUnaryInterceptor(interceptors...))
|
||||
|
||||
unixPrefix := "unix://"
|
||||
if strings.HasPrefix(address, "/") {
|
||||
// It looks like filesystem path.
|
||||
@ -193,7 +244,7 @@ func LogGRPC(ctx context.Context, method string, req, reply interface{}, cc *grp
|
||||
klog.V(5).Infof("GRPC call: %s", method)
|
||||
klog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecrets(req))
|
||||
err := invoker(ctx, method, req, reply, cc, opts...)
|
||||
cappedStr := fmt.Sprintf("%s", protosanitizer.StripSecrets(reply))
|
||||
cappedStr := protosanitizer.StripSecrets(reply).String()
|
||||
if maxLogChar > 0 && len(cappedStr) > maxLogChar {
|
||||
cappedStr = cappedStr[:maxLogChar] + fmt.Sprintf(" [response body too large, log capped to %d chars]", maxLogChar)
|
||||
}
|
||||
|
21
vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go
generated
vendored
21
vendor/github.com/kubernetes-csi/csi-lib-utils/metrics/metrics.go
generated
vendored
@ -20,6 +20,7 @@ import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
@ -99,6 +100,12 @@ type CSIMetricsManager interface {
|
||||
// RegisterToServer registers an HTTP handler for this metrics manager to the
|
||||
// given server at the specified address/path.
|
||||
RegisterToServer(s Server, metricsPath string)
|
||||
|
||||
// RegisterPprofToServer registers the HTTP handlers necessary to enable pprof
|
||||
// for this metrics manager to the given server at the usual path.
|
||||
// This function is not needed when using DefaultServeMux as the Server since
|
||||
// the handlers will automatically be registered when importing pprof.
|
||||
RegisterPprofToServer(s Server)
|
||||
}
|
||||
|
||||
// Server represents any type that could serve HTTP requests for the metrics
|
||||
@ -388,6 +395,20 @@ func (cmm *csiMetricsManager) RegisterToServer(s Server, metricsPath string) {
|
||||
ErrorHandling: metrics.ContinueOnError}))
|
||||
}
|
||||
|
||||
// RegisterPprofToServer registers the HTTP handlers necessary to enable pprof
|
||||
// for this metrics manager to the given server at the usual path.
|
||||
// This function is not needed when using DefaultServeMux as the Server since
|
||||
// the handlers will automatically be registered when importing pprof.
|
||||
func (cmm *csiMetricsManager) RegisterPprofToServer(s Server) {
|
||||
// Needed handlers can be seen here:
|
||||
// https://github.com/golang/go/blob/master/src/net/http/pprof/pprof.go#L27
|
||||
s.Handle("/debug/pprof/", http.HandlerFunc(pprof.Index))
|
||||
s.Handle("/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
|
||||
s.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
|
||||
s.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
|
||||
s.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
|
||||
}
|
||||
|
||||
// VerifyMetricsMatch is a helper function that verifies that the expected and
|
||||
// actual metrics are identical excluding metricToIgnore.
|
||||
// This method is only used by tests. Ideally it should be in the _test file,
|
||||
|
9
vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go
generated
vendored
9
vendor/github.com/kubernetes-csi/csi-lib-utils/protosanitizer/protosanitizer.go
generated
vendored
@ -26,7 +26,6 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
protobufdescriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
||||
)
|
||||
|
||||
@ -56,7 +55,7 @@ func StripSecretsCSI03(msg interface{}) fmt.Stringer {
|
||||
type stripSecrets struct {
|
||||
msg interface{}
|
||||
|
||||
isSecretField func(field *protobuf.FieldDescriptorProto) bool
|
||||
isSecretField func(field *protobufdescriptor.FieldDescriptorProto) bool
|
||||
}
|
||||
|
||||
func (s *stripSecrets) String() string {
|
||||
@ -110,7 +109,7 @@ func (s *stripSecrets) strip(parsed interface{}, msg interface{}) {
|
||||
if _, ok := parsedFields[field.GetName()]; ok {
|
||||
parsedFields[field.GetName()] = "***stripped***"
|
||||
}
|
||||
} else if field.GetType() == protobuf.FieldDescriptorProto_TYPE_MESSAGE {
|
||||
} else if field.GetType() == protobufdescriptor.FieldDescriptorProto_TYPE_MESSAGE {
|
||||
// When we get here,
|
||||
// the type name is something like ".csi.v1.CapacityRange" (leading dot!)
|
||||
// and looking up "csi.v1.CapacityRange"
|
||||
@ -150,7 +149,7 @@ func (s *stripSecrets) strip(parsed interface{}, msg interface{}) {
|
||||
|
||||
// isCSI1Secret uses the csi.E_CsiSecret extension from CSI 1.0 to
|
||||
// determine whether a field contains secrets.
|
||||
func isCSI1Secret(field *protobuf.FieldDescriptorProto) bool {
|
||||
func isCSI1Secret(field *protobufdescriptor.FieldDescriptorProto) bool {
|
||||
ex, err := proto.GetExtension(field.Options, e_CsiSecret)
|
||||
return err == nil && ex != nil && *ex.(*bool)
|
||||
}
|
||||
@ -172,6 +171,6 @@ var e_CsiSecret = &proto.ExtensionDesc{
|
||||
|
||||
// isCSI03Secret relies on the naming convention in CSI <= 0.3
|
||||
// to determine whether a field contains secrets.
|
||||
func isCSI03Secret(field *protobuf.FieldDescriptorProto) bool {
|
||||
func isCSI03Secret(field *protobufdescriptor.FieldDescriptorProto) bool {
|
||||
return strings.HasSuffix(field.GetName(), "_secrets")
|
||||
}
|
||||
|
@ -19,9 +19,10 @@ import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// TODO: Give error package name prefix in next minor release.
|
||||
var errInvalidVarint = errors.New("invalid varint32 encountered")
|
||||
|
||||
// ReadDelimited decodes a message from the provided length-delimited stream,
|
||||
@ -36,6 +37,12 @@ var errInvalidVarint = errors.New("invalid varint32 encountered")
|
||||
// of the stream has been reached in doing so. In that case, any subsequent
|
||||
// calls return (0, io.EOF).
|
||||
func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) {
|
||||
// TODO: Consider allowing the caller to specify a decode buffer in the
|
||||
// next major version.
|
||||
|
||||
// TODO: Consider using error wrapping to annotate error state in pass-
|
||||
// through cases in the next minor version.
|
||||
|
||||
// Per AbstractParser#parsePartialDelimitedFrom with
|
||||
// CodedInputStream#readRawVarint32.
|
||||
var headerBuf [binary.MaxVarintLen32]byte
|
||||
@ -53,15 +60,14 @@ func ReadDelimited(r io.Reader, m proto.Message) (n int, err error) {
|
||||
if err != nil {
|
||||
return bytesRead, err
|
||||
}
|
||||
// A Reader should not return (0, nil), but if it does,
|
||||
// it should be treated as no-op (according to the
|
||||
// Reader contract). So let's go on...
|
||||
// A Reader should not return (0, nil); but if it does, it should
|
||||
// be treated as no-op according to the Reader contract.
|
||||
continue
|
||||
}
|
||||
bytesRead += newBytesRead
|
||||
// Now present everything read so far to the varint decoder and
|
||||
// see if a varint can be decoded already.
|
||||
messageLength, varIntBytes = proto.DecodeVarint(headerBuf[:bytesRead])
|
||||
messageLength, varIntBytes = binary.Uvarint(headerBuf[:bytesRead])
|
||||
}
|
||||
|
||||
messageBuf := make([]byte, messageLength)
|
@ -18,7 +18,7 @@ import (
|
||||
"encoding/binary"
|
||||
"io"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// WriteDelimited encodes and dumps a message to the provided writer prefixed
|
||||
@ -28,6 +28,9 @@ import (
|
||||
// number of bytes written and any applicable error. This is roughly
|
||||
// equivalent to the companion Java API's MessageLite#writeDelimitedTo.
|
||||
func WriteDelimited(w io.Writer, m proto.Message) (n int, err error) {
|
||||
// TODO: Consider allowing the caller to specify an encode buffer in the
|
||||
// next major version.
|
||||
|
||||
buffer, err := proto.Marshal(m)
|
||||
if err != nil {
|
||||
return 0, err
|
56
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
56
vendor/github.com/prometheus/client_golang/prometheus/histogram.go
generated
vendored
@ -475,6 +475,9 @@ type HistogramOpts struct {
|
||||
|
||||
// now is for testing purposes, by default it's time.Now.
|
||||
now func() time.Time
|
||||
|
||||
// afterFunc is for testing purposes, by default it's time.AfterFunc.
|
||||
afterFunc func(time.Duration, func()) *time.Timer
|
||||
}
|
||||
|
||||
// HistogramVecOpts bundles the options to create a HistogramVec metric.
|
||||
@ -526,7 +529,9 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
|
||||
if opts.now == nil {
|
||||
opts.now = time.Now
|
||||
}
|
||||
|
||||
if opts.afterFunc == nil {
|
||||
opts.afterFunc = time.AfterFunc
|
||||
}
|
||||
h := &histogram{
|
||||
desc: desc,
|
||||
upperBounds: opts.Buckets,
|
||||
@ -536,6 +541,7 @@ func newHistogram(desc *Desc, opts HistogramOpts, labelValues ...string) Histogr
|
||||
nativeHistogramMinResetDuration: opts.NativeHistogramMinResetDuration,
|
||||
lastResetTime: opts.now(),
|
||||
now: opts.now,
|
||||
afterFunc: opts.afterFunc,
|
||||
}
|
||||
if len(h.upperBounds) == 0 && opts.NativeHistogramBucketFactor <= 1 {
|
||||
h.upperBounds = DefBuckets
|
||||
@ -716,9 +722,16 @@ type histogram struct {
|
||||
nativeHistogramMinResetDuration time.Duration
|
||||
// lastResetTime is protected by mtx. It is also used as created timestamp.
|
||||
lastResetTime time.Time
|
||||
// resetScheduled is protected by mtx. It is true if a reset is
|
||||
// scheduled for a later time (when nativeHistogramMinResetDuration has
|
||||
// passed).
|
||||
resetScheduled bool
|
||||
|
||||
// now is for testing purposes, by default it's time.Now.
|
||||
now func() time.Time
|
||||
|
||||
// afterFunc is for testing purposes, by default it's time.AfterFunc.
|
||||
afterFunc func(time.Duration, func()) *time.Timer
|
||||
}
|
||||
|
||||
func (h *histogram) Desc() *Desc {
|
||||
@ -874,21 +887,31 @@ func (h *histogram) limitBuckets(counts *histogramCounts, value float64, bucket
|
||||
if h.maybeReset(hotCounts, coldCounts, coldIdx, value, bucket) {
|
||||
return
|
||||
}
|
||||
// One of the other strategies will happen. To undo what they will do as
|
||||
// soon as enough time has passed to satisfy
|
||||
// h.nativeHistogramMinResetDuration, schedule a reset at the right time
|
||||
// if we haven't done so already.
|
||||
if h.nativeHistogramMinResetDuration > 0 && !h.resetScheduled {
|
||||
h.resetScheduled = true
|
||||
h.afterFunc(h.nativeHistogramMinResetDuration-h.now().Sub(h.lastResetTime), h.reset)
|
||||
}
|
||||
|
||||
if h.maybeWidenZeroBucket(hotCounts, coldCounts) {
|
||||
return
|
||||
}
|
||||
h.doubleBucketWidth(hotCounts, coldCounts)
|
||||
}
|
||||
|
||||
// maybeReset resets the whole histogram if at least h.nativeHistogramMinResetDuration
|
||||
// has been passed. It returns true if the histogram has been reset. The caller
|
||||
// must have locked h.mtx.
|
||||
// maybeReset resets the whole histogram if at least
|
||||
// h.nativeHistogramMinResetDuration has been passed. It returns true if the
|
||||
// histogram has been reset. The caller must have locked h.mtx.
|
||||
func (h *histogram) maybeReset(
|
||||
hot, cold *histogramCounts, coldIdx uint64, value float64, bucket int,
|
||||
) bool {
|
||||
// We are using the possibly mocked h.now() rather than
|
||||
// time.Since(h.lastResetTime) to enable testing.
|
||||
if h.nativeHistogramMinResetDuration == 0 ||
|
||||
if h.nativeHistogramMinResetDuration == 0 || // No reset configured.
|
||||
h.resetScheduled || // Do not interefere if a reset is already scheduled.
|
||||
h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration {
|
||||
return false
|
||||
}
|
||||
@ -906,6 +929,29 @@ func (h *histogram) maybeReset(
|
||||
return true
|
||||
}
|
||||
|
||||
// reset resets the whole histogram. It locks h.mtx itself, i.e. it has to be
|
||||
// called without having locked h.mtx.
|
||||
func (h *histogram) reset() {
|
||||
h.mtx.Lock()
|
||||
defer h.mtx.Unlock()
|
||||
|
||||
n := atomic.LoadUint64(&h.countAndHotIdx)
|
||||
hotIdx := n >> 63
|
||||
coldIdx := (^n) >> 63
|
||||
hot := h.counts[hotIdx]
|
||||
cold := h.counts[coldIdx]
|
||||
// Completely reset coldCounts.
|
||||
h.resetCounts(cold)
|
||||
// Make coldCounts the new hot counts while resetting countAndHotIdx.
|
||||
n = atomic.SwapUint64(&h.countAndHotIdx, coldIdx<<63)
|
||||
count := n & ((1 << 63) - 1)
|
||||
waitForCooldown(count, hot)
|
||||
// Finally, reset the formerly hot counts, too.
|
||||
h.resetCounts(hot)
|
||||
h.lastResetTime = h.now()
|
||||
h.resetScheduled = false
|
||||
}
|
||||
|
||||
// maybeWidenZeroBucket widens the zero bucket until it includes the existing
|
||||
// buckets closest to the zero bucket (which could be two, if an equidistant
|
||||
// negative and a positive bucket exists, but usually it's only one bucket to be
|
||||
|
2
vendor/github.com/prometheus/client_golang/prometheus/labels.go
generated
vendored
2
vendor/github.com/prometheus/client_golang/prometheus/labels.go
generated
vendored
@ -165,6 +165,8 @@ func validateValuesInLabels(labels Labels, expectedNumberOfValues int) error {
|
||||
|
||||
func validateLabelValues(vals []string, expectedNumberOfValues int) error {
|
||||
if len(vals) != expectedNumberOfValues {
|
||||
// The call below makes vals escape, copy them to avoid that.
|
||||
vals := append([]string(nil), vals...)
|
||||
return fmt.Errorf(
|
||||
"%w: expected %d label values but got %d in %#v",
|
||||
errInconsistentCardinality, expectedNumberOfValues,
|
||||
|
4
vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
generated
vendored
4
vendor/github.com/prometheus/client_golang/prometheus/process_collector_other.go
generated
vendored
@ -11,8 +11,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !windows && !js
|
||||
// +build !windows,!js
|
||||
//go:build !windows && !js && !wasip1
|
||||
// +build !windows,!js,!wasip1
|
||||
|
||||
package prometheus
|
||||
|
||||
|
26
vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go
generated
vendored
Normal file
26
vendor/github.com/prometheus/client_golang/prometheus/process_collector_wasip1.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2023 The Prometheus 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.
|
||||
|
||||
//go:build wasip1
|
||||
// +build wasip1
|
||||
|
||||
package prometheus
|
||||
|
||||
func canCollectProcess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (*processCollector) processCollect(chan<- Metric) {
|
||||
// noop on this platform
|
||||
return
|
||||
}
|
33
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go
generated
vendored
Normal file
33
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2020 The Prometheus 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 promlint
|
||||
|
||||
import dto "github.com/prometheus/client_model/go"
|
||||
|
||||
// A Problem is an issue detected by a linter.
|
||||
type Problem struct {
|
||||
// The name of the metric indicated by this Problem.
|
||||
Metric string
|
||||
|
||||
// A description of the issue for this Problem.
|
||||
Text string
|
||||
}
|
||||
|
||||
// newProblem is helper function to create a Problem.
|
||||
func newProblem(mf *dto.MetricFamily, text string) Problem {
|
||||
return Problem{
|
||||
Metric: mf.GetName(),
|
||||
Text: text,
|
||||
}
|
||||
}
|
316
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go
generated
vendored
316
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go
generated
vendored
@ -16,15 +16,11 @@ package promlint
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/prometheus/common/expfmt"
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/common/expfmt"
|
||||
)
|
||||
|
||||
// A Linter is a Prometheus metrics linter. It identifies issues with metric
|
||||
@ -37,23 +33,8 @@ type Linter struct {
|
||||
// of them.
|
||||
r io.Reader
|
||||
mfs []*dto.MetricFamily
|
||||
}
|
||||
|
||||
// A Problem is an issue detected by a Linter.
|
||||
type Problem struct {
|
||||
// The name of the metric indicated by this Problem.
|
||||
Metric string
|
||||
|
||||
// A description of the issue for this Problem.
|
||||
Text string
|
||||
}
|
||||
|
||||
// newProblem is helper function to create a Problem.
|
||||
func newProblem(mf *dto.MetricFamily, text string) Problem {
|
||||
return Problem{
|
||||
Metric: mf.GetName(),
|
||||
Text: text,
|
||||
}
|
||||
customValidations []Validation
|
||||
}
|
||||
|
||||
// New creates a new Linter that reads an input stream of Prometheus metrics in
|
||||
@ -72,6 +53,14 @@ func NewWithMetricFamilies(mfs []*dto.MetricFamily) *Linter {
|
||||
}
|
||||
}
|
||||
|
||||
// AddCustomValidations adds custom validations to the linter.
|
||||
func (l *Linter) AddCustomValidations(vs ...Validation) {
|
||||
if l.customValidations == nil {
|
||||
l.customValidations = make([]Validation, 0, len(vs))
|
||||
}
|
||||
l.customValidations = append(l.customValidations, vs...)
|
||||
}
|
||||
|
||||
// Lint performs a linting pass, returning a slice of Problems indicating any
|
||||
// issues found in the metrics stream. The slice is sorted by metric name
|
||||
// and issue description.
|
||||
@ -91,11 +80,11 @@ func (l *Linter) Lint() ([]Problem, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
problems = append(problems, lint(mf)...)
|
||||
problems = append(problems, l.lint(mf)...)
|
||||
}
|
||||
}
|
||||
for _, mf := range l.mfs {
|
||||
problems = append(problems, lint(mf)...)
|
||||
problems = append(problems, l.lint(mf)...)
|
||||
}
|
||||
|
||||
// Ensure deterministic output.
|
||||
@ -110,276 +99,25 @@ func (l *Linter) Lint() ([]Problem, error) {
|
||||
}
|
||||
|
||||
// lint is the entry point for linting a single metric.
|
||||
func lint(mf *dto.MetricFamily) []Problem {
|
||||
fns := []func(mf *dto.MetricFamily) []Problem{
|
||||
lintHelp,
|
||||
lintMetricUnits,
|
||||
lintCounter,
|
||||
lintHistogramSummaryReserved,
|
||||
lintMetricTypeInName,
|
||||
lintReservedChars,
|
||||
lintCamelCase,
|
||||
lintUnitAbbreviations,
|
||||
func (l *Linter) lint(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
|
||||
for _, fn := range defaultValidations {
|
||||
errs := fn(mf)
|
||||
for _, err := range errs {
|
||||
problems = append(problems, newProblem(mf, err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
var problems []Problem
|
||||
for _, fn := range fns {
|
||||
problems = append(problems, fn(mf)...)
|
||||
if l.customValidations != nil {
|
||||
for _, fn := range l.customValidations {
|
||||
errs := fn(mf)
|
||||
for _, err := range errs {
|
||||
problems = append(problems, newProblem(mf, err.Error()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(mdlayher): lint rules for specific metrics types.
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintHelp detects issues related to the help text for a metric.
|
||||
func lintHelp(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
|
||||
// Expect all metrics to have help text available.
|
||||
if mf.Help == nil {
|
||||
problems = append(problems, newProblem(mf, "no help text"))
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintMetricUnits detects issues with metric unit names.
|
||||
func lintMetricUnits(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
|
||||
unit, base, ok := metricUnits(*mf.Name)
|
||||
if !ok {
|
||||
// No known units detected.
|
||||
return nil
|
||||
}
|
||||
|
||||
// Unit is already a base unit.
|
||||
if unit == base {
|
||||
return nil
|
||||
}
|
||||
|
||||
problems = append(problems, newProblem(mf, fmt.Sprintf("use base unit %q instead of %q", base, unit)))
|
||||
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintCounter detects issues specific to counters, as well as patterns that should
|
||||
// only be used with counters.
|
||||
func lintCounter(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
|
||||
isCounter := mf.GetType() == dto.MetricType_COUNTER
|
||||
isUntyped := mf.GetType() == dto.MetricType_UNTYPED
|
||||
hasTotalSuffix := strings.HasSuffix(mf.GetName(), "_total")
|
||||
|
||||
switch {
|
||||
case isCounter && !hasTotalSuffix:
|
||||
problems = append(problems, newProblem(mf, `counter metrics should have "_total" suffix`))
|
||||
case !isUntyped && !isCounter && hasTotalSuffix:
|
||||
problems = append(problems, newProblem(mf, `non-counter metrics should not have "_total" suffix`))
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintHistogramSummaryReserved detects when other types of metrics use names or labels
|
||||
// reserved for use by histograms and/or summaries.
|
||||
func lintHistogramSummaryReserved(mf *dto.MetricFamily) []Problem {
|
||||
// These rules do not apply to untyped metrics.
|
||||
t := mf.GetType()
|
||||
if t == dto.MetricType_UNTYPED {
|
||||
return nil
|
||||
}
|
||||
|
||||
var problems []Problem
|
||||
|
||||
isHistogram := t == dto.MetricType_HISTOGRAM
|
||||
isSummary := t == dto.MetricType_SUMMARY
|
||||
|
||||
n := mf.GetName()
|
||||
|
||||
if !isHistogram && strings.HasSuffix(n, "_bucket") {
|
||||
problems = append(problems, newProblem(mf, `non-histogram metrics should not have "_bucket" suffix`))
|
||||
}
|
||||
if !isHistogram && !isSummary && strings.HasSuffix(n, "_count") {
|
||||
problems = append(problems, newProblem(mf, `non-histogram and non-summary metrics should not have "_count" suffix`))
|
||||
}
|
||||
if !isHistogram && !isSummary && strings.HasSuffix(n, "_sum") {
|
||||
problems = append(problems, newProblem(mf, `non-histogram and non-summary metrics should not have "_sum" suffix`))
|
||||
}
|
||||
|
||||
for _, m := range mf.GetMetric() {
|
||||
for _, l := range m.GetLabel() {
|
||||
ln := l.GetName()
|
||||
|
||||
if !isHistogram && ln == "le" {
|
||||
problems = append(problems, newProblem(mf, `non-histogram metrics should not have "le" label`))
|
||||
}
|
||||
if !isSummary && ln == "quantile" {
|
||||
problems = append(problems, newProblem(mf, `non-summary metrics should not have "quantile" label`))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintMetricTypeInName detects when metric types are included in the metric name.
|
||||
func lintMetricTypeInName(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
n := strings.ToLower(mf.GetName())
|
||||
|
||||
for i, t := range dto.MetricType_name {
|
||||
if i == int32(dto.MetricType_UNTYPED) {
|
||||
continue
|
||||
}
|
||||
|
||||
typename := strings.ToLower(t)
|
||||
if strings.Contains(n, "_"+typename+"_") || strings.HasSuffix(n, "_"+typename) {
|
||||
problems = append(problems, newProblem(mf, fmt.Sprintf(`metric name should not include type '%s'`, typename)))
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintReservedChars detects colons in metric names.
|
||||
func lintReservedChars(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
if strings.Contains(mf.GetName(), ":") {
|
||||
problems = append(problems, newProblem(mf, "metric names should not contain ':'"))
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
var camelCase = regexp.MustCompile(`[a-z][A-Z]`)
|
||||
|
||||
// lintCamelCase detects metric names and label names written in camelCase.
|
||||
func lintCamelCase(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
if camelCase.FindString(mf.GetName()) != "" {
|
||||
problems = append(problems, newProblem(mf, "metric names should be written in 'snake_case' not 'camelCase'"))
|
||||
}
|
||||
|
||||
for _, m := range mf.GetMetric() {
|
||||
for _, l := range m.GetLabel() {
|
||||
if camelCase.FindString(l.GetName()) != "" {
|
||||
problems = append(problems, newProblem(mf, "label names should be written in 'snake_case' not 'camelCase'"))
|
||||
}
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// lintUnitAbbreviations detects abbreviated units in the metric name.
|
||||
func lintUnitAbbreviations(mf *dto.MetricFamily) []Problem {
|
||||
var problems []Problem
|
||||
n := strings.ToLower(mf.GetName())
|
||||
for _, s := range unitAbbreviations {
|
||||
if strings.Contains(n, "_"+s+"_") || strings.HasSuffix(n, "_"+s) {
|
||||
problems = append(problems, newProblem(mf, "metric names should not contain abbreviated units"))
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// metricUnits attempts to detect known unit types used as part of a metric name,
|
||||
// e.g. "foo_bytes_total" or "bar_baz_milligrams".
|
||||
func metricUnits(m string) (unit, base string, ok bool) {
|
||||
ss := strings.Split(m, "_")
|
||||
|
||||
for _, s := range ss {
|
||||
if base, found := units[s]; found {
|
||||
return s, base, true
|
||||
}
|
||||
|
||||
for _, p := range unitPrefixes {
|
||||
if strings.HasPrefix(s, p) {
|
||||
if base, found := units[s[len(p):]]; found {
|
||||
return s, base, true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
// Units and their possible prefixes recognized by this library. More can be
|
||||
// added over time as needed.
|
||||
var (
|
||||
// map a unit to the appropriate base unit.
|
||||
units = map[string]string{
|
||||
// Base units.
|
||||
"amperes": "amperes",
|
||||
"bytes": "bytes",
|
||||
"celsius": "celsius", // Also allow Celsius because it is common in typical Prometheus use cases.
|
||||
"grams": "grams",
|
||||
"joules": "joules",
|
||||
"kelvin": "kelvin", // SI base unit, used in special cases (e.g. color temperature, scientific measurements).
|
||||
"meters": "meters", // Both American and international spelling permitted.
|
||||
"metres": "metres",
|
||||
"seconds": "seconds",
|
||||
"volts": "volts",
|
||||
|
||||
// Non base units.
|
||||
// Time.
|
||||
"minutes": "seconds",
|
||||
"hours": "seconds",
|
||||
"days": "seconds",
|
||||
"weeks": "seconds",
|
||||
// Temperature.
|
||||
"kelvins": "kelvin",
|
||||
"fahrenheit": "celsius",
|
||||
"rankine": "celsius",
|
||||
// Length.
|
||||
"inches": "meters",
|
||||
"yards": "meters",
|
||||
"miles": "meters",
|
||||
// Bytes.
|
||||
"bits": "bytes",
|
||||
// Energy.
|
||||
"calories": "joules",
|
||||
// Mass.
|
||||
"pounds": "grams",
|
||||
"ounces": "grams",
|
||||
}
|
||||
|
||||
unitPrefixes = []string{
|
||||
"pico",
|
||||
"nano",
|
||||
"micro",
|
||||
"milli",
|
||||
"centi",
|
||||
"deci",
|
||||
"deca",
|
||||
"hecto",
|
||||
"kilo",
|
||||
"kibi",
|
||||
"mega",
|
||||
"mibi",
|
||||
"giga",
|
||||
"gibi",
|
||||
"tera",
|
||||
"tebi",
|
||||
"peta",
|
||||
"pebi",
|
||||
}
|
||||
|
||||
// Common abbreviations that we'd like to discourage.
|
||||
unitAbbreviations = []string{
|
||||
"s",
|
||||
"ms",
|
||||
"us",
|
||||
"ns",
|
||||
"sec",
|
||||
"b",
|
||||
"kb",
|
||||
"mb",
|
||||
"gb",
|
||||
"tb",
|
||||
"pb",
|
||||
"m",
|
||||
"h",
|
||||
"d",
|
||||
}
|
||||
)
|
||||
|
33
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go
generated
vendored
Normal file
33
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2020 The Prometheus 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 promlint
|
||||
|
||||
import (
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/testutil/promlint/validations"
|
||||
)
|
||||
|
||||
type Validation = func(mf *dto.MetricFamily) []error
|
||||
|
||||
var defaultValidations = []Validation{
|
||||
validations.LintHelp,
|
||||
validations.LintMetricUnits,
|
||||
validations.LintCounter,
|
||||
validations.LintHistogramSummaryReserved,
|
||||
validations.LintMetricTypeInName,
|
||||
validations.LintReservedChars,
|
||||
validations.LintCamelCase,
|
||||
validations.LintUnitAbbreviations,
|
||||
}
|
40
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go
generated
vendored
Normal file
40
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright 2020 The Prometheus 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 validations
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
)
|
||||
|
||||
// LintCounter detects issues specific to counters, as well as patterns that should
|
||||
// only be used with counters.
|
||||
func LintCounter(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
|
||||
isCounter := mf.GetType() == dto.MetricType_COUNTER
|
||||
isUntyped := mf.GetType() == dto.MetricType_UNTYPED
|
||||
hasTotalSuffix := strings.HasSuffix(mf.GetName(), "_total")
|
||||
|
||||
switch {
|
||||
case isCounter && !hasTotalSuffix:
|
||||
problems = append(problems, errors.New(`counter metrics should have "_total" suffix`))
|
||||
case !isUntyped && !isCounter && hasTotalSuffix:
|
||||
problems = append(problems, errors.New(`non-counter metrics should not have "_total" suffix`))
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
101
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go
generated
vendored
Normal file
101
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
// Copyright 2020 The Prometheus 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 validations
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
)
|
||||
|
||||
var camelCase = regexp.MustCompile(`[a-z][A-Z]`)
|
||||
|
||||
// LintMetricUnits detects issues with metric unit names.
|
||||
func LintMetricUnits(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
|
||||
unit, base, ok := metricUnits(*mf.Name)
|
||||
if !ok {
|
||||
// No known units detected.
|
||||
return nil
|
||||
}
|
||||
|
||||
// Unit is already a base unit.
|
||||
if unit == base {
|
||||
return nil
|
||||
}
|
||||
|
||||
problems = append(problems, fmt.Errorf("use base unit %q instead of %q", base, unit))
|
||||
|
||||
return problems
|
||||
}
|
||||
|
||||
// LintMetricTypeInName detects when metric types are included in the metric name.
|
||||
func LintMetricTypeInName(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
n := strings.ToLower(mf.GetName())
|
||||
|
||||
for i, t := range dto.MetricType_name {
|
||||
if i == int32(dto.MetricType_UNTYPED) {
|
||||
continue
|
||||
}
|
||||
|
||||
typename := strings.ToLower(t)
|
||||
if strings.Contains(n, "_"+typename+"_") || strings.HasSuffix(n, "_"+typename) {
|
||||
problems = append(problems, fmt.Errorf(`metric name should not include type '%s'`, typename))
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// LintReservedChars detects colons in metric names.
|
||||
func LintReservedChars(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
if strings.Contains(mf.GetName(), ":") {
|
||||
problems = append(problems, errors.New("metric names should not contain ':'"))
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// LintCamelCase detects metric names and label names written in camelCase.
|
||||
func LintCamelCase(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
if camelCase.FindString(mf.GetName()) != "" {
|
||||
problems = append(problems, errors.New("metric names should be written in 'snake_case' not 'camelCase'"))
|
||||
}
|
||||
|
||||
for _, m := range mf.GetMetric() {
|
||||
for _, l := range m.GetLabel() {
|
||||
if camelCase.FindString(l.GetName()) != "" {
|
||||
problems = append(problems, errors.New("label names should be written in 'snake_case' not 'camelCase'"))
|
||||
}
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
||||
|
||||
// LintUnitAbbreviations detects abbreviated units in the metric name.
|
||||
func LintUnitAbbreviations(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
n := strings.ToLower(mf.GetName())
|
||||
for _, s := range unitAbbreviations {
|
||||
if strings.Contains(n, "_"+s+"_") || strings.HasSuffix(n, "_"+s) {
|
||||
problems = append(problems, errors.New("metric names should not contain abbreviated units"))
|
||||
}
|
||||
}
|
||||
return problems
|
||||
}
|
32
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go
generated
vendored
Normal file
32
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright 2020 The Prometheus 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 validations
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
)
|
||||
|
||||
// LintHelp detects issues related to the help text for a metric.
|
||||
func LintHelp(mf *dto.MetricFamily) []error {
|
||||
var problems []error
|
||||
|
||||
// Expect all metrics to have help text available.
|
||||
if mf.Help == nil {
|
||||
problems = append(problems, errors.New("no help text"))
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
63
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go
generated
vendored
Normal file
63
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Copyright 2020 The Prometheus 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 validations
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
)
|
||||
|
||||
// LintHistogramSummaryReserved detects when other types of metrics use names or labels
|
||||
// reserved for use by histograms and/or summaries.
|
||||
func LintHistogramSummaryReserved(mf *dto.MetricFamily) []error {
|
||||
// These rules do not apply to untyped metrics.
|
||||
t := mf.GetType()
|
||||
if t == dto.MetricType_UNTYPED {
|
||||
return nil
|
||||
}
|
||||
|
||||
var problems []error
|
||||
|
||||
isHistogram := t == dto.MetricType_HISTOGRAM
|
||||
isSummary := t == dto.MetricType_SUMMARY
|
||||
|
||||
n := mf.GetName()
|
||||
|
||||
if !isHistogram && strings.HasSuffix(n, "_bucket") {
|
||||
problems = append(problems, errors.New(`non-histogram metrics should not have "_bucket" suffix`))
|
||||
}
|
||||
if !isHistogram && !isSummary && strings.HasSuffix(n, "_count") {
|
||||
problems = append(problems, errors.New(`non-histogram and non-summary metrics should not have "_count" suffix`))
|
||||
}
|
||||
if !isHistogram && !isSummary && strings.HasSuffix(n, "_sum") {
|
||||
problems = append(problems, errors.New(`non-histogram and non-summary metrics should not have "_sum" suffix`))
|
||||
}
|
||||
|
||||
for _, m := range mf.GetMetric() {
|
||||
for _, l := range m.GetLabel() {
|
||||
ln := l.GetName()
|
||||
|
||||
if !isHistogram && ln == "le" {
|
||||
problems = append(problems, errors.New(`non-histogram metrics should not have "le" label`))
|
||||
}
|
||||
if !isSummary && ln == "quantile" {
|
||||
problems = append(problems, errors.New(`non-summary metrics should not have "quantile" label`))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return problems
|
||||
}
|
118
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go
generated
vendored
Normal file
118
vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
// Copyright 2020 The Prometheus 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 validations
|
||||
|
||||
import "strings"
|
||||
|
||||
// Units and their possible prefixes recognized by this library. More can be
|
||||
// added over time as needed.
|
||||
var (
|
||||
// map a unit to the appropriate base unit.
|
||||
units = map[string]string{
|
||||
// Base units.
|
||||
"amperes": "amperes",
|
||||
"bytes": "bytes",
|
||||
"celsius": "celsius", // Also allow Celsius because it is common in typical Prometheus use cases.
|
||||
"grams": "grams",
|
||||
"joules": "joules",
|
||||
"kelvin": "kelvin", // SI base unit, used in special cases (e.g. color temperature, scientific measurements).
|
||||
"meters": "meters", // Both American and international spelling permitted.
|
||||
"metres": "metres",
|
||||
"seconds": "seconds",
|
||||
"volts": "volts",
|
||||
|
||||
// Non base units.
|
||||
// Time.
|
||||
"minutes": "seconds",
|
||||
"hours": "seconds",
|
||||
"days": "seconds",
|
||||
"weeks": "seconds",
|
||||
// Temperature.
|
||||
"kelvins": "kelvin",
|
||||
"fahrenheit": "celsius",
|
||||
"rankine": "celsius",
|
||||
// Length.
|
||||
"inches": "meters",
|
||||
"yards": "meters",
|
||||
"miles": "meters",
|
||||
// Bytes.
|
||||
"bits": "bytes",
|
||||
// Energy.
|
||||
"calories": "joules",
|
||||
// Mass.
|
||||
"pounds": "grams",
|
||||
"ounces": "grams",
|
||||
}
|
||||
|
||||
unitPrefixes = []string{
|
||||
"pico",
|
||||
"nano",
|
||||
"micro",
|
||||
"milli",
|
||||
"centi",
|
||||
"deci",
|
||||
"deca",
|
||||
"hecto",
|
||||
"kilo",
|
||||
"kibi",
|
||||
"mega",
|
||||
"mibi",
|
||||
"giga",
|
||||
"gibi",
|
||||
"tera",
|
||||
"tebi",
|
||||
"peta",
|
||||
"pebi",
|
||||
}
|
||||
|
||||
// Common abbreviations that we'd like to discourage.
|
||||
unitAbbreviations = []string{
|
||||
"s",
|
||||
"ms",
|
||||
"us",
|
||||
"ns",
|
||||
"sec",
|
||||
"b",
|
||||
"kb",
|
||||
"mb",
|
||||
"gb",
|
||||
"tb",
|
||||
"pb",
|
||||
"m",
|
||||
"h",
|
||||
"d",
|
||||
}
|
||||
)
|
||||
|
||||
// metricUnits attempts to detect known unit types used as part of a metric name,
|
||||
// e.g. "foo_bytes_total" or "bar_baz_milligrams".
|
||||
func metricUnits(m string) (unit, base string, ok bool) {
|
||||
ss := strings.Split(m, "_")
|
||||
|
||||
for _, s := range ss {
|
||||
if base, found := units[s]; found {
|
||||
return s, base, true
|
||||
}
|
||||
|
||||
for _, p := range unitPrefixes {
|
||||
if strings.HasPrefix(s, p) {
|
||||
if base, found := units[s[len(p):]]; found {
|
||||
return s, base, true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "", "", false
|
||||
}
|
15
vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
generated
vendored
15
vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go
generated
vendored
@ -47,6 +47,7 @@ import (
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/common/expfmt"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/internal"
|
||||
@ -230,6 +231,20 @@ func convertReaderToMetricFamily(reader io.Reader) ([]*dto.MetricFamily, error)
|
||||
return nil, fmt.Errorf("converting reader to metric families failed: %w", err)
|
||||
}
|
||||
|
||||
// The text protocol handles empty help fields inconsistently. When
|
||||
// encoding, any non-nil value, include the empty string, produces a
|
||||
// "# HELP" line. But when decoding, the help field is only set to a
|
||||
// non-nil value if the "# HELP" line contains a non-empty value.
|
||||
//
|
||||
// Because metrics in a registry always have non-nil help fields, populate
|
||||
// any nil help fields in the parsed metrics with the empty string so that
|
||||
// when we compare text encodings, the results are consistent.
|
||||
for _, metric := range notNormalized {
|
||||
if metric.Help == nil {
|
||||
metric.Help = proto.String("")
|
||||
}
|
||||
}
|
||||
|
||||
return internal.NormalizeMetricFamilies(notNormalized), nil
|
||||
}
|
||||
|
||||
|
3
vendor/github.com/prometheus/client_model/go/metrics.pb.go
generated
vendored
3
vendor/github.com/prometheus/client_model/go/metrics.pb.go
generated
vendored
@ -474,6 +474,9 @@ type Histogram struct {
|
||||
NegativeDelta []int64 `protobuf:"zigzag64,10,rep,name=negative_delta,json=negativeDelta" json:"negative_delta,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
|
||||
NegativeCount []float64 `protobuf:"fixed64,11,rep,name=negative_count,json=negativeCount" json:"negative_count,omitempty"` // Absolute count of each bucket.
|
||||
// Positive buckets for the native histogram.
|
||||
// Use a no-op span (offset 0, length 0) for a native histogram without any
|
||||
// observations yet and with a zero_threshold of 0. Otherwise, it would be
|
||||
// indistinguishable from a classic histogram.
|
||||
PositiveSpan []*BucketSpan `protobuf:"bytes,12,rep,name=positive_span,json=positiveSpan" json:"positive_span,omitempty"`
|
||||
// Use either "positive_delta" or "positive_count", the former for
|
||||
// regular histograms with integer counts, the latter for float
|
||||
|
2
vendor/github.com/prometheus/common/expfmt/decode.go
generated
vendored
2
vendor/github.com/prometheus/common/expfmt/decode.go
generated
vendored
@ -22,7 +22,7 @@ import (
|
||||
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
|
||||
"github.com/matttproud/golang_protobuf_extensions/pbutil"
|
||||
"github.com/matttproud/golang_protobuf_extensions/v2/pbutil"
|
||||
"github.com/prometheus/common/model"
|
||||
)
|
||||
|
||||
|
2
vendor/github.com/prometheus/common/expfmt/encode.go
generated
vendored
2
vendor/github.com/prometheus/common/expfmt/encode.go
generated
vendored
@ -18,7 +18,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/matttproud/golang_protobuf_extensions/pbutil"
|
||||
"github.com/matttproud/golang_protobuf_extensions/v2/pbutil"
|
||||
"github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg"
|
||||
"google.golang.org/protobuf/encoding/prototext"
|
||||
|
||||
|
2
vendor/github.com/prometheus/procfs/Makefile.common
generated
vendored
2
vendor/github.com/prometheus/procfs/Makefile.common
generated
vendored
@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
|
||||
SKIP_GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT :=
|
||||
GOLANGCI_LINT_OPTS ?=
|
||||
GOLANGCI_LINT_VERSION ?= v1.53.3
|
||||
GOLANGCI_LINT_VERSION ?= v1.54.2
|
||||
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
|
||||
# windows isn't included here because of the path separator being different.
|
||||
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
|
||||
|
4
vendor/github.com/prometheus/procfs/fs_statfs_notype.go
generated
vendored
4
vendor/github.com/prometheus/procfs/fs_statfs_notype.go
generated
vendored
@ -11,8 +11,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build netbsd || openbsd || solaris || windows || nostatfs
|
||||
// +build netbsd openbsd solaris windows nostatfs
|
||||
//go:build !freebsd && !linux
|
||||
// +build !freebsd,!linux
|
||||
|
||||
package procfs
|
||||
|
||||
|
4
vendor/github.com/prometheus/procfs/fs_statfs_type.go
generated
vendored
4
vendor/github.com/prometheus/procfs/fs_statfs_type.go
generated
vendored
@ -11,8 +11,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//go:build !netbsd && !openbsd && !solaris && !windows && !nostatfs
|
||||
// +build !netbsd,!openbsd,!solaris,!windows,!nostatfs
|
||||
//go:build freebsd || linux
|
||||
// +build freebsd linux
|
||||
|
||||
package procfs
|
||||
|
||||
|
83
vendor/github.com/prometheus/procfs/mountstats.go
generated
vendored
83
vendor/github.com/prometheus/procfs/mountstats.go
generated
vendored
@ -44,6 +44,14 @@ const (
|
||||
|
||||
fieldTransport11TCPLen = 13
|
||||
fieldTransport11UDPLen = 10
|
||||
|
||||
// kernel version >= 4.14 MaxLen
|
||||
// See: https://elixir.bootlin.com/linux/v6.4.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L393
|
||||
fieldTransport11RDMAMaxLen = 28
|
||||
|
||||
// kernel version <= 4.2 MinLen
|
||||
// See: https://elixir.bootlin.com/linux/v4.2.8/source/net/sunrpc/xprtrdma/xprt_rdma.h#L331
|
||||
fieldTransport11RDMAMinLen = 20
|
||||
)
|
||||
|
||||
// A Mount is a device mount parsed from /proc/[pid]/mountstats.
|
||||
@ -233,6 +241,33 @@ type NFSTransportStats struct {
|
||||
// A running counter, incremented on each request as the current size of the
|
||||
// pending queue.
|
||||
CumulativePendingQueue uint64
|
||||
|
||||
// Stats below only available with stat version 1.1.
|
||||
// Transport over RDMA
|
||||
|
||||
// accessed when sending a call
|
||||
ReadChunkCount uint64
|
||||
WriteChunkCount uint64
|
||||
ReplyChunkCount uint64
|
||||
TotalRdmaRequest uint64
|
||||
|
||||
// rarely accessed error counters
|
||||
PullupCopyCount uint64
|
||||
HardwayRegisterCount uint64
|
||||
FailedMarshalCount uint64
|
||||
BadReplyCount uint64
|
||||
MrsRecovered uint64
|
||||
MrsOrphaned uint64
|
||||
MrsAllocated uint64
|
||||
EmptySendctxQ uint64
|
||||
|
||||
// accessed when receiving a reply
|
||||
TotalRdmaReply uint64
|
||||
FixupCopyCount uint64
|
||||
ReplyWaitsForSend uint64
|
||||
LocalInvNeeded uint64
|
||||
NomsgCallCount uint64
|
||||
BcallCount uint64
|
||||
}
|
||||
|
||||
// parseMountStats parses a /proc/[pid]/mountstats file and returns a slice
|
||||
@ -587,14 +622,17 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
|
||||
expectedLength = fieldTransport11TCPLen
|
||||
} else if protocol == "udp" {
|
||||
expectedLength = fieldTransport11UDPLen
|
||||
} else if protocol == "rdma" {
|
||||
expectedLength = fieldTransport11RDMAMinLen
|
||||
} else {
|
||||
return nil, fmt.Errorf("%w: invalid NFS protocol \"%s\" in stats 1.1 statement: %v", ErrFileParse, protocol, ss)
|
||||
}
|
||||
if len(ss) != expectedLength {
|
||||
return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v", ErrFileParse, ss)
|
||||
if (len(ss) != expectedLength && (protocol == "tcp" || protocol == "udp")) ||
|
||||
(protocol == "rdma" && len(ss) < expectedLength) {
|
||||
return nil, fmt.Errorf("%w: invalid NFS transport stats 1.1 statement: %v, protocol: %v", ErrFileParse, ss, protocol)
|
||||
}
|
||||
default:
|
||||
return nil, fmt.Errorf("%s: Unrecognized NFS transport stats version: %q", ErrFileParse, statVersion)
|
||||
return nil, fmt.Errorf("%s: Unrecognized NFS transport stats version: %q, protocol: %v", ErrFileParse, statVersion, protocol)
|
||||
}
|
||||
|
||||
// Allocate enough for v1.1 stats since zero value for v1.1 stats will be okay
|
||||
@ -604,7 +642,9 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
|
||||
// Note: slice length must be set to length of v1.1 stats to avoid a panic when
|
||||
// only v1.0 stats are present.
|
||||
// See: https://github.com/prometheus/node_exporter/issues/571.
|
||||
ns := make([]uint64, fieldTransport11TCPLen)
|
||||
//
|
||||
// Note: NFS Over RDMA slice length is fieldTransport11RDMAMaxLen
|
||||
ns := make([]uint64, fieldTransport11RDMAMaxLen+3)
|
||||
for i, s := range ss {
|
||||
n, err := strconv.ParseUint(s, 10, 64)
|
||||
if err != nil {
|
||||
@ -622,9 +662,14 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
|
||||
// we set them to 0 here.
|
||||
if protocol == "udp" {
|
||||
ns = append(ns[:2], append(make([]uint64, 3), ns[2:]...)...)
|
||||
} else if protocol == "tcp" {
|
||||
ns = append(ns[:fieldTransport11TCPLen], make([]uint64, fieldTransport11RDMAMaxLen-fieldTransport11TCPLen+3)...)
|
||||
} else if protocol == "rdma" {
|
||||
ns = append(ns[:fieldTransport10TCPLen], append(make([]uint64, 3), ns[fieldTransport10TCPLen:]...)...)
|
||||
}
|
||||
|
||||
return &NFSTransportStats{
|
||||
// NFS xprt over tcp or udp
|
||||
Protocol: protocol,
|
||||
Port: ns[0],
|
||||
Bind: ns[1],
|
||||
@ -636,8 +681,32 @@ func parseNFSTransportStats(ss []string, statVersion string) (*NFSTransportStats
|
||||
BadTransactionIDs: ns[7],
|
||||
CumulativeActiveRequests: ns[8],
|
||||
CumulativeBacklog: ns[9],
|
||||
MaximumRPCSlotsUsed: ns[10],
|
||||
CumulativeSendingQueue: ns[11],
|
||||
CumulativePendingQueue: ns[12],
|
||||
|
||||
// NFS xprt over tcp or udp
|
||||
// And statVersion 1.1
|
||||
MaximumRPCSlotsUsed: ns[10],
|
||||
CumulativeSendingQueue: ns[11],
|
||||
CumulativePendingQueue: ns[12],
|
||||
|
||||
// NFS xprt over rdma
|
||||
// And stat Version 1.1
|
||||
ReadChunkCount: ns[13],
|
||||
WriteChunkCount: ns[14],
|
||||
ReplyChunkCount: ns[15],
|
||||
TotalRdmaRequest: ns[16],
|
||||
PullupCopyCount: ns[17],
|
||||
HardwayRegisterCount: ns[18],
|
||||
FailedMarshalCount: ns[19],
|
||||
BadReplyCount: ns[20],
|
||||
MrsRecovered: ns[21],
|
||||
MrsOrphaned: ns[22],
|
||||
MrsAllocated: ns[23],
|
||||
EmptySendctxQ: ns[24],
|
||||
TotalRdmaReply: ns[25],
|
||||
FixupCopyCount: ns[26],
|
||||
ReplyWaitsForSend: ns[27],
|
||||
LocalInvNeeded: ns[28],
|
||||
NomsgCallCount: ns[29],
|
||||
BcallCount: ns[30],
|
||||
}, nil
|
||||
}
|
||||
|
8
vendor/github.com/prometheus/procfs/proc_fdinfo.go
generated
vendored
8
vendor/github.com/prometheus/procfs/proc_fdinfo.go
generated
vendored
@ -26,6 +26,7 @@ var (
|
||||
rPos = regexp.MustCompile(`^pos:\s+(\d+)$`)
|
||||
rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`)
|
||||
rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`)
|
||||
rIno = regexp.MustCompile(`^ino:\s+(\d+)$`)
|
||||
rInotify = regexp.MustCompile(`^inotify`)
|
||||
rInotifyParts = regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)(?:\s+mask:([0-9a-f]+))?`)
|
||||
)
|
||||
@ -40,6 +41,8 @@ type ProcFDInfo struct {
|
||||
Flags string
|
||||
// Mount point ID
|
||||
MntID string
|
||||
// Inode number
|
||||
Ino string
|
||||
// List of inotify lines (structured) in the fdinfo file (kernel 3.8+ only)
|
||||
InotifyInfos []InotifyInfo
|
||||
}
|
||||
@ -51,7 +54,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var text, pos, flags, mntid string
|
||||
var text, pos, flags, mntid, ino string
|
||||
var inotify []InotifyInfo
|
||||
|
||||
scanner := bufio.NewScanner(bytes.NewReader(data))
|
||||
@ -63,6 +66,8 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
|
||||
flags = rFlags.FindStringSubmatch(text)[1]
|
||||
} else if rMntID.MatchString(text) {
|
||||
mntid = rMntID.FindStringSubmatch(text)[1]
|
||||
} else if rIno.MatchString(text) {
|
||||
ino = rIno.FindStringSubmatch(text)[1]
|
||||
} else if rInotify.MatchString(text) {
|
||||
newInotify, err := parseInotifyInfo(text)
|
||||
if err != nil {
|
||||
@ -77,6 +82,7 @@ func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
|
||||
Pos: pos,
|
||||
Flags: flags,
|
||||
MntID: mntid,
|
||||
Ino: ino,
|
||||
InotifyInfos: inotify,
|
||||
}
|
||||
|
||||
|
20
vendor/github.com/prometheus/procfs/proc_maps.go
generated
vendored
20
vendor/github.com/prometheus/procfs/proc_maps.go
generated
vendored
@ -63,17 +63,17 @@ type ProcMap struct {
|
||||
// parseDevice parses the device token of a line and converts it to a dev_t
|
||||
// (mkdev) like structure.
|
||||
func parseDevice(s string) (uint64, error) {
|
||||
toks := strings.Split(s, ":")
|
||||
if len(toks) < 2 {
|
||||
return 0, fmt.Errorf("%w: unexpected number of fields, expected: 2, got: %q", ErrFileParse, len(toks))
|
||||
i := strings.Index(s, ":")
|
||||
if i == -1 {
|
||||
return 0, fmt.Errorf("%w: expected separator `:` in %s", ErrFileParse, s)
|
||||
}
|
||||
|
||||
major, err := strconv.ParseUint(toks[0], 16, 0)
|
||||
major, err := strconv.ParseUint(s[0:i], 16, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
minor, err := strconv.ParseUint(toks[1], 16, 0)
|
||||
minor, err := strconv.ParseUint(s[i+1:], 16, 0)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -93,17 +93,17 @@ func parseAddress(s string) (uintptr, error) {
|
||||
|
||||
// parseAddresses parses the start-end address.
|
||||
func parseAddresses(s string) (uintptr, uintptr, error) {
|
||||
toks := strings.Split(s, "-")
|
||||
if len(toks) < 2 {
|
||||
return 0, 0, fmt.Errorf("%w: invalid address", ErrFileParse)
|
||||
idx := strings.Index(s, "-")
|
||||
if idx == -1 {
|
||||
return 0, 0, fmt.Errorf("%w: expected separator `-` in %s", ErrFileParse, s)
|
||||
}
|
||||
|
||||
saddr, err := parseAddress(toks[0])
|
||||
saddr, err := parseAddress(s[0:idx])
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
eaddr, err := parseAddress(toks[1])
|
||||
eaddr, err := parseAddress(s[idx+1:])
|
||||
if err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
21
vendor/github.com/prometheus/procfs/proc_status.go
generated
vendored
21
vendor/github.com/prometheus/procfs/proc_status.go
generated
vendored
@ -23,7 +23,7 @@ import (
|
||||
)
|
||||
|
||||
// ProcStatus provides status information about the process,
|
||||
// read from /proc/[pid]/stat.
|
||||
// read from /proc/[pid]/status.
|
||||
type ProcStatus struct {
|
||||
// The process ID.
|
||||
PID int
|
||||
@ -32,6 +32,8 @@ type ProcStatus struct {
|
||||
|
||||
// Thread group ID.
|
||||
TGID int
|
||||
// List of Pid namespace.
|
||||
NSpids []uint64
|
||||
|
||||
// Peak virtual memory size.
|
||||
VmPeak uint64 // nolint:revive
|
||||
@ -127,6 +129,8 @@ func (s *ProcStatus) fillStatus(k string, vString string, vUint uint64, vUintByt
|
||||
copy(s.UIDs[:], strings.Split(vString, "\t"))
|
||||
case "Gid":
|
||||
copy(s.GIDs[:], strings.Split(vString, "\t"))
|
||||
case "NSpid":
|
||||
s.NSpids = calcNSPidsList(vString)
|
||||
case "VmPeak":
|
||||
s.VmPeak = vUintBytes
|
||||
case "VmSize":
|
||||
@ -200,3 +204,18 @@ func calcCpusAllowedList(cpuString string) []uint64 {
|
||||
sort.Slice(g, func(i, j int) bool { return g[i] < g[j] })
|
||||
return g
|
||||
}
|
||||
|
||||
func calcNSPidsList(nspidsString string) []uint64 {
|
||||
s := strings.Split(nspidsString, " ")
|
||||
var nspids []uint64
|
||||
|
||||
for _, nspid := range s {
|
||||
nspid, _ := strconv.ParseUint(nspid, 10, 64)
|
||||
if nspid == 0 {
|
||||
continue
|
||||
}
|
||||
nspids = append(nspids, nspid)
|
||||
}
|
||||
|
||||
return nspids
|
||||
}
|
||||
|
Reference in New Issue
Block a user