Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove passt network binding plugin Registration #3212

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/hyperconverged-cluster-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ func main() {
err = metrics.SetupMetrics()
cmdHelper.ExitOnError(err, "failed to setup metrics: %v")

err = hcoutil.CheckPrimaryUDNImageEnvExists()
cmdHelper.ExitOnError(err, "failed to retrieve primary UDN env var")

logger.Info("Starting the Cmd.")
eventEmitter.EmitEvent(nil, corev1.EventTypeNormal, "Init", "Starting the HyperConverged Pod")

Expand Down
28 changes: 1 addition & 27 deletions controllers/operands/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"maps"
"os"
"path"
"reflect"
"strconv"
"strings"
Expand Down Expand Up @@ -46,13 +45,7 @@ const (
DefaultARM64EmulatedMachines = "virt*"
)

const (
primaryUDNNetworkBindingName = "l2bridge"
passtUDNNetworkBindingName = "passt"
// Needs to align with the NAD that will be deployed by CNAO
primaryUDNNetworkBindingNADName = "primary-udn-kubevirt-binding"
primaryUDNNetworkBindingNADNamespace = "default"
)
const primaryUDNNetworkBindingName = "l2bridge"

var (
useKVMEmulation = false
Expand Down Expand Up @@ -528,10 +521,7 @@ func getNetworkBindings(hcoNetworkBindings map[string]kubevirtcorev1.InterfaceBi
networkBindings = make(map[string]kubevirtcorev1.InterfaceBindingPlugin)
}

sidecarImage, _ := os.LookupEnv(hcoutil.PrimaryUDNImageEnvV)
networkBindings[primaryUDNNetworkBindingName] = primaryUserDefinedNetworkBinding()
networkBindings[passtUDNNetworkBindingName] = passtUserDefinedNetworkBinding(sidecarImage)

return networkBindings
}

Expand Down Expand Up @@ -765,22 +755,6 @@ func primaryUserDefinedNetworkBinding() kubevirtcorev1.InterfaceBindingPlugin {
}
}

func passtUserDefinedNetworkBinding(sidecarImage string) kubevirtcorev1.InterfaceBindingPlugin {
const bindingComputeMemoryOverhead = "500Mi"
return kubevirtcorev1.InterfaceBindingPlugin{
NetworkAttachmentDefinition: path.Join(primaryUDNNetworkBindingNADNamespace, primaryUDNNetworkBindingNADName),
SidecarImage: sidecarImage,
Migration: &kubevirtcorev1.InterfaceBindingMigration{
Method: kubevirtcorev1.LinkRefresh,
},
ComputeResourceOverhead: &kubevirtcorev1.ResourceRequirementsWithoutClaims{
Requests: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse(bindingComputeMemoryOverhead),
},
},
}
}

