Skip to content

Commit

Permalink
Merge pull request k8snetworkplumbingwg#47 from zshi-redhat/sriov-plu…
Browse files Browse the repository at this point in the history
…gin-node-affinity

nodeAffinity is not correctly updated with DeepDerivative
  • Loading branch information
pliurh authored Jan 22, 2021
2 parents ed21518 + 4b0bafa commit 4beb329
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,13 @@ func (r *SriovNetworkNodePolicyReconciler) syncDaemonSet(cr *sriovnetworkv1.Srio
// This skips default values added by the api server.
// References in https://github.com/kubernetes-sigs/kubebuilder/issues/592#issuecomment-625738183
if equality.Semantic.DeepDerivative(in.Spec, ds.Spec) {
logger.Info("Daemonset spec did not change, not updating")
return nil
// DeepDerivative has issue detecting nodeAffinity change
// https://bugzilla.redhat.com/show_bug.cgi?id=1914066
if equality.Semantic.DeepEqual(in.Spec.Template.Spec.Affinity.NodeAffinity,
ds.Spec.Template.Spec.Affinity.NodeAffinity) {
logger.Info("Daemonset spec did not change, not updating")
return nil
}
}
err = r.Update(context.TODO(), in)
if err != nil {
Expand Down

0 comments on commit 4beb329

Please sign in to comment.