Skip to content

Commit 7eef7a0

Browse files
committed
Add logging
Signed-off-by: Anish Asthana <anishasthana1@gmail.com>
1 parent 895c0ac commit 7eef7a0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

controllers/config/manifest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package config
22

33
import (
4+
"github.com/go-logr/logr"
45
mfc "github.com/manifestival/controller-runtime-client"
56
mf "github.com/manifestival/manifestival"
67
"sigs.k8s.io/controller-runtime/pkg/client"
78
)
89

9-
func Manifest(cl client.Client, templatePath string, context interface{}, name string) (mf.Manifest, error) {
10-
m, err := mf.ManifestFrom(PathTemplateSource(templatePath, context, name))
10+
func Manifest(cl client.Client, templatePath string, context interface{}, name string, logger logr.Logger) (mf.Manifest, error) {
11+
m, err := mf.ManifestFrom(PathTemplateSource(templatePath, context, name), mf.UseLogger(logger))
1112
if err != nil {
1213
return mf.Manifest{}, err
1314
}
1415
m.Client = mfc.NewClient(cl)
15-
1616
return m, err
1717
}

controllers/mcad_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type MCADReconciler struct {
4545

4646
func (r *MCADReconciler) Apply(owner mf.Owner, params *MCADParams, template string, fns ...mf.Transformer) error {
4747

48-
tmplManifest, err := config.Manifest(r.Client, r.TemplatesPath+template, params, template)
48+
tmplManifest, err := config.Manifest(r.Client, r.TemplatesPath+template, params, template, r.Log)
4949
if err != nil {
5050
return fmt.Errorf("error loading template yaml: %w", err)
5151
}

controllers/multi_cluster_app_dispatcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ var multiClusterAppDispatcherTemplates = []string{
1010
"mcad/configmap.yaml.tmpl",
1111
"mcad/service.yaml.tmpl",
1212
"mcad/serviceaccount.yaml.tmpl",
13-
"mcad/service.yaml.tmpl",
1413
"mcad/rolebinding_custom-metrics-auth-reader.yaml.tmpl", //Confirm is this rolebinding is actually required by MCAD
1514
}
1615

1716
func (r *MCADReconciler) ReconcileMCAD(ctx context.Context, mcad *codeflarev1alpha1.MCAD, req ctrl.Request, params *MCADParams) error {
1817

1918
for _, template := range multiClusterAppDispatcherTemplates {
19+
r.Log.Info("Applying " + template)
2020
err := r.Apply(mcad, params, template)
2121
if err != nil {
2222
return err

0 commit comments

Comments
 (0)