Skip to content

Trying to copy resources from observed state. #121

Open
@spastorclovr

Description

@spastorclovr

What happened?

I have a condition in my composition that could result in some resources not being generated (while they should)
In order for them not to be deleted, because they are no longer present in the desired state, I am trying to figure out how to
copy the resources from the observed state when this condition happens.

I tried to copy over resources from req.observed.resources to rsp.desired.resources like so

            for observed_resource in req.observed.resources:
                resource.update(
                    rsp.desired.resources[observed_resource], req.observed.resources[observed_resource].resource
                )

But I have this error in the composite using this fucntion


  Warning  ComposeResources  6m7s (x5626 over 15m)  defined/compositeresourcedefinition.apiextensions.crossplane.io  cannot compose resources: cannot apply composed resource "namespace": metadata.managedFields must be nil

And also the function seems to be constantly called for reconciliation.

This might not be the right way to do this?

Thx!

What environment did it happen in?

Function version:
skk = 0.6.0
crossplane 1.18

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