This code assumes the registry lives in the default namespace:
defaultRegistry := env("OPENSHIFT_DEFAULT_REGISTRY", "${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT}")
svcCache := service.NewServiceResolverCache(c.KubeClient().Services(api.NamespaceDefault).Get)
defaultRegistryFunc, err := svcCache.Defer(defaultRegistry)
if err != nil {
glog.Fatalf("OPENSHIFT_DEFAULT_REGISTRY variable is invalid %q: %v", defaultRegistry, err)
}
The namespace (currently pinned to "default") and service name (currently pulled from env vars, defaulting to "docker-registry") for the default registry should be part of configuration
This code assumes the registry lives in the default namespace:
The namespace (currently pinned to "default") and service name (currently pulled from env vars, defaulting to "docker-registry") for the default registry should be part of configuration