crossplane-contrib / crossplane-contrib/function-kro

Support read/write from/to pipeline context

Open
#30 4 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
23
Forks
8
Avg merge
14h 29m
Merged PRs (30d)
1

Description

### What problem are you facing?

As a user I expect `function-kro` to be able to access the pipeline context.
I see two gaps:

- **Reading** context in templates.

Users who place `function-kro` after function-environment-configs (or any function that populates a context) cannot reference those values in their resource templates, includeWhen, readyWhen, or forEach expressions. They must instead copy environment data into the XR spec/status via an earlier function, creating unnecessary coupling.

- **Writing** context for downstream functions.

`function-kro` may resolves values that downstream pipeline functions could use.
There is no mechanism to publish those values back to the context.

### How could this Function help solve your problem?

Reading from context could look like the following snippet:

```yaml
resources:
- id: bucket
template:
apiVersion: s3.aws.m.upbound.io/v1beta1
kind: Bucket
spec:
forProvider:
region: ${context["apiextensions.crossplane.io/environment"].region}
- id: logging
includeWhen:
- ${context["foo/bar"].enableLogging == true}
template: [...]
```

Writing to the context could look like a `context` field in the ResourceGraph spec:

```yaml
apiVersion: kro.fn.crossplane.io/v1beta1
kind: ResourceGraph
context:
"foo/bar":
bucketArn: ${bucket.status.atProvider.arn}
resources:
- id: bucket
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.