-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abff03a
commit 9b97276
Showing
3 changed files
with
91 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,10 +50,9 @@ type ModuleReconciler struct { | |
client.Client | ||
Scheme *runtime.Scheme | ||
|
||
templatesRepo templaterepo.ITemplateRepo | ||
kubernetesClient k8sclient.IKubernetesClient | ||
renderer *render.Renderer | ||
skipReconciliation bool | ||
templatesRepo templaterepo.ITemplateRepo | ||
kubernetesClient k8sclient.IKubernetesClient | ||
renderer *render.Renderer | ||
|
||
telemetryClient telemetry.Client | ||
monitor prometheus.Monitor | ||
|
@@ -66,20 +65,18 @@ func NewModuleReconciler( | |
templatesRepo templaterepo.ITemplateRepo, | ||
kubernetesClient k8sclient.IKubernetesClient, | ||
renderer *render.Renderer, | ||
skipReconciliation bool, | ||
telemetryClient telemetry.Client, | ||
monitor prometheus.Monitor, | ||
) *ModuleReconciler { | ||
return &ModuleReconciler{ | ||
Client: client, | ||
Scheme: scheme, | ||
templatesRepo: templatesRepo, | ||
kubernetesClient: kubernetesClient, | ||
renderer: renderer, | ||
telemetryClient: telemetryClient, | ||
monitor: monitor, | ||
skipReconciliation: skipReconciliation, | ||
logger: ctrl.Log.WithName("reconciler"), | ||
Client: client, | ||
Scheme: scheme, | ||
templatesRepo: templatesRepo, | ||
kubernetesClient: kubernetesClient, | ||
renderer: renderer, | ||
telemetryClient: telemetryClient, | ||
monitor: monitor, | ||
logger: ctrl.Log.WithName("reconciler"), | ||
} | ||
} | ||
|
||
|
@@ -97,11 +94,6 @@ func NewModuleReconciler( | |
// For more details, check Reconcile and its Result here: | ||
// - https://pkg.go.dev/sigs.k8s.io/[email protected]/pkg/reconcile | ||
func (r *ModuleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { | ||
if r.skipReconciliation { | ||
r.logger.Info("skipping reconciliation", "namespaced name", req.NamespacedName) | ||
return ctrl.Result{}, nil | ||
} | ||
|
||
_ = log.FromContext(ctx) | ||
r.telemetryClient.ModuleReconciliation() | ||
r.monitor.OnReconciliation() | ||
|