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

Add conditions.Factory #58

Merged

Commits on Sep 10, 2021

  1. Add conditions.Factory

    The conditions.NewCondition function reads cluster state to determine
    the namespace the operator is running in so that it can manipulate the
    correct OperatorConditions object in a cluster.
    
    However this function's dependency on a specific file existing in a
    specific location makes it difficult to test code that uses it.
    
    The Factory interface is introduced to enable users to provide their own
    implementations for building a Condition object to manage OperatorCondition
    resources. Users can now build a factory and inject it into code that builds
    new conditions. This enables code under test to use the Factory abstraction
    and enables operator authors to inject custom functionality needed when
    writing tests.
    
    Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
    joelanford committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    61b77e2 View commit details
    Browse the repository at this point in the history