Skip to content

Commit

Permalink
Do not remove the generated app-config if fluentd resource updated
Browse files Browse the repository at this point in the history
  • Loading branch information
baluchicken authored and tarokkk committed Jun 25, 2019
1 parent 67fd875 commit 41284ea
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/resources/fluentd/appconfigmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@
package fluentd

import (
"context"

"github.com/banzaicloud/logging-operator/pkg/resources/templates"
"github.com/banzaicloud/logging-operator/pkg/util"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
)

func (r *Reconciler) appconfigMap() runtime.Object {
return &corev1.ConfigMap{
ObjectMeta: templates.FluentdObjectMeta(appConfigMapName, util.MergeLabels(r.Fluentd.Labels, labelSelector), r.Fluentd),
Data: map[string]string{},
current := &corev1.ConfigMap{}
err := r.Client.Get(context.TODO(), types.NamespacedName{Namespace: r.Fluentd.Namespace, Name: appConfigMapName}, current)
if err != nil {
return &corev1.ConfigMap{
ObjectMeta: templates.FluentdObjectMeta(appConfigMapName, util.MergeLabels(r.Fluentd.Labels, labelSelector), r.Fluentd),
Data: map[string]string{},
}
}
return current
}

0 comments on commit 41284ea

Please sign in to comment.