// Static for now, could be configured in the HCO CR in the future
func getKVSeccompConfig() *kubevirtcorev1.SeccompConfiguration {
return &kubevirtcorev1.SeccompConfiguration{
Expand Down
18 changes: 0 additions & 18 deletions controllers/operands/kubevirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,6 @@ Version: 1.2.3`)
bindingPlugins := map[string]kubevirtcorev1.InterfaceBindingPlugin{
"binding1": {SidecarImage: "image1", NetworkAttachmentDefinition: "nad1"},
"l2bridge": {Migration: &kubevirtcorev1.InterfaceBindingMigration{}, DomainAttachmentType: "managedTap"},
"passt": {
Migration: &kubevirtcorev1.InterfaceBindingMigration{Method: "link-refresh"},
NetworkAttachmentDefinition: "default/primary-udn-kubevirt-binding",
ComputeResourceOverhead: &kubevirtcorev1.ResourceRequirementsWithoutClaims{
Requests: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("500Mi"),
},
},
},
}
hco.Spec.NetworkBinding = bindingPlugins

Expand Down Expand Up @@ -1902,7 +1893,6 @@ Version: 1.2.3`)
Context("Feature Gates", func() {

getClusterInfo := hcoutil.GetClusterInfo
const expectedPrimaryUDNImage = "quay.io/some-org/some-repo@some-sha"

BeforeEach(func() {
hcoutil.GetClusterInfo = func() hcoutil.ClusterInfo {
Expand All @@ -1914,14 +1904,6 @@ Version: 1.2.3`)
hcoutil.GetClusterInfo = getClusterInfo
})

BeforeEach(func() {
Expect(os.Setenv(hcoutil.PrimaryUDNImageEnvV, expectedPrimaryUDNImage)).To(Succeed())
})

AfterEach(func() {
Expect(os.Unsetenv(hcoutil.PrimaryUDNImageEnvV)).To(Succeed())
})

Context("test feature gates in NewKubeVirt", func() {
It("should add the PersistentReservation feature gate if PersistentReservation is true in HyperConverged CR", func() {
hco.Spec.FeatureGates = hcov1beta1.HyperConvergedFeatureGates{
Expand Down
1 change: 0 additions & 1 deletion deploy/images.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ KUBEVIRT_EXPORTPROXY_IMAGE,quay.io/kubevirt/virt-exportproxy,KUBEVIRT_VERSION,55
KUBEVIRT_EXPORSERVER_IMAGE,quay.io/kubevirt/virt-exportserver,KUBEVIRT_VERSION,ec1693cc6e8a14ab83f2feea87427643a968d65832c44b25a1bb911482403ff2
KUBEVIRT_PR_HELPER,quay.io/kubevirt/pr-helper,KUBEVIRT_VERSION,fd434b4ea1ca5682fc5b05f23de01130c0c10f77a0a2d9d089d8f3cb5b545aa6
KUBEVIRT_SIDECAR_SHIM,quay.io/kubevirt/sidecar-shim,KUBEVIRT_VERSION,cb4025f7275f8de2891c2195c5faf128ac1b68595cdb3eff776a2e5360b8f034
PRIMARY_USER_DEFINED_NETWORK_BINDING_IMAGE,quay.io/kubevirt/network-passt-binding,KUBEVIRT_VERSION,c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
CNA_OPERATOR_IMAGE,quay.io/kubevirt/cluster-network-addons-operator,NETWORK_ADDONS_VERSION,6c4e0af7e8ea2bc9c3caf007f4b875c5dc78e5936f35f1791392d92ede660bb4
SSP_OPERATOR_IMAGE,quay.io/kubevirt/ssp-operator,SSP_VERSION,4e37f106d2ab188c53ca743cd9226703f1f8640ad8628e80bdd249f48ab905cc
SSP_VALIDATOR_IMAGE,quay.io/kubevirt/kubevirt-template-validator,SSP_VERSION,a8d15be0336b43bef23aa127d69b040ddfba917c6ae5a83f2226cdb7ae27ccc5
Expand Down
2 changes: 0 additions & 2 deletions deploy/images.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ KUBEVIRT_EXPORTPROXY_IMAGE=quay.io/kubevirt/virt-exportproxy@sha256:55e38274e59b
KUBEVIRT_EXPORSERVER_IMAGE=quay.io/kubevirt/virt-exportserver@sha256:ec1693cc6e8a14ab83f2feea87427643a968d65832c44b25a1bb911482403ff2
KUBEVIRT_PR_HELPER=quay.io/kubevirt/pr-helper@sha256:fd434b4ea1ca5682fc5b05f23de01130c0c10f77a0a2d9d089d8f3cb5b545aa6
KUBEVIRT_SIDECAR_SHIM=quay.io/kubevirt/sidecar-shim@sha256:cb4025f7275f8de2891c2195c5faf128ac1b68595cdb3eff776a2e5360b8f034
PRIMARY_USER_DEFINED_NETWORK_BINDING_IMAGE=quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
CNA_OPERATOR_IMAGE=quay.io/kubevirt/cluster-network-addons-operator@sha256:6c4e0af7e8ea2bc9c3caf007f4b875c5dc78e5936f35f1791392d92ede660bb4
SSP_OPERATOR_IMAGE=quay.io/kubevirt/ssp-operator@sha256:4e37f106d2ab188c53ca743cd9226703f1f8640ad8628e80bdd249f48ab905cc
SSP_VALIDATOR_IMAGE=quay.io/kubevirt/kubevirt-template-validator@sha256:a8d15be0336b43bef23aa127d69b040ddfba917c6ae5a83f2226cdb7ae27ccc5
Expand Down Expand Up @@ -44,7 +43,6 @@ DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/virt-exportproxy@sha256:55e38274e59
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/virt-exportserver@sha256:ec1693cc6e8a14ab83f2feea87427643a968d65832c44b25a1bb911482403ff2"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/pr-helper@sha256:fd434b4ea1ca5682fc5b05f23de01130c0c10f77a0a2d9d089d8f3cb5b545aa6"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/sidecar-shim@sha256:cb4025f7275f8de2891c2195c5faf128ac1b68595cdb3eff776a2e5360b8f034"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/cluster-network-addons-operator@sha256:6c4e0af7e8ea2bc9c3caf007f4b875c5dc78e5936f35f1791392d92ede660bb4"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/ssp-operator@sha256:4e37f106d2ab188c53ca743cd9226703f1f8640ad8628e80bdd249f48ab905cc"
DIGEST_LIST="${DIGEST_LIST},quay.io/kubevirt/kubevirt-template-validator@sha256:a8d15be0336b43bef23aa127d69b040ddfba917c6ae5a83f2226cdb7ae27ccc5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3196,8 +3196,6 @@ spec:
value: quay.io/kubevirt-ui/kubevirt-plugin@sha256:902af624e05eca764c17137c27813b1618f388e4b1a53b27b54665e8735251a2
- name: KV_CONSOLE_PROXY_IMAGE
value: quay.io/kubevirt-ui/kubevirt-apiserver-proxy@sha256:935475c2850466aa5ac57e4de627fb177515cb2c402a95842ead095d82b6df5f
- name: PRIMARY_UDN_SIDECAR_IMAGE
value: quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
image: +IMAGE_TO_REPLACE+
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4726,8 +4724,6 @@ spec:
name: multus-cni
- image: ghcr.io/k8snetworkplumbingwg/multus-dynamic-networks-controller@sha256:0bdf7dc9c15bdf7e5760955f05077c23868f3421141e8e623d75cf6b8cf36247
name: multus-dynamic-networks-controller
- image: quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
name: network-passt-binding
- image: quay.io/openshift/origin-kube-rbac-proxy@sha256:e2def4213ec0657e72eb790ae8a115511d5b8f164a62d3568d2f1bff189917e8
name: origin-kube-rbac-proxy
- image: ghcr.io/k8snetworkplumbingwg/ovs-cni-plugin@sha256:54be8fcacee50af64deafa9e99f3fe079033630c00c4ed9f74d17b0d91009f10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
certified: "false"
console.openshift.io/disable-operand-delete: "true"
containerImage: quay.io/kubevirt/hyperconverged-cluster-operator:1.14.0-unstable
createdAt: "2024-12-15 07:54:32"
createdAt: "2024-12-18 08:34:40"
description: A unified operator deploying and controlling KubeVirt and its supporting
operators with opinionated defaults
features.operators.openshift.io/cnf: "false"
Expand Down Expand Up @@ -3196,8 +3196,6 @@ spec:
value: quay.io/kubevirt-ui/kubevirt-plugin@sha256:902af624e05eca764c17137c27813b1618f388e4b1a53b27b54665e8735251a2
- name: KV_CONSOLE_PROXY_IMAGE
value: quay.io/kubevirt-ui/kubevirt-apiserver-proxy@sha256:935475c2850466aa5ac57e4de627fb177515cb2c402a95842ead095d82b6df5f
- name: PRIMARY_UDN_SIDECAR_IMAGE
value: quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
image: quay.io/kubevirt/hyperconverged-cluster-operator:1.14.0-unstable
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -4726,8 +4724,6 @@ spec:
name: multus-cni
- image: ghcr.io/k8snetworkplumbingwg/multus-dynamic-networks-controller@sha256:0bdf7dc9c15bdf7e5760955f05077c23868f3421141e8e623d75cf6b8cf36247
name: multus-dynamic-networks-controller
- image: quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
name: network-passt-binding
- image: quay.io/openshift/origin-kube-rbac-proxy@sha256:e2def4213ec0657e72eb790ae8a115511d5b8f164a62d3568d2f1bff189917e8
name: origin-kube-rbac-proxy
- image: ghcr.io/k8snetworkplumbingwg/ovs-cni-plugin@sha256:54be8fcacee50af64deafa9e99f3fe079033630c00c4ed9f74d17b0d91009f10
Expand Down
2 changes: 0 additions & 2 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ spec:
value: v1.3.0
- name: KV_CONSOLE_PLUGIN_IMAGE
- name: KV_CONSOLE_PROXY_IMAGE
- name: PRIMARY_UDN_SIDECAR_IMAGE
value: quay.io/kubevirt/network-passt-binding@sha256:c794cc1b9173267f1e3d34e666d9e2f782b88d93b47fb4449675346b467f802c
image: quay.io/kubevirt/hyperconverged-cluster-operator:1.14.0-unstable
imagePullPolicy: Always
livenessProbe:
Expand Down
4 changes: 1 addition & 3 deletions hack/build-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ ${PROJECT_ROOT}/tools/manifest-templator/manifest-templator \
--aaq-version="${AAQ_VERSION}" \
--operator-image="${HCO_OPERATOR_IMAGE}" \
--webhook-image="${HCO_WEBHOOK_IMAGE}" \
--primary-udn-binding-image-name="${PRIMARY_USER_DEFINED_NETWORK_BINDING_IMAGE}" \
--cli-downloads-image="${HCO_DOWNLOADS_IMAGE}"

(cd ${PROJECT_ROOT}/tools/manifest-templator/ && go clean)
Expand Down Expand Up @@ -353,8 +352,7 @@ ${PROJECT_ROOT}/tools/csv-merger/csv-merger \
--webhook-image-name="${HCO_WEBHOOK_IMAGE}" \
--kubevirt-consoleplugin-image-name="${KUBEVIRT_CONSOLE_PLUGIN_IMAGE}" \
--kubevirt-consoleproxy-image-name="${KUBEVIRT_CONSOLE_PROXY_IMAGE}" \
--cli-downloads-image-name="${HCO_DOWNLOADS_IMAGE}" \
--primary-udn-binding-image-name="${PRIMARY_USER_DEFINED_NETWORK_BINDING_IMAGE}" > "${CSV_DIR}/${OPERATOR_NAME}.v${CSV_VERSION}.${CSV_EXT}"
--cli-downloads-image-name="${HCO_DOWNLOADS_IMAGE}" > "${CSV_DIR}/${OPERATOR_NAME}.v${CSV_VERSION}.${CSV_EXT}"

rendered_csv="$(cat "${CSV_DIR}/${OPERATOR_NAME}.v${CSV_VERSION}.${CSV_EXT}")"
rendered_keywords="$(echo "$rendered_csv" |grep 'keywords' -A 3)"
Expand Down
5 changes: 0 additions & 5 deletions pkg/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ type DeploymentOperatorParams struct {
HppoVersion string
MtqVersion string
AaqVersion string
PrimaryUDNImage string
Env []corev1.EnvVar
}

Expand Down Expand Up @@ -292,10 +291,6 @@ func buildEnvVars(params *DeploymentOperatorParams) []corev1.EnvVar {
Name: util.KVUIProxyImageEnvV,
Value: params.KVUIProxyImage,
},
{
Name: util.PrimaryUDNImageEnvV,
Value: params.PrimaryUDNImage,
},
}, params.Env...)

if params.KvVirtLancherOsVersion != "" {
Expand Down
1 change: 0 additions & 1 deletion pkg/util/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const (
AaqVersionEnvV = "AAQ_VERSION"
KVUIPluginImageEnvV = "KV_CONSOLE_PLUGIN_IMAGE"
KVUIProxyImageEnvV = "KV_CONSOLE_PROXY_IMAGE"
PrimaryUDNImageEnvV = "PRIMARY_UDN_SIDECAR_IMAGE"
HcoValidatingWebhook = "validate-hco.kubevirt.io"
HcoMutatingWebhookNS = "mutate-ns-hco.kubevirt.io"
PrometheusRuleCRDName = "prometheusrules.monitoring.coreos.com"
Expand Down
7 changes: 0 additions & 7 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ func GetOperatorNamespaceFromEnv() (string, error) {
return "", fmt.Errorf("%s unset or empty in environment", OperatorNamespaceEnv)
}

func CheckPrimaryUDNImageEnvExists() error {
if _, primaryUDNImageVarExists := os.LookupEnv(PrimaryUDNImageEnvV); !primaryUDNImageVarExists {
return fmt.Errorf("%s env var not found", PrimaryUDNImageEnvV)
}
return nil
}

func IsRunModeLocal() bool {
return os.Getenv(ForceRunModeEnv) == string(LocalRunMode)
}
Expand Down
3 changes: 1 addition & 2 deletions tools/csv-merger/csv-merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ var (
kvUIPluginImage = flag.String("kubevirt-consoleplugin-image-name", "", "KubeVirt Console Plugin image")
kvUIProxyImage = flag.String("kubevirt-consoleproxy-image-name", "", "KubeVirt Console Proxy image")
kvVirtIOWinImage = flag.String("kv-virtiowin-image-name", "", "KubeVirt VirtIO Win image")
primaryUDNImage = flag.String("primary-udn-binding-image-name", "", "Primary UDN binding image")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep the flag for now, so the tool won't fail. just ignore it (see example in the mtq-csv flag); e.g.

	_                   = flag.String("primary-udn-binding-image-name", "", "deprecated. This flag is ignored")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

_ = flag.String("primary-udn-binding-image-name", "", "deprecated. This flag is ignored")
smbios = flag.String("smbios", "", "Custom SMBIOS string for KubeVirt ConfigMap")
machinetype = flag.String("machinetype", "", "Custom MACHINETYPE string for KubeVirt ConfigMap (Deprecated, use amd64-machinetype)")
amd64MachineType = flag.String("amd64-machinetype", "", "Custom AMD64_MACHINETYPE string for KubeVirt ConfigMap")
Expand Down Expand Up @@ -535,7 +535,6 @@ func getDeploymentParams() *components.DeploymentOperatorParams {
SspVersion: *sspVersion,
HppoVersion: *hppoVersion,
AaqVersion: *aaqVersion,
PrimaryUDNImage: *primaryUDNImage,
Env: envVars,
}
}
Expand Down
3 changes: 1 addition & 2 deletions tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var (
hppoVersion = flag.String("hppo-version", "", "HPP operator version")
_ = flag.String("mtq-version", "", "deprecated. This flag is ignored")
aaqVersion = flag.String("aaq-version", "", "AAQ operator version")
primaryUDNImage = flag.String("primary-udn-binding-image-name", "", "Primary UDN binding image")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DONE

_ = flag.String("primary-udn-binding-image-name", "", "deprecated. This flag is ignored")
apiSources = flag.String("api-sources", cwd+"/...", "Project sources")
)

Expand Down Expand Up @@ -431,7 +431,6 @@ func getOperatorParameters() *components.DeploymentOperatorParams {
SspVersion: *sspVersion,
HppoVersion: *hppoVersion,
AaqVersion: *aaqVersion,
PrimaryUDNImage: *primaryUDNImage,
Env: []corev1.EnvVar{},
}
return params
Expand Down
Loading