@@ -64,7 +64,7 @@ type GlanceReconciler struct {
64
64
Scheme * runtime.Scheme
65
65
}
66
66
67
- // getlogger returns a logger object with a prefix of "conroller .name" and aditional controller context fields
67
+ // GetLogger returns a logger object with a prefix of "controller .name" and additional controller context fields
68
68
func (r * GlanceReconciler ) GetLogger (ctx context.Context ) logr.Logger {
69
69
return log .FromContext (ctx ).WithName ("Controllers" ).WithName ("Glance" )
70
70
}
@@ -615,7 +615,10 @@ func (r *GlanceReconciler) reconcileNormal(ctx context.Context, instance *glance
615
615
}
616
616
if op != controllerutil.OperationResultNone {
617
617
Log .Info (fmt .Sprintf ("Deployment %s successfully reconciled - operation: %s" , instance .Name , string (op )))
618
+ << << << < HEAD
618
619
Log .Info (fmt .Sprintf ("StatefulSet %s successfully reconciled - operation: %s" , instance .Name , string (op )))
620
+ == == == =
621
+ >> >> >> > e82dc49 (switch to structured logging )
619
622
}
620
623
621
624
// It is possible that an earlier call to update the status has also set
@@ -646,7 +649,11 @@ func (r *GlanceReconciler) reconcileNormal(ctx context.Context, instance *glance
646
649
return ctrl.Result {}, err
647
650
}
648
651
if op != controllerutil.OperationResultNone {
652
+ << << << < HEAD
649
653
Log .Info (fmt .Sprintf ("StatefulSet %s successfully reconciled - operation: %s" , instance .Name , string (op )))
654
+ == == == =
655
+ Log .Info (fmt .Sprintf ("Deployment %s successfully reconciled - operation: %s" , instance .Name , string (op )))
656
+ >> >> >> > e82dc49 (switch to structured logging )
650
657
}
651
658
652
659
// Mirror external GlanceAPI status' APIEndpoints to this parent CR
@@ -761,6 +768,7 @@ func (r *GlanceReconciler) generateServiceConfig(
761
768
instance * glancev1.Glance ,
762
769
envVars * map [string ]env.Setter ,
763
770
) error {
771
+ Log := r .GetLogger (ctx )
764
772
labels := labels .GetLabels (instance , labels .GetGroupLabel (glance .ServiceName ), map [string ]string {})
765
773
766
774
ospSecret , _ , err := secret .GetSecret (ctx , h , instance .Spec .Secret , instance .Namespace )
@@ -781,11 +789,22 @@ func (r *GlanceReconciler) generateServiceConfig(
781
789
// We set in the main 00-config-default.conf the image-cache bits that will
782
790
// be used by CronJobs cleaner and pruner
783
791
if len (instance .Spec .ImageCacheSize ) > 0 {
792
+ << << << < HEAD
784
793
// if ImageCacheSize is not a valid k8s Quantity, return an error
785
794
cacheSize , err := resource .ParseQuantity (instance .Spec .ImageCacheSize )
786
795
if err != nil {
787
796
return err
788
797
}
798
+ == == == =
799
+ // catch any panic generated by the MustParse function and report an
800
+ // error
801
+ defer func () {
802
+ if err := recover (); err != nil {
803
+ Log .Error (err .(error ), "ImageCacheSize not valid: %s" )
804
+ }
805
+ }()
806
+ cacheSize := resource .MustParse (instance .Spec .ImageCacheSize )
807
+ >> >> >> > e82dc49 (switch to structured logging )
789
808
templateParameters ["CacheEnabled" ] = true
790
809
templateParameters ["CacheMaxSize" ] = cacheSize .Value ()
791
810
templateParameters ["ImageCacheDir" ] = glance .ImageCacheDir
0 commit comments