mirror of
https://github.com/containers/podman.git
synced 2025-06-21 09:28:09 +08:00
Merge branch 'registry-2.8' into HEAD
This commit is contained in:
@ -7,7 +7,7 @@ ME=$(basename $0)
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# BEGIN defaults
|
# BEGIN defaults
|
||||||
|
|
||||||
PODMAN_REGISTRY_IMAGE=quay.io/libpod/registry:2.6
|
PODMAN_REGISTRY_IMAGE=quay.io/libpod/registry:2.8
|
||||||
|
|
||||||
PODMAN_REGISTRY_USER=
|
PODMAN_REGISTRY_USER=
|
||||||
PODMAN_REGISTRY_PASS=
|
PODMAN_REGISTRY_PASS=
|
||||||
@ -30,7 +30,7 @@ into a local temporary directory, create an htpasswd, start the
|
|||||||
registry, and dump a series of environment variables to stdout:
|
registry, and dump a series of environment variables to stdout:
|
||||||
|
|
||||||
\$ $ME start
|
\$ $ME start
|
||||||
PODMAN_REGISTRY_IMAGE=\"docker.io/library/registry:2.6\"
|
PODMAN_REGISTRY_IMAGE=\"docker.io/library/registry:2.8\"
|
||||||
PODMAN_REGISTRY_PORT=\"5050\"
|
PODMAN_REGISTRY_PORT=\"5050\"
|
||||||
PODMAN_REGISTRY_USER=\"userZ3RZ\"
|
PODMAN_REGISTRY_USER=\"userZ3RZ\"
|
||||||
PODMAN_REGISTRY_PASS=\"T8JVJzKrcl4p6uT\"
|
PODMAN_REGISTRY_PASS=\"T8JVJzKrcl4p6uT\"
|
||||||
@ -197,13 +197,11 @@ function do_start() {
|
|||||||
|
|
||||||
# Store credentials where container will see them. We can't run
|
# Store credentials where container will see them. We can't run
|
||||||
# this one via must_pass because we need its stdout.
|
# this one via must_pass because we need its stdout.
|
||||||
podman run --rm \
|
htpasswd -Bbn ${PODMAN_REGISTRY_USER} ${PODMAN_REGISTRY_PASS} \
|
||||||
--entrypoint htpasswd ${PODMAN_REGISTRY_IMAGE} \
|
|
||||||
-Bbn ${PODMAN_REGISTRY_USER} ${PODMAN_REGISTRY_PASS} \
|
|
||||||
> $AUTHDIR/htpasswd
|
> $AUTHDIR/htpasswd
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rm -rf ${PODMAN_REGISTRY_WORKDIR}
|
rm -rf ${PODMAN_REGISTRY_WORKDIR}
|
||||||
die "Command failed: podman run [htpasswd]"
|
die "Command failed: htpasswd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In case someone needs to debug
|
# In case someone needs to debug
|
||||||
@ -220,7 +218,7 @@ function do_start() {
|
|||||||
-e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \
|
-e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \
|
||||||
-e "REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt" \
|
-e "REGISTRY_HTTP_TLS_CERTIFICATE=/auth/domain.crt" \
|
||||||
-e "REGISTRY_HTTP_TLS_KEY=/auth/domain.key" \
|
-e "REGISTRY_HTTP_TLS_KEY=/auth/domain.key" \
|
||||||
registry:2.6
|
${PODMAN_REGISTRY_IMAGE}
|
||||||
|
|
||||||
# Confirm that registry started and port is active
|
# Confirm that registry started and port is active
|
||||||
wait_for_port $PODMAN_REGISTRY_PORT
|
wait_for_port $PODMAN_REGISTRY_PORT
|
||||||
|
@ -8,7 +8,7 @@ var (
|
|||||||
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, LABELS_IMAGE, HEALTHCHECK_IMAGE, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:revive,stylecheck
|
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, LABELS_IMAGE, HEALTHCHECK_IMAGE, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:revive,stylecheck
|
||||||
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck
|
NGINX_IMAGE = "quay.io/libpod/alpine_nginx:latest" //nolint:revive,stylecheck
|
||||||
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
|
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
|
||||||
REGISTRY_IMAGE = "quay.io/libpod/registry:2.6" //nolint:revive,stylecheck
|
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8" //nolint:revive,stylecheck
|
||||||
LABELS_IMAGE = "quay.io/libpod/alpine_labels:latest" //nolint:revive,stylecheck
|
LABELS_IMAGE = "quay.io/libpod/alpine_labels:latest" //nolint:revive,stylecheck
|
||||||
UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:revive,stylecheck
|
UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:revive,stylecheck
|
||||||
UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:revive,stylecheck
|
UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:revive,stylecheck
|
||||||
|
@ -8,7 +8,7 @@ var (
|
|||||||
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, LABELS_IMAGE, HEALTHCHECK_IMAGE, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:revive,stylecheck
|
CACHE_IMAGES = []string{ALPINE, BB, fedoraMinimal, NGINX_IMAGE, REDIS_IMAGE, REGISTRY_IMAGE, INFRA_IMAGE, LABELS_IMAGE, HEALTHCHECK_IMAGE, UBI_INIT, UBI_MINIMAL, fedoraToolbox} //nolint:revive,stylecheck
|
||||||
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck
|
NGINX_IMAGE = "quay.io/lsm5/alpine_nginx-aarch64:latest" //nolint:revive,stylecheck
|
||||||
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
|
BB_GLIBC = "docker.io/library/busybox:glibc" //nolint:revive,stylecheck
|
||||||
REGISTRY_IMAGE = "quay.io/libpod/registry:2.6" //nolint:revive,stylecheck
|
REGISTRY_IMAGE = "quay.io/libpod/registry:2.8" //nolint:revive,stylecheck
|
||||||
LABELS_IMAGE = "quay.io/libpod/alpine_labels:latest" //nolint:revive,stylecheck
|
LABELS_IMAGE = "quay.io/libpod/alpine_labels:latest" //nolint:revive,stylecheck
|
||||||
UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:revive,stylecheck
|
UBI_MINIMAL = "registry.access.redhat.com/ubi8-minimal" //nolint:revive,stylecheck
|
||||||
UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:revive,stylecheck
|
UBI_INIT = "registry.access.redhat.com/ubi8-init" //nolint:revive,stylecheck
|
||||||
|
@ -52,15 +52,15 @@ var _ = Describe("Podman login and logout", func() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
session := podmanTest.Podman([]string{"run", "--entrypoint", "htpasswd", "registry:2.6", "-Bbn", "podmantest", "test"})
|
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
htpasswd.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(htpasswd).Should(Exit(0))
|
||||||
|
|
||||||
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
|
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
_, err = f.WriteString(session.OutputToString())
|
_, err = f.WriteString(htpasswd.OutputToString())
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
err = f.Sync()
|
err = f.Sync()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
@ -80,12 +80,12 @@ var _ = Describe("Podman login and logout", func() {
|
|||||||
setup := SystemExec("cp", []string{filepath.Join(certPath, "domain.crt"), filepath.Join(certDirPath, "ca.crt")})
|
setup := SystemExec("cp", []string{filepath.Join(certPath, "domain.crt"), filepath.Join(certDirPath, "ca.crt")})
|
||||||
setup.WaitWithDefaultTimeout()
|
setup.WaitWithDefaultTimeout()
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "-d", "-p", strings.Join([]string{strconv.Itoa(port), strconv.Itoa(port)}, ":"),
|
session := podmanTest.Podman([]string{"run", "-d", "-p", strings.Join([]string{strconv.Itoa(port), strconv.Itoa(port)}, ":"),
|
||||||
"-e", strings.Join([]string{"REGISTRY_HTTP_ADDR=0.0.0.0", strconv.Itoa(port)}, ":"), "--name", "registry", "-v",
|
"-e", strings.Join([]string{"REGISTRY_HTTP_ADDR=0.0.0.0", strconv.Itoa(port)}, ":"), "--name", "registry", "-v",
|
||||||
strings.Join([]string{authPath, "/auth:Z"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
strings.Join([]string{authPath, "/auth:Z"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
||||||
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
||||||
"-v", strings.Join([]string{certPath, "/certs:Z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
"-v", strings.Join([]string{certPath, "/certs:Z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
||||||
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", "registry:2.6"})
|
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", REGISTRY_IMAGE})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ var _ = Describe("Podman login and logout", func() {
|
|||||||
strings.Join([]string{authPath, "/auth:z"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
strings.Join([]string{authPath, "/auth:z"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
||||||
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
||||||
"-v", strings.Join([]string{certPath, "/certs:z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
"-v", strings.Join([]string{certPath, "/certs:z"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
||||||
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", "registry:2.6"})
|
"-e", "REGISTRY_HTTP_TLS_KEY=/certs/domain.key", REGISTRY_IMAGE})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
|
|
||||||
|
@ -167,20 +167,20 @@ var _ = Describe("Podman push", func() {
|
|||||||
}
|
}
|
||||||
lock := GetPortLock("5000")
|
lock := GetPortLock("5000")
|
||||||
defer lock.Unlock()
|
defer lock.Unlock()
|
||||||
session := podmanTest.Podman([]string{"run", "--entrypoint", "htpasswd", REGISTRY_IMAGE, "-Bbn", "podmantest", "test"})
|
htpasswd := SystemExec("htpasswd", []string{"-Bbn", "podmantest", "test"})
|
||||||
session.WaitWithDefaultTimeout()
|
htpasswd.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(htpasswd).Should(Exit(0))
|
||||||
|
|
||||||
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
|
f, err := os.Create(filepath.Join(authPath, "htpasswd"))
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
_, err = f.WriteString(session.OutputToString())
|
_, err = f.WriteString(htpasswd.OutputToString())
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
err = f.Sync()
|
err = f.Sync()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v",
|
session := podmanTest.Podman([]string{"run", "-d", "-p", "5000:5000", "--name", "registry", "-v",
|
||||||
strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
strings.Join([]string{authPath, "/auth"}, ":"), "-e", "REGISTRY_AUTH=htpasswd", "-e",
|
||||||
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm", "-e", "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd",
|
||||||
"-v", strings.Join([]string{certPath, "/certs"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
"-v", strings.Join([]string{certPath, "/certs"}, ":"), "-e", "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt",
|
||||||
|
@ -225,7 +225,7 @@ func (p *PodmanTest) WaitContainerReady(id string, expStr string, timeout int, s
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(s.OutputToString(), expStr) {
|
if strings.Contains(s.OutputToString(), expStr) || strings.Contains(s.ErrorToString(), expStr) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
time.Sleep(time.Duration(step) * time.Second)
|
time.Sleep(time.Duration(step) * time.Second)
|
||||||
|
Reference in New Issue
Block a user