Skip to content

feat: customizable ttl#426

Merged
bobh66 merged 10 commits intocrossplane-contrib:mainfrom
fernandezcuesta:main
Apr 13, 2026
Merged

feat: customizable ttl#426
bobh66 merged 10 commits intocrossplane-contrib:mainfrom
fernandezcuesta:main

Conversation

@fernandezcuesta
Copy link
Copy Markdown
Contributor

@fernandezcuesta fernandezcuesta commented May 23, 2025

Description of your changes

Add the ability to set a custom TTL for the function response.

It allows 3 ways to set it up besides the current (default), from lower to higher precedence:

  • default (current behaviour)
  • as a cli argument (deploymentruntimeconfig)
  • as a function input
  • as an annotation in the XR

Fixes #424

I have:

Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
# Common versions
GO_VERSION: '1.23.8'
GOLANGCI_VERSION: 'v1.62.0'
GO_VERSION: '1.24.1'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go1.24.3 was a security release so if updating to 1.24, it should be 1.24.3 (or .4 in a couple of days)

Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

Is there a chance to get this PR reviewed, or in other words, is there anything utterly bad with it/some reason not to approve it? I can invest time resolving the conflicts but want to know first if it makes sense as is. 🙇

Copy link
Copy Markdown
Collaborator

@bobh66 bobh66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fernandezcuesta - sorry for the delay. It looks like there are merge conflicts that need to be resolved.

Also I think it would be better to limit this PR to just the TTL changes and leave the other changes to separate PRs.

@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

Sure I'll split them into two then (basically remove all bump ups in actions and golangcilint)

Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

@bobh66 done

@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

Closing as this PR doesn't look to be of interest.

@Ata-NovacekJan
Copy link
Copy Markdown

Hi @fernandezcuesta , I'd like to ask you - how did you work around this problem in the end? We're facing performance issues with the TTL being its root cause - a huge spike in Crossplane operations after switching to realtime compositions - and came to very similar solution as you did here, just without the contribution due to ... well, inactivity of maintainers, that's how your contribution ended. :(

@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

Hi @Ata-NovacekJan once we enabled real-time compositions I guess this doesn't apply that much. My understanding is that a function that doesn't set a TTL is not affecting the pipeline overall in the sense that:

  • The reconciler triggers as defined by the final TTL, which would be the minimum non-zero (set) TTL of the functions in the pipeline.
  • If no function sets a TTL, the behavior depends on mode, RT composition doesn't requeue XR reconciliation (just watches changes), classic mode falls back to the poll interval (1min).

So my understanding is that setting a TTL would force the composition to reconcile periodically. In our case, the problem was a continous drift of arrays being sorted by crossplane-runtime. Nothing that TTL would help with.

@bobh66 bobh66 requested a review from adamwg as a code owner April 13, 2026 15:32
@bobh66
Copy link
Copy Markdown
Collaborator

bobh66 commented Apr 13, 2026

@fernandezcuesta would you be interested in bringing this PR up to date? I think it would be useful to have this feature. Thanks!

@fernandezcuesta
Copy link
Copy Markdown
Contributor Author

@bobh66 sure, let me work on it later today

Signed-off-by: Jesús Fernández <7312236+fernandezcuesta@users.noreply.github.com>
@fernandezcuesta fernandezcuesta requested a review from bobh66 April 13, 2026 16:20
Copy link
Copy Markdown
Collaborator

@bobh66 bobh66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@bobh66 bobh66 merged commit 2171d4a into crossplane-contrib:main Apr 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for setting the response Meta.TTL

4 participants