Unproject using the same mapping used to project the binding by scothis · Pull Request #233 · servicebinding/runtime

@scothis

From the spec:

> When a service binding projection is removed, the controller MUST use
> the same mappings from the projection creation. After a
> ClusterWorkloadResourceMapping resource is modified, each binding
> targeting the mapped workload type MUST be removed, then reattempted
> with the latest mapping.

We now stash the mapping used to project the binding on the workload as
an annotation. When unprojecting that same binding, we use the stashed
mapping to unproject the binding. If updating an existing binding, the
stashed mapping is used to cleanup existing state before the updated
mapping is used to re-project the binding into the workload.

Signed-off-by: Scott Andrews <andrewssc@vmware.com>

@scothis scothis marked this pull request as ready for review

January 23, 2023 14:58

sadlerap

sadlerap

sadlerap