diff --git a/pkg/dockerregistry/middleware/repository/openshift.go b/pkg/dockerregistry/middleware/repository/openshift.go index 93519fa67d00..df4f160098c1 100644 --- a/pkg/dockerregistry/middleware/repository/openshift.go +++ b/pkg/dockerregistry/middleware/repository/openshift.go @@ -47,7 +47,7 @@ func newRepository(repo distribution.Repository, options map[string]interface{}) return nil, errors.New("REGISTRY_URL is required") } - insecure := len(os.Getenv("OPENSHIFT_INSECURE")) > 0 + insecure := os.Getenv("OPENSHIFT_INSECURE") == "true" var tlsClientConfig kclient.TLSClientConfig if !insecure { caData := os.Getenv("OPENSHIFT_CA_DATA") diff --git a/test/integration/v2_docker_registry_test.go b/test/integration/v2_docker_registry_test.go index 498bb71f9f14..46e48d4858e5 100644 --- a/test/integration/v2_docker_registry_test.go +++ b/test/integration/v2_docker_registry_test.go @@ -88,7 +88,7 @@ middleware: - name: openshift ` - os.Setenv("OPENSHIFT_INSECURE", "1") + os.Setenv("OPENSHIFT_INSECURE", "true") os.Setenv("OPENSHIFT_MASTER", openshift.Server.URL) os.Setenv("REGISTRY_URL", "127.0.0.1:5000")