Skip to content

[Feature Request] Add type to result of condition evaluation  #2424

Closed

Description

@btlem

Summary

The current Workflow implementation allows for the registration of dependent ready conditions, which produces a binary result. However, the specific business logic for what "ready" means may contain information that would be useful to propagate to the status of the primary, such as "Conditions".

Proposal (for brainstorming)

Include an additional return type in the signature of the isMet method, which will allow for storing additional information related to the computation of whether the dependent is ready or not.

Example Scenario

Dependent Resource -> Ingress
Is Ready Condition -> Are endpoints externally accessible (DNS record etc), returns status of each
Primary Status Condition -> Are endpoints ready, if not which are pending

Activity

  1. csviri commented on Jun 4, 2024

    @csviri
    Collaborator

    This sounds, useful yes!

    Note that you can now add arbitrary information to the context and use it later when creating the status here:

    <T> Optional<T> get(Object key, Class<T> expectedType);
    /**
    * Associates the specified contextual value to the specified key. If the value is {@code null},
    * the semantics of this operation is defined as removing the mapping associated with the
    * specified key.
    *
    * @param <T> object type
    * @param key the key identifying which contextual object to add or remove from the context
    * @param value the value to add to the context or {@code null} to remove an existing entry
    * associated with the specified key
    * @return an Optional containing the previous value associated with the key or
    * {@link Optional#empty()} if none existed
    */
    @SuppressWarnings("unchecked")
    <T> T put(Object key, T value);

  2. added this to the 5.0 milestone on Jun 4, 2024
  3. self-assigned this
    on Jun 5, 2024
  4. added a commit that references this issue on Jun 5, 2024
    ebca78c
  5. metacosm commented on Jun 5, 2024

    @metacosm
    Collaborator

    @btlem let us know if the associated PR addresses your use case.

  6. btlem commented on Jun 11, 2024

    @btlem
    Author

    @metacosm Read through the PR and it looks good to me. I agree with the comment that it is general and could be applied to more conditions, though my main use-case is covered here, so this part is mainly nice-to-have for me

    Thanks both (+ @csviri ) for the quick action on this!

  7. added a commit that references this issue on Jun 18, 2024
    e372139
  8. added 2 commits that reference this issue on Jun 19, 2024
    6b54919
    3876208
  9. added 5 commits that reference this issue on Jul 1, 2024
    e7bdd24
    a0b9350
    35eb8e3
    934a1fb
    51dd0f5
  10. 15 remaining items

  11. added a commit that references this issue on Oct 10, 2024
    e1477e0
  12. added 4 commits that reference this issue on Nov 5, 2024
    917a552
    436a347
    f156754
    053f15b
  13. added 2 commits that reference this issue on Nov 13, 2024
    132cbe3
    ec2e4fc
  14. added 6 commits that reference this issue on Nov 19, 2024
    70b86e8
    e70076a
    8343ff8
    464b497
    8614362
    0c4c737
  15. added 2 commits that reference this issue on Dec 6, 2024
    d7dfa5d
    a2b4a31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions