resolve conversation

Signed-off-by: wanjunlei <wanjunlei@yunify.com>
This commit is contained in:
wanjunlei
2021-02-23 12:00:01 +08:00
parent f9213fcdc8
commit d4a8f9bf88
17 changed files with 61 additions and 52 deletions

View File

@@ -222,7 +222,7 @@ func (c *Controller) reconcile(obj interface{}) error {
// Only reconcile the secret which created by notification manager.
if secret, ok := obj.(*corev1.Secret); ok {
if secret.Namespace != constants.KubeSphereNotificationNamespace || secret.Labels[constants.NotificationManagedLabel] != "true" {
if secret.Namespace != constants.NotificationSecretNamespace || secret.Labels[constants.NotificationManagedLabel] != "true" {
klog.V(8).Infof("No need to reconcile secret %s/%s", accessor.GetNamespace(), accessor.GetName())
return nil
}
@@ -919,12 +919,12 @@ func (c *Controller) syncFederatedSecret(obj *corev1.Secret) error {
func (c *Controller) ensureNotificationNamespaceExist() error {
ns := corev1.Namespace{}
if err := c.Get(context.Background(), client.ObjectKey{Name: constants.KubeSphereNotificationNamespace}, &ns); err != nil {
if err := c.Get(context.Background(), client.ObjectKey{Name: constants.NotificationSecretNamespace}, &ns); err != nil {
return err
}
fedNs := v1beta1.FederatedNamespace{}
if err := c.Get(context.Background(), client.ObjectKey{Name: constants.KubeSphereNotificationNamespace, Namespace: constants.KubeSphereNotificationNamespace}, &fedNs); err != nil {
if err := c.Get(context.Background(), client.ObjectKey{Name: constants.NotificationSecretNamespace, Namespace: constants.NotificationSecretNamespace}, &fedNs); err != nil {
if errors.IsAlreadyExists(err) {
return nil
}
@@ -936,8 +936,8 @@ func (c *Controller) ensureNotificationNamespaceExist() error {
APIVersion: v1beta1.SchemeGroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Name: constants.KubeSphereNotificationNamespace,
Namespace: constants.KubeSphereNotificationNamespace,
Name: constants.NotificationSecretNamespace,
Namespace: constants.NotificationSecretNamespace,
},
Spec: v1beta1.FederatedNamespaceSpec{
Placement: v1beta1.GenericPlacementFields{