MCPcopy
hub / github.com/minio/minio-go / getEKSPodIdentityCredentials

Function getEKSPodIdentityCredentials

pkg/credentials/iam_aws.go:333–343  ·  view source on GitHub ↗
(client *http.Client, endpoint string, tokenFile string)

Source from the content-addressed store, hash-verified

331}
332
333func getEKSPodIdentityCredentials(client *http.Client, endpoint string, tokenFile string) (ec2RoleCredRespBody, error) {
334 if tokenFile != "" {
335 bytes, err := os.ReadFile(tokenFile)
336 if err != nil {
337 return ec2RoleCredRespBody{}, fmt.Errorf("getEKSPodIdentityCredentials: failed to read token file:%s", err)
338 }
339 token := string(bytes)
340 return getEcsTaskCredentials(client, endpoint, token)
341 }
342 return ec2RoleCredRespBody{}, fmt.Errorf("getEKSPodIdentityCredentials: no tokenFile found")
343}
344
345func fetchIMDSToken(client *http.Client, endpoint string) (string, error) {
346 ctx, cancel := context.WithTimeout(context.Background(), time.Second)

Callers 1

Calls 1

getEcsTaskCredentialsFunction · 0.85

Tested by

no test coverage detected