Skip to content

Commit 5c6cad5

Browse files
committed
adjust boundschema scope when reconciling service export requests
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 8989855 commit 5c6cad5

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

backend/controllers/serviceexportrequest/serviceexportrequest_reconcile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ func (r *reconciler) ensureBoundSchemas(ctx context.Context, cl client.Client, c
163163
continue
164164
}
165165

166+
// If namespaced isolation is configured for cluster-scoped objects,
167+
// we need to rewrite the BoundSchema's scope accordingly. For all
168+
// other isolation strategies, as well as for namespaced schemas,
169+
// no changes are necessary.
170+
if boundSchema.Spec.Scope == apiextensionsv1.ClusterScoped && r.clusterScopedIsolation == kubebindv1alpha2.IsolationNamespaced {
171+
boundSchema.Spec.Scope = apiextensionsv1.NamespaceScoped
172+
}
173+
166174
if err := r.createBoundSchema(ctx, cl, boundSchema); err != nil {
167175
return err
168176
}

0 commit comments

Comments
 (0)