Skip to content

Commit

Permalink
try fix gitguardian complain
Browse files Browse the repository at this point in the history
  • Loading branch information
skylenet committed Oct 2, 2024
1 parent 2e53e92 commit 41451af
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,25 @@ func WriteStaticConfig(t *testing.T, configContent string) string {
}

func TestGetAuthConfigForRepoPlain(t *testing.T) {
cfg := `
expectedAuth := registry.AuthConfig{

Check failure on line 32 in container-engine-lib/lib/backend_impls/docker/docker_manager/docker_auth_test.go

View workflow job for this annotation

GitHub Actions / golang-lint (container-engine-lib)

Auth, Email, ServerAddress, IdentityToken, RegistryToken are missing in AuthConfig (exhaustruct)
Username: "user",
Password: "password",
}

base64Auth := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", expectedAuth.Username, expectedAuth.Password)))

cfg := fmt.Sprintf(`
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "dXNlcjpwYXNzd29yZA=="
"auth": "%s"
}
}
}
`
}`, base64Auth)

tmpDir := WriteStaticConfig(t, cfg)
defer os.RemoveAll(tmpDir)

expectedAuth := registry.AuthConfig{
Username: "user",
Password: "password",
}
encodedAuth := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", expectedAuth.Username, expectedAuth.Password)))

// Test 1: Retrieve auth config for Docker Hub using docker.io domain
Expand Down

0 comments on commit 41451af

Please sign in to comment.