From 69ea6a2a8515e3f449d869b09cd8712904e10d1c Mon Sep 17 00:00:00 2001 From: wangyd1988 Date: Tue, 5 Dec 2023 17:14:51 +0800 Subject: [PATCH] Add check to ensure jq can be found in $PATH when enabling switchdev mode --- .../files/switchdev-configuration-before-nm.sh.yaml | 2 ++ controllers/sriovnetworknodepolicy_controller.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bindata/manifests/switchdev-config/files/switchdev-configuration-before-nm.sh.yaml b/bindata/manifests/switchdev-config/files/switchdev-configuration-before-nm.sh.yaml index 3337b22c..fcf08aaa 100644 --- a/bindata/manifests/switchdev-config/files/switchdev-configuration-before-nm.sh.yaml +++ b/bindata/manifests/switchdev-config/files/switchdev-configuration-before-nm.sh.yaml @@ -13,6 +13,8 @@ contents: exit fi + which jq + append_to_file(){ content="$1" file_name="$2" diff --git a/controllers/sriovnetworknodepolicy_controller.go b/controllers/sriovnetworknodepolicy_controller.go index a71f1ad3..03679e4c 100644 --- a/controllers/sriovnetworknodepolicy_controller.go +++ b/controllers/sriovnetworknodepolicy_controller.go @@ -359,7 +359,7 @@ func (r *SriovNetworkNodePolicyReconciler) syncSriovNetworkNodeState(np *sriovne } } newVersion.Spec.DpConfigVersion = cksum - if equality.Semantic.DeepDerivative(newVersion.Spec, found.Spec) { + if equality.Semantic.DeepEqual(newVersion.Spec, found.Spec) { logger.Info("SriovNetworkNodeState did not change, not updating") return nil }