mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +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
|
return
|
||||||
}
|
}
|
||||||
desiredNamespace := &api_v1.Namespace{
|
desiredNamespace := &api_v1.Namespace{
|
||||||
ObjectMeta: baseNamespace.ObjectMeta,
|
ObjectMeta: util.CopyObjectMeta(baseNamespace.ObjectMeta),
|
||||||
Spec: baseNamespace.Spec,
|
Spec: baseNamespace.Spec,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ func (nc *NamespaceController) reconcileNamespace(namespace string) {
|
|||||||
clusterNamespace := clusterNamespaceObj.(*api_v1.Namespace)
|
clusterNamespace := clusterNamespaceObj.(*api_v1.Namespace)
|
||||||
|
|
||||||
// Update existing namespace, if needed.
|
// 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) {
|
!reflect.DeepEqual(desiredNamespace.Spec, clusterNamespace.Spec) {
|
||||||
operations = append(operations, util.FederatedOperation{
|
operations = append(operations, util.FederatedOperation{
|
||||||
Type: util.OperationTypeUpdate,
|
Type: util.OperationTypeUpdate,
|
||||||
|
@ -272,7 +272,7 @@ func (secretcontroller *SecretController) reconcileSecret(namespace string, secr
|
|||||||
}
|
}
|
||||||
|
|
||||||
desiredSecret := &api_v1.Secret{
|
desiredSecret := &api_v1.Secret{
|
||||||
ObjectMeta: baseSecret.ObjectMeta,
|
ObjectMeta: util.CopyObjectMeta(baseSecret.ObjectMeta),
|
||||||
Data: baseSecret.Data,
|
Data: baseSecret.Data,
|
||||||
Type: baseSecret.Type,
|
Type: baseSecret.Type,
|
||||||
}
|
}
|
||||||
@ -287,7 +287,9 @@ func (secretcontroller *SecretController) reconcileSecret(namespace string, secr
|
|||||||
clusterSecret := clusterSecretObj.(*api_v1.Secret)
|
clusterSecret := clusterSecretObj.(*api_v1.Secret)
|
||||||
|
|
||||||
// Update existing secret, if needed.
|
// 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{
|
operations = append(operations, util.FederatedOperation{
|
||||||
Type: util.OperationTypeUpdate,
|
Type: util.OperationTypeUpdate,
|
||||||
Obj: desiredSecret,
|
Obj: desiredSecret,
|
||||||
|
Loading…
Reference in New Issue
Block a user