@@ -29,10 +29,6 @@ import (
29
29
30
30
func Test_NoInspectReconcile_IfNoDeployAttempted (t * testing.T ) {
31
31
log := logf .Log .WithName ("kc" )
32
- var (
33
- appMetrics = metrics .NewCountMetrics ()
34
- timeMetrics = metrics .NewReconcileTimeMetrics ()
35
- )
36
32
37
33
// The url under fetch is invalid, which will cause this
38
34
// app to fail before deploy.
@@ -55,7 +51,7 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) {
55
51
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
56
52
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
57
53
58
- crdApp := NewCRDApp (& app , log , & metrics.Metrics { ReconcileCountMetrics : appMetrics , ReconcileTimeMetrics : timeMetrics } , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
54
+ crdApp := NewCRDApp (& app , log , metrics .NewMetrics () , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
59
55
_ , err := crdApp .Reconcile (false )
60
56
assert .Nil (t , err , "unexpected error with reconciling" , err )
61
57
@@ -89,10 +85,6 @@ func Test_NoInspectReconcile_IfNoDeployAttempted(t *testing.T) {
89
85
90
86
func Test_NoInspectReconcile_IfInspectNotEnabled (t * testing.T ) {
91
87
log := logf .Log .WithName ("kc" )
92
- var (
93
- appMetrics = metrics .NewCountMetrics ()
94
- timeMetrics = metrics .NewReconcileTimeMetrics ()
95
- )
96
88
97
89
app := v1alpha1.App {
98
90
ObjectMeta : metav1.ObjectMeta {
@@ -125,7 +117,7 @@ func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) {
125
117
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
126
118
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
127
119
128
- crdApp := NewCRDApp (& app , log , & metrics.Metrics { ReconcileCountMetrics : appMetrics , ReconcileTimeMetrics : timeMetrics } , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
120
+ crdApp := NewCRDApp (& app , log , metrics .NewMetrics () , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
129
121
_ , err := crdApp .Reconcile (false )
130
122
assert .Nil (t , err , "unexpected error with reconciling" , err )
131
123
@@ -170,10 +162,6 @@ func Test_NoInspectReconcile_IfInspectNotEnabled(t *testing.T) {
170
162
171
163
func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty (t * testing.T ) {
172
164
log := logf .Log .WithName ("kc" )
173
- var (
174
- appMetrics = metrics .NewCountMetrics ()
175
- timeMetrics = metrics .NewReconcileTimeMetrics ()
176
- )
177
165
178
166
fetchInline := map [string ]string {
179
167
"file.yml" : `foo: #@ data.values.nothere` ,
@@ -200,7 +188,7 @@ func Test_TemplateError_DisplayedInStatus_UsefulErrorMessageProperty(t *testing.
200
188
tmpFac := template .NewFactory (k8scs , fetchFac , false , exec .NewPlainCmdRunner ())
201
189
deployFac := deploy .NewFactory (k8scs , kubeconfig .NewKubeconfig (k8scs , log ), nil , exec .NewPlainCmdRunner (), log )
202
190
203
- crdApp := NewCRDApp (& app , log , & metrics.Metrics { ReconcileCountMetrics : appMetrics , ReconcileTimeMetrics : timeMetrics } , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
191
+ crdApp := NewCRDApp (& app , log , metrics .NewMetrics () , kappcs , fetchFac , tmpFac , deployFac , FakeComponentInfo {}, Opts {MinimumSyncPeriod : 30 * time .Second })
204
192
_ , err := crdApp .Reconcile (false )
205
193
assert .Nil (t , err , "Unexpected error with reconciling" , err )
206
194
0 commit comments