Skip to content

Commit

Permalink
Remove parts of oc status that depend on oc in node container
Browse files Browse the repository at this point in the history
Will restore in the future. Also reduce logging level on tests below the
unintelligible threshold.
  • Loading branch information
smarterclayton committed May 2, 2018
1 parent cef740e commit 6a60535
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 41 deletions.
34 changes: 0 additions & 34 deletions pkg/oc/bootstrap/docker/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
configapilatest "github.com/openshift/origin/pkg/cmd/server/apis/config/latest"
"github.com/openshift/origin/pkg/oc/bootstrap/docker/dockerhelper"
"github.com/openshift/origin/pkg/oc/bootstrap/docker/errors"
"github.com/openshift/origin/pkg/oc/bootstrap/docker/exec"
"github.com/openshift/origin/pkg/oc/bootstrap/docker/openshift"
"github.com/openshift/origin/pkg/oc/cli/util/clientcmd"
)
Expand Down Expand Up @@ -112,39 +111,6 @@ func (c *ClientStatusConfig) Status(f *clientcmd.Factory, out io.Writer) error {

fmt.Fprint(out, status(container, masterConfig))

notReady := 0

eh := exec.NewExecHelper(dockerClient, openshift.ContainerName)

stdout, _, _ := eh.Command("oc", "get", "dc", "docker-registry", "-n", "default", "-o", "template", "--template", "{{.status.availableReplicas}}").Output()
if stdout != "1" {
fmt.Fprintln(out, "Notice: Docker registry is not yet ready")
notReady++
}

stdout, _, _ = eh.Command("oc", "get", "dc", "router", "-n", "default", "-o", "template", "--template", "{{.status.availableReplicas}}").Output()
if stdout != "1" {
fmt.Fprintln(out, "Notice: Router is not yet ready")
notReady++
}

stdout, _, _ = eh.Command("oc", "get", "job", "persistent-volume-setup", "-n", "default", "-o", "template", "--template", "{{.status.succeeded}}").Output()
if stdout != "1" {
fmt.Fprintln(out, "Notice: Persistent volumes are not yet ready")
notReady++
}

stdout, _, _ = eh.Command("oc", "get", "is", "-n", "openshift", "-o", "template", "--template", `{{range .items}}{{if not .status.tags}}notready{{end}}{{end}}`).Output()
if len(stdout) > 0 {
fmt.Fprintln(out, "Notice: Imagestreams are not yet ready")
notReady++
}

if notReady > 0 {
fmt.Fprintf(out, "\nNotice: %d OpenShift component(s) are not yet ready (see above)\n", notReady)
return fmt.Errorf("")
}

return nil
}

Expand Down
14 changes: 7 additions & 7 deletions test/extended/clusterup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ function os::test::extended::clusterup::noargs () {
os::test::extended::clusterup::standard_test \
--base-dir=${base_dir} \
--tag="$ORIGIN_COMMIT" \
--loglevel=5 \
--loglevel=4 \
${@}
}

# Test the usage of --enable flag
function os::test::extended::clusterup::enable () {
local base_dir
base_dir=$(os::test::extended::clusterup::make_base_dir "enable")
os::cmd::expect_success "oc cluster up --loglevel=5 --base-dir=${base_dir} --tag=${ORIGIN_COMMIT} --enable=* --write-config"
os::cmd::expect_failure_and_text "oc cluster up --loglevel=5 --base-dir=${base_dir} --tag=${ORIGIN_COMMIT} --enable=foo" 'use cluster add instead'
os::cmd::expect_success "oc cluster up --loglevel=4 --base-dir=${base_dir} --tag=${ORIGIN_COMMIT} --enable=* --write-config"
os::cmd::expect_failure_and_text "oc cluster up --loglevel=4 --base-dir=${base_dir} --tag=${ORIGIN_COMMIT} --enable=foo" 'use cluster add instead'
}

# Tests creating a cluster with specific host directories
Expand Down Expand Up @@ -349,19 +349,19 @@ readonly extra_args=(
# Test the previous OCP release
# TODO - enable this once v3.9 ships, v3.7 didn't have a TSB image so it's
# annoying to test.
#"--loglevel=5 --image=registry.access.redhat.com/openshift3/ose --tag=v3.7"
#"--loglevel=4 --image=registry.access.redhat.com/openshift3/ose --tag=v3.7"

# Test the previous origin release
# TODO - enable this once oc cluster up v3.9 supports modifiying cluster
# roles on a 3.7 cluster image (https://github.com/openshift/origin/issues/17867)
# "--loglevel=5 --image=docker.io/openshift/origin --tag=v3.7.0"
# "--loglevel=4 --image=docker.io/openshift/origin --tag=v3.7.0"

# Test the current published release
# disabling this based on irc with clayton. This is more strict than openshift-ansible.
#"--loglevel=5" # can't be empty, so pass something benign
#"--loglevel=4" # can't be empty, so pass something benign

# Test the code being delivered
"--loglevel=5 --server-loglevel=5 --tag=${ORIGIN_COMMIT}"
"--loglevel=4 --server-loglevel=4 --tag=${ORIGIN_COMMIT}"

)
tests=("${1:-"${default_tests[@]}"}")
Expand Down

0 comments on commit 6a60535

Please sign in to comment.