func (r *NodeFeatureDiscoveryReconciler) updateProgressingCondition(nfd *nfdv1.NodeFeatureDiscovery, reason, message string) (ctrl.Result, error) {
	progressingCondition := r.getProgressingConditions(reason, message)
	if err := r.updateStatus(nfd, progressingCondition); err != nil {
		return reconcile.Result{}, err
	}
	return reconcile.Result{Requeue: true}, nil
}
updateProgressingCondition is used to mark a given resource as "progressing" so
that the reconciler can take steps to rectify the situation.
package controllers
import (
	"context"
	"errors"
	"time"
	meta "k8s.io/apimachinery/pkg/api/meta"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/reconcile"
	nfdv1 "github.com/kubernetes-sigs/node-feature-discovery-operator/api/v1"
)
const (
	nfdNamespace        = "node-feature-discovery-operator"
	nfdWorkerApp string = "nfd-worker"
	nfdMasterApp string = "nfd-master"
)
const (
	conditionFailedGettingNFDWorkerConfig         = "FailedGettingNFDWorkerConfig"
	conditionFailedGettingNFDWorkerServiceAccount = "FailedGettingNFDWorkerServiceAccount"
	conditionFailedGettingNFDMasterServiceAccount = "FailedGettingNFDMasterServiceAccount"
	conditionFailedGettingNFDService              = "FailedGettingNFDService"
	conditionFailedGettingNFDWorkerDaemonSet      = "FailedGettingNFDWorkerDaemonSet"
	conditionFailedGettingNFDMasterDaemonSet      = "FailedGettingNFDMasterDaemonSet"
	conditionFailedGettingNFDRoleBinding          = "FailedGettingNFDRoleBinding"
	conditionFailedGettingNFDClusterRoleBinding   = "FailedGettingNFDClusterRole"
	conditionNFDWorkerConfigDegraded         = "NFDWorkerConfigResourceDegraded"
	conditionNFDWorkerServiceAccountDegraded = "NFDWorkerServiceAccountDegraded"
	conditionNFDMasterServiceAccountDegraded = "NFDMasterServiceAccountDegraded"
	conditionNFDServiceDegraded              = "NFDServiceDegraded"
	conditionNFDWorkerDaemonSetDegraded      = "NFDWorkerDaemonSetDegraded"
	conditionNFDMasterDaemonSetDegraded      = "NFDMasterDaemonSetDegraded"
	conditionNFDRoleDegraded                 = "NFDRoleDegraded"
	conditionNFDRoleBindingDegraded          = "NFDRoleBindingDegraded"
	conditionNFDClusterRoleDegraded          = "NFDClusterRoleDegraded"
	conditionNFDClusterRoleBindingDegraded   = "NFDClusterRoleBindingDegraded"
	errorNFDWorkerDaemonSetUnknown = "NFDWorkerDaemonSetCorrupted"
	errorNFDMasterDaemonSetUnknown = "NFDMasterDaemonSetCorrupted"
	errorTooManyNFDWorkerDaemonSetReadyNodes = "NFDWorkerDaemonSetHasMoreNodesThanScheduled"
	errorTooManyNFDMasterDaemonSetReadyNodes = "NFDMasterDaemonSetHasMoreNodesThanScheduled"
	warningNumberOfReadyNodesIsLessThanScheduled = "warningNumberOfReadyNodesIsLessThanScheduled"
	warningNFDWorkerDaemonSetProgressing         = "warningNFDWorkerDaemonSetProgressing"
	warningNFDMasterDaemonSetProgressing         = "warningNFDMasterDaemonSetProgressing"
	ConditionAvailable string = "Available"
	ConditionProgressing string = "Progressing"
	ConditionDegraded string = "Degraded"
	ConditionUpgradeable string = "Upgradeable"
)
func (r *NodeFeatureDiscoveryReconciler) updateStatus(nfd *nfdv1.NodeFeatureDiscovery, condition []metav1.Condition) error {
	nfdCopy := nfd.DeepCopy()
	if condition != nil {
		nfdCopy.Status.Conditions = condition
	}
	modified := false
	for _, newCondition := range nfdCopy.Status.Conditions {
		oldCondition := meta.FindStatusCondition(nfd.Status.Conditions, newCondition.Type)
		if oldCondition == nil {
			modified = true
			break
		}
		if oldCondition.Status != newCondition.Status ||
			oldCondition.Reason != newCondition.Reason ||
			oldCondition.Message != newCondition.Message {
			modified = true
			break
		}
	}
	if !modified {
		return nil
	}
	return r.Status().Update(context.TODO(), nfdCopy)
}
func (r *NodeFeatureDiscoveryReconciler) updateDegradedCondition(nfd *nfdv1.NodeFeatureDiscovery, reason, message string) (ctrl.Result, error) {
	degradedCondition := r.getDegradedConditions(reason, message)
	if err := r.updateStatus(nfd, degradedCondition); err != nil {
		return reconcile.Result{}, err
	}
	return reconcile.Result{Requeue: true}, nil
}