@@ -214,6 +214,7 @@ func TestEngine_LicenseDockerCfg(t *testing.T) {
214214 DefaultDomains : release.Domains {
215215 ReplicatedAppDomain : "my-app.example.com" ,
216216 ReplicatedRegistryDomain : "registry.my-app.example.com" ,
217+ ProxyRegistryDomain : "proxy.my-app.example.com" ,
217218 },
218219 },
219220 }
@@ -239,7 +240,7 @@ func TestEngine_LicenseDockerCfg(t *testing.T) {
239240 require .True (t , ok , "auths should be a map" )
240241
241242 // Check that both proxy and registry domains are present
242- proxyAuth , ok := auths ["my-app.example.com" ].(map [string ]interface {})
243+ proxyAuth , ok := auths ["proxy. my-app.example.com" ].(map [string ]interface {})
243244 require .True (t , ok , "proxy auth should exist" )
244245 require .Contains (t , proxyAuth , "auth" )
245246
@@ -322,12 +323,8 @@ func TestEngine_LicenseDockerCfgStagingEndpoint(t *testing.T) {
322323 auths , ok := dockercfg ["auths" ].(map [string ]interface {})
323324 require .True (t , ok , "auths should be a map" )
324325
325- // With staging endpoint, should use staging domains:
326- // - Proxy: ReplicatedAppDomain (default: "replicated.app") - not affected by staging
327- // - Registry: ReplicatedRegistryDomain (default: "registry.replicated.com") - not affected by staging
328- // Note: The staging endpoint only affects the getRegistryProxyInfoFromLicense function,
329- // but when there's no release data, utils.GetDomains returns default domains
330- proxyAuth , ok := auths ["replicated.app" ].(map [string ]interface {})
326+ // The (staging) endpoint in license should not affect the domains being used
327+ proxyAuth , ok := auths ["proxy.replicated.com" ].(map [string ]interface {})
331328 require .True (t , ok , "staging proxy auth should exist" )
332329 require .Contains (t , proxyAuth , "auth" )
333330
@@ -364,6 +361,7 @@ func TestEngine_LicenseDockerCfgStagingEndpointWithReleaseData(t *testing.T) {
364361 DefaultDomains : release.Domains {
365362 ReplicatedAppDomain : "staging-app.example.com" ,
366363 ReplicatedRegistryDomain : "staging-registry.example.com" ,
364+ ProxyRegistryDomain : "staging-proxy.example.com" ,
367365 },
368366 },
369367 }
@@ -388,15 +386,15 @@ func TestEngine_LicenseDockerCfgStagingEndpointWithReleaseData(t *testing.T) {
388386 auths , ok := dockercfg ["auths" ].(map [string ]interface {})
389387 require .True (t , ok , "auths should be a map" )
390388
391- // With staging endpoint and release data, should use release data domains :
392- // - Proxy: ReplicatedAppDomain from release data
389+ // Domains should come from release data and not be affected by the staging endpoint in license :
390+ // - Proxy: ProxyRegistryDomain from release data
393391 // - Registry: ReplicatedRegistryDomain from release data
394- proxyAuth , ok := auths ["staging-app .example.com" ].(map [string ]interface {})
395- require .True (t , ok , "staging proxy auth should exist" )
392+ proxyAuth , ok := auths ["staging-proxy .example.com" ].(map [string ]interface {})
393+ require .True (t , ok , "custom staging proxy auth should exist" )
396394 require .Contains (t , proxyAuth , "auth" )
397395
398396 registryAuth , ok := auths ["staging-registry.example.com" ].(map [string ]interface {})
399- require .True (t , ok , "staging registry auth should exist" )
397+ require .True (t , ok , "custom staging registry auth should exist" )
400398 require .Contains (t , registryAuth , "auth" )
401399
402400 // Verify the auth value is base64 encoded license:license
0 commit comments