crossplane-contrib / crossplane-contrib/function-sequencer

Possibility to make sequence dynamic if component not present in claim spec

Open
#65 2 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
37
Forks
19
Avg merge
1d 14h
Merged PRs (30d)
4

Description

### What problem are you facing?
Hi, we have a composition that creates nearly 13 components including usages, and since we have dependencies per components, we specify different sequences, example:
`
rules:
- sequence:
- component1
- component1secret
- component1usage
- sequence:
- component1
- component2
- component2secret1
- component2secret2
- component2usage
- sequence:
- component1
- component3
- component3secret
- component3usage
`

The problem we are facing is that for some environments we do not need all components and when we remove the not needed components from claim spec. When removing a component from spec, the logic in kcl code does not return that component. Since the component is define on the sequence (hardcoded), the sequencer function keeps waiting for it, and even if all needed component are ready, claim stays in an unready status.

### How could this Function help solve your problem?
Is it possible to accept the following feature. Have a key equal to the component key in spec, and check if the component exist in spec, if it doesn't exist, we skip the sequence, if it exists, we append it and take it into account, example:
`
rules:
- component1: <- this key is checked in spec, if not present skipped
- component1
- component1secret
- component1usage
- component2: <- same
- component1
- component2
- component2secret1
- component2secret2
- component2usage
- component3: <- same
- component1
- component3
- component3secret
- component3usage
- sequence: <- keeping this as default behaviour
- component4
- component4secret
- component4usage
`

Tested on my side, i could propose a PR.

Thanks in advance.

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.