Skip to content

Commit

Permalink
Reenabled registry dc's liveness probe
Browse files Browse the repository at this point in the history
Reverts 12f4a35

Signed-off-by: Michal Minar <[email protected]>
  • Loading branch information
Michal Minar committed Dec 11, 2015
1 parent c8766b4 commit e3a4cfa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
20 changes: 9 additions & 11 deletions pkg/cmd/admin/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
kclientcmd "k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/runtime"
kutil "k8s.io/kubernetes/pkg/util"

"github.com/openshift/origin/pkg/cmd/util/clientcmd"
"github.com/openshift/origin/pkg/cmd/util/variable"
Expand Down Expand Up @@ -250,19 +251,16 @@ func RunCmdRegistry(f *clientcmd.Factory, cmd *cobra.Command, out io.Writer, cfg
SecurityContext: &kapi.SecurityContext{
Privileged: &mountHost,
},
// TODO reenable the liveness probe when we no longer support the v1 registry.
/*
LivenessProbe: &kapi.Probe{
InitialDelaySeconds: 3,
TimeoutSeconds: 5,
Handler: kapi.Handler{
HTTPGet: &kapi.HTTPGetAction{
Path: "/healthz",
Port: util.NewIntOrStringFromInt(5000),
},
LivenessProbe: &kapi.Probe{
InitialDelaySeconds: 3,
TimeoutSeconds: 5,
Handler: kapi.Handler{
HTTPGet: &kapi.HTTPGetAction{
Path: "/",
Port: kutil.NewIntOrStringFromInt(ports[0].ContainerPort),
},
},
*/
},
},
},
Volumes: []kapi.Volume{
Expand Down
12 changes: 6 additions & 6 deletions pkg/image/prune/imagepruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ type defaultRegistryPinger struct {
}

func (drp *defaultRegistryPinger) ping(registry string) error {
healthzCheck := func(proto, registry string) error {
healthzResponse, err := drp.client.Get(fmt.Sprintf("%s://%s/healthz", proto, registry))
healthCheck := func(proto, registry string) error {
healthResponse, err := drp.client.Get(fmt.Sprintf("%s://%s/", proto, registry))
if err != nil {
return err
}
defer healthzResponse.Body.Close()
defer healthResponse.Body.Close()

if healthzResponse.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected status code %d", healthzResponse.StatusCode)
if healthResponse.StatusCode != http.StatusOK {
return fmt.Errorf("unexpected status code %d", healthResponse.StatusCode)
}

return nil
Expand All @@ -173,7 +173,7 @@ func (drp *defaultRegistryPinger) ping(registry string) error {
var err error
for _, proto := range []string{"https", "http"} {
glog.V(4).Infof("Trying %s for %s", proto, registry)
err = healthzCheck(proto, registry)
err = healthCheck(proto, registry)
if err == nil {
break
}
Expand Down
4 changes: 2 additions & 2 deletions test/old-start-configs/v1.0.0/test-end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ registry="$(dig @${API_HOST} "docker-registry.default.svc.cluster.local." +short
[[ -n "${registry}" && "${registry}:5000" == "${DOCKER_REGISTRY}" ]]

echo "[INFO] Verifying the docker-registry is up at ${DOCKER_REGISTRY}"
wait_for_url_timed "http://${DOCKER_REGISTRY}/healthz" "[INFO] Docker registry says: " $((2*TIME_MIN))
wait_for_url_timed "http://${DOCKER_REGISTRY}/" "[INFO] Docker registry says: " $((2*TIME_MIN))

[ "$(dig @${API_HOST} "docker-registry.default.local." A)" ]

Expand Down Expand Up @@ -404,7 +404,7 @@ oc exec -p ${registry_pod} id | grep 10
# Port forwarding
echo "[INFO] Validating port-forward"
oc port-forward -p ${registry_pod} 5001:5000 &> "${LOG_DIR}/port-forward.log" &
wait_for_url_timed "http://localhost:5001/healthz" "[INFO] Docker registry says: " $((10*TIME_SEC))
wait_for_url_timed "http://localhost:5001/" "[INFO] Docker registry says: " $((10*TIME_SEC))

# UI e2e tests can be found in assets/test/e2e
if [[ "$TEST_ASSETS" == "true" ]]; then
Expand Down

0 comments on commit e3a4cfa

Please sign in to comment.