mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
🌱 Bump github.com/aws/aws-sdk-go-v2/service/eks (#935)
Bumps [github.com/aws/aws-sdk-go-v2/service/eks](https://github.com/aws/aws-sdk-go-v2) from 1.57.1 to 1.63.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/s3/v1.57.1...service/s3/v1.63.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/eks dependency-version: 1.63.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
9
go.mod
9
go.mod
@@ -3,9 +3,9 @@ module open-cluster-management.io/ocm
|
||||
go 1.22.5
|
||||
|
||||
require (
|
||||
github.com/aws/aws-sdk-go-v2 v1.35.0
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.3
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.11
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.57.1
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1
|
||||
github.com/aws/aws-sdk-go-v2/service/iam v1.38.6
|
||||
github.com/aws/smithy-go v1.22.2
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
|
||||
@@ -57,8 +57,8 @@ require (
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.52 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.23 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.30 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.30 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.8 // indirect
|
||||
@@ -108,7 +108,6 @@ require (
|
||||
github.com/huandu/xstrings v1.5.0 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.17.11 // indirect
|
||||
|
||||
20
go.sum
20
go.sum
@@ -22,22 +22,22 @@ github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8
|
||||
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/aws/aws-sdk-go-v2 v1.35.0 h1:jTPxEJyzjSuuz0wB+302hr8Eu9KUI+Zv8zlujMGJpVI=
|
||||
github.com/aws/aws-sdk-go-v2 v1.35.0/go.mod h1:JgstGg0JjWU1KpVJjD5H0y0yyAIpSdKEq556EI6yOOM=
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.3 h1:mJoei2CxPutQVxaATCzDUjcZEjVRdpsiiXi2o38yqWM=
|
||||
github.com/aws/aws-sdk-go-v2 v1.36.3/go.mod h1:LLXuLpgzEbD766Z5ECcRmi8AzSwfZItDtmABVkRLGzg=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.11 h1:7Ekru0IkRHRnSRWGQLnLN6i0o1Jncd0rHo2T130+tEQ=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.28.11/go.mod h1:x78TpPvBfHH16hi5tE3OCWQ0pzNfyXA349p5/Wp82Yo=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.52 h1:I4ymSk35LHogx2Re2Wu6LOHNTRaRWkLVoJgWS5Wd40M=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.52/go.mod h1:vAkqKbMNUcher8fDXP2Ge2qFXKMkcD74qvk1lJRMemM=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.23 h1:IBAoD/1d8A8/1aA8g4MBVtTRHhXRiNAgwdbo/xRM2DI=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.23/go.mod h1:vfENuCM7dofkgKpYzuzf1VT1UKkA/YL3qanfBn7HCaA=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.30 h1:+7AzSGNhHoY53di13lvztf9Dyd/9ofzoYGBllkWp3a0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.30/go.mod h1:Jxd/FrCny99yURiQiMywgXvBhd7tmgdv6KdlUTNzMSo=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.30 h1:Ex06eY6I5rO7IX0HalGfa5nGjpBoOsS1Qm3xfjkuszs=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.30/go.mod h1:AvyEMA9QcX59kFhVizBpIBpEMThUTXssuJe+emBdcGM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 h1:ZK5jHhnrioRkUNOc+hOgQKlUL5JeC3S6JgLxtQ+Rm0Q=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34/go.mod h1:p4VfIceZokChbA9FzMbRGz5OV+lekcVtHlPKEO0gSZY=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 h1:SZwFm17ZUNNg5Np0ioo/gq8Mn6u9w19Mri8DnJ15Jf0=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34/go.mod h1:dFZsC0BLo346mvKQLWmoJxT+Sjp+qcVR1tRVHQGOH9Q=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ=
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.57.1 h1:lvI5xrZY3p2R36S48Clrbihte00YYaLh07DzlsJ+ptg=
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.57.1/go.mod h1:OeKQS8ZtV7WtZPzxkpnrqtsHBTHagy54EuJ73Ni8CUk=
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1 h1:oI4AHf3K7cA+ukczcNwYsE8A7trMQiTRZTsgfkSS9BE=
|
||||
github.com/aws/aws-sdk-go-v2/service/eks v1.63.1/go.mod h1:v1xXy6ea0PHtWkjFUvAUh6B/5wv7UF909Nru0dOIJDk=
|
||||
github.com/aws/aws-sdk-go-v2/service/iam v1.38.6 h1:AXwKkfCZEqUr1QuNb0UN44CIg5YN4jqfYwUpkv+dsSk=
|
||||
github.com/aws/aws-sdk-go-v2/service/iam v1.38.6/go.mod h1:dgsc0h/uKL5OjfHSZz6z7WhkX83BbRQ2ZxYoWYg5LbA=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y=
|
||||
@@ -198,10 +198,6 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg=
|
||||
github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg=
|
||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
|
||||
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
|
||||
11
vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go
generated
vendored
11
vendor/github.com/aws/aws-sdk-go-v2/aws/credential_cache.go
generated
vendored
@@ -172,6 +172,17 @@ func (p *CredentialsCache) getCreds() (Credentials, bool) {
|
||||
return *c, true
|
||||
}
|
||||
|
||||
// ProviderSources returns a list of where the underlying credential provider
|
||||
// has been sourced, if available. Returns empty if the provider doesn't implement
|
||||
// the interface
|
||||
func (p *CredentialsCache) ProviderSources() []CredentialSource {
|
||||
asSource, ok := p.provider.(CredentialProviderSource)
|
||||
if !ok {
|
||||
return []CredentialSource{}
|
||||
}
|
||||
return asSource.ProviderSources()
|
||||
}
|
||||
|
||||
// Invalidate will invalidate the cached credentials. The next call to Retrieve
|
||||
// will cause the provider's Retrieve method to be called.
|
||||
func (p *CredentialsCache) Invalidate() {
|
||||
|
||||
57
vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go
generated
vendored
57
vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go
generated
vendored
@@ -70,6 +70,56 @@ func (AnonymousCredentials) Retrieve(context.Context) (Credentials, error) {
|
||||
fmt.Errorf("the AnonymousCredentials is not a valid credential provider, and cannot be used to sign AWS requests with")
|
||||
}
|
||||
|
||||
// CredentialSource is the source of the credential provider.
|
||||
// A provider can have multiple credential sources: For example, a provider that reads a profile, calls ECS to
|
||||
// get credentials and then assumes a role using STS will have all these as part of its provider chain.
|
||||
type CredentialSource int
|
||||
|
||||
const (
|
||||
// CredentialSourceUndefined is the sentinel zero value
|
||||
CredentialSourceUndefined CredentialSource = iota
|
||||
// CredentialSourceCode credentials resolved from code, cli parameters, session object, or client instance
|
||||
CredentialSourceCode
|
||||
// CredentialSourceEnvVars credentials resolved from environment variables
|
||||
CredentialSourceEnvVars
|
||||
// CredentialSourceEnvVarsSTSWebIDToken credentials resolved from environment variables for assuming a role with STS using a web identity token
|
||||
CredentialSourceEnvVarsSTSWebIDToken
|
||||
// CredentialSourceSTSAssumeRole credentials resolved from STS using AssumeRole
|
||||
CredentialSourceSTSAssumeRole
|
||||
// CredentialSourceSTSAssumeRoleSaml credentials resolved from STS using assume role with SAML
|
||||
CredentialSourceSTSAssumeRoleSaml
|
||||
// CredentialSourceSTSAssumeRoleWebID credentials resolved from STS using assume role with web identity
|
||||
CredentialSourceSTSAssumeRoleWebID
|
||||
// CredentialSourceSTSFederationToken credentials resolved from STS using a federation token
|
||||
CredentialSourceSTSFederationToken
|
||||
// CredentialSourceSTSSessionToken credentials resolved from STS using a session token S
|
||||
CredentialSourceSTSSessionToken
|
||||
// CredentialSourceProfile credentials resolved from a config file(s) profile with static credentials
|
||||
CredentialSourceProfile
|
||||
// CredentialSourceProfileSourceProfile credentials resolved from a source profile in a config file(s) profile
|
||||
CredentialSourceProfileSourceProfile
|
||||
// CredentialSourceProfileNamedProvider credentials resolved from a named provider in a config file(s) profile (like EcsContainer)
|
||||
CredentialSourceProfileNamedProvider
|
||||
// CredentialSourceProfileSTSWebIDToken credentials resolved from configuration for assuming a role with STS using web identity token in a config file(s) profile
|
||||
CredentialSourceProfileSTSWebIDToken
|
||||
// CredentialSourceProfileSSO credentials resolved from an SSO session in a config file(s) profile
|
||||
CredentialSourceProfileSSO
|
||||
// CredentialSourceSSO credentials resolved from an SSO session
|
||||
CredentialSourceSSO
|
||||
// CredentialSourceProfileSSOLegacy credentials resolved from an SSO session in a config file(s) profile using legacy format
|
||||
CredentialSourceProfileSSOLegacy
|
||||
// CredentialSourceSSOLegacy credentials resolved from an SSO session using legacy format
|
||||
CredentialSourceSSOLegacy
|
||||
// CredentialSourceProfileProcess credentials resolved from a process in a config file(s) profile
|
||||
CredentialSourceProfileProcess
|
||||
// CredentialSourceProcess credentials resolved from a process
|
||||
CredentialSourceProcess
|
||||
// CredentialSourceHTTP credentials resolved from an HTTP endpoint
|
||||
CredentialSourceHTTP
|
||||
// CredentialSourceIMDS credentials resolved from the instance metadata service (IMDS)
|
||||
CredentialSourceIMDS
|
||||
)
|
||||
|
||||
// A Credentials is the AWS credentials value for individual credential fields.
|
||||
type Credentials struct {
|
||||
// AWS Access key ID
|
||||
@@ -125,6 +175,13 @@ type CredentialsProvider interface {
|
||||
Retrieve(ctx context.Context) (Credentials, error)
|
||||
}
|
||||
|
||||
// CredentialProviderSource allows any credential provider to track
|
||||
// all providers where a credential provider were sourced. For example, if the credentials came from a
|
||||
// call to a role specified in the profile, this method will give the whole breadcrumb trail
|
||||
type CredentialProviderSource interface {
|
||||
ProviderSources() []CredentialSource
|
||||
}
|
||||
|
||||
// CredentialsProviderFunc provides a helper wrapping a function value to
|
||||
// satisfy the CredentialsProvider interface.
|
||||
type CredentialsProviderFunc func(context.Context) (Credentials, error)
|
||||
|
||||
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
@@ -3,4 +3,4 @@
|
||||
package aws
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.35.0"
|
||||
const goModuleVersion = "1.36.3"
|
||||
|
||||
112
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go
generated
vendored
112
vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go
generated
vendored
@@ -76,30 +76,90 @@ type UserAgentFeature string
|
||||
|
||||
// Enumerates UserAgentFeature.
|
||||
const (
|
||||
UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types)
|
||||
UserAgentFeatureWaiter = "B"
|
||||
UserAgentFeaturePaginator = "C"
|
||||
UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard)
|
||||
UserAgentFeatureRetryModeStandard = "E"
|
||||
UserAgentFeatureRetryModeAdaptive = "F"
|
||||
UserAgentFeatureS3Transfer = "G"
|
||||
UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external)
|
||||
UserAgentFeatureS3CryptoV2 = "I" // n/a
|
||||
UserAgentFeatureS3ExpressBucket = "J"
|
||||
UserAgentFeatureS3AccessGrants = "K" // not yet implemented
|
||||
UserAgentFeatureGZIPRequestCompression = "L"
|
||||
UserAgentFeatureProtocolRPCV2CBOR = "M"
|
||||
UserAgentFeatureRequestChecksumCRC32 = "U"
|
||||
UserAgentFeatureRequestChecksumCRC32C = "V"
|
||||
UserAgentFeatureRequestChecksumCRC64 = "W"
|
||||
UserAgentFeatureRequestChecksumSHA1 = "X"
|
||||
UserAgentFeatureRequestChecksumSHA256 = "Y"
|
||||
UserAgentFeatureRequestChecksumWhenSupported = "Z"
|
||||
UserAgentFeatureRequestChecksumWhenRequired = "a"
|
||||
UserAgentFeatureResponseChecksumWhenSupported = "b"
|
||||
UserAgentFeatureResponseChecksumWhenRequired = "c"
|
||||
UserAgentFeatureResourceModel UserAgentFeature = "A" // n/a (we don't generate separate resource types)
|
||||
|
||||
UserAgentFeatureWaiter = "B"
|
||||
UserAgentFeaturePaginator = "C"
|
||||
|
||||
UserAgentFeatureRetryModeLegacy = "D" // n/a (equivalent to standard)
|
||||
UserAgentFeatureRetryModeStandard = "E"
|
||||
UserAgentFeatureRetryModeAdaptive = "F"
|
||||
|
||||
UserAgentFeatureS3Transfer = "G"
|
||||
UserAgentFeatureS3CryptoV1N = "H" // n/a (crypto client is external)
|
||||
UserAgentFeatureS3CryptoV2 = "I" // n/a
|
||||
UserAgentFeatureS3ExpressBucket = "J"
|
||||
UserAgentFeatureS3AccessGrants = "K" // not yet implemented
|
||||
|
||||
UserAgentFeatureGZIPRequestCompression = "L"
|
||||
|
||||
UserAgentFeatureProtocolRPCV2CBOR = "M"
|
||||
|
||||
UserAgentFeatureAccountIDEndpoint = "O" // DO NOT IMPLEMENT: rules output is not currently defined. SDKs should not parse endpoints for feature information.
|
||||
UserAgentFeatureAccountIDModePreferred = "P"
|
||||
UserAgentFeatureAccountIDModeDisabled = "Q"
|
||||
UserAgentFeatureAccountIDModeRequired = "R"
|
||||
|
||||
UserAgentFeatureRequestChecksumCRC32 = "U"
|
||||
UserAgentFeatureRequestChecksumCRC32C = "V"
|
||||
UserAgentFeatureRequestChecksumCRC64 = "W"
|
||||
UserAgentFeatureRequestChecksumSHA1 = "X"
|
||||
UserAgentFeatureRequestChecksumSHA256 = "Y"
|
||||
UserAgentFeatureRequestChecksumWhenSupported = "Z"
|
||||
UserAgentFeatureRequestChecksumWhenRequired = "a"
|
||||
UserAgentFeatureResponseChecksumWhenSupported = "b"
|
||||
UserAgentFeatureResponseChecksumWhenRequired = "c"
|
||||
|
||||
UserAgentFeatureDynamoDBUserAgent = "d" // not yet implemented
|
||||
|
||||
UserAgentFeatureCredentialsCode = "e"
|
||||
UserAgentFeatureCredentialsJvmSystemProperties = "f" // n/a (this is not a JVM sdk)
|
||||
UserAgentFeatureCredentialsEnvVars = "g"
|
||||
UserAgentFeatureCredentialsEnvVarsStsWebIDToken = "h"
|
||||
UserAgentFeatureCredentialsStsAssumeRole = "i"
|
||||
UserAgentFeatureCredentialsStsAssumeRoleSaml = "j" // not yet implemented
|
||||
UserAgentFeatureCredentialsStsAssumeRoleWebID = "k"
|
||||
UserAgentFeatureCredentialsStsFederationToken = "l" // not yet implemented
|
||||
UserAgentFeatureCredentialsStsSessionToken = "m" // not yet implemented
|
||||
UserAgentFeatureCredentialsProfile = "n"
|
||||
UserAgentFeatureCredentialsProfileSourceProfile = "o"
|
||||
UserAgentFeatureCredentialsProfileNamedProvider = "p"
|
||||
UserAgentFeatureCredentialsProfileStsWebIDToken = "q"
|
||||
UserAgentFeatureCredentialsProfileSso = "r"
|
||||
UserAgentFeatureCredentialsSso = "s"
|
||||
UserAgentFeatureCredentialsProfileSsoLegacy = "t"
|
||||
UserAgentFeatureCredentialsSsoLegacy = "u"
|
||||
UserAgentFeatureCredentialsProfileProcess = "v"
|
||||
UserAgentFeatureCredentialsProcess = "w"
|
||||
UserAgentFeatureCredentialsBoto2ConfigFile = "x" // n/a (this is not boto/Python)
|
||||
UserAgentFeatureCredentialsAwsSdkStore = "y" // n/a (this is used by .NET based sdk)
|
||||
UserAgentFeatureCredentialsHTTP = "z"
|
||||
UserAgentFeatureCredentialsIMDS = "0"
|
||||
)
|
||||
|
||||
var credentialSourceToFeature = map[aws.CredentialSource]UserAgentFeature{
|
||||
aws.CredentialSourceCode: UserAgentFeatureCredentialsCode,
|
||||
aws.CredentialSourceEnvVars: UserAgentFeatureCredentialsEnvVars,
|
||||
aws.CredentialSourceEnvVarsSTSWebIDToken: UserAgentFeatureCredentialsEnvVarsStsWebIDToken,
|
||||
aws.CredentialSourceSTSAssumeRole: UserAgentFeatureCredentialsStsAssumeRole,
|
||||
aws.CredentialSourceSTSAssumeRoleSaml: UserAgentFeatureCredentialsStsAssumeRoleSaml,
|
||||
aws.CredentialSourceSTSAssumeRoleWebID: UserAgentFeatureCredentialsStsAssumeRoleWebID,
|
||||
aws.CredentialSourceSTSFederationToken: UserAgentFeatureCredentialsStsFederationToken,
|
||||
aws.CredentialSourceSTSSessionToken: UserAgentFeatureCredentialsStsSessionToken,
|
||||
aws.CredentialSourceProfile: UserAgentFeatureCredentialsProfile,
|
||||
aws.CredentialSourceProfileSourceProfile: UserAgentFeatureCredentialsProfileSourceProfile,
|
||||
aws.CredentialSourceProfileNamedProvider: UserAgentFeatureCredentialsProfileNamedProvider,
|
||||
aws.CredentialSourceProfileSTSWebIDToken: UserAgentFeatureCredentialsProfileStsWebIDToken,
|
||||
aws.CredentialSourceProfileSSO: UserAgentFeatureCredentialsProfileSso,
|
||||
aws.CredentialSourceSSO: UserAgentFeatureCredentialsSso,
|
||||
aws.CredentialSourceProfileSSOLegacy: UserAgentFeatureCredentialsProfileSsoLegacy,
|
||||
aws.CredentialSourceSSOLegacy: UserAgentFeatureCredentialsSsoLegacy,
|
||||
aws.CredentialSourceProfileProcess: UserAgentFeatureCredentialsProfileProcess,
|
||||
aws.CredentialSourceProcess: UserAgentFeatureCredentialsProcess,
|
||||
aws.CredentialSourceHTTP: UserAgentFeatureCredentialsHTTP,
|
||||
aws.CredentialSourceIMDS: UserAgentFeatureCredentialsIMDS,
|
||||
}
|
||||
|
||||
// RequestUserAgent is a build middleware that set the User-Agent for the request.
|
||||
type RequestUserAgent struct {
|
||||
sdkAgent, userAgent *smithyhttp.UserAgentBuilder
|
||||
@@ -252,6 +312,14 @@ func (u *RequestUserAgent) AddSDKAgentKeyValue(keyType SDKAgentKeyType, key, val
|
||||
u.userAgent.AddKeyValue(keyType.string(), strings.Map(rules, key)+"#"+strings.Map(rules, value))
|
||||
}
|
||||
|
||||
// AddCredentialsSource adds the credential source as a feature on the User-Agent string
|
||||
func (u *RequestUserAgent) AddCredentialsSource(source aws.CredentialSource) {
|
||||
x, ok := credentialSourceToFeature[source]
|
||||
if ok {
|
||||
u.AddUserAgentFeature(x)
|
||||
}
|
||||
}
|
||||
|
||||
// ID the name of the middleware.
|
||||
func (u *RequestUserAgent) ID() string {
|
||||
return "UserAgent"
|
||||
|
||||
17
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
17
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
@@ -1,3 +1,20 @@
|
||||
# v1.3.34 (2025-02-27)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.33 (2025-02-18)
|
||||
|
||||
* **Bug Fix**: Bump go version to 1.22
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.32 (2025-02-05)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.31 (2025-01-31)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.30 (2025-01-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
@@ -3,4 +3,4 @@
|
||||
package configsources
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.3.30"
|
||||
const goModuleVersion = "1.3.34"
|
||||
|
||||
12
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json
generated
vendored
12
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json
generated
vendored
@@ -223,7 +223,17 @@
|
||||
"supportsFIPS" : true
|
||||
},
|
||||
"regionRegex" : "^us\\-isof\\-\\w+\\-\\d+$",
|
||||
"regions" : { }
|
||||
"regions" : {
|
||||
"aws-iso-f-global" : {
|
||||
"description" : "AWS ISOF global region"
|
||||
},
|
||||
"us-isof-east-1" : {
|
||||
"description" : "US ISOF EAST"
|
||||
},
|
||||
"us-isof-south-1" : {
|
||||
"description" : "US ISOF SOUTH"
|
||||
}
|
||||
}
|
||||
} ],
|
||||
"version" : "1.1"
|
||||
}
|
||||
17
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
17
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
@@ -1,3 +1,20 @@
|
||||
# v2.6.34 (2025-02-27)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v2.6.33 (2025-02-18)
|
||||
|
||||
* **Bug Fix**: Bump go version to 1.22
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v2.6.32 (2025-02-05)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v2.6.31 (2025-01-31)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v2.6.30 (2025-01-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
@@ -3,4 +3,4 @@
|
||||
package endpoints
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "2.6.30"
|
||||
const goModuleVersion = "2.6.34"
|
||||
|
||||
51
vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.md
generated
vendored
51
vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.md
generated
vendored
@@ -1,3 +1,54 @@
|
||||
# v1.63.1 (2025-04-03)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.63.0 (2025-03-31)
|
||||
|
||||
* **Feature**: Add support for updating RemoteNetworkConfig for hybrid nodes on EKS UpdateClusterConfig API
|
||||
|
||||
# v1.62.0 (2025-03-27)
|
||||
|
||||
* **Feature**: Added support for BOTTLEROCKET FIPS AMIs to AMI types in US regions.
|
||||
|
||||
# v1.61.0 (2025-03-25)
|
||||
|
||||
* **Feature**: Added support to override upgrade-blocking readiness checks via force flag when updating a cluster.
|
||||
|
||||
# v1.60.1 (2025-03-04.2)
|
||||
|
||||
* **Bug Fix**: Add assurance test for operation order.
|
||||
|
||||
# v1.60.0 (2025-02-28)
|
||||
|
||||
* **Feature**: Adding licenses to EKS Anywhere Subscription operations response.
|
||||
|
||||
# v1.59.0 (2025-02-27)
|
||||
|
||||
* **Feature**: Track credential providers via User-Agent Feature ids
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.58.1 (2025-02-18)
|
||||
|
||||
* **Bug Fix**: Bump go version to 1.22
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.58.0 (2025-02-07)
|
||||
|
||||
* **Feature**: Introduce versionStatus field to take place of status field in EKS DescribeClusterVersions API
|
||||
|
||||
# v1.57.4 (2025-02-05)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.57.3 (2025-02-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.57.2 (2025-01-31)
|
||||
|
||||
* **Dependency Update**: Switch to code-generated waiter matchers, removing the dependency on go-jmespath.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.57.1 (2025-01-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
31
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.go
generated
vendored
31
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.go
generated
vendored
@@ -773,6 +773,37 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type setCredentialSourceMiddleware struct {
|
||||
ua *awsmiddleware.RequestUserAgent
|
||||
options Options
|
||||
}
|
||||
|
||||
func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" }
|
||||
|
||||
func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (
|
||||
out middleware.BuildOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource)
|
||||
if !ok {
|
||||
return next.HandleBuild(ctx, in)
|
||||
}
|
||||
providerSources := asProviderSource.ProviderSources()
|
||||
for _, source := range providerSources {
|
||||
m.ua.AddCredentialsSource(source)
|
||||
}
|
||||
return next.HandleBuild(ctx, in)
|
||||
}
|
||||
|
||||
func addCredentialSource(stack *middleware.Stack, options Options) error {
|
||||
ua, err := getOrAddRequestUserAgent(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mw := setCredentialSourceMiddleware{ua: ua, options: options}
|
||||
return stack.Build.Insert(&mw, "UserAgent", middleware.Before)
|
||||
}
|
||||
|
||||
func resolveTracerProvider(options *Options) {
|
||||
if options.TracerProvider == nil {
|
||||
options.TracerProvider = &tracing.NopTracerProvider{}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.go
generated
vendored
@@ -139,6 +139,9 @@ func (c *Client) addOperationAssociateAccessPolicyMiddlewares(stack *middleware.
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssociateAccessPolicyValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.go
generated
vendored
@@ -125,6 +125,9 @@ func (c *Client) addOperationAssociateEncryptionConfigMiddlewares(stack *middlew
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opAssociateEncryptionConfigMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -138,6 +138,9 @@ func (c *Client) addOperationAssociateIdentityProviderConfigMiddlewares(stack *m
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opAssociateIdentityProviderConfigMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.go
generated
vendored
@@ -208,6 +208,9 @@ func (c *Client) addOperationCreateAccessEntryMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateAccessEntryMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
5
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.go
generated
vendored
5
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.go
generated
vendored
@@ -83,7 +83,7 @@ type CreateAddonInput struct {
|
||||
// of the add-on is installed on your cluster Amazon EKS doesn't change the add-on
|
||||
// resource properties. Creation of the add-on might fail if conflicts are
|
||||
// detected. This option works differently during the update operation. For more
|
||||
// information, see [UpdateAddon].
|
||||
// information, see [UpdateAddon]UpdateAddon .
|
||||
//
|
||||
// If you don't currently have the self-managed version of the add-on installed on
|
||||
// your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to
|
||||
@@ -191,6 +191,9 @@ func (c *Client) addOperationCreateAddonMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateAddonMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
7
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.go
generated
vendored
7
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.go
generated
vendored
@@ -145,8 +145,8 @@ type CreateClusterInput struct {
|
||||
// [Local clusters for Amazon EKS on Amazon Web Services Outposts]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-local-cluster-overview.html
|
||||
OutpostConfig *types.OutpostConfigRequest
|
||||
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can't change or
|
||||
// update this configuration after the cluster is created.
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or
|
||||
// remove this configuration after the cluster is created.
|
||||
RemoteNetworkConfig *types.RemoteNetworkConfigRequest
|
||||
|
||||
// Enable or disable the block storage capability of EKS Auto Mode when creating
|
||||
@@ -266,6 +266,9 @@ func (c *Client) addOperationCreateClusterMiddlewares(stack *middleware.Stack, o
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateClusterMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -151,6 +151,9 @@ func (c *Client) addOperationCreateEksAnywhereSubscriptionMiddlewares(stack *mid
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateEksAnywhereSubscriptionMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.go
generated
vendored
@@ -180,6 +180,9 @@ func (c *Client) addOperationCreateFargateProfileMiddlewares(stack *middleware.S
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateFargateProfileMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
15
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.go
generated
vendored
15
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.go
generated
vendored
@@ -16,8 +16,13 @@ import (
|
||||
// You can only create a node group for your cluster that is equal to the current
|
||||
// Kubernetes version for the cluster. All node groups are created with the latest
|
||||
// AMI release version for the respective minor Kubernetes version of the cluster,
|
||||
// unless you deploy a custom AMI using a launch template. For more information
|
||||
// about using launch templates, see [Customizing managed nodes with launch templates].
|
||||
// unless you deploy a custom AMI using a launch template.
|
||||
//
|
||||
// For later updates, you will only be able to update a node group using a launch
|
||||
// template only if it was originally deployed with a launch template.
|
||||
// Additionally, the launch template ID or name must match what was used when the
|
||||
// node group was created. You can update the launch template version with
|
||||
// necessary changes. For more information about using launch templates, see [Customizing managed nodes with launch templates].
|
||||
//
|
||||
// An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and
|
||||
// associated Amazon EC2 instances that are managed by Amazon Web Services for an
|
||||
@@ -130,6 +135,9 @@ type CreateNodegroupInput struct {
|
||||
|
||||
// An object representing a node group's launch template specification. When using
|
||||
// this object, don't directly specify instanceTypes , diskSize , or remoteAccess .
|
||||
// You cannot later specify a different launch template ID or name than what was
|
||||
// used to create the node group.
|
||||
//
|
||||
// Make sure that the launch template meets the requirements in
|
||||
// launchTemplateSpecification . Also refer to [Customizing managed nodes with launch templates] in the Amazon EKS User Guide.
|
||||
//
|
||||
@@ -271,6 +279,9 @@ func (c *Client) addOperationCreateNodegroupMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreateNodegroupMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -182,6 +182,9 @@ func (c *Client) addOperationCreatePodIdentityAssociationMiddlewares(stack *midd
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opCreatePodIdentityAssociationMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.go
generated
vendored
@@ -116,6 +116,9 @@ func (c *Client) addOperationDeleteAccessEntryMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteAccessEntryValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.go
generated
vendored
@@ -130,6 +130,9 @@ func (c *Client) addOperationDeleteAddonMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteAddonValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.go
generated
vendored
@@ -124,6 +124,9 @@ func (c *Client) addOperationDeleteClusterMiddlewares(stack *middleware.Stack, o
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteClusterValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ func (c *Client) addOperationDeleteEksAnywhereSubscriptionMiddlewares(stack *mid
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteEksAnywhereSubscriptionValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.go
generated
vendored
@@ -127,6 +127,9 @@ func (c *Client) addOperationDeleteFargateProfileMiddlewares(stack *middleware.S
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteFargateProfileValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.go
generated
vendored
@@ -117,6 +117,9 @@ func (c *Client) addOperationDeleteNodegroupMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeleteNodegroupValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -122,6 +122,9 @@ func (c *Client) addOperationDeletePodIdentityAssociationMiddlewares(stack *midd
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeletePodIdentityAssociationValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.go
generated
vendored
@@ -117,6 +117,9 @@ func (c *Client) addOperationDeregisterClusterMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDeregisterClusterValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.go
generated
vendored
@@ -117,6 +117,9 @@ func (c *Client) addOperationDescribeAccessEntryMiddlewares(stack *middleware.St
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeAccessEntryValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
76
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.go
generated
vendored
76
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.go
generated
vendored
@@ -12,7 +12,6 @@ import (
|
||||
smithytime "github.com/aws/smithy-go/time"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
smithywaiter "github.com/aws/smithy-go/waiter"
|
||||
jmespath "github.com/jmespath/go-jmespath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -127,6 +126,9 @@ func (c *Client) addOperationDescribeAddonMiddlewares(stack *middleware.Stack, o
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeAddonValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -322,52 +324,46 @@ func (w *AddonActiveWaiter) WaitForOutput(ctx context.Context, params *DescribeA
|
||||
func addonActiveStateRetryable(ctx context.Context, input *DescribeAddonInput, output *DescribeAddonOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("addon.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Addon
|
||||
var v2 types.AddonStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "CREATE_FAILED"
|
||||
value, ok := pathValue.(types.AddonStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.AddonStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("addon.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Addon
|
||||
var v2 types.AddonStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "DEGRADED"
|
||||
value, ok := pathValue.(types.AddonStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.AddonStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("addon.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Addon
|
||||
var v2 types.AddonStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "ACTIVE"
|
||||
value, ok := pathValue.(types.AddonStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.AddonStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
@@ -537,18 +533,16 @@ func (w *AddonDeletedWaiter) WaitForOutput(ctx context.Context, params *Describe
|
||||
func addonDeletedStateRetryable(ctx context.Context, input *DescribeAddonInput, output *DescribeAddonOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("addon.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Addon
|
||||
var v2 types.AddonStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "DELETE_FAILED"
|
||||
value, ok := pathValue.(types.AddonStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.AddonStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.go
generated
vendored
@@ -135,6 +135,9 @@ func (c *Client) addOperationDescribeAddonConfigurationMiddlewares(stack *middle
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeAddonConfigurationValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.go
generated
vendored
@@ -158,6 +158,9 @@ func (c *Client) addOperationDescribeAddonVersionsMiddlewares(stack *middleware.
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddonVersions(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
112
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go
generated
vendored
112
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeCluster.go
generated
vendored
@@ -12,7 +12,6 @@ import (
|
||||
smithytime "github.com/aws/smithy-go/time"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
smithywaiter "github.com/aws/smithy-go/waiter"
|
||||
jmespath "github.com/jmespath/go-jmespath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -126,6 +125,9 @@ func (c *Client) addOperationDescribeClusterMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeClusterValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -322,52 +324,46 @@ func (w *ClusterActiveWaiter) WaitForOutput(ctx context.Context, params *Describ
|
||||
func clusterActiveStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "DELETING"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "FAILED"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "ACTIVE"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
@@ -538,52 +534,46 @@ func (w *ClusterDeletedWaiter) WaitForOutput(ctx context.Context, params *Descri
|
||||
func clusterDeletedStateRetryable(ctx context.Context, input *DescribeClusterInput, output *DescribeClusterOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "ACTIVE"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "CREATING"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("cluster.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Cluster
|
||||
var v2 types.ClusterStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "PENDING"
|
||||
value, ok := pathValue.(types.ClusterStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.ClusterStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
11
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeClusterVersions.go
generated
vendored
11
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeClusterVersions.go
generated
vendored
@@ -47,9 +47,17 @@ type DescribeClusterVersionsInput struct {
|
||||
// Pagination token for the next set of results.
|
||||
NextToken *string
|
||||
|
||||
// This field is deprecated. Use versionStatus instead, as that field matches for
|
||||
// input and output of this action.
|
||||
//
|
||||
// Filter versions by their current status.
|
||||
//
|
||||
// Deprecated: status has been replaced by versionStatus
|
||||
Status types.ClusterVersionStatus
|
||||
|
||||
// Filter versions by their current status.
|
||||
VersionStatus types.VersionStatus
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
@@ -131,6 +139,9 @@ func (c *Client) addOperationDescribeClusterVersionsMiddlewares(stack *middlewar
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeClusterVersions(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@ func (c *Client) addOperationDescribeEksAnywhereSubscriptionMiddlewares(stack *m
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeEksAnywhereSubscriptionValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
58
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeFargateProfile.go
generated
vendored
58
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeFargateProfile.go
generated
vendored
@@ -12,7 +12,6 @@ import (
|
||||
smithytime "github.com/aws/smithy-go/time"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
smithywaiter "github.com/aws/smithy-go/waiter"
|
||||
jmespath "github.com/jmespath/go-jmespath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -122,6 +121,9 @@ func (c *Client) addOperationDescribeFargateProfileMiddlewares(stack *middleware
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeFargateProfileValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -320,35 +322,31 @@ func (w *FargateProfileActiveWaiter) WaitForOutput(ctx context.Context, params *
|
||||
func fargateProfileActiveStateRetryable(ctx context.Context, input *DescribeFargateProfileInput, output *DescribeFargateProfileOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("fargateProfile.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.FargateProfile
|
||||
var v2 types.FargateProfileStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "CREATE_FAILED"
|
||||
value, ok := pathValue.(types.FargateProfileStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.FargateProfileStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("fargateProfile.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.FargateProfile
|
||||
var v2 types.FargateProfileStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "ACTIVE"
|
||||
value, ok := pathValue.(types.FargateProfileStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.FargateProfileStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
@@ -521,18 +519,16 @@ func (w *FargateProfileDeletedWaiter) WaitForOutput(ctx context.Context, params
|
||||
func fargateProfileDeletedStateRetryable(ctx context.Context, input *DescribeFargateProfileInput, output *DescribeFargateProfileOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("fargateProfile.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.FargateProfile
|
||||
var v2 types.FargateProfileStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "DELETE_FAILED"
|
||||
value, ok := pathValue.(types.FargateProfileStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.FargateProfileStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,9 @@ func (c *Client) addOperationDescribeIdentityProviderConfigMiddlewares(stack *mi
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeIdentityProviderConfigValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsight.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeInsight.go
generated
vendored
@@ -117,6 +117,9 @@ func (c *Client) addOperationDescribeInsightMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeInsightValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
58
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeNodegroup.go
generated
vendored
58
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeNodegroup.go
generated
vendored
@@ -12,7 +12,6 @@ import (
|
||||
smithytime "github.com/aws/smithy-go/time"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
smithywaiter "github.com/aws/smithy-go/waiter"
|
||||
jmespath "github.com/jmespath/go-jmespath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -122,6 +121,9 @@ func (c *Client) addOperationDescribeNodegroupMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeNodegroupValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -318,35 +320,31 @@ func (w *NodegroupActiveWaiter) WaitForOutput(ctx context.Context, params *Descr
|
||||
func nodegroupActiveStateRetryable(ctx context.Context, input *DescribeNodegroupInput, output *DescribeNodegroupOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("nodegroup.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Nodegroup
|
||||
var v2 types.NodegroupStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "CREATE_FAILED"
|
||||
value, ok := pathValue.(types.NodegroupStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.NodegroupStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("nodegroup.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Nodegroup
|
||||
var v2 types.NodegroupStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "ACTIVE"
|
||||
value, ok := pathValue.(types.NodegroupStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.NodegroupStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
@@ -517,18 +515,16 @@ func (w *NodegroupDeletedWaiter) WaitForOutput(ctx context.Context, params *Desc
|
||||
func nodegroupDeletedStateRetryable(ctx context.Context, input *DescribeNodegroupInput, output *DescribeNodegroupOutput, err error) (bool, error) {
|
||||
|
||||
if err == nil {
|
||||
pathValue, err := jmespath.Search("nodegroup.status", output)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error evaluating waiter state: %w", err)
|
||||
v1 := output.Nodegroup
|
||||
var v2 types.NodegroupStatus
|
||||
if v1 != nil {
|
||||
v3 := v1.Status
|
||||
v2 = v3
|
||||
}
|
||||
|
||||
expectedValue := "DELETE_FAILED"
|
||||
value, ok := pathValue.(types.NodegroupStatus)
|
||||
if !ok {
|
||||
return false, fmt.Errorf("waiter comparator expected types.NodegroupStatus value, got %T", pathValue)
|
||||
}
|
||||
|
||||
if string(value) == expectedValue {
|
||||
var pathValue string
|
||||
pathValue = string(v2)
|
||||
if pathValue == expectedValue {
|
||||
return false, fmt.Errorf("waiter state transitioned to Failure")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,6 +122,9 @@ func (c *Client) addOperationDescribePodIdentityAssociationMiddlewares(stack *mi
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribePodIdentityAssociationValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
5
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeUpdate.go
generated
vendored
5
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeUpdate.go
generated
vendored
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// Describes an update to an Amazon EKS resource.
|
||||
//
|
||||
// When the status of the update is Succeeded , the update is complete. If an
|
||||
// When the status of the update is Successful , the update is complete. If an
|
||||
// update fails, the status is Failed , and an error detail explains the reason for
|
||||
// the failure.
|
||||
func (c *Client) DescribeUpdate(ctx context.Context, params *DescribeUpdateInput, optFns ...func(*Options)) (*DescribeUpdateOutput, error) {
|
||||
@@ -132,6 +132,9 @@ func (c *Client) addOperationDescribeUpdateMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDescribeUpdateValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateAccessPolicy.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DisassociateAccessPolicy.go
generated
vendored
@@ -118,6 +118,9 @@ func (c *Client) addOperationDisassociateAccessPolicyMiddlewares(stack *middlewa
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDisassociateAccessPolicyValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -125,6 +125,9 @@ func (c *Client) addOperationDisassociateIdentityProviderConfigMiddlewares(stack
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opDisassociateIdentityProviderConfigMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessEntries.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessEntries.go
generated
vendored
@@ -142,6 +142,9 @@ func (c *Client) addOperationListAccessEntriesMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListAccessEntriesValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessPolicies.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAccessPolicies.go
generated
vendored
@@ -136,6 +136,9 @@ func (c *Client) addOperationListAccessPoliciesMiddlewares(stack *middleware.Sta
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPolicies(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAddons.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListAddons.go
generated
vendored
@@ -137,6 +137,9 @@ func (c *Client) addOperationListAddonsMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListAddonsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -149,6 +149,9 @@ func (c *Client) addOperationListAssociatedAccessPoliciesMiddlewares(stack *midd
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListAssociatedAccessPoliciesValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListClusters.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListClusters.go
generated
vendored
@@ -141,6 +141,9 @@ func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, op
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClusters(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -133,6 +133,9 @@ func (c *Client) addOperationListEksAnywhereSubscriptionsMiddlewares(stack *midd
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEksAnywhereSubscriptions(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListFargateProfiles.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListFargateProfiles.go
generated
vendored
@@ -138,6 +138,9 @@ func (c *Client) addOperationListFargateProfilesMiddlewares(stack *middleware.St
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListFargateProfilesValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -138,6 +138,9 @@ func (c *Client) addOperationListIdentityProviderConfigsMiddlewares(stack *middl
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListIdentityProviderConfigsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListInsights.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListInsights.go
generated
vendored
@@ -140,6 +140,9 @@ func (c *Client) addOperationListInsightsMiddlewares(stack *middleware.Stack, op
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListInsightsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListNodegroups.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListNodegroups.go
generated
vendored
@@ -139,6 +139,9 @@ func (c *Client) addOperationListNodegroupsMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListNodegroupsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -70,7 +70,8 @@ type ListPodIdentityAssociationsOutput struct {
|
||||
// The list of summarized descriptions of the associations that are in the cluster
|
||||
// and match any filters that you provided.
|
||||
//
|
||||
// Each summary is simplified by removing these fields compared to the full PodIdentityAssociation:
|
||||
// Each summary is simplified by removing these fields compared to the full [PodIdentityAssociation]
|
||||
// PodIdentityAssociation :
|
||||
//
|
||||
// - The IAM role: roleArn
|
||||
//
|
||||
@@ -79,6 +80,8 @@ type ListPodIdentityAssociationsOutput struct {
|
||||
// - The most recent timestamp that the association was modified at:. modifiedAt
|
||||
//
|
||||
// - The tags on the association: tags
|
||||
//
|
||||
// [PodIdentityAssociation]: https://docs.aws.amazon.com/eks/latest/APIReference/API_PodIdentityAssociation.html
|
||||
Associations []types.PodIdentityAssociationSummary
|
||||
|
||||
// The nextToken value to include in a future ListPodIdentityAssociations request.
|
||||
@@ -160,6 +163,9 @@ func (c *Client) addOperationListPodIdentityAssociationsMiddlewares(stack *middl
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListPodIdentityAssociationsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListTagsForResource.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListTagsForResource.go
generated
vendored
@@ -111,6 +111,9 @@ func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.St
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListUpdates.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_ListUpdates.go
generated
vendored
@@ -144,6 +144,9 @@ func (c *Client) addOperationListUpdatesMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListUpdatesValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
8
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_RegisterCluster.go
generated
vendored
8
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_RegisterCluster.go
generated
vendored
@@ -16,8 +16,8 @@ import (
|
||||
// Any Kubernetes cluster can be connected to the Amazon EKS control plane to view
|
||||
// current information about the cluster and its nodes.
|
||||
//
|
||||
// Cluster connection requires two steps. First, send a RegisterClusterRequest to add it to the Amazon
|
||||
// EKS control plane.
|
||||
// Cluster connection requires two steps. First, send a [RegisterClusterRequest]RegisterClusterRequest to
|
||||
// add it to the Amazon EKS control plane.
|
||||
//
|
||||
// Second, a [Manifest] containing the activationID and activationCode must be applied to
|
||||
// the Kubernetes cluster through it's native provider to provide visibility.
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
// the connected cluster will no longer be visible and must be deregistered using
|
||||
// DeregisterCluster .
|
||||
//
|
||||
// [RegisterClusterRequest]: https://docs.aws.amazon.com/eks/latest/APIReference/API_RegisterClusterRequest.html
|
||||
// [Manifest]: https://amazon-eks.s3.us-west-2.amazonaws.com/eks-connector/manifests/eks-connector/latest/eks-connector.yaml
|
||||
func (c *Client) RegisterCluster(ctx context.Context, params *RegisterClusterInput, optFns ...func(*Options)) (*RegisterClusterOutput, error) {
|
||||
if params == nil {
|
||||
@@ -143,6 +144,9 @@ func (c *Client) addOperationRegisterClusterMiddlewares(stack *middleware.Stack,
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opRegisterClusterMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_TagResource.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_TagResource.go
generated
vendored
@@ -120,6 +120,9 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UntagResource.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UntagResource.go
generated
vendored
@@ -112,6 +112,9 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAccessEntry.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAccessEntry.go
generated
vendored
@@ -150,6 +150,9 @@ func (c *Client) addOperationUpdateAccessEntryMiddlewares(stack *middleware.Stac
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateAccessEntryMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAddon.go
generated
vendored
3
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateAddon.go
generated
vendored
@@ -173,6 +173,9 @@ func (c *Client) addOperationUpdateAddonMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateAddonMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
55
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterConfig.go
generated
vendored
55
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterConfig.go
generated
vendored
@@ -13,31 +13,40 @@ import (
|
||||
|
||||
// Updates an Amazon EKS cluster configuration. Your cluster continues to function
|
||||
// during the update. The response output includes an update ID that you can use to
|
||||
// track the status of your cluster update with DescribeUpdate "/>.
|
||||
// track the status of your cluster update with DescribeUpdate .
|
||||
//
|
||||
// You can use this API operation to enable or disable exporting the Kubernetes
|
||||
// control plane logs for your cluster to CloudWatch Logs. By default, cluster
|
||||
// control plane logs aren't exported to CloudWatch Logs. For more information, see
|
||||
// [Amazon EKS Cluster control plane logs]in the Amazon EKS User Guide .
|
||||
// You can use this operation to do the following actions:
|
||||
//
|
||||
// - You can use this API operation to enable or disable exporting the
|
||||
// Kubernetes control plane logs for your cluster to CloudWatch Logs. By default,
|
||||
// cluster control plane logs aren't exported to CloudWatch Logs. For more
|
||||
// information, see [Amazon EKS Cluster control plane logs]in the Amazon EKS User Guide .
|
||||
//
|
||||
// CloudWatch Logs ingestion, archive storage, and data scanning rates apply to
|
||||
// exported control plane logs. For more information, see [CloudWatch Pricing].
|
||||
//
|
||||
// You can also use this API operation to enable or disable public and private
|
||||
// access to your cluster's Kubernetes API server endpoint. By default, public
|
||||
// access is enabled, and private access is disabled. For more information, see [Amazon EKS cluster endpoint access control]in
|
||||
// the Amazon EKS User Guide .
|
||||
// exported control plane logs. For more information, see [CloudWatch Pricing].
|
||||
//
|
||||
// You can also use this API operation to choose different subnets and security
|
||||
// groups for the cluster. You must specify at least two subnets that are in
|
||||
// different Availability Zones. You can't change which VPC the subnets are from,
|
||||
// the subnets must be in the same VPC as the subnets that the cluster was created
|
||||
// with. For more information about the VPC requirements, see [https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html]in the Amazon EKS
|
||||
// User Guide .
|
||||
// - You can also use this API operation to enable or disable public and private
|
||||
// access to your cluster's Kubernetes API server endpoint. By default, public
|
||||
// access is enabled, and private access is disabled. For more information, see [Amazon EKS cluster endpoint access control]
|
||||
// in the Amazon EKS User Guide .
|
||||
//
|
||||
// You can also use this API operation to enable or disable ARC zonal shift. If
|
||||
// zonal shift is enabled, Amazon Web Services configures zonal autoshift for the
|
||||
// cluster.
|
||||
// - You can also use this API operation to choose different subnets and
|
||||
// security groups for the cluster. You must specify at least two subnets that are
|
||||
// in different Availability Zones. You can't change which VPC the subnets are
|
||||
// from, the subnets must be in the same VPC as the subnets that the cluster was
|
||||
// created with. For more information about the VPC requirements, see [https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html]in the
|
||||
// Amazon EKS User Guide .
|
||||
//
|
||||
// - You can also use this API operation to enable or disable ARC zonal shift.
|
||||
// If zonal shift is enabled, Amazon Web Services configures zonal autoshift for
|
||||
// the cluster.
|
||||
//
|
||||
// - You can also use this API operation to add, change, or remove the
|
||||
// configuration in the cluster for EKS Hybrid Nodes. To remove the configuration,
|
||||
// use the remoteNetworkConfig key with an object containing both subkeys with
|
||||
// empty arrays for each. Here is an inline example: "remoteNetworkConfig": {
|
||||
// "remoteNodeNetworks": [], "remotePodNetworks": [] } .
|
||||
//
|
||||
// Cluster updates are asynchronous, and they should finish within a few minutes.
|
||||
// During an update, the cluster status moves to UPDATING (this status transition
|
||||
@@ -45,6 +54,7 @@ import (
|
||||
// Successful ), the cluster status moves to Active .
|
||||
//
|
||||
// [Amazon EKS Cluster control plane logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html
|
||||
//
|
||||
// [CloudWatch Pricing]: http://aws.amazon.com/cloudwatch/pricing/
|
||||
// [https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html]: https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html
|
||||
// [Amazon EKS cluster endpoint access control]: https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html
|
||||
@@ -95,6 +105,10 @@ type UpdateClusterConfigInput struct {
|
||||
// [Amazon EKS cluster control plane logs]: https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html
|
||||
Logging *types.Logging
|
||||
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or
|
||||
// remove this configuration after the cluster is created.
|
||||
RemoteNetworkConfig *types.RemoteNetworkConfigRequest
|
||||
|
||||
// An object representing the VPC configuration to use for an Amazon EKS cluster.
|
||||
ResourcesVpcConfig *types.VpcConfigRequest
|
||||
|
||||
@@ -204,6 +218,9 @@ func (c *Client) addOperationUpdateClusterConfigMiddlewares(stack *middleware.St
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateClusterConfigMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
13
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterVersion.go
generated
vendored
13
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateClusterVersion.go
generated
vendored
@@ -13,8 +13,8 @@ import (
|
||||
|
||||
// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster
|
||||
// continues to function during the update. The response output includes an update
|
||||
// ID that you can use to track the status of your cluster update with the DescribeUpdateAPI
|
||||
// operation.
|
||||
// ID that you can use to track the status of your cluster update with the [DescribeUpdate]
|
||||
// DescribeUpdate API operation.
|
||||
//
|
||||
// Cluster updates are asynchronous, and they should finish within a few minutes.
|
||||
// During an update, the cluster status moves to UPDATING (this status transition
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
// If your cluster has managed node groups attached to it, all of your node
|
||||
// groups' Kubernetes versions must match the cluster's Kubernetes version in order
|
||||
// to update the cluster to a new Kubernetes version.
|
||||
//
|
||||
// [DescribeUpdate]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeUpdate.html
|
||||
func (c *Client) UpdateClusterVersion(ctx context.Context, params *UpdateClusterVersionInput, optFns ...func(*Options)) (*UpdateClusterVersionOutput, error) {
|
||||
if params == nil {
|
||||
params = &UpdateClusterVersionInput{}
|
||||
@@ -55,6 +57,10 @@ type UpdateClusterVersionInput struct {
|
||||
// of the request.
|
||||
ClientRequestToken *string
|
||||
|
||||
// Set this value to true to override upgrade-blocking readiness checks when
|
||||
// updating a cluster.
|
||||
Force bool
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
@@ -133,6 +139,9 @@ func (c *Client) addOperationUpdateClusterVersionMiddlewares(stack *middleware.S
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateClusterVersionMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -121,6 +121,9 @@ func (c *Client) addOperationUpdateEksAnywhereSubscriptionMiddlewares(stack *mid
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateEksAnywhereSubscriptionMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
11
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupConfig.go
generated
vendored
11
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupConfig.go
generated
vendored
@@ -13,9 +13,11 @@ import (
|
||||
|
||||
// Updates an Amazon EKS managed node group configuration. Your node group
|
||||
// continues to function during the update. The response output includes an update
|
||||
// ID that you can use to track the status of your node group update with the DescribeUpdateAPI
|
||||
// operation. You can update the Kubernetes labels and taints for a node group and
|
||||
// the scaling and version update configuration.
|
||||
// ID that you can use to track the status of your node group update with the [DescribeUpdate]
|
||||
// DescribeUpdate API operation. You can update the Kubernetes labels and taints
|
||||
// for a node group and the scaling and version update configuration.
|
||||
//
|
||||
// [DescribeUpdate]: https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeUpdate.html
|
||||
func (c *Client) UpdateNodegroupConfig(ctx context.Context, params *UpdateNodegroupConfigInput, optFns ...func(*Options)) (*UpdateNodegroupConfigOutput, error) {
|
||||
if params == nil {
|
||||
params = &UpdateNodegroupConfigInput{}
|
||||
@@ -143,6 +145,9 @@ func (c *Client) addOperationUpdateNodegroupConfigMiddlewares(stack *middleware.
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateNodegroupConfigMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
18
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupVersion.go
generated
vendored
18
vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_UpdateNodegroupVersion.go
generated
vendored
@@ -15,10 +15,14 @@ import (
|
||||
// group.
|
||||
//
|
||||
// You can update a node group using a launch template only if the node group was
|
||||
// originally deployed with a launch template. If you need to update a custom AMI
|
||||
// in a node group that was deployed with a launch template, then update your
|
||||
// custom AMI, specify the new ID in a new version of the launch template, and then
|
||||
// update the node group to the new version of the launch template.
|
||||
// originally deployed with a launch template. Additionally, the launch template ID
|
||||
// or name must match what was used when the node group was created. You can update
|
||||
// the launch template version with necessary changes.
|
||||
//
|
||||
// If you need to update a custom AMI in a node group that was deployed with a
|
||||
// launch template, then update your custom AMI, specify the new ID in a new
|
||||
// version of the launch template, and then update the node group to the new
|
||||
// version of the launch template.
|
||||
//
|
||||
// If you update without a launch template, then you can update to the latest
|
||||
// available AMI version of a node group's current Kubernetes version by not
|
||||
@@ -78,7 +82,8 @@ type UpdateNodegroupVersionInput struct {
|
||||
|
||||
// An object representing a node group's launch template specification. You can
|
||||
// only update a node group using a launch template if the node group was
|
||||
// originally deployed with a launch template.
|
||||
// originally deployed with a launch template. When updating, you must specify the
|
||||
// same launch template ID or name that was used to create the node group.
|
||||
LaunchTemplate *types.LaunchTemplateSpecification
|
||||
|
||||
// The AMI version of the Amazon EKS optimized AMI to use for the update. By
|
||||
@@ -187,6 +192,9 @@ func (c *Client) addOperationUpdateNodegroupVersionMiddlewares(stack *middleware
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdateNodegroupVersionMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -127,6 +127,9 @@ func (c *Client) addOperationUpdatePodIdentityAssociationMiddlewares(stack *midd
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addCredentialSource(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addIdempotencyToken_opUpdatePodIdentityAssociationMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
285
vendor/github.com/aws/aws-sdk-go-v2/service/eks/deserializers.go
generated
vendored
285
vendor/github.com/aws/aws-sdk-go-v2/service/eks/deserializers.go
generated
vendored
@@ -329,6 +329,9 @@ func awsRestjson1_deserializeOpErrorAssociateEncryptionConfig(response *smithyht
|
||||
case strings.EqualFold("ServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ThrottlingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
@@ -496,6 +499,9 @@ func awsRestjson1_deserializeOpErrorAssociateIdentityProviderConfig(response *sm
|
||||
case strings.EqualFold("ServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ThrottlingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
@@ -5308,6 +5314,9 @@ func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response
|
||||
case strings.EqualFold("ServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ThrottlingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
@@ -8368,6 +8377,9 @@ func awsRestjson1_deserializeOpErrorUpdateClusterConfig(response *smithyhttp.Res
|
||||
case strings.EqualFold("ServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ThrottlingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
@@ -8526,6 +8538,9 @@ func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Re
|
||||
case strings.EqualFold("InvalidRequestException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidStateException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidStateException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ResourceInUseException", errorCode):
|
||||
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
|
||||
|
||||
@@ -8535,6 +8550,9 @@ func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Re
|
||||
case strings.EqualFold("ServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ThrottlingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
@@ -9420,6 +9438,42 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorInvalidStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.InvalidStateException{}
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
|
||||
body := io.TeeReader(errorBody, ringBuffer)
|
||||
decoder := json.NewDecoder(body)
|
||||
decoder.UseNumber()
|
||||
var shape interface{}
|
||||
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
err := awsRestjson1_deserializeDocumentInvalidStateException(&output, shape)
|
||||
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
errorBody.Seek(0, io.SeekStart)
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.NotFoundException{}
|
||||
var buff [1024]byte
|
||||
@@ -9672,6 +9726,42 @@ func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyht
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.ThrottlingException{}
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
|
||||
body := io.TeeReader(errorBody, ringBuffer)
|
||||
decoder := json.NewDecoder(body)
|
||||
decoder.UseNumber()
|
||||
var shape interface{}
|
||||
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
|
||||
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
errorBody.Seek(0, io.SeekStart)
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.UnsupportedAvailabilityZoneException{}
|
||||
var buff [1024]byte
|
||||
@@ -11683,6 +11773,15 @@ func awsRestjson1_deserializeDocumentClusterVersionInformation(v **types.Cluster
|
||||
sv.Status = types.ClusterVersionStatus(jtv)
|
||||
}
|
||||
|
||||
case "versionStatus":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected VersionStatus to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.VersionStatus = types.VersionStatus(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
@@ -12212,6 +12311,11 @@ func awsRestjson1_deserializeDocumentEksAnywhereSubscription(v **types.EksAnywhe
|
||||
sv.LicenseQuantity = int32(i64)
|
||||
}
|
||||
|
||||
case "licenses":
|
||||
if err := awsRestjson1_deserializeDocumentLicenseList(&sv.Licenses, value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
case "licenseType":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
@@ -13668,6 +13772,55 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentInvalidStateException(v **types.InvalidStateException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.(map[string]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var sv *types.InvalidStateException
|
||||
if *v == nil {
|
||||
sv = &types.InvalidStateException{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for key, value := range shape {
|
||||
switch key {
|
||||
case "clusterName":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.ClusterName = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "message", "Message":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Message = ptr.String(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
}
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentIssue(v **types.Issue, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
@@ -13913,6 +14066,89 @@ func awsRestjson1_deserializeDocumentLaunchTemplateSpecification(v **types.Launc
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentLicense(v **types.License, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.(map[string]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var sv *types.License
|
||||
if *v == nil {
|
||||
sv = &types.License{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for key, value := range shape {
|
||||
switch key {
|
||||
case "id":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Id = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "token":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Token = ptr.String(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
}
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentLicenseList(v *[]types.License, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.([]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var cv []types.License
|
||||
if *v == nil {
|
||||
cv = []types.License{}
|
||||
} else {
|
||||
cv = *v
|
||||
}
|
||||
|
||||
for _, value := range shape {
|
||||
var col types.License
|
||||
destAddr := &col
|
||||
if err := awsRestjson1_deserializeDocumentLicense(&destAddr, value); err != nil {
|
||||
return err
|
||||
}
|
||||
col = *destAddr
|
||||
cv = append(cv, col)
|
||||
|
||||
}
|
||||
*v = cv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentLogging(v **types.Logging, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
@@ -15975,6 +16211,55 @@ func awsRestjson1_deserializeDocumentTaintsList(v *[]types.Taint, value interfac
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.(map[string]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var sv *types.ThrottlingException
|
||||
if *v == nil {
|
||||
sv = &types.ThrottlingException{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for key, value := range shape {
|
||||
switch key {
|
||||
case "clusterName":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.ClusterName = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "message", "Message":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected String to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Message = ptr.String(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
}
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentUnsupportedAvailabilityZoneException(v **types.UnsupportedAvailabilityZoneException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
|
||||
6
vendor/github.com/aws/aws-sdk-go-v2/service/eks/generated.json
generated
vendored
6
vendor/github.com/aws/aws-sdk-go-v2/service/eks/generated.json
generated
vendored
@@ -3,8 +3,7 @@
|
||||
"github.com/aws/aws-sdk-go-v2": "v1.4.0",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/jmespath/go-jmespath": "v0.4.0"
|
||||
"github.com/aws/smithy-go": "v1.4.0"
|
||||
},
|
||||
"files": [
|
||||
"api_client.go",
|
||||
@@ -79,12 +78,13 @@
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"snapshot_test.go",
|
||||
"sra_operation_order_test.go",
|
||||
"types/enums.go",
|
||||
"types/errors.go",
|
||||
"types/types.go",
|
||||
"validators.go"
|
||||
],
|
||||
"go": "1.15",
|
||||
"go": "1.22",
|
||||
"module": "github.com/aws/aws-sdk-go-v2/service/eks",
|
||||
"unstable": false
|
||||
}
|
||||
|
||||
2
vendor/github.com/aws/aws-sdk-go-v2/service/eks/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/eks/go_module_metadata.go
generated
vendored
@@ -3,4 +3,4 @@
|
||||
package eks
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.57.1"
|
||||
const goModuleVersion = "1.63.1"
|
||||
|
||||
35
vendor/github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints/endpoints.go
generated
vendored
35
vendor/github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints/endpoints.go
generated
vendored
@@ -87,6 +87,7 @@ func New() *Resolver {
|
||||
var partitionRegexp = struct {
|
||||
Aws *regexp.Regexp
|
||||
AwsCn *regexp.Regexp
|
||||
AwsEusc *regexp.Regexp
|
||||
AwsIso *regexp.Regexp
|
||||
AwsIsoB *regexp.Regexp
|
||||
AwsIsoE *regexp.Regexp
|
||||
@@ -96,6 +97,7 @@ var partitionRegexp = struct {
|
||||
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"),
|
||||
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
||||
AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"),
|
||||
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
||||
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
||||
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
|
||||
@@ -340,6 +342,27 @@ var defaultPartitions = endpoints.Partitions{
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-eusc",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "eks-fips.{region}.amazonaws.eu",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "eks.{region}.amazonaws.eu",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsEusc,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
@@ -423,19 +446,27 @@ var defaultPartitions = endpoints.Partitions{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "eks-fips.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "eks.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
Protocols: []string{"http", "https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoF,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-isof-east-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-isof-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
|
||||
16
vendor/github.com/aws/aws-sdk-go-v2/service/eks/serializers.go
generated
vendored
16
vendor/github.com/aws/aws-sdk-go-v2/service/eks/serializers.go
generated
vendored
@@ -2433,6 +2433,10 @@ func awsRestjson1_serializeOpHttpBindingsDescribeClusterVersionsInput(v *Describ
|
||||
encoder.SetQuery("status").String(string(v.Status))
|
||||
}
|
||||
|
||||
if len(v.VersionStatus) > 0 {
|
||||
encoder.SetQuery("versionStatus").String(string(v.VersionStatus))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4898,6 +4902,13 @@ func awsRestjson1_serializeOpDocumentUpdateClusterConfigInput(v *UpdateClusterCo
|
||||
}
|
||||
}
|
||||
|
||||
if v.RemoteNetworkConfig != nil {
|
||||
ok := object.Key("remoteNetworkConfig")
|
||||
if err := awsRestjson1_serializeDocumentRemoteNetworkConfigRequest(v.RemoteNetworkConfig, ok); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if v.ResourcesVpcConfig != nil {
|
||||
ok := object.Key("resourcesVpcConfig")
|
||||
if err := awsRestjson1_serializeDocumentVpcConfigRequest(v.ResourcesVpcConfig, ok); err != nil {
|
||||
@@ -5020,6 +5031,11 @@ func awsRestjson1_serializeOpDocumentUpdateClusterVersionInput(v *UpdateClusterV
|
||||
ok.String(*v.ClientRequestToken)
|
||||
}
|
||||
|
||||
if v.Force {
|
||||
ok := object.Key("force")
|
||||
ok.Boolean(v.Force)
|
||||
}
|
||||
|
||||
if v.Version != nil {
|
||||
ok := object.Key("version")
|
||||
ok.String(*v.Version)
|
||||
|
||||
29
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/enums.go
generated
vendored
29
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/enums.go
generated
vendored
@@ -97,6 +97,8 @@ const (
|
||||
AMITypesCustom AMITypes = "CUSTOM"
|
||||
AMITypesBottlerocketArm64 AMITypes = "BOTTLEROCKET_ARM_64"
|
||||
AMITypesBottlerocketX8664 AMITypes = "BOTTLEROCKET_x86_64"
|
||||
AMITypesBottlerocketArm64Fips AMITypes = "BOTTLEROCKET_ARM_64_FIPS"
|
||||
AMITypesBottlerocketX8664Fips AMITypes = "BOTTLEROCKET_x86_64_FIPS"
|
||||
AMITypesBottlerocketArm64Nvidia AMITypes = "BOTTLEROCKET_ARM_64_NVIDIA"
|
||||
AMITypesBottlerocketX8664Nvidia AMITypes = "BOTTLEROCKET_x86_64_NVIDIA"
|
||||
AMITypesWindowsCore2019X8664 AMITypes = "WINDOWS_CORE_2019_x86_64"
|
||||
@@ -121,6 +123,8 @@ func (AMITypes) Values() []AMITypes {
|
||||
"CUSTOM",
|
||||
"BOTTLEROCKET_ARM_64",
|
||||
"BOTTLEROCKET_x86_64",
|
||||
"BOTTLEROCKET_ARM_64_FIPS",
|
||||
"BOTTLEROCKET_x86_64_FIPS",
|
||||
"BOTTLEROCKET_ARM_64_NVIDIA",
|
||||
"BOTTLEROCKET_x86_64_NVIDIA",
|
||||
"WINDOWS_CORE_2019_x86_64",
|
||||
@@ -811,6 +815,7 @@ const (
|
||||
UpdateParamTypeComputeConfig UpdateParamType = "ComputeConfig"
|
||||
UpdateParamTypeStorageConfig UpdateParamType = "StorageConfig"
|
||||
UpdateParamTypeKubernetesNetworkConfig UpdateParamType = "KubernetesNetworkConfig"
|
||||
UpdateParamTypeRemoteNetworkConfig UpdateParamType = "RemoteNetworkConfig"
|
||||
)
|
||||
|
||||
// Values returns all known values for UpdateParamType. Note that this can be
|
||||
@@ -854,6 +859,7 @@ func (UpdateParamType) Values() []UpdateParamType {
|
||||
"ComputeConfig",
|
||||
"StorageConfig",
|
||||
"KubernetesNetworkConfig",
|
||||
"RemoteNetworkConfig",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,6 +903,7 @@ const (
|
||||
UpdateTypeUpgradePolicyUpdate UpdateType = "UpgradePolicyUpdate"
|
||||
UpdateTypeZonalShiftConfigUpdate UpdateType = "ZonalShiftConfigUpdate"
|
||||
UpdateTypeAutoModeUpdate UpdateType = "AutoModeUpdate"
|
||||
UpdateTypeRemoteNetworkConfigUpdate UpdateType = "RemoteNetworkConfigUpdate"
|
||||
)
|
||||
|
||||
// Values returns all known values for UpdateType. Note that this can be expanded
|
||||
@@ -918,5 +925,27 @@ func (UpdateType) Values() []UpdateType {
|
||||
"UpgradePolicyUpdate",
|
||||
"ZonalShiftConfigUpdate",
|
||||
"AutoModeUpdate",
|
||||
"RemoteNetworkConfigUpdate",
|
||||
}
|
||||
}
|
||||
|
||||
type VersionStatus string
|
||||
|
||||
// Enum values for VersionStatus
|
||||
const (
|
||||
VersionStatusUnsupported VersionStatus = "UNSUPPORTED"
|
||||
VersionStatusStandardSupport VersionStatus = "STANDARD_SUPPORT"
|
||||
VersionStatusExtendedSupport VersionStatus = "EXTENDED_SUPPORT"
|
||||
)
|
||||
|
||||
// Values returns all known values for VersionStatus. Note that this can be
|
||||
// expanded in the future, and so it is only as up to date as the client.
|
||||
//
|
||||
// The ordering of this slice is not guaranteed to be stable across updates.
|
||||
func (VersionStatus) Values() []VersionStatus {
|
||||
return []VersionStatus{
|
||||
"UNSUPPORTED",
|
||||
"STANDARD_SUPPORT",
|
||||
"EXTENDED_SUPPORT",
|
||||
}
|
||||
}
|
||||
|
||||
62
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/errors.go
generated
vendored
62
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/errors.go
generated
vendored
@@ -165,6 +165,39 @@ func (e *InvalidRequestException) ErrorCode() string {
|
||||
}
|
||||
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Amazon EKS detected upgrade readiness issues. Call the [ListInsights]ListInsights API to view
|
||||
// detected upgrade blocking issues. Pass the [force]force flag when updating to override
|
||||
// upgrade readiness errors.
|
||||
//
|
||||
// [ListInsights]: https://docs.aws.amazon.com/eks/latest/APIReference/API_ListInsights.html
|
||||
// [force]: https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateClusterVersion.html#API_UpdateClusterVersion_RequestBody
|
||||
type InvalidStateException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
ClusterName *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidStateException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidStateException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidStateException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidStateException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// A service resource associated with the request could not be found. Clients
|
||||
// should not retry such requests.
|
||||
type NotFoundException struct {
|
||||
@@ -371,6 +404,35 @@ func (e *ServiceUnavailableException) ErrorCode() string {
|
||||
}
|
||||
func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
|
||||
|
||||
// The request or operation couldn't be performed because a service is throttling
|
||||
// requests.
|
||||
type ThrottlingException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
ClusterName *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *ThrottlingException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *ThrottlingException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *ThrottlingException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "ThrottlingException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// At least one of your specified cluster subnets is in an Availability Zone that
|
||||
// does not support Amazon EKS. The exception output specifies the supported
|
||||
// Availability Zones for your account, from which you can choose subnets for your
|
||||
|
||||
52
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/types.go
generated
vendored
52
vendor/github.com/aws/aws-sdk-go-v2/service/eks/types/types.go
generated
vendored
@@ -428,8 +428,8 @@ type Cluster struct {
|
||||
// [Amazon EKS local cluster platform versions]: https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-platform-versions.html
|
||||
PlatformVersion *string
|
||||
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can't change or
|
||||
// update this configuration after the cluster is created.
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or
|
||||
// remove this configuration after the cluster is created.
|
||||
RemoteNetworkConfig *RemoteNetworkConfigResponse
|
||||
|
||||
// The VPC configuration used by the cluster control plane. Amazon EKS VPC
|
||||
@@ -527,9 +527,15 @@ type ClusterVersionInformation struct {
|
||||
// The release date of this cluster version.
|
||||
ReleaseDate *time.Time
|
||||
|
||||
// This field is deprecated. Use versionStatus instead, as that field matches for
|
||||
// input and output of this action.
|
||||
//
|
||||
// Current status of this cluster version.
|
||||
Status ClusterVersionStatus
|
||||
|
||||
// Current status of this cluster version.
|
||||
VersionStatus VersionStatus
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
@@ -736,6 +742,10 @@ type EksAnywhereSubscription struct {
|
||||
// cluster.
|
||||
LicenseType EksAnywhereSubscriptionLicenseType
|
||||
|
||||
// Includes all of the claims in the license token necessary to validate the
|
||||
// license for extended support.
|
||||
Licenses []License
|
||||
|
||||
// The status of a subscription.
|
||||
Status *string
|
||||
|
||||
@@ -1260,22 +1270,37 @@ type LaunchTemplateSpecification struct {
|
||||
// The ID of the launch template.
|
||||
//
|
||||
// You must specify either the launch template ID or the launch template name in
|
||||
// the request, but not both.
|
||||
// the request, but not both. After node group creation, you cannot use a different
|
||||
// ID.
|
||||
Id *string
|
||||
|
||||
// The name of the launch template.
|
||||
//
|
||||
// You must specify either the launch template name or the launch template ID in
|
||||
// the request, but not both.
|
||||
// the request, but not both. After node group creation, you cannot use a different
|
||||
// name.
|
||||
Name *string
|
||||
|
||||
// The version number of the launch template to use. If no version is specified,
|
||||
// then the template's default version is used.
|
||||
// then the template's default version is used. You can use a different version for
|
||||
// node group updates.
|
||||
Version *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// An EKS Anywhere license associated with a subscription.
|
||||
type License struct {
|
||||
|
||||
// An id associated with an EKS Anywhere subscription license.
|
||||
Id *string
|
||||
|
||||
// An optional license token that can be used for extended support verification.
|
||||
Token *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// An object representing the logging configuration for resources in your cluster.
|
||||
type Logging struct {
|
||||
|
||||
@@ -1504,7 +1529,7 @@ type NodegroupUpdateConfig struct {
|
||||
|
||||
// The configuration for the behavior to follow during a node group version update
|
||||
// of this managed node group. You choose between two possible strategies for
|
||||
// replacing nodes during an [UpdateNodegroupVersion]action.
|
||||
// replacing nodes during an [UpdateNodegroupVersion]UpdateNodegroupVersion action.
|
||||
//
|
||||
// An Amazon EKS managed node group updates by replacing nodes with new nodes of
|
||||
// newer AMI versions in parallel. The update strategy changes the managed node
|
||||
@@ -1516,7 +1541,7 @@ type NodegroupUpdateConfig struct {
|
||||
// constrained to resources or costs (for example, with hardware accelerators such
|
||||
// as GPUs).
|
||||
//
|
||||
// [UpdateNodegroupVersion]: https://docs.aws.amazon.com/latest/APIReference/API_UpdateNodegroupVersion.html
|
||||
// [UpdateNodegroupVersion]: https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateNodegroupVersion.html
|
||||
UpdateStrategy NodegroupUpdateStrategies
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@@ -1791,7 +1816,8 @@ type PodIdentityAssociation struct {
|
||||
|
||||
// The summarized description of the association.
|
||||
//
|
||||
// Each summary is simplified by removing these fields compared to the full PodIdentityAssociation:
|
||||
// Each summary is simplified by removing these fields compared to the full [PodIdentityAssociation]
|
||||
// PodIdentityAssociation :
|
||||
//
|
||||
// - The IAM role: roleArn
|
||||
//
|
||||
@@ -1800,6 +1826,8 @@ type PodIdentityAssociation struct {
|
||||
// - The most recent timestamp that the association was modified at:. modifiedAt
|
||||
//
|
||||
// - The tags on the association: tags
|
||||
//
|
||||
// [PodIdentityAssociation]: https://docs.aws.amazon.com/eks/latest/APIReference/API_PodIdentityAssociation.html
|
||||
type PodIdentityAssociationSummary struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) of the association.
|
||||
@@ -1867,8 +1895,8 @@ type RemoteAccessConfig struct {
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can't change or
|
||||
// update this configuration after the cluster is created.
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or
|
||||
// remove this configuration after the cluster is created.
|
||||
type RemoteNetworkConfigRequest struct {
|
||||
|
||||
// The list of network CIDRs that can contain hybrid nodes.
|
||||
@@ -1927,8 +1955,8 @@ type RemoteNetworkConfigRequest struct {
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can't change or
|
||||
// update this configuration after the cluster is created.
|
||||
// The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or
|
||||
// remove this configuration after the cluster is created.
|
||||
type RemoteNetworkConfigResponse struct {
|
||||
|
||||
// The list of network CIDRs that can contain hybrid nodes.
|
||||
|
||||
4
vendor/github.com/jmespath/go-jmespath/.gitignore
generated
vendored
4
vendor/github.com/jmespath/go-jmespath/.gitignore
generated
vendored
@@ -1,4 +0,0 @@
|
||||
/jpgo
|
||||
jmespath-fuzz.zip
|
||||
cpu.out
|
||||
go-jmespath.test
|
||||
28
vendor/github.com/jmespath/go-jmespath/.travis.yml
generated
vendored
28
vendor/github.com/jmespath/go-jmespath/.travis.yml
generated
vendored
@@ -1,28 +0,0 @@
|
||||
language: go
|
||||
|
||||
sudo: false
|
||||
|
||||
go:
|
||||
- 1.5.x
|
||||
- 1.6.x
|
||||
- 1.7.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- 1.12.x
|
||||
- 1.13.x
|
||||
- 1.14.x
|
||||
- 1.15.x
|
||||
- tip
|
||||
|
||||
allow_failures:
|
||||
- go: tip
|
||||
|
||||
script: make build
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- language: go
|
||||
go: 1.15.x
|
||||
script: make test
|
||||
13
vendor/github.com/jmespath/go-jmespath/LICENSE
generated
vendored
13
vendor/github.com/jmespath/go-jmespath/LICENSE
generated
vendored
@@ -1,13 +0,0 @@
|
||||
Copyright 2015 James Saryerwinnie
|
||||
|
||||
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.
|
||||
51
vendor/github.com/jmespath/go-jmespath/Makefile
generated
vendored
51
vendor/github.com/jmespath/go-jmespath/Makefile
generated
vendored
@@ -1,51 +0,0 @@
|
||||
|
||||
CMD = jpgo
|
||||
|
||||
SRC_PKGS=./ ./cmd/... ./fuzz/...
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " test to run all the tests"
|
||||
@echo " build to build the library and jp executable"
|
||||
@echo " generate to run codegen"
|
||||
|
||||
|
||||
generate:
|
||||
go generate ${SRC_PKGS}
|
||||
|
||||
build:
|
||||
rm -f $(CMD)
|
||||
go build ${SRC_PKGS}
|
||||
rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./...
|
||||
mv cmd/$(CMD)/$(CMD) .
|
||||
|
||||
test: test-internal-testify
|
||||
echo "making tests ${SRC_PKGS}"
|
||||
go test -v ${SRC_PKGS}
|
||||
|
||||
check:
|
||||
go vet ${SRC_PKGS}
|
||||
@echo "golint ${SRC_PKGS}"
|
||||
@lint=`golint ${SRC_PKGS}`; \
|
||||
lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \
|
||||
echo "$$lint"; \
|
||||
if [ "$$lint" != "" ]; then exit 1; fi
|
||||
|
||||
htmlc:
|
||||
go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov
|
||||
|
||||
buildfuzz:
|
||||
go-fuzz-build github.com/jmespath/go-jmespath/fuzz
|
||||
|
||||
fuzz: buildfuzz
|
||||
go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata
|
||||
|
||||
bench:
|
||||
go test -bench . -cpuprofile cpu.out
|
||||
|
||||
pprof-cpu:
|
||||
go tool pprof ./go-jmespath.test ./cpu.out
|
||||
|
||||
test-internal-testify:
|
||||
cd internal/testify && go test ./...
|
||||
|
||||
87
vendor/github.com/jmespath/go-jmespath/README.md
generated
vendored
87
vendor/github.com/jmespath/go-jmespath/README.md
generated
vendored
@@ -1,87 +0,0 @@
|
||||
# go-jmespath - A JMESPath implementation in Go
|
||||
|
||||
[](https://travis-ci.org/jmespath/go-jmespath)
|
||||
|
||||
|
||||
|
||||
go-jmespath is a GO implementation of JMESPath,
|
||||
which is a query language for JSON. It will take a JSON
|
||||
document and transform it into another JSON document
|
||||
through a JMESPath expression.
|
||||
|
||||
Using go-jmespath is really easy. There's a single function
|
||||
you use, `jmespath.search`:
|
||||
|
||||
|
||||
```go
|
||||
> import "github.com/jmespath/go-jmespath"
|
||||
>
|
||||
> var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data
|
||||
> var data interface{}
|
||||
> err := json.Unmarshal(jsondata, &data)
|
||||
> result, err := jmespath.Search("foo.bar.baz[2]", data)
|
||||
result = 2
|
||||
```
|
||||
|
||||
In the example we gave the ``search`` function input data of
|
||||
`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}` as well as the JMESPath
|
||||
expression `foo.bar.baz[2]`, and the `search` function evaluated
|
||||
the expression against the input data to produce the result ``2``.
|
||||
|
||||
The JMESPath language can do a lot more than select an element
|
||||
from a list. Here are a few more examples:
|
||||
|
||||
```go
|
||||
> var jsondata = []byte(`{"foo": {"bar": {"baz": [0, 1, 2, 3, 4]}}}`) // your data
|
||||
> var data interface{}
|
||||
> err := json.Unmarshal(jsondata, &data)
|
||||
> result, err := jmespath.search("foo.bar", data)
|
||||
result = { "baz": [ 0, 1, 2, 3, 4 ] }
|
||||
|
||||
|
||||
> var jsondata = []byte(`{"foo": [{"first": "a", "last": "b"},
|
||||
{"first": "c", "last": "d"}]}`) // your data
|
||||
> var data interface{}
|
||||
> err := json.Unmarshal(jsondata, &data)
|
||||
> result, err := jmespath.search({"foo[*].first", data)
|
||||
result [ 'a', 'c' ]
|
||||
|
||||
|
||||
> var jsondata = []byte(`{"foo": [{"age": 20}, {"age": 25},
|
||||
{"age": 30}, {"age": 35},
|
||||
{"age": 40}]}`) // your data
|
||||
> var data interface{}
|
||||
> err := json.Unmarshal(jsondata, &data)
|
||||
> result, err := jmespath.search("foo[?age > `30`]")
|
||||
result = [ { age: 35 }, { age: 40 } ]
|
||||
```
|
||||
|
||||
You can also pre-compile your query. This is usefull if
|
||||
you are going to run multiple searches with it:
|
||||
|
||||
```go
|
||||
> var jsondata = []byte(`{"foo": "bar"}`)
|
||||
> var data interface{}
|
||||
> err := json.Unmarshal(jsondata, &data)
|
||||
> precompiled, err := Compile("foo")
|
||||
> if err != nil{
|
||||
> // ... handle the error
|
||||
> }
|
||||
> result, err := precompiled.Search(data)
|
||||
result = "bar"
|
||||
```
|
||||
|
||||
## More Resources
|
||||
|
||||
The example above only show a small amount of what
|
||||
a JMESPath expression can do. If you want to take a
|
||||
tour of the language, the *best* place to go is the
|
||||
[JMESPath Tutorial](http://jmespath.org/tutorial.html).
|
||||
|
||||
One of the best things about JMESPath is that it is
|
||||
implemented in many different programming languages including
|
||||
python, ruby, php, lua, etc. To see a complete list of libraries,
|
||||
check out the [JMESPath libraries page](http://jmespath.org/libraries.html).
|
||||
|
||||
And finally, the full JMESPath specification can be found
|
||||
on the [JMESPath site](http://jmespath.org/specification.html).
|
||||
49
vendor/github.com/jmespath/go-jmespath/api.go
generated
vendored
49
vendor/github.com/jmespath/go-jmespath/api.go
generated
vendored
@@ -1,49 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import "strconv"
|
||||
|
||||
// JMESPath is the representation of a compiled JMES path query. A JMESPath is
|
||||
// safe for concurrent use by multiple goroutines.
|
||||
type JMESPath struct {
|
||||
ast ASTNode
|
||||
intr *treeInterpreter
|
||||
}
|
||||
|
||||
// Compile parses a JMESPath expression and returns, if successful, a JMESPath
|
||||
// object that can be used to match against data.
|
||||
func Compile(expression string) (*JMESPath, error) {
|
||||
parser := NewParser()
|
||||
ast, err := parser.Parse(expression)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
jmespath := &JMESPath{ast: ast, intr: newInterpreter()}
|
||||
return jmespath, nil
|
||||
}
|
||||
|
||||
// MustCompile is like Compile but panics if the expression cannot be parsed.
|
||||
// It simplifies safe initialization of global variables holding compiled
|
||||
// JMESPaths.
|
||||
func MustCompile(expression string) *JMESPath {
|
||||
jmespath, err := Compile(expression)
|
||||
if err != nil {
|
||||
panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error())
|
||||
}
|
||||
return jmespath
|
||||
}
|
||||
|
||||
// Search evaluates a JMESPath expression against input data and returns the result.
|
||||
func (jp *JMESPath) Search(data interface{}) (interface{}, error) {
|
||||
return jp.intr.Execute(jp.ast, data)
|
||||
}
|
||||
|
||||
// Search evaluates a JMESPath expression against input data and returns the result.
|
||||
func Search(expression string, data interface{}) (interface{}, error) {
|
||||
intr := newInterpreter()
|
||||
parser := NewParser()
|
||||
ast, err := parser.Parse(expression)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return intr.Execute(ast, data)
|
||||
}
|
||||
16
vendor/github.com/jmespath/go-jmespath/astnodetype_string.go
generated
vendored
16
vendor/github.com/jmespath/go-jmespath/astnodetype_string.go
generated
vendored
@@ -1,16 +0,0 @@
|
||||
// generated by stringer -type astNodeType; DO NOT EDIT
|
||||
|
||||
package jmespath
|
||||
|
||||
import "fmt"
|
||||
|
||||
const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection"
|
||||
|
||||
var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307}
|
||||
|
||||
func (i astNodeType) String() string {
|
||||
if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) {
|
||||
return fmt.Sprintf("astNodeType(%d)", i)
|
||||
}
|
||||
return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]]
|
||||
}
|
||||
842
vendor/github.com/jmespath/go-jmespath/functions.go
generated
vendored
842
vendor/github.com/jmespath/go-jmespath/functions.go
generated
vendored
@@ -1,842 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
type jpFunction func(arguments []interface{}) (interface{}, error)
|
||||
|
||||
type jpType string
|
||||
|
||||
const (
|
||||
jpUnknown jpType = "unknown"
|
||||
jpNumber jpType = "number"
|
||||
jpString jpType = "string"
|
||||
jpArray jpType = "array"
|
||||
jpObject jpType = "object"
|
||||
jpArrayNumber jpType = "array[number]"
|
||||
jpArrayString jpType = "array[string]"
|
||||
jpExpref jpType = "expref"
|
||||
jpAny jpType = "any"
|
||||
)
|
||||
|
||||
type functionEntry struct {
|
||||
name string
|
||||
arguments []argSpec
|
||||
handler jpFunction
|
||||
hasExpRef bool
|
||||
}
|
||||
|
||||
type argSpec struct {
|
||||
types []jpType
|
||||
variadic bool
|
||||
}
|
||||
|
||||
type byExprString struct {
|
||||
intr *treeInterpreter
|
||||
node ASTNode
|
||||
items []interface{}
|
||||
hasError bool
|
||||
}
|
||||
|
||||
func (a *byExprString) Len() int {
|
||||
return len(a.items)
|
||||
}
|
||||
func (a *byExprString) Swap(i, j int) {
|
||||
a.items[i], a.items[j] = a.items[j], a.items[i]
|
||||
}
|
||||
func (a *byExprString) Less(i, j int) bool {
|
||||
first, err := a.intr.Execute(a.node, a.items[i])
|
||||
if err != nil {
|
||||
a.hasError = true
|
||||
// Return a dummy value.
|
||||
return true
|
||||
}
|
||||
ith, ok := first.(string)
|
||||
if !ok {
|
||||
a.hasError = true
|
||||
return true
|
||||
}
|
||||
second, err := a.intr.Execute(a.node, a.items[j])
|
||||
if err != nil {
|
||||
a.hasError = true
|
||||
// Return a dummy value.
|
||||
return true
|
||||
}
|
||||
jth, ok := second.(string)
|
||||
if !ok {
|
||||
a.hasError = true
|
||||
return true
|
||||
}
|
||||
return ith < jth
|
||||
}
|
||||
|
||||
type byExprFloat struct {
|
||||
intr *treeInterpreter
|
||||
node ASTNode
|
||||
items []interface{}
|
||||
hasError bool
|
||||
}
|
||||
|
||||
func (a *byExprFloat) Len() int {
|
||||
return len(a.items)
|
||||
}
|
||||
func (a *byExprFloat) Swap(i, j int) {
|
||||
a.items[i], a.items[j] = a.items[j], a.items[i]
|
||||
}
|
||||
func (a *byExprFloat) Less(i, j int) bool {
|
||||
first, err := a.intr.Execute(a.node, a.items[i])
|
||||
if err != nil {
|
||||
a.hasError = true
|
||||
// Return a dummy value.
|
||||
return true
|
||||
}
|
||||
ith, ok := first.(float64)
|
||||
if !ok {
|
||||
a.hasError = true
|
||||
return true
|
||||
}
|
||||
second, err := a.intr.Execute(a.node, a.items[j])
|
||||
if err != nil {
|
||||
a.hasError = true
|
||||
// Return a dummy value.
|
||||
return true
|
||||
}
|
||||
jth, ok := second.(float64)
|
||||
if !ok {
|
||||
a.hasError = true
|
||||
return true
|
||||
}
|
||||
return ith < jth
|
||||
}
|
||||
|
||||
type functionCaller struct {
|
||||
functionTable map[string]functionEntry
|
||||
}
|
||||
|
||||
func newFunctionCaller() *functionCaller {
|
||||
caller := &functionCaller{}
|
||||
caller.functionTable = map[string]functionEntry{
|
||||
"length": {
|
||||
name: "length",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpString, jpArray, jpObject}},
|
||||
},
|
||||
handler: jpfLength,
|
||||
},
|
||||
"starts_with": {
|
||||
name: "starts_with",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpString}},
|
||||
{types: []jpType{jpString}},
|
||||
},
|
||||
handler: jpfStartsWith,
|
||||
},
|
||||
"abs": {
|
||||
name: "abs",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpNumber}},
|
||||
},
|
||||
handler: jpfAbs,
|
||||
},
|
||||
"avg": {
|
||||
name: "avg",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArrayNumber}},
|
||||
},
|
||||
handler: jpfAvg,
|
||||
},
|
||||
"ceil": {
|
||||
name: "ceil",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpNumber}},
|
||||
},
|
||||
handler: jpfCeil,
|
||||
},
|
||||
"contains": {
|
||||
name: "contains",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArray, jpString}},
|
||||
{types: []jpType{jpAny}},
|
||||
},
|
||||
handler: jpfContains,
|
||||
},
|
||||
"ends_with": {
|
||||
name: "ends_with",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpString}},
|
||||
{types: []jpType{jpString}},
|
||||
},
|
||||
handler: jpfEndsWith,
|
||||
},
|
||||
"floor": {
|
||||
name: "floor",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpNumber}},
|
||||
},
|
||||
handler: jpfFloor,
|
||||
},
|
||||
"map": {
|
||||
name: "amp",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpExpref}},
|
||||
{types: []jpType{jpArray}},
|
||||
},
|
||||
handler: jpfMap,
|
||||
hasExpRef: true,
|
||||
},
|
||||
"max": {
|
||||
name: "max",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArrayNumber, jpArrayString}},
|
||||
},
|
||||
handler: jpfMax,
|
||||
},
|
||||
"merge": {
|
||||
name: "merge",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpObject}, variadic: true},
|
||||
},
|
||||
handler: jpfMerge,
|
||||
},
|
||||
"max_by": {
|
||||
name: "max_by",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArray}},
|
||||
{types: []jpType{jpExpref}},
|
||||
},
|
||||
handler: jpfMaxBy,
|
||||
hasExpRef: true,
|
||||
},
|
||||
"sum": {
|
||||
name: "sum",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArrayNumber}},
|
||||
},
|
||||
handler: jpfSum,
|
||||
},
|
||||
"min": {
|
||||
name: "min",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArrayNumber, jpArrayString}},
|
||||
},
|
||||
handler: jpfMin,
|
||||
},
|
||||
"min_by": {
|
||||
name: "min_by",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArray}},
|
||||
{types: []jpType{jpExpref}},
|
||||
},
|
||||
handler: jpfMinBy,
|
||||
hasExpRef: true,
|
||||
},
|
||||
"type": {
|
||||
name: "type",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpAny}},
|
||||
},
|
||||
handler: jpfType,
|
||||
},
|
||||
"keys": {
|
||||
name: "keys",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpObject}},
|
||||
},
|
||||
handler: jpfKeys,
|
||||
},
|
||||
"values": {
|
||||
name: "values",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpObject}},
|
||||
},
|
||||
handler: jpfValues,
|
||||
},
|
||||
"sort": {
|
||||
name: "sort",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArrayString, jpArrayNumber}},
|
||||
},
|
||||
handler: jpfSort,
|
||||
},
|
||||
"sort_by": {
|
||||
name: "sort_by",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArray}},
|
||||
{types: []jpType{jpExpref}},
|
||||
},
|
||||
handler: jpfSortBy,
|
||||
hasExpRef: true,
|
||||
},
|
||||
"join": {
|
||||
name: "join",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpString}},
|
||||
{types: []jpType{jpArrayString}},
|
||||
},
|
||||
handler: jpfJoin,
|
||||
},
|
||||
"reverse": {
|
||||
name: "reverse",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpArray, jpString}},
|
||||
},
|
||||
handler: jpfReverse,
|
||||
},
|
||||
"to_array": {
|
||||
name: "to_array",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpAny}},
|
||||
},
|
||||
handler: jpfToArray,
|
||||
},
|
||||
"to_string": {
|
||||
name: "to_string",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpAny}},
|
||||
},
|
||||
handler: jpfToString,
|
||||
},
|
||||
"to_number": {
|
||||
name: "to_number",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpAny}},
|
||||
},
|
||||
handler: jpfToNumber,
|
||||
},
|
||||
"not_null": {
|
||||
name: "not_null",
|
||||
arguments: []argSpec{
|
||||
{types: []jpType{jpAny}, variadic: true},
|
||||
},
|
||||
handler: jpfNotNull,
|
||||
},
|
||||
}
|
||||
return caller
|
||||
}
|
||||
|
||||
func (e *functionEntry) resolveArgs(arguments []interface{}) ([]interface{}, error) {
|
||||
if len(e.arguments) == 0 {
|
||||
return arguments, nil
|
||||
}
|
||||
if !e.arguments[len(e.arguments)-1].variadic {
|
||||
if len(e.arguments) != len(arguments) {
|
||||
return nil, errors.New("incorrect number of args")
|
||||
}
|
||||
for i, spec := range e.arguments {
|
||||
userArg := arguments[i]
|
||||
err := spec.typeCheck(userArg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return arguments, nil
|
||||
}
|
||||
if len(arguments) < len(e.arguments) {
|
||||
return nil, errors.New("Invalid arity.")
|
||||
}
|
||||
return arguments, nil
|
||||
}
|
||||
|
||||
func (a *argSpec) typeCheck(arg interface{}) error {
|
||||
for _, t := range a.types {
|
||||
switch t {
|
||||
case jpNumber:
|
||||
if _, ok := arg.(float64); ok {
|
||||
return nil
|
||||
}
|
||||
case jpString:
|
||||
if _, ok := arg.(string); ok {
|
||||
return nil
|
||||
}
|
||||
case jpArray:
|
||||
if isSliceType(arg) {
|
||||
return nil
|
||||
}
|
||||
case jpObject:
|
||||
if _, ok := arg.(map[string]interface{}); ok {
|
||||
return nil
|
||||
}
|
||||
case jpArrayNumber:
|
||||
if _, ok := toArrayNum(arg); ok {
|
||||
return nil
|
||||
}
|
||||
case jpArrayString:
|
||||
if _, ok := toArrayStr(arg); ok {
|
||||
return nil
|
||||
}
|
||||
case jpAny:
|
||||
return nil
|
||||
case jpExpref:
|
||||
if _, ok := arg.(expRef); ok {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return fmt.Errorf("Invalid type for: %v, expected: %#v", arg, a.types)
|
||||
}
|
||||
|
||||
func (f *functionCaller) CallFunction(name string, arguments []interface{}, intr *treeInterpreter) (interface{}, error) {
|
||||
entry, ok := f.functionTable[name]
|
||||
if !ok {
|
||||
return nil, errors.New("unknown function: " + name)
|
||||
}
|
||||
resolvedArgs, err := entry.resolveArgs(arguments)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if entry.hasExpRef {
|
||||
var extra []interface{}
|
||||
extra = append(extra, intr)
|
||||
resolvedArgs = append(extra, resolvedArgs...)
|
||||
}
|
||||
return entry.handler(resolvedArgs)
|
||||
}
|
||||
|
||||
func jpfAbs(arguments []interface{}) (interface{}, error) {
|
||||
num := arguments[0].(float64)
|
||||
return math.Abs(num), nil
|
||||
}
|
||||
|
||||
func jpfLength(arguments []interface{}) (interface{}, error) {
|
||||
arg := arguments[0]
|
||||
if c, ok := arg.(string); ok {
|
||||
return float64(utf8.RuneCountInString(c)), nil
|
||||
} else if isSliceType(arg) {
|
||||
v := reflect.ValueOf(arg)
|
||||
return float64(v.Len()), nil
|
||||
} else if c, ok := arg.(map[string]interface{}); ok {
|
||||
return float64(len(c)), nil
|
||||
}
|
||||
return nil, errors.New("could not compute length()")
|
||||
}
|
||||
|
||||
func jpfStartsWith(arguments []interface{}) (interface{}, error) {
|
||||
search := arguments[0].(string)
|
||||
prefix := arguments[1].(string)
|
||||
return strings.HasPrefix(search, prefix), nil
|
||||
}
|
||||
|
||||
func jpfAvg(arguments []interface{}) (interface{}, error) {
|
||||
// We've already type checked the value so we can safely use
|
||||
// type assertions.
|
||||
args := arguments[0].([]interface{})
|
||||
length := float64(len(args))
|
||||
numerator := 0.0
|
||||
for _, n := range args {
|
||||
numerator += n.(float64)
|
||||
}
|
||||
return numerator / length, nil
|
||||
}
|
||||
func jpfCeil(arguments []interface{}) (interface{}, error) {
|
||||
val := arguments[0].(float64)
|
||||
return math.Ceil(val), nil
|
||||
}
|
||||
func jpfContains(arguments []interface{}) (interface{}, error) {
|
||||
search := arguments[0]
|
||||
el := arguments[1]
|
||||
if searchStr, ok := search.(string); ok {
|
||||
if elStr, ok := el.(string); ok {
|
||||
return strings.Index(searchStr, elStr) != -1, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
// Otherwise this is a generic contains for []interface{}
|
||||
general := search.([]interface{})
|
||||
for _, item := range general {
|
||||
if item == el {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
func jpfEndsWith(arguments []interface{}) (interface{}, error) {
|
||||
search := arguments[0].(string)
|
||||
suffix := arguments[1].(string)
|
||||
return strings.HasSuffix(search, suffix), nil
|
||||
}
|
||||
func jpfFloor(arguments []interface{}) (interface{}, error) {
|
||||
val := arguments[0].(float64)
|
||||
return math.Floor(val), nil
|
||||
}
|
||||
func jpfMap(arguments []interface{}) (interface{}, error) {
|
||||
intr := arguments[0].(*treeInterpreter)
|
||||
exp := arguments[1].(expRef)
|
||||
node := exp.ref
|
||||
arr := arguments[2].([]interface{})
|
||||
mapped := make([]interface{}, 0, len(arr))
|
||||
for _, value := range arr {
|
||||
current, err := intr.Execute(node, value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mapped = append(mapped, current)
|
||||
}
|
||||
return mapped, nil
|
||||
}
|
||||
func jpfMax(arguments []interface{}) (interface{}, error) {
|
||||
if items, ok := toArrayNum(arguments[0]); ok {
|
||||
if len(items) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if len(items) == 1 {
|
||||
return items[0], nil
|
||||
}
|
||||
best := items[0]
|
||||
for _, item := range items[1:] {
|
||||
if item > best {
|
||||
best = item
|
||||
}
|
||||
}
|
||||
return best, nil
|
||||
}
|
||||
// Otherwise we're dealing with a max() of strings.
|
||||
items, _ := toArrayStr(arguments[0])
|
||||
if len(items) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if len(items) == 1 {
|
||||
return items[0], nil
|
||||
}
|
||||
best := items[0]
|
||||
for _, item := range items[1:] {
|
||||
if item > best {
|
||||
best = item
|
||||
}
|
||||
}
|
||||
return best, nil
|
||||
}
|
||||
func jpfMerge(arguments []interface{}) (interface{}, error) {
|
||||
final := make(map[string]interface{})
|
||||
for _, m := range arguments {
|
||||
mapped := m.(map[string]interface{})
|
||||
for key, value := range mapped {
|
||||
final[key] = value
|
||||
}
|
||||
}
|
||||
return final, nil
|
||||
}
|
||||
func jpfMaxBy(arguments []interface{}) (interface{}, error) {
|
||||
intr := arguments[0].(*treeInterpreter)
|
||||
arr := arguments[1].([]interface{})
|
||||
exp := arguments[2].(expRef)
|
||||
node := exp.ref
|
||||
if len(arr) == 0 {
|
||||
return nil, nil
|
||||
} else if len(arr) == 1 {
|
||||
return arr[0], nil
|
||||
}
|
||||
start, err := intr.Execute(node, arr[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch t := start.(type) {
|
||||
case float64:
|
||||
bestVal := t
|
||||
bestItem := arr[0]
|
||||
for _, item := range arr[1:] {
|
||||
result, err := intr.Execute(node, item)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
current, ok := result.(float64)
|
||||
if !ok {
|
||||
return nil, errors.New("invalid type, must be number")
|
||||
}
|
||||
if current > bestVal {
|
||||
bestVal = current
|
||||
bestItem = item
|
||||
}
|
||||
}
|
||||
return bestItem, nil
|
||||
case string:
|
||||
bestVal := t
|
||||
bestItem := arr[0]
|
||||
for _, item := range arr[1:] {
|
||||
result, err := intr.Execute(node, item)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
current, ok := result.(string)
|
||||
if !ok {
|
||||
return nil, errors.New("invalid type, must be string")
|
||||
}
|
||||
if current > bestVal {
|
||||
bestVal = current
|
||||
bestItem = item
|
||||
}
|
||||
}
|
||||
return bestItem, nil
|
||||
default:
|
||||
return nil, errors.New("invalid type, must be number of string")
|
||||
}
|
||||
}
|
||||
func jpfSum(arguments []interface{}) (interface{}, error) {
|
||||
items, _ := toArrayNum(arguments[0])
|
||||
sum := 0.0
|
||||
for _, item := range items {
|
||||
sum += item
|
||||
}
|
||||
return sum, nil
|
||||
}
|
||||
|
||||
func jpfMin(arguments []interface{}) (interface{}, error) {
|
||||
if items, ok := toArrayNum(arguments[0]); ok {
|
||||
if len(items) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if len(items) == 1 {
|
||||
return items[0], nil
|
||||
}
|
||||
best := items[0]
|
||||
for _, item := range items[1:] {
|
||||
if item < best {
|
||||
best = item
|
||||
}
|
||||
}
|
||||
return best, nil
|
||||
}
|
||||
items, _ := toArrayStr(arguments[0])
|
||||
if len(items) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
if len(items) == 1 {
|
||||
return items[0], nil
|
||||
}
|
||||
best := items[0]
|
||||
for _, item := range items[1:] {
|
||||
if item < best {
|
||||
best = item
|
||||
}
|
||||
}
|
||||
return best, nil
|
||||
}
|
||||
|
||||
func jpfMinBy(arguments []interface{}) (interface{}, error) {
|
||||
intr := arguments[0].(*treeInterpreter)
|
||||
arr := arguments[1].([]interface{})
|
||||
exp := arguments[2].(expRef)
|
||||
node := exp.ref
|
||||
if len(arr) == 0 {
|
||||
return nil, nil
|
||||
} else if len(arr) == 1 {
|
||||
return arr[0], nil
|
||||
}
|
||||
start, err := intr.Execute(node, arr[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if t, ok := start.(float64); ok {
|
||||
bestVal := t
|
||||
bestItem := arr[0]
|
||||
for _, item := range arr[1:] {
|
||||
result, err := intr.Execute(node, item)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
current, ok := result.(float64)
|
||||
if !ok {
|
||||
return nil, errors.New("invalid type, must be number")
|
||||
}
|
||||
if current < bestVal {
|
||||
bestVal = current
|
||||
bestItem = item
|
||||
}
|
||||
}
|
||||
return bestItem, nil
|
||||
} else if t, ok := start.(string); ok {
|
||||
bestVal := t
|
||||
bestItem := arr[0]
|
||||
for _, item := range arr[1:] {
|
||||
result, err := intr.Execute(node, item)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
current, ok := result.(string)
|
||||
if !ok {
|
||||
return nil, errors.New("invalid type, must be string")
|
||||
}
|
||||
if current < bestVal {
|
||||
bestVal = current
|
||||
bestItem = item
|
||||
}
|
||||
}
|
||||
return bestItem, nil
|
||||
} else {
|
||||
return nil, errors.New("invalid type, must be number of string")
|
||||
}
|
||||
}
|
||||
func jpfType(arguments []interface{}) (interface{}, error) {
|
||||
arg := arguments[0]
|
||||
if _, ok := arg.(float64); ok {
|
||||
return "number", nil
|
||||
}
|
||||
if _, ok := arg.(string); ok {
|
||||
return "string", nil
|
||||
}
|
||||
if _, ok := arg.([]interface{}); ok {
|
||||
return "array", nil
|
||||
}
|
||||
if _, ok := arg.(map[string]interface{}); ok {
|
||||
return "object", nil
|
||||
}
|
||||
if arg == nil {
|
||||
return "null", nil
|
||||
}
|
||||
if arg == true || arg == false {
|
||||
return "boolean", nil
|
||||
}
|
||||
return nil, errors.New("unknown type")
|
||||
}
|
||||
func jpfKeys(arguments []interface{}) (interface{}, error) {
|
||||
arg := arguments[0].(map[string]interface{})
|
||||
collected := make([]interface{}, 0, len(arg))
|
||||
for key := range arg {
|
||||
collected = append(collected, key)
|
||||
}
|
||||
return collected, nil
|
||||
}
|
||||
func jpfValues(arguments []interface{}) (interface{}, error) {
|
||||
arg := arguments[0].(map[string]interface{})
|
||||
collected := make([]interface{}, 0, len(arg))
|
||||
for _, value := range arg {
|
||||
collected = append(collected, value)
|
||||
}
|
||||
return collected, nil
|
||||
}
|
||||
func jpfSort(arguments []interface{}) (interface{}, error) {
|
||||
if items, ok := toArrayNum(arguments[0]); ok {
|
||||
d := sort.Float64Slice(items)
|
||||
sort.Stable(d)
|
||||
final := make([]interface{}, len(d))
|
||||
for i, val := range d {
|
||||
final[i] = val
|
||||
}
|
||||
return final, nil
|
||||
}
|
||||
// Otherwise we're dealing with sort()'ing strings.
|
||||
items, _ := toArrayStr(arguments[0])
|
||||
d := sort.StringSlice(items)
|
||||
sort.Stable(d)
|
||||
final := make([]interface{}, len(d))
|
||||
for i, val := range d {
|
||||
final[i] = val
|
||||
}
|
||||
return final, nil
|
||||
}
|
||||
func jpfSortBy(arguments []interface{}) (interface{}, error) {
|
||||
intr := arguments[0].(*treeInterpreter)
|
||||
arr := arguments[1].([]interface{})
|
||||
exp := arguments[2].(expRef)
|
||||
node := exp.ref
|
||||
if len(arr) == 0 {
|
||||
return arr, nil
|
||||
} else if len(arr) == 1 {
|
||||
return arr, nil
|
||||
}
|
||||
start, err := intr.Execute(node, arr[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, ok := start.(float64); ok {
|
||||
sortable := &byExprFloat{intr, node, arr, false}
|
||||
sort.Stable(sortable)
|
||||
if sortable.hasError {
|
||||
return nil, errors.New("error in sort_by comparison")
|
||||
}
|
||||
return arr, nil
|
||||
} else if _, ok := start.(string); ok {
|
||||
sortable := &byExprString{intr, node, arr, false}
|
||||
sort.Stable(sortable)
|
||||
if sortable.hasError {
|
||||
return nil, errors.New("error in sort_by comparison")
|
||||
}
|
||||
return arr, nil
|
||||
} else {
|
||||
return nil, errors.New("invalid type, must be number of string")
|
||||
}
|
||||
}
|
||||
func jpfJoin(arguments []interface{}) (interface{}, error) {
|
||||
sep := arguments[0].(string)
|
||||
// We can't just do arguments[1].([]string), we have to
|
||||
// manually convert each item to a string.
|
||||
arrayStr := []string{}
|
||||
for _, item := range arguments[1].([]interface{}) {
|
||||
arrayStr = append(arrayStr, item.(string))
|
||||
}
|
||||
return strings.Join(arrayStr, sep), nil
|
||||
}
|
||||
func jpfReverse(arguments []interface{}) (interface{}, error) {
|
||||
if s, ok := arguments[0].(string); ok {
|
||||
r := []rune(s)
|
||||
for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
|
||||
r[i], r[j] = r[j], r[i]
|
||||
}
|
||||
return string(r), nil
|
||||
}
|
||||
items := arguments[0].([]interface{})
|
||||
length := len(items)
|
||||
reversed := make([]interface{}, length)
|
||||
for i, item := range items {
|
||||
reversed[length-(i+1)] = item
|
||||
}
|
||||
return reversed, nil
|
||||
}
|
||||
func jpfToArray(arguments []interface{}) (interface{}, error) {
|
||||
if _, ok := arguments[0].([]interface{}); ok {
|
||||
return arguments[0], nil
|
||||
}
|
||||
return arguments[:1:1], nil
|
||||
}
|
||||
func jpfToString(arguments []interface{}) (interface{}, error) {
|
||||
if v, ok := arguments[0].(string); ok {
|
||||
return v, nil
|
||||
}
|
||||
result, err := json.Marshal(arguments[0])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return string(result), nil
|
||||
}
|
||||
func jpfToNumber(arguments []interface{}) (interface{}, error) {
|
||||
arg := arguments[0]
|
||||
if v, ok := arg.(float64); ok {
|
||||
return v, nil
|
||||
}
|
||||
if v, ok := arg.(string); ok {
|
||||
conv, err := strconv.ParseFloat(v, 64)
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
return conv, nil
|
||||
}
|
||||
if _, ok := arg.([]interface{}); ok {
|
||||
return nil, nil
|
||||
}
|
||||
if _, ok := arg.(map[string]interface{}); ok {
|
||||
return nil, nil
|
||||
}
|
||||
if arg == nil {
|
||||
return nil, nil
|
||||
}
|
||||
if arg == true || arg == false {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, errors.New("unknown type")
|
||||
}
|
||||
func jpfNotNull(arguments []interface{}) (interface{}, error) {
|
||||
for _, arg := range arguments {
|
||||
if arg != nil {
|
||||
return arg, nil
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
418
vendor/github.com/jmespath/go-jmespath/interpreter.go
generated
vendored
418
vendor/github.com/jmespath/go-jmespath/interpreter.go
generated
vendored
@@ -1,418 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"reflect"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
/* This is a tree based interpreter. It walks the AST and directly
|
||||
interprets the AST to search through a JSON document.
|
||||
*/
|
||||
|
||||
type treeInterpreter struct {
|
||||
fCall *functionCaller
|
||||
}
|
||||
|
||||
func newInterpreter() *treeInterpreter {
|
||||
interpreter := treeInterpreter{}
|
||||
interpreter.fCall = newFunctionCaller()
|
||||
return &interpreter
|
||||
}
|
||||
|
||||
type expRef struct {
|
||||
ref ASTNode
|
||||
}
|
||||
|
||||
// Execute takes an ASTNode and input data and interprets the AST directly.
|
||||
// It will produce the result of applying the JMESPath expression associated
|
||||
// with the ASTNode to the input data "value".
|
||||
func (intr *treeInterpreter) Execute(node ASTNode, value interface{}) (interface{}, error) {
|
||||
switch node.nodeType {
|
||||
case ASTComparator:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
right, err := intr.Execute(node.children[1], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
switch node.value {
|
||||
case tEQ:
|
||||
return objsEqual(left, right), nil
|
||||
case tNE:
|
||||
return !objsEqual(left, right), nil
|
||||
}
|
||||
leftNum, ok := left.(float64)
|
||||
if !ok {
|
||||
return nil, nil
|
||||
}
|
||||
rightNum, ok := right.(float64)
|
||||
if !ok {
|
||||
return nil, nil
|
||||
}
|
||||
switch node.value {
|
||||
case tGT:
|
||||
return leftNum > rightNum, nil
|
||||
case tGTE:
|
||||
return leftNum >= rightNum, nil
|
||||
case tLT:
|
||||
return leftNum < rightNum, nil
|
||||
case tLTE:
|
||||
return leftNum <= rightNum, nil
|
||||
}
|
||||
case ASTExpRef:
|
||||
return expRef{ref: node.children[0]}, nil
|
||||
case ASTFunctionExpression:
|
||||
resolvedArgs := []interface{}{}
|
||||
for _, arg := range node.children {
|
||||
current, err := intr.Execute(arg, value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resolvedArgs = append(resolvedArgs, current)
|
||||
}
|
||||
return intr.fCall.CallFunction(node.value.(string), resolvedArgs, intr)
|
||||
case ASTField:
|
||||
if m, ok := value.(map[string]interface{}); ok {
|
||||
key := node.value.(string)
|
||||
return m[key], nil
|
||||
}
|
||||
return intr.fieldFromStruct(node.value.(string), value)
|
||||
case ASTFilterProjection:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
sliceType, ok := left.([]interface{})
|
||||
if !ok {
|
||||
if isSliceType(left) {
|
||||
return intr.filterProjectionWithReflection(node, left)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
compareNode := node.children[2]
|
||||
collected := []interface{}{}
|
||||
for _, element := range sliceType {
|
||||
result, err := intr.Execute(compareNode, element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !isFalse(result) {
|
||||
current, err := intr.Execute(node.children[1], element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if current != nil {
|
||||
collected = append(collected, current)
|
||||
}
|
||||
}
|
||||
}
|
||||
return collected, nil
|
||||
case ASTFlatten:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
sliceType, ok := left.([]interface{})
|
||||
if !ok {
|
||||
// If we can't type convert to []interface{}, there's
|
||||
// a chance this could still work via reflection if we're
|
||||
// dealing with user provided types.
|
||||
if isSliceType(left) {
|
||||
return intr.flattenWithReflection(left)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
flattened := []interface{}{}
|
||||
for _, element := range sliceType {
|
||||
if elementSlice, ok := element.([]interface{}); ok {
|
||||
flattened = append(flattened, elementSlice...)
|
||||
} else if isSliceType(element) {
|
||||
reflectFlat := []interface{}{}
|
||||
v := reflect.ValueOf(element)
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
reflectFlat = append(reflectFlat, v.Index(i).Interface())
|
||||
}
|
||||
flattened = append(flattened, reflectFlat...)
|
||||
} else {
|
||||
flattened = append(flattened, element)
|
||||
}
|
||||
}
|
||||
return flattened, nil
|
||||
case ASTIdentity, ASTCurrentNode:
|
||||
return value, nil
|
||||
case ASTIndex:
|
||||
if sliceType, ok := value.([]interface{}); ok {
|
||||
index := node.value.(int)
|
||||
if index < 0 {
|
||||
index += len(sliceType)
|
||||
}
|
||||
if index < len(sliceType) && index >= 0 {
|
||||
return sliceType[index], nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
// Otherwise try via reflection.
|
||||
rv := reflect.ValueOf(value)
|
||||
if rv.Kind() == reflect.Slice {
|
||||
index := node.value.(int)
|
||||
if index < 0 {
|
||||
index += rv.Len()
|
||||
}
|
||||
if index < rv.Len() && index >= 0 {
|
||||
v := rv.Index(index)
|
||||
return v.Interface(), nil
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
case ASTKeyValPair:
|
||||
return intr.Execute(node.children[0], value)
|
||||
case ASTLiteral:
|
||||
return node.value, nil
|
||||
case ASTMultiSelectHash:
|
||||
if value == nil {
|
||||
return nil, nil
|
||||
}
|
||||
collected := make(map[string]interface{})
|
||||
for _, child := range node.children {
|
||||
current, err := intr.Execute(child, value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
key := child.value.(string)
|
||||
collected[key] = current
|
||||
}
|
||||
return collected, nil
|
||||
case ASTMultiSelectList:
|
||||
if value == nil {
|
||||
return nil, nil
|
||||
}
|
||||
collected := []interface{}{}
|
||||
for _, child := range node.children {
|
||||
current, err := intr.Execute(child, value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
collected = append(collected, current)
|
||||
}
|
||||
return collected, nil
|
||||
case ASTOrExpression:
|
||||
matched, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if isFalse(matched) {
|
||||
matched, err = intr.Execute(node.children[1], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return matched, nil
|
||||
case ASTAndExpression:
|
||||
matched, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if isFalse(matched) {
|
||||
return matched, nil
|
||||
}
|
||||
return intr.Execute(node.children[1], value)
|
||||
case ASTNotExpression:
|
||||
matched, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if isFalse(matched) {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
case ASTPipe:
|
||||
result := value
|
||||
var err error
|
||||
for _, child := range node.children {
|
||||
result, err = intr.Execute(child, result)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
case ASTProjection:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sliceType, ok := left.([]interface{})
|
||||
if !ok {
|
||||
if isSliceType(left) {
|
||||
return intr.projectWithReflection(node, left)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
collected := []interface{}{}
|
||||
var current interface{}
|
||||
for _, element := range sliceType {
|
||||
current, err = intr.Execute(node.children[1], element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if current != nil {
|
||||
collected = append(collected, current)
|
||||
}
|
||||
}
|
||||
return collected, nil
|
||||
case ASTSubexpression, ASTIndexExpression:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return intr.Execute(node.children[1], left)
|
||||
case ASTSlice:
|
||||
sliceType, ok := value.([]interface{})
|
||||
if !ok {
|
||||
if isSliceType(value) {
|
||||
return intr.sliceWithReflection(node, value)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
parts := node.value.([]*int)
|
||||
sliceParams := make([]sliceParam, 3)
|
||||
for i, part := range parts {
|
||||
if part != nil {
|
||||
sliceParams[i].Specified = true
|
||||
sliceParams[i].N = *part
|
||||
}
|
||||
}
|
||||
return slice(sliceType, sliceParams)
|
||||
case ASTValueProjection:
|
||||
left, err := intr.Execute(node.children[0], value)
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
mapType, ok := left.(map[string]interface{})
|
||||
if !ok {
|
||||
return nil, nil
|
||||
}
|
||||
values := make([]interface{}, len(mapType))
|
||||
for _, value := range mapType {
|
||||
values = append(values, value)
|
||||
}
|
||||
collected := []interface{}{}
|
||||
for _, element := range values {
|
||||
current, err := intr.Execute(node.children[1], element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if current != nil {
|
||||
collected = append(collected, current)
|
||||
}
|
||||
}
|
||||
return collected, nil
|
||||
}
|
||||
return nil, errors.New("Unknown AST node: " + node.nodeType.String())
|
||||
}
|
||||
|
||||
func (intr *treeInterpreter) fieldFromStruct(key string, value interface{}) (interface{}, error) {
|
||||
rv := reflect.ValueOf(value)
|
||||
first, n := utf8.DecodeRuneInString(key)
|
||||
fieldName := string(unicode.ToUpper(first)) + key[n:]
|
||||
if rv.Kind() == reflect.Struct {
|
||||
v := rv.FieldByName(fieldName)
|
||||
if !v.IsValid() {
|
||||
return nil, nil
|
||||
}
|
||||
return v.Interface(), nil
|
||||
} else if rv.Kind() == reflect.Ptr {
|
||||
// Handle multiple levels of indirection?
|
||||
if rv.IsNil() {
|
||||
return nil, nil
|
||||
}
|
||||
rv = rv.Elem()
|
||||
v := rv.FieldByName(fieldName)
|
||||
if !v.IsValid() {
|
||||
return nil, nil
|
||||
}
|
||||
return v.Interface(), nil
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (intr *treeInterpreter) flattenWithReflection(value interface{}) (interface{}, error) {
|
||||
v := reflect.ValueOf(value)
|
||||
flattened := []interface{}{}
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
element := v.Index(i).Interface()
|
||||
if reflect.TypeOf(element).Kind() == reflect.Slice {
|
||||
// Then insert the contents of the element
|
||||
// slice into the flattened slice,
|
||||
// i.e flattened = append(flattened, mySlice...)
|
||||
elementV := reflect.ValueOf(element)
|
||||
for j := 0; j < elementV.Len(); j++ {
|
||||
flattened = append(
|
||||
flattened, elementV.Index(j).Interface())
|
||||
}
|
||||
} else {
|
||||
flattened = append(flattened, element)
|
||||
}
|
||||
}
|
||||
return flattened, nil
|
||||
}
|
||||
|
||||
func (intr *treeInterpreter) sliceWithReflection(node ASTNode, value interface{}) (interface{}, error) {
|
||||
v := reflect.ValueOf(value)
|
||||
parts := node.value.([]*int)
|
||||
sliceParams := make([]sliceParam, 3)
|
||||
for i, part := range parts {
|
||||
if part != nil {
|
||||
sliceParams[i].Specified = true
|
||||
sliceParams[i].N = *part
|
||||
}
|
||||
}
|
||||
final := []interface{}{}
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
element := v.Index(i).Interface()
|
||||
final = append(final, element)
|
||||
}
|
||||
return slice(final, sliceParams)
|
||||
}
|
||||
|
||||
func (intr *treeInterpreter) filterProjectionWithReflection(node ASTNode, value interface{}) (interface{}, error) {
|
||||
compareNode := node.children[2]
|
||||
collected := []interface{}{}
|
||||
v := reflect.ValueOf(value)
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
element := v.Index(i).Interface()
|
||||
result, err := intr.Execute(compareNode, element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !isFalse(result) {
|
||||
current, err := intr.Execute(node.children[1], element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if current != nil {
|
||||
collected = append(collected, current)
|
||||
}
|
||||
}
|
||||
}
|
||||
return collected, nil
|
||||
}
|
||||
|
||||
func (intr *treeInterpreter) projectWithReflection(node ASTNode, value interface{}) (interface{}, error) {
|
||||
collected := []interface{}{}
|
||||
v := reflect.ValueOf(value)
|
||||
for i := 0; i < v.Len(); i++ {
|
||||
element := v.Index(i).Interface()
|
||||
result, err := intr.Execute(node.children[1], element)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if result != nil {
|
||||
collected = append(collected, result)
|
||||
}
|
||||
}
|
||||
return collected, nil
|
||||
}
|
||||
420
vendor/github.com/jmespath/go-jmespath/lexer.go
generated
vendored
420
vendor/github.com/jmespath/go-jmespath/lexer.go
generated
vendored
@@ -1,420 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
type token struct {
|
||||
tokenType tokType
|
||||
value string
|
||||
position int
|
||||
length int
|
||||
}
|
||||
|
||||
type tokType int
|
||||
|
||||
const eof = -1
|
||||
|
||||
// Lexer contains information about the expression being tokenized.
|
||||
type Lexer struct {
|
||||
expression string // The expression provided by the user.
|
||||
currentPos int // The current position in the string.
|
||||
lastWidth int // The width of the current rune. This
|
||||
buf bytes.Buffer // Internal buffer used for building up values.
|
||||
}
|
||||
|
||||
// SyntaxError is the main error used whenever a lexing or parsing error occurs.
|
||||
type SyntaxError struct {
|
||||
msg string // Error message displayed to user
|
||||
Expression string // Expression that generated a SyntaxError
|
||||
Offset int // The location in the string where the error occurred
|
||||
}
|
||||
|
||||
func (e SyntaxError) Error() string {
|
||||
// In the future, it would be good to underline the specific
|
||||
// location where the error occurred.
|
||||
return "SyntaxError: " + e.msg
|
||||
}
|
||||
|
||||
// HighlightLocation will show where the syntax error occurred.
|
||||
// It will place a "^" character on a line below the expression
|
||||
// at the point where the syntax error occurred.
|
||||
func (e SyntaxError) HighlightLocation() string {
|
||||
return e.Expression + "\n" + strings.Repeat(" ", e.Offset) + "^"
|
||||
}
|
||||
|
||||
//go:generate stringer -type=tokType
|
||||
const (
|
||||
tUnknown tokType = iota
|
||||
tStar
|
||||
tDot
|
||||
tFilter
|
||||
tFlatten
|
||||
tLparen
|
||||
tRparen
|
||||
tLbracket
|
||||
tRbracket
|
||||
tLbrace
|
||||
tRbrace
|
||||
tOr
|
||||
tPipe
|
||||
tNumber
|
||||
tUnquotedIdentifier
|
||||
tQuotedIdentifier
|
||||
tComma
|
||||
tColon
|
||||
tLT
|
||||
tLTE
|
||||
tGT
|
||||
tGTE
|
||||
tEQ
|
||||
tNE
|
||||
tJSONLiteral
|
||||
tStringLiteral
|
||||
tCurrent
|
||||
tExpref
|
||||
tAnd
|
||||
tNot
|
||||
tEOF
|
||||
)
|
||||
|
||||
var basicTokens = map[rune]tokType{
|
||||
'.': tDot,
|
||||
'*': tStar,
|
||||
',': tComma,
|
||||
':': tColon,
|
||||
'{': tLbrace,
|
||||
'}': tRbrace,
|
||||
']': tRbracket, // tLbracket not included because it could be "[]"
|
||||
'(': tLparen,
|
||||
')': tRparen,
|
||||
'@': tCurrent,
|
||||
}
|
||||
|
||||
// Bit mask for [a-zA-Z_] shifted down 64 bits to fit in a single uint64.
|
||||
// When using this bitmask just be sure to shift the rune down 64 bits
|
||||
// before checking against identifierStartBits.
|
||||
const identifierStartBits uint64 = 576460745995190270
|
||||
|
||||
// Bit mask for [a-zA-Z0-9], 128 bits -> 2 uint64s.
|
||||
var identifierTrailingBits = [2]uint64{287948901175001088, 576460745995190270}
|
||||
|
||||
var whiteSpace = map[rune]bool{
|
||||
' ': true, '\t': true, '\n': true, '\r': true,
|
||||
}
|
||||
|
||||
func (t token) String() string {
|
||||
return fmt.Sprintf("Token{%+v, %s, %d, %d}",
|
||||
t.tokenType, t.value, t.position, t.length)
|
||||
}
|
||||
|
||||
// NewLexer creates a new JMESPath lexer.
|
||||
func NewLexer() *Lexer {
|
||||
lexer := Lexer{}
|
||||
return &lexer
|
||||
}
|
||||
|
||||
func (lexer *Lexer) next() rune {
|
||||
if lexer.currentPos >= len(lexer.expression) {
|
||||
lexer.lastWidth = 0
|
||||
return eof
|
||||
}
|
||||
r, w := utf8.DecodeRuneInString(lexer.expression[lexer.currentPos:])
|
||||
lexer.lastWidth = w
|
||||
lexer.currentPos += w
|
||||
return r
|
||||
}
|
||||
|
||||
func (lexer *Lexer) back() {
|
||||
lexer.currentPos -= lexer.lastWidth
|
||||
}
|
||||
|
||||
func (lexer *Lexer) peek() rune {
|
||||
t := lexer.next()
|
||||
lexer.back()
|
||||
return t
|
||||
}
|
||||
|
||||
// tokenize takes an expression and returns corresponding tokens.
|
||||
func (lexer *Lexer) tokenize(expression string) ([]token, error) {
|
||||
var tokens []token
|
||||
lexer.expression = expression
|
||||
lexer.currentPos = 0
|
||||
lexer.lastWidth = 0
|
||||
loop:
|
||||
for {
|
||||
r := lexer.next()
|
||||
if identifierStartBits&(1<<(uint64(r)-64)) > 0 {
|
||||
t := lexer.consumeUnquotedIdentifier()
|
||||
tokens = append(tokens, t)
|
||||
} else if val, ok := basicTokens[r]; ok {
|
||||
// Basic single char token.
|
||||
t := token{
|
||||
tokenType: val,
|
||||
value: string(r),
|
||||
position: lexer.currentPos - lexer.lastWidth,
|
||||
length: 1,
|
||||
}
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '-' || (r >= '0' && r <= '9') {
|
||||
t := lexer.consumeNumber()
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '[' {
|
||||
t := lexer.consumeLBracket()
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '"' {
|
||||
t, err := lexer.consumeQuotedIdentifier()
|
||||
if err != nil {
|
||||
return tokens, err
|
||||
}
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '\'' {
|
||||
t, err := lexer.consumeRawStringLiteral()
|
||||
if err != nil {
|
||||
return tokens, err
|
||||
}
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '`' {
|
||||
t, err := lexer.consumeLiteral()
|
||||
if err != nil {
|
||||
return tokens, err
|
||||
}
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '|' {
|
||||
t := lexer.matchOrElse(r, '|', tOr, tPipe)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '<' {
|
||||
t := lexer.matchOrElse(r, '=', tLTE, tLT)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '>' {
|
||||
t := lexer.matchOrElse(r, '=', tGTE, tGT)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '!' {
|
||||
t := lexer.matchOrElse(r, '=', tNE, tNot)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '=' {
|
||||
t := lexer.matchOrElse(r, '=', tEQ, tUnknown)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == '&' {
|
||||
t := lexer.matchOrElse(r, '&', tAnd, tExpref)
|
||||
tokens = append(tokens, t)
|
||||
} else if r == eof {
|
||||
break loop
|
||||
} else if _, ok := whiteSpace[r]; ok {
|
||||
// Ignore whitespace
|
||||
} else {
|
||||
return tokens, lexer.syntaxError(fmt.Sprintf("Unknown char: %s", strconv.QuoteRuneToASCII(r)))
|
||||
}
|
||||
}
|
||||
tokens = append(tokens, token{tEOF, "", len(lexer.expression), 0})
|
||||
return tokens, nil
|
||||
}
|
||||
|
||||
// Consume characters until the ending rune "r" is reached.
|
||||
// If the end of the expression is reached before seeing the
|
||||
// terminating rune "r", then an error is returned.
|
||||
// If no error occurs then the matching substring is returned.
|
||||
// The returned string will not include the ending rune.
|
||||
func (lexer *Lexer) consumeUntil(end rune) (string, error) {
|
||||
start := lexer.currentPos
|
||||
current := lexer.next()
|
||||
for current != end && current != eof {
|
||||
if current == '\\' && lexer.peek() != eof {
|
||||
lexer.next()
|
||||
}
|
||||
current = lexer.next()
|
||||
}
|
||||
if lexer.lastWidth == 0 {
|
||||
// Then we hit an EOF so we never reached the closing
|
||||
// delimiter.
|
||||
return "", SyntaxError{
|
||||
msg: "Unclosed delimiter: " + string(end),
|
||||
Expression: lexer.expression,
|
||||
Offset: len(lexer.expression),
|
||||
}
|
||||
}
|
||||
return lexer.expression[start : lexer.currentPos-lexer.lastWidth], nil
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeLiteral() (token, error) {
|
||||
start := lexer.currentPos
|
||||
value, err := lexer.consumeUntil('`')
|
||||
if err != nil {
|
||||
return token{}, err
|
||||
}
|
||||
value = strings.Replace(value, "\\`", "`", -1)
|
||||
return token{
|
||||
tokenType: tJSONLiteral,
|
||||
value: value,
|
||||
position: start,
|
||||
length: len(value),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeRawStringLiteral() (token, error) {
|
||||
start := lexer.currentPos
|
||||
currentIndex := start
|
||||
current := lexer.next()
|
||||
for current != '\'' && lexer.peek() != eof {
|
||||
if current == '\\' && lexer.peek() == '\'' {
|
||||
chunk := lexer.expression[currentIndex : lexer.currentPos-1]
|
||||
lexer.buf.WriteString(chunk)
|
||||
lexer.buf.WriteString("'")
|
||||
lexer.next()
|
||||
currentIndex = lexer.currentPos
|
||||
}
|
||||
current = lexer.next()
|
||||
}
|
||||
if lexer.lastWidth == 0 {
|
||||
// Then we hit an EOF so we never reached the closing
|
||||
// delimiter.
|
||||
return token{}, SyntaxError{
|
||||
msg: "Unclosed delimiter: '",
|
||||
Expression: lexer.expression,
|
||||
Offset: len(lexer.expression),
|
||||
}
|
||||
}
|
||||
if currentIndex < lexer.currentPos {
|
||||
lexer.buf.WriteString(lexer.expression[currentIndex : lexer.currentPos-1])
|
||||
}
|
||||
value := lexer.buf.String()
|
||||
// Reset the buffer so it can reused again.
|
||||
lexer.buf.Reset()
|
||||
return token{
|
||||
tokenType: tStringLiteral,
|
||||
value: value,
|
||||
position: start,
|
||||
length: len(value),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (lexer *Lexer) syntaxError(msg string) SyntaxError {
|
||||
return SyntaxError{
|
||||
msg: msg,
|
||||
Expression: lexer.expression,
|
||||
Offset: lexer.currentPos - 1,
|
||||
}
|
||||
}
|
||||
|
||||
// Checks for a two char token, otherwise matches a single character
|
||||
// token. This is used whenever a two char token overlaps a single
|
||||
// char token, e.g. "||" -> tPipe, "|" -> tOr.
|
||||
func (lexer *Lexer) matchOrElse(first rune, second rune, matchedType tokType, singleCharType tokType) token {
|
||||
start := lexer.currentPos - lexer.lastWidth
|
||||
nextRune := lexer.next()
|
||||
var t token
|
||||
if nextRune == second {
|
||||
t = token{
|
||||
tokenType: matchedType,
|
||||
value: string(first) + string(second),
|
||||
position: start,
|
||||
length: 2,
|
||||
}
|
||||
} else {
|
||||
lexer.back()
|
||||
t = token{
|
||||
tokenType: singleCharType,
|
||||
value: string(first),
|
||||
position: start,
|
||||
length: 1,
|
||||
}
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeLBracket() token {
|
||||
// There's three options here:
|
||||
// 1. A filter expression "[?"
|
||||
// 2. A flatten operator "[]"
|
||||
// 3. A bare rbracket "["
|
||||
start := lexer.currentPos - lexer.lastWidth
|
||||
nextRune := lexer.next()
|
||||
var t token
|
||||
if nextRune == '?' {
|
||||
t = token{
|
||||
tokenType: tFilter,
|
||||
value: "[?",
|
||||
position: start,
|
||||
length: 2,
|
||||
}
|
||||
} else if nextRune == ']' {
|
||||
t = token{
|
||||
tokenType: tFlatten,
|
||||
value: "[]",
|
||||
position: start,
|
||||
length: 2,
|
||||
}
|
||||
} else {
|
||||
t = token{
|
||||
tokenType: tLbracket,
|
||||
value: "[",
|
||||
position: start,
|
||||
length: 1,
|
||||
}
|
||||
lexer.back()
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeQuotedIdentifier() (token, error) {
|
||||
start := lexer.currentPos
|
||||
value, err := lexer.consumeUntil('"')
|
||||
if err != nil {
|
||||
return token{}, err
|
||||
}
|
||||
var decoded string
|
||||
asJSON := []byte("\"" + value + "\"")
|
||||
if err := json.Unmarshal([]byte(asJSON), &decoded); err != nil {
|
||||
return token{}, err
|
||||
}
|
||||
return token{
|
||||
tokenType: tQuotedIdentifier,
|
||||
value: decoded,
|
||||
position: start - 1,
|
||||
length: len(decoded),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeUnquotedIdentifier() token {
|
||||
// Consume runes until we reach the end of an unquoted
|
||||
// identifier.
|
||||
start := lexer.currentPos - lexer.lastWidth
|
||||
for {
|
||||
r := lexer.next()
|
||||
if r < 0 || r > 128 || identifierTrailingBits[uint64(r)/64]&(1<<(uint64(r)%64)) == 0 {
|
||||
lexer.back()
|
||||
break
|
||||
}
|
||||
}
|
||||
value := lexer.expression[start:lexer.currentPos]
|
||||
return token{
|
||||
tokenType: tUnquotedIdentifier,
|
||||
value: value,
|
||||
position: start,
|
||||
length: lexer.currentPos - start,
|
||||
}
|
||||
}
|
||||
|
||||
func (lexer *Lexer) consumeNumber() token {
|
||||
// Consume runes until we reach something that's not a number.
|
||||
start := lexer.currentPos - lexer.lastWidth
|
||||
for {
|
||||
r := lexer.next()
|
||||
if r < '0' || r > '9' {
|
||||
lexer.back()
|
||||
break
|
||||
}
|
||||
}
|
||||
value := lexer.expression[start:lexer.currentPos]
|
||||
return token{
|
||||
tokenType: tNumber,
|
||||
value: value,
|
||||
position: start,
|
||||
length: lexer.currentPos - start,
|
||||
}
|
||||
}
|
||||
603
vendor/github.com/jmespath/go-jmespath/parser.go
generated
vendored
603
vendor/github.com/jmespath/go-jmespath/parser.go
generated
vendored
@@ -1,603 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type astNodeType int
|
||||
|
||||
//go:generate stringer -type astNodeType
|
||||
const (
|
||||
ASTEmpty astNodeType = iota
|
||||
ASTComparator
|
||||
ASTCurrentNode
|
||||
ASTExpRef
|
||||
ASTFunctionExpression
|
||||
ASTField
|
||||
ASTFilterProjection
|
||||
ASTFlatten
|
||||
ASTIdentity
|
||||
ASTIndex
|
||||
ASTIndexExpression
|
||||
ASTKeyValPair
|
||||
ASTLiteral
|
||||
ASTMultiSelectHash
|
||||
ASTMultiSelectList
|
||||
ASTOrExpression
|
||||
ASTAndExpression
|
||||
ASTNotExpression
|
||||
ASTPipe
|
||||
ASTProjection
|
||||
ASTSubexpression
|
||||
ASTSlice
|
||||
ASTValueProjection
|
||||
)
|
||||
|
||||
// ASTNode represents the abstract syntax tree of a JMESPath expression.
|
||||
type ASTNode struct {
|
||||
nodeType astNodeType
|
||||
value interface{}
|
||||
children []ASTNode
|
||||
}
|
||||
|
||||
func (node ASTNode) String() string {
|
||||
return node.PrettyPrint(0)
|
||||
}
|
||||
|
||||
// PrettyPrint will pretty print the parsed AST.
|
||||
// The AST is an implementation detail and this pretty print
|
||||
// function is provided as a convenience method to help with
|
||||
// debugging. You should not rely on its output as the internal
|
||||
// structure of the AST may change at any time.
|
||||
func (node ASTNode) PrettyPrint(indent int) string {
|
||||
spaces := strings.Repeat(" ", indent)
|
||||
output := fmt.Sprintf("%s%s {\n", spaces, node.nodeType)
|
||||
nextIndent := indent + 2
|
||||
if node.value != nil {
|
||||
if converted, ok := node.value.(fmt.Stringer); ok {
|
||||
// Account for things like comparator nodes
|
||||
// that are enums with a String() method.
|
||||
output += fmt.Sprintf("%svalue: %s\n", strings.Repeat(" ", nextIndent), converted.String())
|
||||
} else {
|
||||
output += fmt.Sprintf("%svalue: %#v\n", strings.Repeat(" ", nextIndent), node.value)
|
||||
}
|
||||
}
|
||||
lastIndex := len(node.children)
|
||||
if lastIndex > 0 {
|
||||
output += fmt.Sprintf("%schildren: {\n", strings.Repeat(" ", nextIndent))
|
||||
childIndent := nextIndent + 2
|
||||
for _, elem := range node.children {
|
||||
output += elem.PrettyPrint(childIndent)
|
||||
}
|
||||
}
|
||||
output += fmt.Sprintf("%s}\n", spaces)
|
||||
return output
|
||||
}
|
||||
|
||||
var bindingPowers = map[tokType]int{
|
||||
tEOF: 0,
|
||||
tUnquotedIdentifier: 0,
|
||||
tQuotedIdentifier: 0,
|
||||
tRbracket: 0,
|
||||
tRparen: 0,
|
||||
tComma: 0,
|
||||
tRbrace: 0,
|
||||
tNumber: 0,
|
||||
tCurrent: 0,
|
||||
tExpref: 0,
|
||||
tColon: 0,
|
||||
tPipe: 1,
|
||||
tOr: 2,
|
||||
tAnd: 3,
|
||||
tEQ: 5,
|
||||
tLT: 5,
|
||||
tLTE: 5,
|
||||
tGT: 5,
|
||||
tGTE: 5,
|
||||
tNE: 5,
|
||||
tFlatten: 9,
|
||||
tStar: 20,
|
||||
tFilter: 21,
|
||||
tDot: 40,
|
||||
tNot: 45,
|
||||
tLbrace: 50,
|
||||
tLbracket: 55,
|
||||
tLparen: 60,
|
||||
}
|
||||
|
||||
// Parser holds state about the current expression being parsed.
|
||||
type Parser struct {
|
||||
expression string
|
||||
tokens []token
|
||||
index int
|
||||
}
|
||||
|
||||
// NewParser creates a new JMESPath parser.
|
||||
func NewParser() *Parser {
|
||||
p := Parser{}
|
||||
return &p
|
||||
}
|
||||
|
||||
// Parse will compile a JMESPath expression.
|
||||
func (p *Parser) Parse(expression string) (ASTNode, error) {
|
||||
lexer := NewLexer()
|
||||
p.expression = expression
|
||||
p.index = 0
|
||||
tokens, err := lexer.tokenize(expression)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
p.tokens = tokens
|
||||
parsed, err := p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if p.current() != tEOF {
|
||||
return ASTNode{}, p.syntaxError(fmt.Sprintf(
|
||||
"Unexpected token at the end of the expression: %s", p.current()))
|
||||
}
|
||||
return parsed, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseExpression(bindingPower int) (ASTNode, error) {
|
||||
var err error
|
||||
leftToken := p.lookaheadToken(0)
|
||||
p.advance()
|
||||
leftNode, err := p.nud(leftToken)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
currentToken := p.current()
|
||||
for bindingPower < bindingPowers[currentToken] {
|
||||
p.advance()
|
||||
leftNode, err = p.led(currentToken, leftNode)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
currentToken = p.current()
|
||||
}
|
||||
return leftNode, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseIndexExpression() (ASTNode, error) {
|
||||
if p.lookahead(0) == tColon || p.lookahead(1) == tColon {
|
||||
return p.parseSliceExpression()
|
||||
}
|
||||
indexStr := p.lookaheadToken(0).value
|
||||
parsedInt, err := strconv.Atoi(indexStr)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
indexNode := ASTNode{nodeType: ASTIndex, value: parsedInt}
|
||||
p.advance()
|
||||
if err := p.match(tRbracket); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return indexNode, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseSliceExpression() (ASTNode, error) {
|
||||
parts := []*int{nil, nil, nil}
|
||||
index := 0
|
||||
current := p.current()
|
||||
for current != tRbracket && index < 3 {
|
||||
if current == tColon {
|
||||
index++
|
||||
p.advance()
|
||||
} else if current == tNumber {
|
||||
parsedInt, err := strconv.Atoi(p.lookaheadToken(0).value)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
parts[index] = &parsedInt
|
||||
p.advance()
|
||||
} else {
|
||||
return ASTNode{}, p.syntaxError(
|
||||
"Expected tColon or tNumber" + ", received: " + p.current().String())
|
||||
}
|
||||
current = p.current()
|
||||
}
|
||||
if err := p.match(tRbracket); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTSlice,
|
||||
value: parts,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *Parser) match(tokenType tokType) error {
|
||||
if p.current() == tokenType {
|
||||
p.advance()
|
||||
return nil
|
||||
}
|
||||
return p.syntaxError("Expected " + tokenType.String() + ", received: " + p.current().String())
|
||||
}
|
||||
|
||||
func (p *Parser) led(tokenType tokType, node ASTNode) (ASTNode, error) {
|
||||
switch tokenType {
|
||||
case tDot:
|
||||
if p.current() != tStar {
|
||||
right, err := p.parseDotRHS(bindingPowers[tDot])
|
||||
return ASTNode{
|
||||
nodeType: ASTSubexpression,
|
||||
children: []ASTNode{node, right},
|
||||
}, err
|
||||
}
|
||||
p.advance()
|
||||
right, err := p.parseProjectionRHS(bindingPowers[tDot])
|
||||
return ASTNode{
|
||||
nodeType: ASTValueProjection,
|
||||
children: []ASTNode{node, right},
|
||||
}, err
|
||||
case tPipe:
|
||||
right, err := p.parseExpression(bindingPowers[tPipe])
|
||||
return ASTNode{nodeType: ASTPipe, children: []ASTNode{node, right}}, err
|
||||
case tOr:
|
||||
right, err := p.parseExpression(bindingPowers[tOr])
|
||||
return ASTNode{nodeType: ASTOrExpression, children: []ASTNode{node, right}}, err
|
||||
case tAnd:
|
||||
right, err := p.parseExpression(bindingPowers[tAnd])
|
||||
return ASTNode{nodeType: ASTAndExpression, children: []ASTNode{node, right}}, err
|
||||
case tLparen:
|
||||
name := node.value
|
||||
var args []ASTNode
|
||||
for p.current() != tRparen {
|
||||
expression, err := p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if p.current() == tComma {
|
||||
if err := p.match(tComma); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
}
|
||||
args = append(args, expression)
|
||||
}
|
||||
if err := p.match(tRparen); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTFunctionExpression,
|
||||
value: name,
|
||||
children: args,
|
||||
}, nil
|
||||
case tFilter:
|
||||
return p.parseFilter(node)
|
||||
case tFlatten:
|
||||
left := ASTNode{nodeType: ASTFlatten, children: []ASTNode{node}}
|
||||
right, err := p.parseProjectionRHS(bindingPowers[tFlatten])
|
||||
return ASTNode{
|
||||
nodeType: ASTProjection,
|
||||
children: []ASTNode{left, right},
|
||||
}, err
|
||||
case tEQ, tNE, tGT, tGTE, tLT, tLTE:
|
||||
right, err := p.parseExpression(bindingPowers[tokenType])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTComparator,
|
||||
value: tokenType,
|
||||
children: []ASTNode{node, right},
|
||||
}, nil
|
||||
case tLbracket:
|
||||
tokenType := p.current()
|
||||
var right ASTNode
|
||||
var err error
|
||||
if tokenType == tNumber || tokenType == tColon {
|
||||
right, err = p.parseIndexExpression()
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return p.projectIfSlice(node, right)
|
||||
}
|
||||
// Otherwise this is a projection.
|
||||
if err := p.match(tStar); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if err := p.match(tRbracket); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
right, err = p.parseProjectionRHS(bindingPowers[tStar])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTProjection,
|
||||
children: []ASTNode{node, right},
|
||||
}, nil
|
||||
}
|
||||
return ASTNode{}, p.syntaxError("Unexpected token: " + tokenType.String())
|
||||
}
|
||||
|
||||
func (p *Parser) nud(token token) (ASTNode, error) {
|
||||
switch token.tokenType {
|
||||
case tJSONLiteral:
|
||||
var parsed interface{}
|
||||
err := json.Unmarshal([]byte(token.value), &parsed)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{nodeType: ASTLiteral, value: parsed}, nil
|
||||
case tStringLiteral:
|
||||
return ASTNode{nodeType: ASTLiteral, value: token.value}, nil
|
||||
case tUnquotedIdentifier:
|
||||
return ASTNode{
|
||||
nodeType: ASTField,
|
||||
value: token.value,
|
||||
}, nil
|
||||
case tQuotedIdentifier:
|
||||
node := ASTNode{nodeType: ASTField, value: token.value}
|
||||
if p.current() == tLparen {
|
||||
return ASTNode{}, p.syntaxErrorToken("Can't have quoted identifier as function name.", token)
|
||||
}
|
||||
return node, nil
|
||||
case tStar:
|
||||
left := ASTNode{nodeType: ASTIdentity}
|
||||
var right ASTNode
|
||||
var err error
|
||||
if p.current() == tRbracket {
|
||||
right = ASTNode{nodeType: ASTIdentity}
|
||||
} else {
|
||||
right, err = p.parseProjectionRHS(bindingPowers[tStar])
|
||||
}
|
||||
return ASTNode{nodeType: ASTValueProjection, children: []ASTNode{left, right}}, err
|
||||
case tFilter:
|
||||
return p.parseFilter(ASTNode{nodeType: ASTIdentity})
|
||||
case tLbrace:
|
||||
return p.parseMultiSelectHash()
|
||||
case tFlatten:
|
||||
left := ASTNode{
|
||||
nodeType: ASTFlatten,
|
||||
children: []ASTNode{{nodeType: ASTIdentity}},
|
||||
}
|
||||
right, err := p.parseProjectionRHS(bindingPowers[tFlatten])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{nodeType: ASTProjection, children: []ASTNode{left, right}}, nil
|
||||
case tLbracket:
|
||||
tokenType := p.current()
|
||||
//var right ASTNode
|
||||
if tokenType == tNumber || tokenType == tColon {
|
||||
right, err := p.parseIndexExpression()
|
||||
if err != nil {
|
||||
return ASTNode{}, nil
|
||||
}
|
||||
return p.projectIfSlice(ASTNode{nodeType: ASTIdentity}, right)
|
||||
} else if tokenType == tStar && p.lookahead(1) == tRbracket {
|
||||
p.advance()
|
||||
p.advance()
|
||||
right, err := p.parseProjectionRHS(bindingPowers[tStar])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTProjection,
|
||||
children: []ASTNode{{nodeType: ASTIdentity}, right},
|
||||
}, nil
|
||||
} else {
|
||||
return p.parseMultiSelectList()
|
||||
}
|
||||
case tCurrent:
|
||||
return ASTNode{nodeType: ASTCurrentNode}, nil
|
||||
case tExpref:
|
||||
expression, err := p.parseExpression(bindingPowers[tExpref])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{nodeType: ASTExpRef, children: []ASTNode{expression}}, nil
|
||||
case tNot:
|
||||
expression, err := p.parseExpression(bindingPowers[tNot])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{nodeType: ASTNotExpression, children: []ASTNode{expression}}, nil
|
||||
case tLparen:
|
||||
expression, err := p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if err := p.match(tRparen); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return expression, nil
|
||||
case tEOF:
|
||||
return ASTNode{}, p.syntaxErrorToken("Incomplete expression", token)
|
||||
}
|
||||
|
||||
return ASTNode{}, p.syntaxErrorToken("Invalid token: "+token.tokenType.String(), token)
|
||||
}
|
||||
|
||||
func (p *Parser) parseMultiSelectList() (ASTNode, error) {
|
||||
var expressions []ASTNode
|
||||
for {
|
||||
expression, err := p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
expressions = append(expressions, expression)
|
||||
if p.current() == tRbracket {
|
||||
break
|
||||
}
|
||||
err = p.match(tComma)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
}
|
||||
err := p.match(tRbracket)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTMultiSelectList,
|
||||
children: expressions,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseMultiSelectHash() (ASTNode, error) {
|
||||
var children []ASTNode
|
||||
for {
|
||||
keyToken := p.lookaheadToken(0)
|
||||
if err := p.match(tUnquotedIdentifier); err != nil {
|
||||
if err := p.match(tQuotedIdentifier); err != nil {
|
||||
return ASTNode{}, p.syntaxError("Expected tQuotedIdentifier or tUnquotedIdentifier")
|
||||
}
|
||||
}
|
||||
keyName := keyToken.value
|
||||
err := p.match(tColon)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
value, err := p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
node := ASTNode{
|
||||
nodeType: ASTKeyValPair,
|
||||
value: keyName,
|
||||
children: []ASTNode{value},
|
||||
}
|
||||
children = append(children, node)
|
||||
if p.current() == tComma {
|
||||
err := p.match(tComma)
|
||||
if err != nil {
|
||||
return ASTNode{}, nil
|
||||
}
|
||||
} else if p.current() == tRbrace {
|
||||
err := p.match(tRbrace)
|
||||
if err != nil {
|
||||
return ASTNode{}, nil
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
return ASTNode{
|
||||
nodeType: ASTMultiSelectHash,
|
||||
children: children,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *Parser) projectIfSlice(left ASTNode, right ASTNode) (ASTNode, error) {
|
||||
indexExpr := ASTNode{
|
||||
nodeType: ASTIndexExpression,
|
||||
children: []ASTNode{left, right},
|
||||
}
|
||||
if right.nodeType == ASTSlice {
|
||||
right, err := p.parseProjectionRHS(bindingPowers[tStar])
|
||||
return ASTNode{
|
||||
nodeType: ASTProjection,
|
||||
children: []ASTNode{indexExpr, right},
|
||||
}, err
|
||||
}
|
||||
return indexExpr, nil
|
||||
}
|
||||
func (p *Parser) parseFilter(node ASTNode) (ASTNode, error) {
|
||||
var right, condition ASTNode
|
||||
var err error
|
||||
condition, err = p.parseExpression(0)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if err := p.match(tRbracket); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
if p.current() == tFlatten {
|
||||
right = ASTNode{nodeType: ASTIdentity}
|
||||
} else {
|
||||
right, err = p.parseProjectionRHS(bindingPowers[tFilter])
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
}
|
||||
|
||||
return ASTNode{
|
||||
nodeType: ASTFilterProjection,
|
||||
children: []ASTNode{node, right, condition},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (p *Parser) parseDotRHS(bindingPower int) (ASTNode, error) {
|
||||
lookahead := p.current()
|
||||
if tokensOneOf([]tokType{tQuotedIdentifier, tUnquotedIdentifier, tStar}, lookahead) {
|
||||
return p.parseExpression(bindingPower)
|
||||
} else if lookahead == tLbracket {
|
||||
if err := p.match(tLbracket); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return p.parseMultiSelectList()
|
||||
} else if lookahead == tLbrace {
|
||||
if err := p.match(tLbrace); err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return p.parseMultiSelectHash()
|
||||
}
|
||||
return ASTNode{}, p.syntaxError("Expected identifier, lbracket, or lbrace")
|
||||
}
|
||||
|
||||
func (p *Parser) parseProjectionRHS(bindingPower int) (ASTNode, error) {
|
||||
current := p.current()
|
||||
if bindingPowers[current] < 10 {
|
||||
return ASTNode{nodeType: ASTIdentity}, nil
|
||||
} else if current == tLbracket {
|
||||
return p.parseExpression(bindingPower)
|
||||
} else if current == tFilter {
|
||||
return p.parseExpression(bindingPower)
|
||||
} else if current == tDot {
|
||||
err := p.match(tDot)
|
||||
if err != nil {
|
||||
return ASTNode{}, err
|
||||
}
|
||||
return p.parseDotRHS(bindingPower)
|
||||
} else {
|
||||
return ASTNode{}, p.syntaxError("Error")
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Parser) lookahead(number int) tokType {
|
||||
return p.lookaheadToken(number).tokenType
|
||||
}
|
||||
|
||||
func (p *Parser) current() tokType {
|
||||
return p.lookahead(0)
|
||||
}
|
||||
|
||||
func (p *Parser) lookaheadToken(number int) token {
|
||||
return p.tokens[p.index+number]
|
||||
}
|
||||
|
||||
func (p *Parser) advance() {
|
||||
p.index++
|
||||
}
|
||||
|
||||
func tokensOneOf(elements []tokType, token tokType) bool {
|
||||
for _, elem := range elements {
|
||||
if elem == token {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *Parser) syntaxError(msg string) SyntaxError {
|
||||
return SyntaxError{
|
||||
msg: msg,
|
||||
Expression: p.expression,
|
||||
Offset: p.lookaheadToken(0).position,
|
||||
}
|
||||
}
|
||||
|
||||
// Create a SyntaxError based on the provided token.
|
||||
// This differs from syntaxError() which creates a SyntaxError
|
||||
// based on the current lookahead token.
|
||||
func (p *Parser) syntaxErrorToken(msg string, t token) SyntaxError {
|
||||
return SyntaxError{
|
||||
msg: msg,
|
||||
Expression: p.expression,
|
||||
Offset: t.position,
|
||||
}
|
||||
}
|
||||
16
vendor/github.com/jmespath/go-jmespath/toktype_string.go
generated
vendored
16
vendor/github.com/jmespath/go-jmespath/toktype_string.go
generated
vendored
@@ -1,16 +0,0 @@
|
||||
// generated by stringer -type=tokType; DO NOT EDIT
|
||||
|
||||
package jmespath
|
||||
|
||||
import "fmt"
|
||||
|
||||
const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF"
|
||||
|
||||
var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214}
|
||||
|
||||
func (i tokType) String() string {
|
||||
if i < 0 || i >= tokType(len(_tokType_index)-1) {
|
||||
return fmt.Sprintf("tokType(%d)", i)
|
||||
}
|
||||
return _tokType_name[_tokType_index[i]:_tokType_index[i+1]]
|
||||
}
|
||||
185
vendor/github.com/jmespath/go-jmespath/util.go
generated
vendored
185
vendor/github.com/jmespath/go-jmespath/util.go
generated
vendored
@@ -1,185 +0,0 @@
|
||||
package jmespath
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// IsFalse determines if an object is false based on the JMESPath spec.
|
||||
// JMESPath defines false values to be any of:
|
||||
// - An empty string array, or hash.
|
||||
// - The boolean value false.
|
||||
// - nil
|
||||
func isFalse(value interface{}) bool {
|
||||
switch v := value.(type) {
|
||||
case bool:
|
||||
return !v
|
||||
case []interface{}:
|
||||
return len(v) == 0
|
||||
case map[string]interface{}:
|
||||
return len(v) == 0
|
||||
case string:
|
||||
return len(v) == 0
|
||||
case nil:
|
||||
return true
|
||||
}
|
||||
// Try the reflection cases before returning false.
|
||||
rv := reflect.ValueOf(value)
|
||||
switch rv.Kind() {
|
||||
case reflect.Struct:
|
||||
// A struct type will never be false, even if
|
||||
// all of its values are the zero type.
|
||||
return false
|
||||
case reflect.Slice, reflect.Map:
|
||||
return rv.Len() == 0
|
||||
case reflect.Ptr:
|
||||
if rv.IsNil() {
|
||||
return true
|
||||
}
|
||||
// If it's a pointer type, we'll try to deref the pointer
|
||||
// and evaluate the pointer value for isFalse.
|
||||
element := rv.Elem()
|
||||
return isFalse(element.Interface())
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// ObjsEqual is a generic object equality check.
|
||||
// It will take two arbitrary objects and recursively determine
|
||||
// if they are equal.
|
||||
func objsEqual(left interface{}, right interface{}) bool {
|
||||
return reflect.DeepEqual(left, right)
|
||||
}
|
||||
|
||||
// SliceParam refers to a single part of a slice.
|
||||
// A slice consists of a start, a stop, and a step, similar to
|
||||
// python slices.
|
||||
type sliceParam struct {
|
||||
N int
|
||||
Specified bool
|
||||
}
|
||||
|
||||
// Slice supports [start:stop:step] style slicing that's supported in JMESPath.
|
||||
func slice(slice []interface{}, parts []sliceParam) ([]interface{}, error) {
|
||||
computed, err := computeSliceParams(len(slice), parts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
start, stop, step := computed[0], computed[1], computed[2]
|
||||
result := []interface{}{}
|
||||
if step > 0 {
|
||||
for i := start; i < stop; i += step {
|
||||
result = append(result, slice[i])
|
||||
}
|
||||
} else {
|
||||
for i := start; i > stop; i += step {
|
||||
result = append(result, slice[i])
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func computeSliceParams(length int, parts []sliceParam) ([]int, error) {
|
||||
var start, stop, step int
|
||||
if !parts[2].Specified {
|
||||
step = 1
|
||||
} else if parts[2].N == 0 {
|
||||
return nil, errors.New("Invalid slice, step cannot be 0")
|
||||
} else {
|
||||
step = parts[2].N
|
||||
}
|
||||
var stepValueNegative bool
|
||||
if step < 0 {
|
||||
stepValueNegative = true
|
||||
} else {
|
||||
stepValueNegative = false
|
||||
}
|
||||
|
||||
if !parts[0].Specified {
|
||||
if stepValueNegative {
|
||||
start = length - 1
|
||||
} else {
|
||||
start = 0
|
||||
}
|
||||
} else {
|
||||
start = capSlice(length, parts[0].N, step)
|
||||
}
|
||||
|
||||
if !parts[1].Specified {
|
||||
if stepValueNegative {
|
||||
stop = -1
|
||||
} else {
|
||||
stop = length
|
||||
}
|
||||
} else {
|
||||
stop = capSlice(length, parts[1].N, step)
|
||||
}
|
||||
return []int{start, stop, step}, nil
|
||||
}
|
||||
|
||||
func capSlice(length int, actual int, step int) int {
|
||||
if actual < 0 {
|
||||
actual += length
|
||||
if actual < 0 {
|
||||
if step < 0 {
|
||||
actual = -1
|
||||
} else {
|
||||
actual = 0
|
||||
}
|
||||
}
|
||||
} else if actual >= length {
|
||||
if step < 0 {
|
||||
actual = length - 1
|
||||
} else {
|
||||
actual = length
|
||||
}
|
||||
}
|
||||
return actual
|
||||
}
|
||||
|
||||
// ToArrayNum converts an empty interface type to a slice of float64.
|
||||
// If any element in the array cannot be converted, then nil is returned
|
||||
// along with a second value of false.
|
||||
func toArrayNum(data interface{}) ([]float64, bool) {
|
||||
// Is there a better way to do this with reflect?
|
||||
if d, ok := data.([]interface{}); ok {
|
||||
result := make([]float64, len(d))
|
||||
for i, el := range d {
|
||||
item, ok := el.(float64)
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
result[i] = item
|
||||
}
|
||||
return result, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// ToArrayStr converts an empty interface type to a slice of strings.
|
||||
// If any element in the array cannot be converted, then nil is returned
|
||||
// along with a second value of false. If the input data could be entirely
|
||||
// converted, then the converted data, along with a second value of true,
|
||||
// will be returned.
|
||||
func toArrayStr(data interface{}) ([]string, bool) {
|
||||
// Is there a better way to do this with reflect?
|
||||
if d, ok := data.([]interface{}); ok {
|
||||
result := make([]string, len(d))
|
||||
for i, el := range d {
|
||||
item, ok := el.(string)
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
result[i] = item
|
||||
}
|
||||
return result, true
|
||||
}
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func isSliceType(v interface{}) bool {
|
||||
if v == nil {
|
||||
return false
|
||||
}
|
||||
return reflect.TypeOf(v).Kind() == reflect.Slice
|
||||
}
|
||||
19
vendor/modules.txt
vendored
19
vendor/modules.txt
vendored
@@ -28,8 +28,8 @@ github.com/antlr4-go/antlr/v4
|
||||
# github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
|
||||
## explicit; go 1.13
|
||||
github.com/asaskevich/govalidator
|
||||
# github.com/aws/aws-sdk-go-v2 v1.35.0
|
||||
## explicit; go 1.21
|
||||
# github.com/aws/aws-sdk-go-v2 v1.36.3
|
||||
## explicit; go 1.22
|
||||
github.com/aws/aws-sdk-go-v2/aws
|
||||
github.com/aws/aws-sdk-go-v2/aws/arn
|
||||
github.com/aws/aws-sdk-go-v2/aws/defaults
|
||||
@@ -71,17 +71,17 @@ github.com/aws/aws-sdk-go-v2/credentials/stscreds
|
||||
## explicit; go 1.21
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config
|
||||
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.30
|
||||
## explicit; go 1.21
|
||||
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34
|
||||
## explicit; go 1.22
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources
|
||||
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.30
|
||||
## explicit; go 1.21
|
||||
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34
|
||||
## explicit; go 1.22
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
|
||||
# github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1
|
||||
## explicit; go 1.21
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini
|
||||
# github.com/aws/aws-sdk-go-v2/service/eks v1.57.1
|
||||
## explicit; go 1.21
|
||||
# github.com/aws/aws-sdk-go-v2/service/eks v1.63.1
|
||||
## explicit; go 1.22
|
||||
github.com/aws/aws-sdk-go-v2/service/eks
|
||||
github.com/aws/aws-sdk-go-v2/service/eks/internal/endpoints
|
||||
github.com/aws/aws-sdk-go-v2/service/eks/types
|
||||
@@ -348,9 +348,6 @@ github.com/imdario/mergo
|
||||
# github.com/inconshreveable/mousetrap v1.1.0
|
||||
## explicit; go 1.18
|
||||
github.com/inconshreveable/mousetrap
|
||||
# github.com/jmespath/go-jmespath v0.4.0
|
||||
## explicit; go 1.14
|
||||
github.com/jmespath/go-jmespath
|
||||
# github.com/josharian/intern v1.0.0
|
||||
## explicit; go 1.5
|
||||
github.com/josharian/intern
|
||||
|
||||
Reference in New Issue
Block a user