Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/controller/kustomization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type KustomizationReconciler struct {
artifactFetchRetries int
requeueDependency time.Duration

APIReader client.Reader
StatusPoller *polling.StatusPoller
PollingOpts polling.Options
ControllerName string
Expand Down Expand Up @@ -488,7 +489,7 @@ func (r *KustomizationReconciler) checkDependencies(ctx context.Context,
Name: d.Name,
}
var k kustomizev1.Kustomization
err := r.Get(ctx, dName, &k)
err := r.APIReader.Get(ctx, dName, &k)
if err != nil {
return fmt.Errorf("dependency '%s' not found: %w", dName, err)
}
Expand Down
1 change: 1 addition & 0 deletions internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func TestMain(m *testing.M) {
reconciler = &KustomizationReconciler{
ControllerName: controllerName,
Client: testEnv,
APIReader: testEnv,
EventRecorder: testEnv.GetEventRecorderFor(controllerName),
Metrics: testMetricsH,
ConcurrentSSA: 4,
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ func main() {
ControllerName: controllerName,
DefaultServiceAccount: defaultServiceAccount,
Client: mgr.GetClient(),
APIReader: mgr.GetAPIReader(),
Metrics: metricsH,
EventRecorder: eventRecorder,
NoCrossNamespaceRefs: aclOptions.NoCrossNamespaceRefs,
Expand Down