openshift-metal3 / dev-scripts

Scripts to automate development/test setup for openshift integration with https://github.com/metal3-io/
Apache License 2.0
93 stars 185 forks source link

10_deploy_rook.sh fails with Error: unknown flag: --show-all #599

Closed mcornea closed 5 years ago

mcornea commented 5 years ago

Describe the bug

10_deploy_rook.sh fails with Error: unknown flag: --show-all:


+ source common.sh
+++ go env
++ eval 'GOARCH="amd64"
GOBIN=""
GOCACHE="/home/centos/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/centos/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build666573116=/tmp/go-build -gno-record-gcc-switches"'
+++ GOARCH=amd64
+++ GOBIN=
+++ GOCACHE=/home/centos/.cache/go-build
+++ GOEXE=
+++ GOFLAGS=
+++ GOHOSTARCH=amd64
+++ GOHOSTOS=linux
+++ GOOS=linux
+++ GOPATH=/home/centos/go
+++ GOPROXY=
+++ GORACE=
+++ GOROOT=/usr/lib/golang
+++ GOTMPDIR=
+++ GOTOOLDIR=/usr/lib/golang/pkg/tool/linux_amd64
+++ GCCGO=gccgo
+++ CC=gcc
+++ CXX=g++
+++ CGO_ENABLED=1
+++ GOMOD=
+++ CGO_CFLAGS='-g -O2'
+++ CGO_CPPFLAGS=
+++ CGO_CXXFLAGS='-g -O2'
+++ CGO_FFLAGS='-g -O2'
+++ CGO_LDFLAGS='-g -O2'
+++ PKG_CONFIG=pkg-config
+++ GOGCCFLAGS='-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build666573116=/tmp/go-build -gno-record-gcc-switches'
++++ dirname common.sh
+++ cd .
+++ pwd
++ SCRIPTDIR=/home/centos/dev-scripts
+++ whoami
++ USER=centos
++ '[' -z '' ']'
++ '[' -f /home/centos/dev-scripts/config_centos.sh ']'
++ echo 'Using CONFIG /home/centos/dev-scripts/config_centos.sh'
Using CONFIG /home/centos/dev-scripts/config_centos.sh
++ CONFIG=/home/centos/dev-scripts/config_centos.sh
++ source /home/centos/dev-scripts/config_centos.sh
+++ set +x
+++ BOOTSTRAP_SSH_READY=2500
+++ NODES_PLATFORM=baremetal
+++ INT_IF=eth0
+++ PRO_IF=eth1
+++ EXT_IF=
+++ ROOT_DISK=/dev/sda
+++ NODES_FILE=/home/centos/instackenv.json
+++ MANAGE_BR_BRIDGE=n
+++ NUM_WORKERS=3
+++ CLUSTER_NAME=rhhi-virt-cluster
+++ BASE_DOMAIN=qe.lab.redhat.com
+++ RHCOS_IMAGE_URL=
++ ADDN_DNS=
++ EXT_IF=
++ PRO_IF=eth1
++ MANAGE_BR_BRIDGE=n
++ MANAGE_PRO_BRIDGE=y
++ MANAGE_INT_BRIDGE=y
++ INT_IF=eth0
++ ROOT_DISK_NAME=/dev/sda
++ FILESYSTEM=/
++ WORKING_DIR=/opt/dev-scripts
++ NODES_FILE=/home/centos/instackenv.json
++ NODES_PLATFORM=baremetal
++ MASTER_NODES_FILE=ocp/master_nodes.json
++ export NUM_MASTERS=3
++ NUM_MASTERS=3
++ export NUM_WORKERS=3
++ NUM_WORKERS=3
++ export VM_EXTRADISKS=false
++ VM_EXTRADISKS=false
++ export RHCOS_INSTALLER_IMAGE_URL=https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190520.0/
++ RHCOS_INSTALLER_IMAGE_URL=https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190520.0/
++ export RHCOS_IMAGE_URL=https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190520.0/
++ RHCOS_IMAGE_URL=https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190520.0/
+++ curl https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/ootpa/410.8.20190520.0//meta.json
+++ jq -r .images.openstack.path
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6459  100  6459    0     0   8880      0 --:--:-- --:--:-- --:--:--  8872
++ export RHCOS_IMAGE_FILENAME_OPENSTACK_GZ=rhcos-410.8.20190520.0-openstack.qcow2
++ RHCOS_IMAGE_FILENAME_OPENSTACK_GZ=rhcos-410.8.20190520.0-openstack.qcow2
+++ echo rhcos-410.8.20190520.0-openstack.qcow2
+++ sed -e 's/-openstack.*//'
++ export RHCOS_IMAGE_NAME=rhcos-410.8.20190520.0
++ RHCOS_IMAGE_NAME=rhcos-410.8.20190520.0
++ export RHCOS_IMAGE_FILENAME_OPENSTACK=rhcos-410.8.20190520.0-openstack.qcow2
++ RHCOS_IMAGE_FILENAME_OPENSTACK=rhcos-410.8.20190520.0-openstack.qcow2
++ export RHCOS_IMAGE_FILENAME_COMPRESSED=rhcos-410.8.20190520.0-compressed.qcow2
++ RHCOS_IMAGE_FILENAME_COMPRESSED=rhcos-410.8.20190520.0-compressed.qcow2
++ export RHCOS_IMAGE_FILENAME_LATEST=rhcos-ootpa-latest.qcow2
++ RHCOS_IMAGE_FILENAME_LATEST=rhcos-ootpa-latest.qcow2
++ export IRONIC_IMAGE=quay.io/metal3-io/ironic:master
++ IRONIC_IMAGE=quay.io/metal3-io/ironic:master
++ export IRONIC_INSPECTOR_IMAGE=quay.io/metal3-io/ironic-inspector:master
++ IRONIC_INSPECTOR_IMAGE=quay.io/metal3-io/ironic-inspector:master
++ export IRONIC_DATA_DIR=/opt/dev-scripts/ironic
++ IRONIC_DATA_DIR=/opt/dev-scripts/ironic
++ export KUBECONFIG=/home/centos/dev-scripts/ocp/auth/kubeconfig
++ KUBECONFIG=/home/centos/dev-scripts/ocp/auth/kubeconfig
++ export 'SSH=ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5'
++ SSH='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5'
++ export LIBVIRT_DEFAULT_URI=qemu:///system
++ LIBVIRT_DEFAULT_URI=qemu:///system
++ '[' centos '!=' root -a /run/user/1000 == /run/user/0 ']'
++ sudo -n uptime
+++ tr -d '"'
+++ awk -F= '/^ID=/ { print $2 }' /etc/os-release
++ [[ ! centos =~ ^(centos|rhel)$ ]]
+++ cut -f1 -d.
+++ awk -F= '/^VERSION_ID=/ { print $2 }' /etc/os-release
+++ tr -d '"'
++ [[ 7 -ne 7 ]]
+++ df / --output=fstype
+++ grep -v Type
++ FSTYPE=xfs
++ case ${FSTYPE} in
+++ grep -q ftype=1
+++ xfs_info /
common.sh: line 105: xfs_info: command not found
++ [[ -n '' ]]
++ '[' 3955 = 0 ']'
++ '[' '!' -d /opt/dev-scripts ']'
++ sudo chown centos:centos /opt/dev-scripts
++ chmod 755 /opt/dev-scripts
+ echo 'Deploying rook'
Deploying rook
++ go env
+ eval 'GOARCH="amd64"
GOBIN=""
GOCACHE="/home/centos/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/centos/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build918963057=/tmp/go-build -gno-record-gcc-switches"'
++ GOARCH=amd64
++ GOBIN=
++ GOCACHE=/home/centos/.cache/go-build
++ GOEXE=
++ GOFLAGS=
++ GOHOSTARCH=amd64
++ GOHOSTOS=linux
++ GOOS=linux
++ GOPATH=/home/centos/go
++ GOPROXY=
++ GORACE=
++ GOROOT=/usr/lib/golang
++ GOTMPDIR=
++ GOTOOLDIR=/usr/lib/golang/pkg/tool/linux_amd64
++ GCCGO=gccgo
++ CC=gcc
++ CXX=g++
++ CGO_ENABLED=1
++ GOMOD=
++ CGO_CFLAGS='-g -O2'
++ CGO_CPPFLAGS=
++ CGO_CXXFLAGS='-g -O2'
++ CGO_FFLAGS='-g -O2'
++ CGO_LDFLAGS='-g -O2'
++ PKG_CONFIG=pkg-config
++ GOGCCFLAGS='-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build918963057=/tmp/go-build -gno-record-gcc-switches'
+ ROOK_VERSION=v0.9.0-519.g111610e
+ GIT_VERSION=111610e50f942c84ddc3523b4bf7b57858c19b19
+ export MIXINPATH=/home/centos/go/src/github.com/ceph/ceph-mixins
+ MIXINPATH=/home/centos/go/src/github.com/ceph/ceph-mixins
+ export ROOKPATH=/home/centos/go/src/github.com/rook/rook
+ ROOKPATH=/home/centos/go/src/github.com/rook/rook
+ cd /home/centos/go/src/github.com/rook/rook/cluster/examples/kubernetes/ceph
+ git checkout 111610e50f942c84ddc3523b4bf7b57858c19b19
Note: checking out '111610e50f942c84ddc3523b4bf7b57858c19b19'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 111610e... Merge pull request #3066 from noahdesu/skip-early-orch
+ sed 's/name: rook-ceph$/name: openshift-storage/' common.yaml
+ sed -i 's/namespace: rook-ceph/namespace: openshift-storage/' common-modified.yaml
+ oc create -f common-modified.yaml
namespace/openshift-storage created
customresourcedefinition.apiextensions.k8s.io/cephclusters.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/cephfilesystems.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/cephnfses.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/cephobjectstores.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/cephobjectstoreusers.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/cephblockpools.ceph.rook.io created
customresourcedefinition.apiextensions.k8s.io/volumes.rook.io created
clusterrole.rbac.authorization.k8s.io/rook-ceph-cluster-mgmt created
clusterrole.rbac.authorization.k8s.io/rook-ceph-cluster-mgmt-rules created
role.rbac.authorization.k8s.io/rook-ceph-system created
clusterrole.rbac.authorization.k8s.io/rook-ceph-global created
clusterrole.rbac.authorization.k8s.io/rook-ceph-global-rules created
clusterrole.rbac.authorization.k8s.io/rook-ceph-mgr-cluster created
clusterrole.rbac.authorization.k8s.io/rook-ceph-mgr-cluster-rules created
serviceaccount/rook-ceph-system created
rolebinding.rbac.authorization.k8s.io/rook-ceph-system created
clusterrolebinding.rbac.authorization.k8s.io/rook-ceph-global created
serviceaccount/rook-ceph-osd created
serviceaccount/rook-ceph-mgr created
role.rbac.authorization.k8s.io/rook-ceph-osd created
clusterrole.rbac.authorization.k8s.io/rook-ceph-mgr-system created
clusterrole.rbac.authorization.k8s.io/rook-ceph-mgr-system-rules created
role.rbac.authorization.k8s.io/rook-ceph-mgr created
rolebinding.rbac.authorization.k8s.io/rook-ceph-cluster-mgmt created
rolebinding.rbac.authorization.k8s.io/rook-ceph-osd created
rolebinding.rbac.authorization.k8s.io/rook-ceph-mgr created
rolebinding.rbac.authorization.k8s.io/rook-ceph-mgr-system created
clusterrolebinding.rbac.authorization.k8s.io/rook-ceph-mgr-cluster created
+ oc label namespace openshift-storage openshift.io/cluster-monitoring=true
namespace/openshift-storage labeled
+ oc policy add-role-to-user view system:serviceaccount:openshift-monitoring:prometheus-k8s -n openshift-storage
clusterrole.rbac.authorization.k8s.io/view added: "system:serviceaccount:openshift-monitoring:prometheus-k8s"
+ sed 's/namespace: rook-ceph/namespace: openshift-storage/' operator-openshift.yaml
+ sed -i s/:rook-ceph:/:openshift-storage:/ operator-openshift-modified.yaml
+ sed -i s@rook/ceph:master@rook/ceph:v0.9.0-519.g111610e@ operator-openshift-modified.yaml
+ sed -i '/ROOK_MON_HEALTHCHECK_INTERVAL/!b;n;c\          value: "30s"' operator-openshift-modified.yaml
+ sed -i '/ROOK_MON_OUT_TIMEOUT/!b;n;c\          value: "40s"' operator-openshift-modified.yaml
+ oc create -f operator-openshift-modified.yaml
securitycontextconstraints.security.openshift.io/rook-ceph created
deployment.apps/rook-ceph-operator created
+ sleep 10
+ oc wait --for condition=ready pod -l app=rook-ceph-operator -n openshift-storage --timeout=1200s
pod/rook-ceph-operator-7dc4fb9c9d-hp5p6 condition met
+ oc wait --for condition=ready pod -l app=rook-ceph-agent -n openshift-storage --timeout=1200s
pod/rook-ceph-agent-5ll57 condition met
pod/rook-ceph-agent-dl7tx condition met
pod/rook-ceph-agent-dz5xf condition met
pod/rook-ceph-agent-hprk7 condition met
pod/rook-ceph-agent-mjpb8 condition met
pod/rook-ceph-agent-qtz9d condition met
+ oc wait --for condition=ready pod -l app=rook-discover -n openshift-storage --timeout=1200s
pod/rook-discover-6md59 condition met
pod/rook-discover-7zdpj condition met
pod/rook-discover-dgx8m condition met
pod/rook-discover-hc4c8 condition met
pod/rook-discover-hh29b condition met
pod/rook-discover-wj5n4 condition met
+ sed 's/# port: 8443/port: 8444/' cluster.yaml
+ sed -i 's/namespace: rook-ceph/namespace: openshift-storage/' cluster-modified.yaml
+ sed -i 's/allowUnsupported: false/allowUnsupported: true/' cluster-modified.yaml
+ oc create -f cluster-modified.yaml
cephcluster.ceph.rook.io/rook-ceph created
+ sed 's/namespace: rook-ceph/namespace: openshift-storage/' toolbox.yaml
+ sed -i s@rook/ceph:master@rook/ceph:v0.9.0-519.g111610e@ toolbox-modified.yaml
+ oc create -f toolbox-modified.yaml
deployment.apps/rook-ceph-tools created
+ sleep 10
+ oc wait --for condition=ready pod -l app=rook-ceph-tools -n openshift-storage --timeout=1200s
pod/rook-ceph-tools-795764c774-7scs2 condition met
+ sleep 10
+ oc wait --for condition=ready pod -l app=rook-ceph-mon -n openshift-storage --timeout=1200s
pod/rook-ceph-mon-a-86c495df8d-zcmj6 condition met
++ oc -n openshift-storage get pod --show-all=false -l app=rook-ceph-tools -o 'jsonpath={.items[0].metadata.name}'
Error: unknown flag: --show-all

Usage:
  oc get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]

Examples:
  # List all pods in ps output format.
  oc get pods

  # List all pods in ps output format with more information (such as node name).
  oc get pods -o wide

  # List a single replication controller with specified NAME in ps output format.
  oc get replicationcontroller web

  # List deployments in JSON output format, in the "v1" version of the "apps" API group:
  oc get deployments.v1.apps -o json

  # List a single pod in JSON output format.
  oc get -o json pod web-pod-13je7

  # List a pod identified by type and name specified in "pod.yaml" in JSON output format.
  oc get -f pod.yaml -o json

  # List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.
  oc get -k dir/

  # Return only the phase value of the specified pod.
  oc get -o template pod/web-pod-13je7 --template={{.status.phase}}

  # List resource information in custom columns.
  oc get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image

  # List all replication controllers and services together in ps output format.
  oc get rc,services

  # List one or more resources by their type and names.
  oc get rc/web service/frontend pods/web-pod-13je7

Options:
  -A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
      --allow-missing-template-keys=true: If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
      --chunk-size=500: Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
      --field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.
  -f, --filename=[]: Filename, directory, or URL to files identifying the resource to get from a server.
      --ignore-not-found=false: If the requested object does not exist the command will return exit code 0.
  -k, --kustomize='': Process the kustomization directory. This flag can't be used together with -f or -R.
  -L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...
      --no-headers=false: When using the default or custom-column output format, don't print headers (default print headers).
  -o, --output='': Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].
      --raw='': Raw URI to request from the server.  Uses the transport specified by the kubeconfig file.
  -R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
  -l, --selector='': Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
      --server-print=true: If true, have the server return the appropriate table output. Supports extension APIs and CRDs.
      --show-kind=false: If present, list the resource type for the requested object(s).
      --show-labels=false: When printing, show all labels as the last column (default hide labels column)
      --sort-by='': If non-empty, sort list types using this field specification.  The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
      --template='': Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
  -w, --watch=false: After listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided.
      --watch-only=false: Watch for changes to the requested object(s), without listing/getting first.

Use "oc options" for a list of global command-line options (applies to all commands).

+ oc -n openshift-storage exec -- ceph mgr module enable pg_autoscaler --force
error: expected 'exec POD_NAME COMMAND [ARG1] [ARG2] ... [ARGN]'.
POD_NAME and COMMAND are required arguments for the exec command
See 'oc exec -h' for help and examples

Additional context This was probably introduced after switching the oc client to 4.2

dantrainor commented 5 years ago

Looks like we can just remove --show-all=false, since this appears to have been replaced by --all-namespaces, which defaults to false anyway.