Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex matching deleting resources from observed state #40

Open
twobiers opened this issue Jan 23, 2025 · 0 comments · May be fixed by #41
Open

Regex matching deleting resources from observed state #40

twobiers opened this issue Jan 23, 2025 · 0 comments · May be fixed by #41
Labels
bug Something isn't working

Comments

@twobiers
Copy link

What happened?

The current function logic is preventing deletion of already created resources only for full-name matches and not for regex matches.

How can we reproduce it?

When using the following logic composition, the function will attempt to delete the second resource once it becomes unready or an additional resource matching the first-resource.* pattern will be added to it.

apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: function-sequencer
spec:
  compositeTypeRef:
    apiVersion: example.crossplane.io/v1
    kind: XR
  mode: Pipeline
  pipeline:
  - step: patch-and-transform
    functionRef:
      name: function-patch-and-transform
    input:
      apiVersion: pt.fn.crossplane.io/v1beta1
      kind: Resources
      resources:
        - name: first-resource
          base:
            apiVersion: nop.crossplane.io/v1alpha1
            kind: NopResource
            spec:
              forProvider:
                conditionAfter:
                  - time: 5s
                    conditionType: Ready
                    conditionStatus: "False"
                  - time: 10s
                    conditionType: Ready
                    conditionStatus: "True"
                  # We should not delete the dependent resources if this turns back to unready.
                  - time: 30s
                    conditionType: Ready
                    conditionStatus: "False"
                  - time: 90s
                    conditionType: Ready
                    conditionStatus: "True"
        - name: second-resource
          base:
            apiVersion: nop.crossplane.io/v1alpha1
            kind: NopResource
            spec:
              forProvider:
                conditionAfter:
                  - time: 5s
                    conditionType: Ready
                    conditionStatus: "False"
                  - time: 10s
                    conditionType: Ready
                    conditionStatus: "True"
       
  - step: detect-readiness
    functionRef:
      name: function-auto-ready
  - step: sequence-creation
    functionRef:
      name: function-sequencer
    input:
      apiVersion: sequencer.fn.crossplane.io/v1beta1
      kind: Input
      rules:
        - sequence:
          - first.*-resource
          - second.*-resource

What environment did it happen in?

Function version: 0.2.2

@twobiers twobiers added the bug Something isn't working label Jan 23, 2025
@twobiers twobiers linked a pull request Jan 23, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant