kubevirt/hyperconverged-cluster-operator

Unable to build the hyperconverged-cluster-operator

jcanocan opened this issue · 2 comments

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

/kind bug

What happened:

I'm trying to build the project following this. I'm able to make cluster-up. However, in the make cluster-sync I'm getting the following error:

$ make cluster-sync
./cluster/sync.sh
+ source ./hack/common.sh
++ set -e
++++ dirname './hack/common.sh[0]'
+++ readlink -e ./hack/../
++ PROJECT_ROOT=/home/jcano/Repos/hyperconverged-cluster-operator
++ source /home/jcano/Repos/hyperconverged-cluster-operator/hack/config
+++ KUBEVIRT_VERSION=v0.59.0-alpha.0
+++ CDI_VERSION=v1.55.0
+++ NETWORK_ADDONS_VERSION=v0.80.0
+++ SSP_VERSION=v0.16.1
+++ TTO_VERSION=v0.4.1
+++ HPPO_VERSION=v0.14.0
+++ HPP_VERSION=v0.14.0
+++ HPP_CSI_VERSION=v0.12.0
+++ NODE_DRIVER_REG_VERSION=v2.2.0
+++ LIVENESS_PROBE_VERSION=v2.3.0
+++ CSI_SNAPSHOT_VERSION=v4.2.1
+++ CSI_SIG_STORAGE_PROVISIONER_VERSION=v2.2.1
+++ KUBE_RBAC_PROXY_VERSION=4.10
+++ KUBEVIRT_CONSOLE_PLUGIN_VERSION=v4.12.0-3
+++ CONTAINER_REGISTRY=quay.io/kubevirt
+++ RELEASE_DELTA=0
+++ PACKAGE_DIR=./deploy/olm-catalog/community-kubevirt-hyperconverged
++++ sort -rV
++++ ls -d ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.1/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.2/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.3/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.0.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.1.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.2.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.3.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.4.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.5.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.7.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.8.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.9.0/
++++ awk NR==1
++++ cut -d / -f 5
+++ CSV_VERSION=1.9.0
++++ sort -rV
++++ ls -d ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.1/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.2/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.3/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.0.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.1.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.2.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.3.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.4.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.5.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.7.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.8.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.9.0/
++++ awk NR==2
++++ cut -d / -f 5
+++ REPLACES_CSV_VERSION=1.8.0
++ source cluster/kubevirtci.sh
+++ export KUBEVIRT_PROVIDER=k8s-1.23
+++ KUBEVIRT_PROVIDER=k8s-1.23
++++ curl -L -Ss https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirtci/latest
+++ export KUBEVIRTCI_TAG=2211212125-021efaa
+++ KUBEVIRTCI_TAG=2211212125-021efaa
+++ KUBEVIRTCI_PATH=/home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ CDI_OPERATOR_URL=https://github.com/kubevirt/containerized-data-importer/releases/download/v1.55.0/cdi-operator.yaml
++ KUBEVIRT_OPERATOR_URL=https://github.com/kubevirt/kubevirt/releases/download/v0.59.0-alpha.0/kubevirt-operator.yaml
++ SSP_OPERATOR_URL=https://github.com/kubevirt/ssp-operator/releases/download/v0.16.1/ssp-operator.yaml
++ TTO_OPERATOR_URL=https://github.com/kubevirt/tekton-tasks-operator/releases/download/v0.4.1/tekton-tasks-operator.yaml
++ CNA_URL_PREFIX=https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.80.0
++ mem_size=5120M
++ num_nodes=1
++ KUBEVIRT_PROVIDER=k8s-1.23
++ BASE_PATH=/home/jcano/Repos/hyperconverged-cluster-operator
+++ kubevirtci::path
+++ echo -n /home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ KUBEVIRTCI_PATH=/home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ CMD=
++ KUBECTL=
++ TEST_OUT_PATH=tests/func-tests/_out
++ JOB_TYPE=
+++ which kubectl
++ KUBECTL=/snap/bin/kubectl
++ '[' -z '' ']'
++ '[' -z /snap/bin/kubectl ']'
++ CMD=kubectl
+ container_command=podman
++ podman ps
++ grep -Po '(?<=0.0.0.0:)\d+(?=->5000\/tcp)'
++ echo ''
+ registry_port=
+ '[' -z '' ']'
+ container_command=docker
++ docker ps
++ grep -Po '(?<=0.0.0.0:)\d+(?=->5000\/tcp)'
+ registry_port=
make: *** [Makefile:133: cluster-sync] Error 1

