Skip to content

function overrides the whole context (key) instead of inserting new (into) keys #92

@tenstad

Description

@tenstad

What happened?

The function overrides all previous runs instead of adding new keys to the context.

In the case below, I would expect the 2nd run to simply add obj-1 into the context, and leave obj-0 be, so that both obj-0 and obj-1 are present at the end.

How can we reproduce it?

- step: first
  functionRef:
    name: crossplane-contrib-function-extra-resources
  input:
    apiVersion: extra-resources.fn.crossplane.io/v1beta1
    kind: Input
    spec:
      policy:
        resolution: Required # these are required
      extraResources:
        - into: obj-0
          # ...
- step: second
  functionRef:
    name: crossplane-contrib-function-extra-resources
  input:
    apiVersion: extra-resources.fn.crossplane.io/v1beta1
    kind: Input
    spec:
      policy:
        resolution: Optional # these are optional
      extraResources:
        - into: obj-1
          # ...

Suggested solution

Load the potentially existing context and insert the new (into) keys. No need to deep-merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions