Skip to content

Commit

Permalink
[release 1.10] Fix community CSV (#2804)
Browse files Browse the repository at this point in the history
* Allow running in community hub CI

The community hub CI is trying to install HCO at namespace named
community-kubevirt-hyperconverged. This is not allowed by the operator
code.

This PR adds this namespace to the allowed namesapce list.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

* Handle the kubevirt-template-validator image in CSV

The kubevirt-template-validator was missing in the related-image list in
the CSV. Also, it was listed with tag instead of with digest, in the SSP
deployment.

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

* add missing annotations to the csv

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

* set kvci tag to the last working one, 2401211710-a250111

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>

---------

Signed-off-by: Nahshon Unna-Tsameret <[email protected]>
  • Loading branch information
nunnatsa authored Feb 9, 2024
1 parent ed5f470 commit 5384bbb
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cluster/kubevirtci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

export KUBEVIRT_PROVIDER=${KUBEVIRT_PROVIDER:-'k8s-1.26-centos9'}
export KUBEVIRTCI_TAG=$(curl -L -Ss https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirtci/latest)
export KUBEVIRTCI_TAG=2401211710-a250111
KUBEVIRTCI_PATH="${PWD}/_kubevirtci"
KUBEVIRTCI_REPO='https://github.com/kubevirt/kubevirtci.git'

Expand Down
17 changes: 16 additions & 1 deletion cmd/cmdcommon/cmdcommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)

// list of namespace allowed for HCO installations (for tests)
const (
operatorTestNamespace = "test-operators"
operatorHubNamespace = "operators"
communityHubNamespace = "community-kubevirt-hyperconverged"
communityHubTargetNamespace = "community-kubevirt-hyperconverged-target"
)

type HcCmdHelper struct {
Logger logr.Logger
runInLocal bool
Expand Down Expand Up @@ -139,7 +147,14 @@ func (h HcCmdHelper) checkNameSpace() {

// Allowing the operator to be deployed in OperatorTestNamespace, in addition to OPERATOR_NAMESPACE env var,
// to unblock its publish in OperatorHub.io
nsAllowList := []string{requiredNS, hcoutil.OperatorTestNamespace, hcoutil.OperatorHubNamespace}
nsAllowList := []string{
requiredNS,
operatorTestNamespace,
operatorHubNamespace,
communityHubNamespace,
communityHubTargetNamespace,
}

if !StringInSlice(actualNS, nsAllowList) {
err := fmt.Errorf("%s is running in different namespace than expected", h.Name)
msg := fmt.Sprintf("Please re-deploy this %s into %v namespace", h.Name, requiredNS)
Expand Down
1 change: 1 addition & 0 deletions deploy/images.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ KUBEVIRT_EXPORTPROXY_IMAGE,quay.io/kubevirt/virt-exportproxy,KUBEVIRT_VERSION,f1
KUBEVIRT_EXPORSERVER_IMAGE,quay.io/kubevirt/virt-exportserver,KUBEVIRT_VERSION,73311f79a9c71007f8572b3cc40cd6f6da404c7ef0a9c6509fb717d979546582
CNA_OPERATOR_IMAGE,quay.io/kubevirt/cluster-network-addons-operator,NETWORK_ADDONS_VERSION,f64ab5981d9ddef1662dd0a05888783f5dbadda8ede596585ba80bfc97a0f51e
SSP_OPERATOR_IMAGE,quay.io/kubevirt/ssp-operator,SSP_VERSION,49cac00844f091d6e80301573e00235d685415185ec29c89b4bd7361f938711e
SSP_VALIDATOR_IMAGE,quay.io/kubevirt/kubevirt-template-validator,SSP_VERSION,a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
CDI_OPERATOR_IMAGE,quay.io/kubevirt/cdi-operator,CDI_VERSION,6c63521d835578b0fbb77d3145b648f95ab0932d5d1b36ff2068ed8fcd91bc5a
CDI_CONTROLLER_IMAGE,quay.io/kubevirt/cdi-controller,CDI_VERSION,27c47883a08226f83757971d3adafb0cd9bcb26e58fbcf7208236070e0adf37e
CDI_APISERVER_IMAGE,quay.io/kubevirt/cdi-apiserver,CDI_VERSION,e9e39408413b1478d2e98eba68913f9e20c93000558b190b47de73bdfd1d9ac4
Expand Down
2 changes: 2 additions & 0 deletions deploy/images.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ KUBEVIRT_EXPORTPROXY_IMAGE=quay.io/kubevirt/virt-exportproxy@sha256:f14444b0200a
KUBEVIRT_EXPORSERVER_IMAGE=quay.io/kubevirt/virt-exportserver@sha256:73311f79a9c71007f8572b3cc40cd6f6da404c7ef0a9c6509fb717d979546582
CNA_OPERATOR_IMAGE=quay.io/kubevirt/cluster-network-addons-operator@sha256:f64ab5981d9ddef1662dd0a05888783f5dbadda8ede596585ba80bfc97a0f51e
SSP_OPERATOR_IMAGE=quay.io/kubevirt/ssp-operator@sha256:49cac00844f091d6e80301573e00235d685415185ec29c89b4bd7361f938711e
SSP_VALIDATOR_IMAGE=quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
CDI_OPERATOR_IMAGE=quay.io/kubevirt/cdi-operator@sha256:6c63521d835578b0fbb77d3145b648f95ab0932d5d1b36ff2068ed8fcd91bc5a
CDI_CONTROLLER_IMAGE=quay.io/kubevirt/cdi-controller@sha256:27c47883a08226f83757971d3adafb0cd9bcb26e58fbcf7208236070e0adf37e
CDI_APISERVER_IMAGE=quay.io/kubevirt/cdi-apiserver@sha256:e9e39408413b1478d2e98eba68913f9e20c93000558b190b47de73bdfd1d9ac4
Expand Down Expand Up @@ -40,6 +41,7 @@ DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/virt-exportproxy@sha256:f14444b0200
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/virt-exportserver@sha256:73311f79a9c71007f8572b3cc40cd6f6da404c7ef0a9c6509fb717d979546582"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/cluster-network-addons-operator@sha256:f64ab5981d9ddef1662dd0a05888783f5dbadda8ede596585ba80bfc97a0f51e"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/ssp-operator@sha256:49cac00844f091d6e80301573e00235d685415185ec29c89b4bd7361f938711e"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/cdi-operator@sha256:6c63521d835578b0fbb77d3145b648f95ab0932d5d1b36ff2068ed8fcd91bc5a"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/cdi-controller@sha256:27c47883a08226f83757971d3adafb0cd9bcb26e58fbcf7208236070e0adf37e"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/cdi-apiserver@sha256:e9e39408413b1478d2e98eba68913f9e20c93000558b190b47de73bdfd1d9ac4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ metadata:
createdAt: "2020-10-23 08:58:25"
description: A unified operator deploying and controlling KubeVirt and its supporting
operators with opinionated defaults
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "true"
features.operators.openshift.io/csi: "true"
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "false"
features.operators.openshift.io/proxy-aware: "true"
features.operators.openshift.io/tls-profiles: "true"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
operatorframework.io/initialization-resource: '{"apiVersion":"hco.kubevirt.io/v1beta1","kind":"HyperConverged","metadata":{"annotations":{"deployOVS":"false"},"name":"kubevirt-hyperconverged","namespace":"kubevirt-hyperconverged"},"spec":{}}'
operatorframework.io/suggested-namespace: kubevirt-hyperconverged
operators.openshift.io/infrastructure-features: '["disconnected","proxy-aware"]'
Expand Down Expand Up @@ -3491,7 +3501,7 @@ spec:
- /manager
env:
- name: VALIDATOR_IMAGE
value: quay.io/kubevirt/kubevirt-template-validator:v0.18.3
value: quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
- name: VIRTIO_IMG
- name: OPERATOR_VERSION
value: v0.18.3
Expand Down Expand Up @@ -4342,6 +4352,8 @@ spec:
name: kubevirt-apiserver-proxy
- image: quay.io/kubevirt-ui/kubevirt-plugin@sha256:e79027973b09aac75860f267c7d7f830599978c38a081001f404b9a1c3d2990f
name: kubevirt-plugin
- image: quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
name: kubevirt-template-validator
- image: quay.io/kubevirt/libguestfs-tools@sha256:b7e248be783691daad1326cf41641d5042be80c5c057ebc5315ca7a1619b0581
name: libguestfs-tools
- image: registry.k8s.io/sig-storage/livenessprobe@sha256:4dc0b87ccd69f9865b89234d8555d3a614ab0a16ed94a3016ffd27f8106132ce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@ metadata:
certified: "false"
console.openshift.io/disable-operand-delete: "true"
containerImage: quay.io/kubevirt/hyperconverged-cluster-operator:1.10.7-unstable
createdAt: "2024-01-28 07:58:00"
createdAt: "2024-02-08 15:51:32"
description: A unified operator deploying and controlling KubeVirt and its supporting
operators with opinionated defaults
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "true"
features.operators.openshift.io/csi: "true"
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "false"
features.operators.openshift.io/proxy-aware: "true"
features.operators.openshift.io/tls-profiles: "true"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
operatorframework.io/initialization-resource: '{"apiVersion":"hco.kubevirt.io/v1beta1","kind":"HyperConverged","metadata":{"annotations":{"deployOVS":"false"},"name":"kubevirt-hyperconverged","namespace":"kubevirt-hyperconverged"},"spec":{}}'
operatorframework.io/suggested-namespace: kubevirt-hyperconverged
operators.openshift.io/infrastructure-features: '["disconnected","proxy-aware"]'
Expand Down Expand Up @@ -3491,7 +3501,7 @@ spec:
- /manager
env:
- name: VALIDATOR_IMAGE
value: quay.io/kubevirt/kubevirt-template-validator:v0.18.3
value: quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
- name: VIRTIO_IMG
- name: OPERATOR_VERSION
value: v0.18.3
Expand Down Expand Up @@ -4342,6 +4352,8 @@ spec:
name: kubevirt-apiserver-proxy
- image: quay.io/kubevirt-ui/kubevirt-plugin@sha256:e79027973b09aac75860f267c7d7f830599978c38a081001f404b9a1c3d2990f
name: kubevirt-plugin
- image: quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
name: kubevirt-template-validator
- image: quay.io/kubevirt/libguestfs-tools@sha256:b7e248be783691daad1326cf41641d5042be80c5c057ebc5315ca7a1619b0581
name: libguestfs-tools
- image: registry.k8s.io/sig-storage/livenessprobe@sha256:4dc0b87ccd69f9865b89234d8555d3a614ab0a16ed94a3016ffd27f8106132ce
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ spec:
- /manager
env:
- name: VALIDATOR_IMAGE
value: quay.io/kubevirt/kubevirt-template-validator:v0.18.3
value: quay.io/kubevirt/kubevirt-template-validator@sha256:a148b6e812b70f326b48d0439b1e44a967a6e1f8cf2f98b1a08e9294a93674eb
- name: VIRTIO_IMG
- name: OPERATOR_VERSION
value: v0.18.3
Expand Down
1 change: 1 addition & 0 deletions hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function create_ssp_csv() {
--csv-version=${CSV_VERSION} \
--operator-image=${SSP_OPERATOR_IMAGE} \
--operator-version=${SSP_VERSION} \
--validator-image=${SSP_VALIDATOR_IMAGE} \
"

gen_csv ${SSP_CSV_GENERATOR} ${operatorName} "${SSP_OPERATOR_IMAGE}" ${dumpCRDsArg} ${operatorArgs}
Expand Down
16 changes: 13 additions & 3 deletions pkg/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,19 @@ func GetCSVBase(params *CSVBaseParams) *csvv1alpha1.ClusterServiceVersion {
"description": params.MetaDescription,
"repository": "https://github.com/kubevirt/hyperconverged-cluster-operator",
"support": "false",
"operatorframework.io/suggested-namespace": params.Namespace,
"operators.openshift.io/infrastructure-features": `["disconnected","proxy-aware"]`,
"operatorframework.io/initialization-resource": string(almExamples),
"operatorframework.io/suggested-namespace": params.Namespace,
"operators.openshift.io/infrastructure-features": `["disconnected","proxy-aware"]`,
"operatorframework.io/initialization-resource": string(almExamples),
"features.operators.openshift.io/disconnected": "true",
"features.operators.openshift.io/fips-compliant": "false",
"features.operators.openshift.io/proxy-aware": "true",
"features.operators.openshift.io/cnf": "false",
"features.operators.openshift.io/cni": "true",
"features.operators.openshift.io/csi": "true",
"features.operators.openshift.io/tls-profiles": "true",
"features.operators.openshift.io/token-auth-aws": "false",
"features.operators.openshift.io/token-auth-azure": "false",
"features.operators.openshift.io/token-auth-gcp": "false",
},
},
Spec: csvv1alpha1.ClusterServiceVersionSpec{
Expand Down
2 changes: 0 additions & 2 deletions pkg/util/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ const (
AppLabel = "app"
UndefinedNamespace = ""
OpenshiftNamespace = "openshift"
OperatorTestNamespace = "test-operators"
OperatorHubNamespace = "operators"
APIVersionAlpha = "v1alpha1"
APIVersionBeta = "v1beta1"
CurrentAPIVersion = APIVersionBeta
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/csv-merger/csv-merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func appendOnce(slice []string, item string) []string {

func appendRelatedImageIfMissing(slice []csvv1alpha1.RelatedImage, ri csvv1alpha1.RelatedImage) []csvv1alpha1.RelatedImage {
for _, ele := range slice {
if ele.Name == ri.Name {
if ele.Image == ri.Image {
return slice
}
}
Expand Down

0 comments on commit 5384bbb

Please sign in to comment.