Skip to content

Support read/write from/to pipeline context #30

@fernandezcuesta

Description

@fernandezcuesta

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:

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions