Skip to content

Commit 2278f65

Browse files
committed
Update konnector developer docs
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com> On-behalf-of: @SAP karol.szwaj@sap.com
1 parent fbbda1c commit 2278f65

4 files changed

Lines changed: 51 additions & 38 deletions

File tree

docs/content/developers/konnector/controllers/cluster/apiservicebinding.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,21 @@ flowchart TD
2020
set_apiservicebinding_condition_connected_to_true(["Set condition 'Connected' to true"])
2121
set_apiservicebinding_condition_connected_to_false(["Set condition 'Connected' to false"])
2222
set_apiservicebinding_condition_schemainsync_to_true(["Set condition 'SchemaInSync' to true"])
23-
set_apiservicebinding_condition_schemainsync_to_false(["Set condition 'SchemaInSync' to false"])
2423
2524
get_apiserviceexport(["Get APIServiceExport"])
26-
convert_apiserviceexport_to_crd(["Convert APIServiceExport to CRD"])
2725
is_apiserviceexport_present{"export<br>exists?"}
28-
is_apiserviceexport_valid{"export<br>valid?"}
26+
27+
get_bound_schemas(["Get all referenced
28+
BoundSchemas from
29+
APIServiceExport"])
30+
bound_schema_fetch_successful(["Fetching BoundSchemas
31+
succeed?"])
32+
reference_bound_schema(["Reference BoundSchema
33+
in APIServiceBinding
34+
status"])
35+
convert_boundschema_to_crd(["Convert BoundSchema
36+
to CRD"])
37+
2938
3039
get_crd(["Get CRD"])
3140
create_crd(["Create CRD"])
@@ -42,29 +51,29 @@ flowchart TD
4251
4352
is_apiservicebinding_owned --> |yes| get_apiserviceexport
4453
get_apiserviceexport --> is_apiserviceexport_present
45-
is_apiserviceexport_present --> |yes| set_apiservicebinding_condition_connected_to_true
54+
is_apiserviceexport_present --> |yes| get_bound_schemas
4655
is_apiserviceexport_present --> |no| set_apiservicebinding_condition_connected_to_false
47-
set_apiservicebinding_condition_connected_to_true --> convert_apiserviceexport_to_crd
56+
get_bound_schemas --> bound_schema_fetch_successful
57+
bound_schema_fetch_successful --> |yes| reference_bound_schema
58+
bound_schema_fetch_successful --> |no| set_apiservicebinding_condition_connected_to_false
59+
reference_bound_schema --> convert_boundschema_to_crd
4860
set_apiservicebinding_condition_connected_to_false --> stop
4961
50-
convert_apiserviceexport_to_crd --> is_apiserviceexport_valid
51-
is_apiserviceexport_valid --> |yes| get_crd
52-
is_apiserviceexport_valid --> |no| set_apiservicebinding_condition_schemainsync_to_false
62+
convert_boundschema_to_crd --> get_crd
5363
5464
get_crd --> is_crd_present
5565
is_crd_present --> |no| create_crd
5666
is_crd_present --> |yes| is_crd_owned
57-
update_crd --> set_apiservicebinding_condition_schemainsync_to_true
58-
create_crd --> set_apiservicebinding_condition_schemainsync_to_true
67+
create_crd --> update_crd
68+
69+
update_crd --> set_apiservicebinding_condition_connected_to_true
70+
set_apiservicebinding_condition_connected_to_true --> set_apiservicebinding_condition_schemainsync_to_true
5971
6072
is_crd_owned --> |yes| update_crd
61-
is_crd_owned --> |no| set_apiservicebinding_condition_schemainsync_to_false
73+
is_crd_owned --> |no| set_apiservicebinding_condition_connected_to_false
6274
6375
set_apiservicebinding_condition_schemainsync_to_true --> get_clusterbinding
64-
set_apiservicebinding_condition_schemainsync_to_false --> get_clusterbinding
65-
6676
get_clusterbinding --> set_apiservicebinding_provider_name
67-
6877
is_apiservicebinding_owned --> |no| stop
6978
set_apiservicebinding_provider_name --> stop
7079
```

docs/content/developers/konnector/controllers/cluster/apiserviceexport.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,20 @@ flowchart TD
2929
for APIServiceExport"])
3030
is_apiserviceexport_present{"APIServiceExport<br>exists?"}
3131
32-
get_crd(["Get referenced
33-
CustomResourceDefinition"])
34-
get_crd2(["Get referenced
35-
CustomResourceDefinition"])
36-
37-
is_crd_present{"CRD<br>exists?"}
38-
is_crd_present2{"CRD<br>exists?"}
32+
get_bound_schemas(["Get referenced
33+
BoundSchemas"])
34+
get_bound_schemas2(["Get referenced
35+
BoundSchemas"])
36+
is_bound_schema_present{"BoundSchema<br>exists?"}
37+
update_bound_schema(["Update BoundSchema
38+
status"])
3939
4040
stop_apiserviceexport_sync(["Stop APIServiceExport sync"])
4141
4242
get_binding(["Get referenced
4343
APIServiceBinding"])
44-
get_binding2(["Get referenced APIServiceBinding"])
44+
get_binding2(["Get referenced
45+
APIServiceBinding"])
4546
4647
is_binding_present{"APIServiceBinding<br>exists?"}
4748
is_binding_present2{"APIServiceBinding<br>exists?"}
@@ -59,6 +60,8 @@ to false"])
5960
set_apiserviceexport_condition_consumerinsync_to_false(["Set condition
6061
'ConsumerInSync' to false"])
6162
63+
get_crd(["Get referenced
64+
CustomResourceDefinition"])
6265
copy_crd_conditions(["Copy CRD conditions
6366
to APIServiceExport
6467
conditions"])
@@ -71,31 +74,32 @@ to false"])
7174
start --> enqueue_reconcile
7275
enqueue_reconcile --> is_apiserviceexport_present
7376
is_apiserviceexport_present --> |no| stop
74-
is_apiserviceexport_present --> |yes| get_crd
75-
get_crd --> is_crd_present
76-
is_crd_present --> |yes| get_binding
77-
is_crd_present --> |no| stop_apiserviceexport_sync
78-
stop_apiserviceexport_sync --> stop
77+
is_apiserviceexport_present --> |yes| get_binding
7978
8079
get_binding --> is_binding_present
81-
is_binding_present --> |yes| start_new_syncer
80+
is_binding_present --> |yes| get_bound_schemas
8281
is_binding_present --> |no| stop_apiserviceexport_sync
8382
stop_apiserviceexport_sync --> stop
8483
84+
get_bound_schemas --> is_bound_schema_present
85+
is_bound_schema_present --> |yes| start_new_syncer
86+
is_bound_schema_present --> |no| stop_apiserviceexport_sync
87+
stop_apiserviceexport_sync --> stop
88+
8589
start_new_syncer --> get_binding2
8690
get_binding2 --> is_binding_present2
8791
is_binding_present2 --> |yes| set_apiserviceexport_condition_connected_to_true
8892
is_binding_present2 --> |no| set_apiserviceexport_condition_connected_to_false
8993
set_apiserviceexport_condition_connected_to_false --> set_apiserviceexport_condition_consumerinsync_to_false
9094
set_apiserviceexport_condition_connected_to_true --> is_binding_schemainsync
9195
is_binding_schemainsync --> |yes| set_apiserviceexport_condition_consumerinsync_to_true
92-
set_apiserviceexport_condition_consumerinsync_to_true --> get_crd2
96+
set_apiserviceexport_condition_consumerinsync_to_true --> get_bound_schemas2
9397
is_binding_schemainsync --> |no| set_apiserviceexport_condition_consumerinsync_to_false
94-
set_apiserviceexport_condition_consumerinsync_to_false --> get_crd2
98+
set_apiserviceexport_condition_consumerinsync_to_false --> get_bound_schemas2
9599
96-
get_crd2 --> is_crd_present2
97-
is_crd_present2 --> |no| stop
98-
is_crd_present2 --> |yes| copy_crd_conditions
100+
get_bound_schemas2 --> get_crd
101+
get_crd --> copy_crd_conditions
99102
copy_crd_conditions --> set_summary_condition
100-
set_summary_condition --> stop
103+
set_summary_condition --> update_bound_schema
104+
update_bound_schema --> stop
101105
```

pkg/konnector/controllers/cluster/servicebinding/servicebinding_reconcile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (r *reconciler) ensureCRDs(ctx context.Context, binding *kubebindv1alpha2.A
131131
return nil // nothing we can do here
132132
}
133133

134-
// Get all APIResourceSchema objects referenced by the export
134+
// Get all BoundSchema objects referenced by the export
135135
schemas, err := r.getSchemasFromExport(ctx, export)
136136
if err != nil {
137137
conditions.MarkFalse(
@@ -148,7 +148,7 @@ func (r *reconciler) ensureCRDs(ctx context.Context, binding *kubebindv1alpha2.A
148148

149149
// Process each schema
150150
for _, schema := range schemas {
151-
if err := r.referenceBoundAPIResourceSchema(ctx, binding, schema.Name); err != nil {
151+
if err := r.referenceBoundSchema(ctx, binding, schema.Name); err != nil {
152152
errs = append(errs, err)
153153
}
154154

@@ -166,7 +166,7 @@ func (r *reconciler) ensureCRDs(ctx context.Context, binding *kubebindv1alpha2.A
166166
return utilerrors.NewAggregate(errs)
167167
}
168168

169-
func (r *reconciler) referenceBoundAPIResourceSchema(ctx context.Context, binding *kubebindv1alpha2.APIServiceBinding, name string) error {
169+
func (r *reconciler) referenceBoundSchema(ctx context.Context, binding *kubebindv1alpha2.APIServiceBinding, name string) error {
170170
boundSchema, err := r.getBoundSchema(ctx, name)
171171
if err != nil && !errors.IsNotFound(err) {
172172
return fmt.Errorf("failed to get BoundSchema %s: %w", name, err)

pkg/konnector/controllers/cluster/serviceexport/serviceexport_reconcile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (r *reconciler) ensureControllers(ctx context.Context, name string, export
131131

132132
for _, res := range export.Spec.Resources {
133133
name := res.ResourceGroupName()
134-
// Fetch the APIResourceSchema
134+
// Fetch the BoundSchema
135135
schema, err := r.getRemoteBoundSchema(ctx, name)
136136
if err != nil {
137137
if errors.IsNotFound(err) {

0 commit comments

Comments
 (0)