fix: also update github.com/awslabs/amazon-ecr-credential-helper to resolve issues with AWS ECR authentication (#2908)

As mentioned in https://github.com/aws/aws-sdk-go-v2/issues/2370, AWS
SDK for Go v2 releases after 2023/11/15 broke compatibility with all
previous releases.

Resolves #2882

Signed-off-by: Patrick Decat <pdecat@gmail.com>
This commit is contained in:
Patrick Decat
2023-12-15 11:11:02 -08:00
committed by GitHub
parent 8d40aa97d9
commit a946b82f22
97 changed files with 5344 additions and 677 deletions
+5 -8
View File
@@ -1,11 +1,9 @@
package client
import (
"fmt"
"io"
"os"
exec "golang.org/x/sys/execabs"
"os/exec"
)
// Program is an interface to execute external programs.
@@ -31,27 +29,26 @@ func NewShellProgramFuncWithEnv(name string, env *map[string]string) ProgramFunc
func createProgramCmdRedirectErr(commandName string, args []string, env *map[string]string) *exec.Cmd {
programCmd := exec.Command(commandName, args...)
programCmd.Env = os.Environ()
if env != nil {
for k, v := range *env {
programCmd.Env = append(programCmd.Env, fmt.Sprintf("%s=%s", k, v))
programCmd.Env = append(programCmd.Environ(), k+"="+v)
}
}
programCmd.Stderr = os.Stderr
return programCmd
}
// Shell invokes shell commands to talk with a remote credentials helper.
// Shell invokes shell commands to talk with a remote credentials-helper.
type Shell struct {
cmd *exec.Cmd
}
// Output returns responses from the remote credentials helper.
// Output returns responses from the remote credentials-helper.
func (s *Shell) Output() ([]byte, error) {
return s.cmd.Output()
}
// Input sets the input to send to a remote credentials helper.
// Input sets the input to send to a remote credentials-helper.
func (s *Shell) Input(in io.Reader) {
s.cmd.Stdin = in
}