Allow cross-shard dependency check

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2024-09-25 11:45:10 +03:00
parent aabb41fc5d
commit 2b44187c23
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
3 changed files with 4 additions and 1 deletions

View File

@ -89,6 +89,7 @@ type KustomizationReconciler struct {
artifactFetchRetries int
requeueDependency time.Duration
APIReader client.Reader
StatusPoller *polling.StatusPoller
PollingOpts polling.Options
ControllerName string
@ -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)
}

View File

@ -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,

View File

@ -238,6 +238,7 @@ func main() {
ControllerName: controllerName,
DefaultServiceAccount: defaultServiceAccount,
Client: mgr.GetClient(),
APIReader: mgr.GetAPIReader(),
Metrics: metricsH,
EventRecorder: eventRecorder,
NoCrossNamespaceRefs: aclOptions.NoCrossNamespaceRefs,