I also tried with sudo make cluster-sync and I got a different error:

$ sudo make cluster-sync
./cluster/sync.sh
+ source ./hack/common.sh
++ set -e
++++ dirname './hack/common.sh[0]'
+++ readlink -e ./hack/../
++ PROJECT_ROOT=/home/jcano/Repos/hyperconverged-cluster-operator
++ source /home/jcano/Repos/hyperconverged-cluster-operator/hack/config
+++ KUBEVIRT_VERSION=v0.59.0-alpha.0
+++ CDI_VERSION=v1.55.0
+++ NETWORK_ADDONS_VERSION=v0.80.0
+++ SSP_VERSION=v0.16.1
+++ TTO_VERSION=v0.4.1
+++ HPPO_VERSION=v0.14.0
+++ HPP_VERSION=v0.14.0
+++ HPP_CSI_VERSION=v0.12.0
+++ NODE_DRIVER_REG_VERSION=v2.2.0
+++ LIVENESS_PROBE_VERSION=v2.3.0
+++ CSI_SNAPSHOT_VERSION=v4.2.1
+++ CSI_SIG_STORAGE_PROVISIONER_VERSION=v2.2.1
+++ KUBE_RBAC_PROXY_VERSION=4.10
+++ KUBEVIRT_CONSOLE_PLUGIN_VERSION=v4.12.0-3
+++ CONTAINER_REGISTRY=quay.io/kubevirt
+++ RELEASE_DELTA=0
+++ PACKAGE_DIR=./deploy/olm-catalog/community-kubevirt-hyperconverged
++++ sort -rV
++++ ls -d ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.1/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.2/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.3/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.0.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.1.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.2.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.3.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.4.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.5.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.7.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.8.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.9.0/
++++ awk NR==1
++++ cut -d / -f 5
+++ CSV_VERSION=1.9.0
++++ sort -rV
++++ ls -d ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.1/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.2/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/0.0.3/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.0.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.1.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.2.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.3.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.4.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.5.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.6.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.7.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.8.0/ ./deploy/olm-catalog/community-kubevirt-hyperconverged/1.9.0/
++++ awk NR==2
++++ cut -d / -f 5
+++ REPLACES_CSV_VERSION=1.8.0
++ source cluster/kubevirtci.sh
+++ export KUBEVIRT_PROVIDER=k8s-1.23
+++ KUBEVIRT_PROVIDER=k8s-1.23
++++ curl -L -Ss https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirtci/latest
+++ export KUBEVIRTCI_TAG=2211212125-021efaa
+++ KUBEVIRTCI_TAG=2211212125-021efaa
+++ KUBEVIRTCI_PATH=/home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ CDI_OPERATOR_URL=https://github.com/kubevirt/containerized-data-importer/releases/download/v1.55.0/cdi-operator.yaml
++ KUBEVIRT_OPERATOR_URL=https://github.com/kubevirt/kubevirt/releases/download/v0.59.0-alpha.0/kubevirt-operator.yaml
++ SSP_OPERATOR_URL=https://github.com/kubevirt/ssp-operator/releases/download/v0.16.1/ssp-operator.yaml
++ TTO_OPERATOR_URL=https://github.com/kubevirt/tekton-tasks-operator/releases/download/v0.4.1/tekton-tasks-operator.yaml
++ CNA_URL_PREFIX=https://github.com/kubevirt/cluster-network-addons-operator/releases/download/v0.80.0
++ mem_size=5120M
++ num_nodes=1
++ KUBEVIRT_PROVIDER=k8s-1.23
++ BASE_PATH=/home/jcano/Repos/hyperconverged-cluster-operator
+++ kubevirtci::path
+++ echo -n /home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ KUBEVIRTCI_PATH=/home/jcano/Repos/hyperconverged-cluster-operator/_kubevirtci
++ CMD=
++ KUBECTL=
++ TEST_OUT_PATH=tests/func-tests/_out
++ JOB_TYPE=
+++ which kubectl
++ KUBECTL=/snap/bin/kubectl
++ '[' -z '' ']'
++ '[' -z /snap/bin/kubectl ']'
++ CMD=kubectl
+ container_command=podman
++ podman ps
++ grep -Po '(?<=0.0.0.0:)\d+(?=->5000\/tcp)'
+ registry_port='39351
39351
39351'
+ '[' -z '39351
39351
39351' ']'
+ registry='localhost:39351
39351
39351'
+ rm -rf _out/
+ cp -r deploy _out/
+ sed -r -i 's|: quay.io/kubevirt/hyperconverged-cluster-operator(@sha256)?:.*$|: registry:5000/kubevirt/hyperconverged-cluster-operator:latest|g' _out/operator.yaml
+ sed -r -i 's|: quay.io/kubevirt/hyperconverged-cluster-webhook(@sha256)?:.*$|: registry:5000/kubevirt/hyperconverged-cluster-webhook:latest|g' _out/operator.yaml
+ CMD=./cluster/kubectl.sh
+ ./hack/clean.sh
selecting podman as container runtime
error: unable to recognize "_out/hco.cr.yaml": no matches for kind "HyperConverged" in version "hco.kubevirt.io/v1beta1"
selecting podman as container runtime
error: the server doesn't have a resource type "hyperconverged"
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
unable to recognize "_out/webhooks.yaml": no matches for kind "Issuer" in version "cert-manager.io/v1"
unable to recognize "_out/webhooks.yaml": no matches for kind "Certificate" in version "cert-manager.io/v1"
unable to recognize "_out/webhooks.yaml": no matches for kind "Certificate" in version "cert-manager.io/v1"
unable to recognize "_out/webhooks.yaml": no matches for kind "Certificate" in version "cert-manager.io/v1"
unable to recognize "_out/webhooks.yaml": no matches for kind "Certificate" in version "cert-manager.io/v1"
selecting podman as container runtime
warning: deleting cluster-scoped resources, not scoped to the provided namespace
selecting podman as container runtime
selecting podman as container runtime
warning: deleting cluster-scoped resources, not scoped to the provided namespace
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
selecting podman as container runtime
+ IMAGE_REGISTRY='localhost:39351
39351
39351'
+ make container-build-operator container-push-operator container-build-webhook container-push-webhook
make[1]: se entra en el directorio '/home/jcano/Repos/hyperconverged-cluster-operator'
. "hack/cri-bin.sh" && $CRI_BIN build -f build/Dockerfile -t localhost:39351
+ podman ps
+ _cri_bin=podman
+ _cri_insecure=--tls-verify=false
+ echo selecting podman as container runtime
selecting podman as container runtime
+ CRI_BIN=podman
+ CRI_INSECURE=--tls-verify=false
+ podman build -f build/Dockerfile -t localhost:39351
[1/2] STEP 1/4: FROM docker.io/golang:1.19.2 AS builder
[1/2] STEP 2/4: WORKDIR /go/src/github.com/kubevirt/hyperconverged-cluster-operator/
--> Using cache 094ffcbf672eac3552e28b20a6f10ed2acba646c519ee5026fd32e3e511af09c
--> 094ffcbf672
[1/2] STEP 3/4: COPY . .
--> Using cache 8c3810ba18811be4202c68e84152987da0d3c06c3e47de6d6020a38a0e01c14d
--> 8c3810ba188
[1/2] STEP 4/4: RUN make build-operator build-csv-merger
make: *** No rule to make target 'build-operator'.  Stop.
[2/2] STEP 1/11: FROM quay.io/centos/centos:stream8
Error: error building at STEP "RUN make build-operator build-csv-merger": error while running runtime: exit status 2
make[1]: *** [Makefile:92: container-build-operator] Error 125
make[1]: exiting directory '/home/jcano/Repos/hyperconverged-cluster-operator'
make: *** [Makefile:133: cluster-sync] Error 2

In order to discard that the image is causing the problem, I replaced it with quay.io/centos/centos:stream8. Nevertheless, I got the same error.

Thanks in advance!

What you expected to happen:
Having a working k8s cluster with the hyperconverged-cluser-operator deployed.

How to reproduce it (as minimally and precisely as possible):
I followed the steps described here.

Anything else we need to know?:

Environment:

  • HCO version (use oc get csv -n kubevirt-hyperconverged):
  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration:
  • Install tools:
  • Others: podman 3.4.2
  • SO: Kubuntu 20.04

@nunnatsa can you please take a look?

We have spotted the issue here. Basically line 7 and line 12 get more than one output. Something similar to:

sudo podman ps | grep -Po '(?<=0.0.0.0:)\d+(?=->5000\/tcp)' 
38791
38791
38791

This breaks the following command during the make cluster-sync process:

podman build -f build/Dockerfile -t localhost:39351

which should be something similar to:

podman build -f build/Dockerfile -t localhost:38791/kubevirt/hyperconverged-cluster-operator:latest --build-arg git_sha=a29c0fa4ee454de6e87de5904b0f093785403557-dirty .

I will post a PR fixing this ASAP.

Many thanks to @0xFelix and @tiraboschi for the help! 😊