mirror of https://github.com/k3s-io/k3s
Merge pull request #34609 from mwielgus/usespecandmeta
Automatic merge from submit-queue Use ObjectMetaAndSpecEquivalent in federation controllers Use util added in #34561. cc: @quinton-hoolepull/6/head
commit
7d8c0fa0c9
|
@ -20,7 +20,6 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
|
@ -489,8 +488,7 @@ func (fdc *DeploymentController) reconcileDeployment(key string) (reconciliation
|
|||
|
||||
currentLd := ldObj.(*extensionsv1.Deployment)
|
||||
// Update existing replica set, if needed.
|
||||
if !fedutil.ObjectMetaEquivalent(ld.ObjectMeta, currentLd.ObjectMeta) ||
|
||||
!reflect.DeepEqual(ld.Spec, currentLd.Spec) {
|
||||
if !fedutil.ObjectMetaAndSpecEquivalent(ld, currentLd) {
|
||||
fdc.eventRecorder.Eventf(fd, api.EventTypeNormal, "UpdateInCluster",
|
||||
"Updating deployment in cluster %s", clusterName)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ package ingress
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -711,8 +710,7 @@ func (ic *IngressController) reconcileIngress(ingress types.NamespacedName) {
|
|||
glog.V(4).Infof(logStr, "Not transferring")
|
||||
}
|
||||
// Update existing cluster ingress, if needed.
|
||||
if util.ObjectMetaEquivalent(baseIngress.ObjectMeta, clusterIngress.ObjectMeta) &&
|
||||
reflect.DeepEqual(baseIngress.Spec, clusterIngress.Spec) {
|
||||
if util.ObjectMetaAndSpecEquivalent(baseIngress, clusterIngress) {
|
||||
glog.V(4).Infof("Ingress %q in cluster %q does not need an update: cluster ingress is equivalent to federated ingress", ingress, cluster.Name)
|
||||
} else {
|
||||
glog.V(4).Infof("Ingress %s in cluster %s needs an update: cluster ingress %v is not equivalent to federated ingress %v", ingress, cluster.Name, clusterIngress, desiredIngress)
|
||||
|
|
|
@ -18,7 +18,6 @@ package namespace
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
federation_api "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
|
@ -289,8 +288,7 @@ func (nc *NamespaceController) reconcileNamespace(namespace string) {
|
|||
clusterNamespace := clusterNamespaceObj.(*api_v1.Namespace)
|
||||
|
||||
// Update existing namespace, if needed.
|
||||
if !util.ObjectMetaEquivalent(desiredNamespace.ObjectMeta, clusterNamespace.ObjectMeta) ||
|
||||
!reflect.DeepEqual(desiredNamespace.Spec, clusterNamespace.Spec) {
|
||||
if !util.ObjectMetaAndSpecEquivalent(desiredNamespace, clusterNamespace) {
|
||||
nc.eventRecorder.Eventf(baseNamespace, api.EventTypeNormal, "UpdateInCluster",
|
||||
"Updating namespace in cluster %s", cluster.Name)
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
|
@ -486,8 +485,7 @@ func (frsc *ReplicaSetController) reconcileReplicaSet(key string) (reconciliatio
|
|||
} else {
|
||||
currentLrs := lrsObj.(*extensionsv1.ReplicaSet)
|
||||
// Update existing replica set, if needed.
|
||||
if !fedutil.ObjectMetaEquivalent(lrs.ObjectMeta, currentLrs.ObjectMeta) ||
|
||||
!reflect.DeepEqual(lrs.Spec, currentLrs.Spec) {
|
||||
if !fedutil.ObjectMetaAndSpecEquivalent(lrs, currentLrs) {
|
||||
frsc.eventRecorder.Eventf(frs, api.EventTypeNormal, "UpdateInCluster",
|
||||
"Updating replicaset in cluster %s", clusterName)
|
||||
|
||||
|
|
Loading…
Reference in New Issue