Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Create an OwnerReference based watch on the unpack job #63

@rashmigottipati

Description

@rashmigottipati

In the controller's Reconcile function, the existing logic creates the unpack job and obtains the pods for the job and if there is an error during the parsing of unpack logs to obtain the pods, then we check if the error is due to pod not being present and if it is, then we requeue after 10s. This is essentially polling for every 10s even when no events come in, and it also leads to ignoring any events that come between 0-10s.

Ideally, we should reconcile when the state of the job changes instead of polling. Therefore, the better solution is to put an OwnerReference on the job (which we already do) and create an OwnerReference based watch on the job such that we reconcile when state of the job changes. We may also need to do a similar thing for the underlying pod itself.

Also, instead of doing a RequeueAfter for every 10s, we should just return the error as that would trigger exponential backoff.

See: #34 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions