Code change:
cmd := exec.CommandContext(ctx, filepath.Join(e.pluginBinDir, e.name), e.args...) cmd.Stdout, cmd.Stderr, cmd.Stdin = stdout, stderr, stdin <del> cmd.Env = []string{} for _, envVar := range e.envVars { cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", envVar.Name, envVar.Value)) </del> <ins> var configEnvVars []string for _, v := range e.envVars { configEnvVars = append(configEnvVars, fmt.Sprintf("%s=%s", v.Name, v.Value)) </ins> } <ins> // Append current system environment variables, to the ones configured in the // credential provider file. Failing to do so may result in unsuccessful execution // of the provider binary, see https://github.com/kubernetes/kubernetes/issues/102750 // also, this behaviour is inline with Credential Provider Config spec cmd.Env = mergeEnvVars(e.environ(), configEnvVars) </ins> err = cmd.Run() if ctx.Err() != nil { return nil, fmt.Errorf("error execing credential provider plugin %s for image %s: %w", e.name, image, ctx.Err())

Related discussion:
text: If it doesn't work out then I'll reach out to you for creds
After several rounds of troubleshooting I was able to get working in my KinD environment. My credential loading setup is <-<-and below is my configuration of credential process Initially, I got the same error as yours, then I couple of custom log lines to print env vars in in directory and I could verify that the env vars specified in the credentials spec were indeed being passed. What I noticed in my KinD setup is that AWS SDK was logging an error because it couldn't find any "providers", though I could verify in the container that file and were indeed present. I altered my env vars section of the as below and it worked for me Apparently, what I noticed is is being passed ONLY the env vars which are present in the spec and everything else was missing! Or at least this is the behaviour in my local cluster setup + KinD cluster. Can you please add and other env vars necessary for the correct execution of AWS SDK and see if it works for you? If this doesn't work, then I'll send you the modified version of the which puts some additional logs to troubleshoot this issue further.
That did it! Thanks for helping me troubleshoot this. I wonder if this is unique to KinD or whether we would see this behavior in a "normal" cluster (i'll test it later). I will tell the developers who wrote the ecr-credential-provider to include an argument to increase the verbosity or to output logs to a file so this is easier to troubleshoot in the future.
What I have observed is, is only passed env vars which are in credential spec and the spec clearly says that the vars in spec are appended to existing env vars and this looks like an issue which needs deeper investigation. Could you please re-open this issue?
sure thing.
The label cannot be applied. Only GitHub organization members can add the label. <detailsIn response to : /triage accepted Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
To me this looks like an issue with the kubelet and I have observed this behaviour with as well as my local cluster. What are your thoughts on this? If this looks like a bug then can you accept the triage? I would fix this.