mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Apply object meta functions to controllers
This commit is contained in:
parent
66df63f618
commit
b0ec300ce8
@ -263,7 +263,7 @@ func (nc *NamespaceController) reconcileNamespace(namespace string) {
|
||||
return
|
||||
}
|
||||
desiredNamespace := &api_v1.Namespace{
|
||||
ObjectMeta: baseNamespace.ObjectMeta,
|
||||
ObjectMeta: util.CopyObjectMeta(baseNamespace.ObjectMeta),
|
||||
Spec: baseNamespace.Spec,
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ func (nc *NamespaceController) reconcileNamespace(namespace string) {
|
||||
clusterNamespace := clusterNamespaceObj.(*api_v1.Namespace)
|
||||
|
||||
// Update existing namespace, if needed.
|
||||
if !reflect.DeepEqual(desiredNamespace.ObjectMeta, clusterNamespace.ObjectMeta) ||
|
||||
if !util.ObjectMetaEquivalent(desiredNamespace.ObjectMeta, clusterNamespace.ObjectMeta) ||
|
||||
!reflect.DeepEqual(desiredNamespace.Spec, clusterNamespace.Spec) {
|
||||
operations = append(operations, util.FederatedOperation{
|
||||
Type: util.OperationTypeUpdate,
|
||||
|
@ -272,7 +272,7 @@ func (secretcontroller *SecretController) reconcileSecret(namespace string, secr
|
||||
}
|
||||
|
||||
desiredSecret := &api_v1.Secret{
|
||||
ObjectMeta: baseSecret.ObjectMeta,
|
||||
ObjectMeta: util.CopyObjectMeta(baseSecret.ObjectMeta),
|
||||
Data: baseSecret.Data,
|
||||
Type: baseSecret.Type,
|
||||
}
|
||||
@ -287,7 +287,9 @@ func (secretcontroller *SecretController) reconcileSecret(namespace string, secr
|
||||
clusterSecret := clusterSecretObj.(*api_v1.Secret)
|
||||
|
||||
// Update existing secret, if needed.
|
||||
if !reflect.DeepEqual(desiredSecret.ObjectMeta, clusterSecret.ObjectMeta) {
|
||||
if !util.ObjectMetaEquivalent(desiredSecret.ObjectMeta, clusterSecret.ObjectMeta) ||
|
||||
!reflect.DeepEqual(desiredSecret.Data, clusterSecret.Data) ||
|
||||
!reflect.DeepEqual(desiredSecret.Type, clusterSecret.Type) {
|
||||
operations = append(operations, util.FederatedOperation{
|
||||
Type: util.OperationTypeUpdate,
|
||||
Obj: desiredSecret,
|
||||
|
Loading…
Reference in New Issue
Block a user