Skip to content

Commit

Permalink
simplify testing types
Browse files Browse the repository at this point in the history
  • Loading branch information
quixoten committed Aug 8, 2024
1 parent 68004ba commit b00e214
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions e2e/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,12 @@ func TestSecretValueInjection(t *testing.T) {
err := cfg.Client().Resources(cfg.Namespace()).Get(ctx, "test-secret-docker-json-key", cfg.Namespace(), &secret)
require.NoError(t, err)

type v1 struct {
type auth struct {
Auth string `json:"auth"`
}

type auths struct {
V1 v1 `json:"https://index.docker.io/v1/"`
}

type dockerconfig struct {
Auths auths `json:"auths"`
Auths map[string]auth `json:"auths"`
}

var dockerconfigjson dockerconfig
Expand All @@ -131,7 +127,7 @@ func TestSecretValueInjection(t *testing.T) {
require.NoError(t, err)

dockerrepoauth := base64.StdEncoding.EncodeToString([]byte("_json_key: {\n \"type\": \"service_account\",\n \"project_id\": \"test\"\n}\n"))
assert.Equal(t, dockerrepoauth, dockerconfigjson.Auths.V1.Auth)
assert.Equal(t, dockerrepoauth, dockerconfigjson.Auths["https://index.docker.io/v1/"].Auth)

return ctx
}).
Expand Down

0 comments on commit b00e214

Please sign in to comment.