cli/command: TestRetrieveAuthTokenFromImage: don't decode authconfig

Rewrite the test to not depend on registry.DecodeAuthConfig, which
may be moved internal to the daemon as part of the modules transition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-08-19 12:39:10 +02:00
parent 4c3fa4ac3c
commit ae1727c41e

View File

@ -185,9 +185,9 @@ func TestRetrieveAuthTokenFromImage(t *testing.T) {
imageRef := path.Join(tc.prefix, remoteRef)
actual, err := command.RetrieveAuthTokenFromImage(&cfg, imageRef)
assert.NilError(t, err)
ac, err := registry.DecodeAuthConfig(actual)
expectedAuthCfg, err := registry.EncodeAuthConfig(tc.expectedAuthCfg)
assert.NilError(t, err)
assert.Check(t, is.DeepEqual(*ac, tc.expectedAuthCfg))
assert.Equal(t, actual, expectedAuthCfg)
}
})
}