Просмотр исходного кода

Fix template fallback logic to handle TemplateFrom syntax

Marc Billow 4 лет назад
Родитель
Сommit
6de9399126
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      pkg/controllers/externalsecret/externalsecret_controller_template.go

+ 1 - 1
pkg/controllers/externalsecret/externalsecret_controller_template.go

@@ -67,7 +67,7 @@ func (r *Reconciler) applyTemplate(ctx context.Context, es *esv1beta1.ExternalSe
 
 
 	// if no data was provided by template fallback
 	// if no data was provided by template fallback
 	// to value from the provider
 	// to value from the provider
-	if len(es.Spec.Target.Template.Data) == 0 {
+	if len(es.Spec.Target.Template.Data) == 0 && len(es.Spec.Target.Template.TemplateFrom) == 0 {
 		secret.Data = dataMap
 		secret.Data = dataMap
 	}
 	}
 	secret.Annotations[esv1beta1.AnnotationDataHash] = utils.ObjectHash(secret.Data)
 	secret.Annotations[esv1beta1.AnnotationDataHash] = utils.ObjectHash(secret.Data)