fix(registry): use the https://dhi.io credentials key
Some checks are pending
ci / validate (lint) (push) Waiting to run
ci / validate (relay-lint) (push) Waiting to run
ci / validate (relay-test) (push) Waiting to run
ci / validate (validate-docs) (push) Waiting to run
ci / validate (validate-go-mod) (push) Waiting to run
ci / validate (validate-headers) (push) Waiting to run
ci / validate (validate-mocks) (push) Waiting to run
ci / binary (push) Waiting to run
ci / binary-finalize (push) Blocked by required conditions
ci / bin-image-test (push) Waiting to run
ci / relay-image-test (push) Waiting to run
ci / test (push) Waiting to run
ci / e2e (plugin, oldstable, graphdriver) (push) Waiting to run
ci / e2e (standalone, oldstable, graphdriver) (push) Waiting to run
ci / e2e (plugin, stable, containerd) (push) Waiting to run
ci / e2e (plugin, stable, graphdriver) (push) Waiting to run
ci / e2e (standalone, stable, containerd) (push) Waiting to run
ci / e2e (standalone, stable, graphdriver) (push) Waiting to run
ci / coverage (push) Blocked by required conditions
ci / release (push) Blocked by required conditions
merge / bin-image-prepare (push) Waiting to run
merge / bin-image (push) Blocked by required conditions
merge / relay-image (push) Waiting to run
merge / module-image (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
zizmor / zizmor (push) Waiting to run

Docker Desktop stores Docker Hardened Images credentials under https://dhi.io, so return that as the server address of dhi.io credentials, as StagingIndexServer does for the staging registry.

Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
Alano Terblanche 2026-10-07 11:49:13 +02:00 • committed by Nicolas De loof
parent 81b6b59e79
commit e22de3b574
3 changed files with 5 additions and 3 deletions

View file

@ -104,7 +104,7 @@ func (p *desktopAuthProvider) GetAuthConfig(registryHostname string) (clitypes.A
if session := p.sessionFor(registryHostname); session != nil {
if auth, ok := session.auth(); ok {
if registryHost(registryHostname) == DHIRegistryHost {
auth.ServerAddress = DHIRegistryHost
auth.ServerAddress = DHIIndexServer
}
return auth, nil
}

View file

@ -214,14 +214,14 @@ func TestDesktopAuthProvider_OtherRegistriesUseFallback(t *testing.T) {
}
func TestDesktopAuthProvider_DHIUsesDockerHubSession(t *testing.T) {
for _, host := range []string{DHIRegistryHost, "https://" + DHIRegistryHost, "https://" + DHIRegistryHost + "/"} {
for _, host := range []string{DHIRegistryHost, DHIIndexServer, DHIIndexServer + "/"} {
t.Run(host, func(t *testing.T) {
hub := &fakeHub{session: hubSession("hubuser", testNow.Add(time.Hour))}
p := newTestProvider(hub, nil)
p.signInToStaging()
want := desktopCredentials()
want.ServerAddress = DHIRegistryHost
want.ServerAddress = DHIIndexServer
got, err := p.GetAuthConfig(host)
assert.NilError(t, err)
assert.DeepEqual(t, got, want)

View file

@ -45,6 +45,8 @@ const (
StagingIndexServer = "https://" + StagingRegistryHost + "/"
// DHIRegistryHost is the Docker Hardened Images registry.
DHIRegistryHost = "dhi.io"
// DHIIndexServer is the credentials key for DHIRegistryHost.
DHIIndexServer = "https://" + DHIRegistryHost
)
// GetAuthConfigKey special-cases using the full index address of the official