Allow fallback across default ports

When no port is specified, allow falling back from 443 to 80 when
http is specified along with a TLS configuration.

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2024-05-30 15:57:56 -07:00
parent d4148d94cc
commit 02b6c6939f
4 changed files with 61 additions and 15 deletions

View File

@@ -26,8 +26,9 @@ import (
"path/filepath"
"testing"
"github.com/containerd/containerd/v2/core/remotes/docker"
"github.com/containerd/log/logtest"
"github.com/containerd/containerd/v2/core/remotes/docker"
)
const allCaps = docker.HostCapabilityPull | docker.HostCapabilityResolve | docker.HostCapabilityPush
@@ -361,8 +362,8 @@ func TestHTTPFallback(t *testing.T) {
InsecureSkipVerify: true,
},
},
expectedScheme: "http",
usesFallback: false,
expectedScheme: "https",
usesFallback: true,
},
{
host: "localhost",
@@ -402,8 +403,8 @@ func TestHTTPFallback(t *testing.T) {
InsecureSkipVerify: true,
},
},
expectedScheme: "http",
usesFallback: false,
expectedScheme: "https",
usesFallback: true,
},
{
host: "example.com:5000",