Skip to content

Commit c871303

Browse files
committed
resolved the nits
Signed-off-by: sethiyash <[email protected]>
1 parent 1631608 commit c871303

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

cmd/controller/run.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,15 @@ func Run(opts Options, runLog logr.Logger) error {
197197
}
198198
{ // add controller for apps
199199
appFactory := app.CRDAppFactory{
200-
CoreClient: coreClient,
201-
AppClient: kcClient,
202-
KcConfig: kcConfig,
203-
CountMetrics: countMetrics,
204-
TimeMetrics: reconcileTimeMetrics,
205-
CmdRunner: sidecarCmdExec,
206-
Kubeconf: kubeconf,
207-
CompInfo: compInfo,
208-
CacheFolder: cacheFolderApps,
200+
CoreClient: coreClient,
201+
AppClient: kcClient,
202+
KcConfig: kcConfig,
203+
CountMetrics: countMetrics,
204+
ReconcileTimeMetrics: reconcileTimeMetrics,
205+
CmdRunner: sidecarCmdExec,
206+
Kubeconf: kubeconf,
207+
CompInfo: compInfo,
208+
CacheFolder: cacheFolderApps,
209209
}
210210
reconciler := app.NewReconciler(kcClient, runLog.WithName("app"),
211211
appFactory, refTracker, updateStatusTracker, compInfo)

pkg/app/app_factory.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ import (
2323

2424
// CRDAppFactory allows to create CRDApps.
2525
type CRDAppFactory struct {
26-
CoreClient kubernetes.Interface
27-
AppClient kcclient.Interface
28-
KcConfig *config.Config
29-
CountMetrics *metrics.ReconcileCountMetrics
30-
TimeMetrics *metrics.ReconcileTimeMetrics
31-
VendirConfigHook func(vendirconf.Config) vendirconf.Config
32-
KbldAllowBuild bool
33-
CmdRunner exec.CmdRunner
34-
Kubeconf *kubeconfig.Kubeconfig
35-
CompInfo ComponentInfo
36-
DeployFactory deploy.Factory
37-
CacheFolder *memdir.TmpDir
26+
CoreClient kubernetes.Interface
27+
AppClient kcclient.Interface
28+
KcConfig *config.Config
29+
CountMetrics *metrics.ReconcileCountMetrics
30+
ReconcileTimeMetrics *metrics.ReconcileTimeMetrics
31+
VendirConfigHook func(vendirconf.Config) vendirconf.Config
32+
KbldAllowBuild bool
33+
CmdRunner exec.CmdRunner
34+
Kubeconf *kubeconfig.Kubeconfig
35+
CompInfo ComponentInfo
36+
DeployFactory deploy.Factory
37+
CacheFolder *memdir.TmpDir
3838
}
3939

4040
// NewCRDApp creates a CRDApp injecting necessary dependencies.
@@ -49,7 +49,7 @@ func (f *CRDAppFactory) NewCRDApp(app *kcv1alpha1.App, log logr.Logger) *CRDApp
4949
templateFactory := template.NewFactory(f.CoreClient, fetchFactory, f.KbldAllowBuild, f.CmdRunner)
5050
deployFactory := deploy.NewFactory(f.CoreClient, f.Kubeconf, f.KcConfig, f.CmdRunner, log)
5151

52-
return NewCRDApp(app, log, f.CountMetrics, f.TimeMetrics, f.AppClient, fetchFactory, templateFactory, deployFactory, f.CompInfo, Opts{
52+
return NewCRDApp(app, log, f.CountMetrics, f.ReconcileTimeMetrics, f.AppClient, fetchFactory, templateFactory, deployFactory, f.CompInfo, Opts{
5353
DefaultSyncPeriod: f.KcConfig.AppDefaultSyncPeriod(),
5454
MinimumSyncPeriod: f.KcConfig.AppMinimumSyncPeriod(),
5555
})

pkg/app/app_reconcile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ func (a *App) reconcileDeploy() error {
105105
}
106106

107107
func (a *App) reconcileFetchTemplateDeploy() exec.CmdRunResult {
108-
reconcileStartTS := time.Now()
108+
reconcileStartTime := time.Now()
109109
a.isFirstReconcile = a.countMetrics.GetReconcileAttemptCounterValue("app", a.app.Name, a.app.Namespace) == 1
110110
defer func() {
111111
a.timeMetrics.RegisterOverallTime(appResourceType, a.app.Name, a.app.Namespace, a.isFirstReconcile,
112-
time.Since(reconcileStartTS))
112+
time.Since(reconcileStartTime))
113113
}()
114114

115115
tmpDir := memdir.NewTmpDir("fetch-template-deploy")

pkg/packageinstall/packageinstall.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ func (pi *PackageInstallCR) reconcile(modelStatus *reconciler.Status) (reconcile
113113
pi.log.Info("Reconciling")
114114
pi.countMetrics.RegisterReconcileAttempt(packageInstallType, pi.model.Name, pi.model.Namespace)
115115

116-
reconcileStartTS := time.Now()
116+
reconcileStartTime := time.Now()
117117
pi.firstReconcile = pi.countMetrics.GetReconcileAttemptCounterValue("pkgi", pi.model.Name, pi.model.Namespace) == 1
118118
defer func() {
119119
pi.timeMetrics.RegisterOverallTime(packageInstallType, pi.model.Name, pi.model.Namespace,
120-
pi.firstReconcile, time.Since(reconcileStartTS))
120+
pi.firstReconcile, time.Since(reconcileStartTime))
121121
}()
122122

123123
err := pi.blockDeletion()

pkg/pkgrepository/app_reconcile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ func (a *App) reconcileDeploy() error {
9494
}
9595

9696
func (a *App) reconcileFetchTemplateDeploy() exec.CmdRunResult {
97-
reconcileStartTS := time.Now()
97+
reconcileStartTime := time.Now()
9898
a.isFirstReconcile = a.countMetrics.GetReconcileAttemptCounterValue(packageRepoResourceType, a.app.Name, a.app.Namespace) == 1
9999
defer func() {
100100
a.timeMetrics.RegisterOverallTime(packageRepoResourceType, a.app.Name, a.app.Namespace, a.isFirstReconcile,
101-
time.Since(reconcileStartTS))
101+
time.Since(reconcileStartTime))
102102
}()
103103

104104
tmpDir := memdir.NewTmpDir("fetch-template-deploy")

pkg/pkgrepository/app_reconcile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package pkgrepository
55

66
import (
7-
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics"
87
"testing"
98

109
"github.com/stretchr/testify/assert"
@@ -15,6 +14,7 @@ import (
1514
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/exec"
1615
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch"
1716
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/kubeconfig"
17+
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics"
1818
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/template"
1919
corev1 "k8s.io/api/core/v1"
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

pkg/pkgrepository/crd_app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ package pkgrepository
66
import (
77
"context"
88
"fmt"
9-
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics"
109

1110
"github.com/go-logr/logr"
1211
kcv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/kappctrl/v1alpha1"
1312
pkgingv1alpha1 "github.com/vmware-tanzu/carvel-kapp-controller/pkg/apis/packaging/v1alpha1"
1413
kcclient "github.com/vmware-tanzu/carvel-kapp-controller/pkg/client/clientset/versioned"
1514
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/deploy"
1615
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/fetch"
16+
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/metrics"
1717
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/reftracker"
1818
"github.com/vmware-tanzu/carvel-kapp-controller/pkg/template"
1919
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

0 commit comments

Comments
 (0)