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

Panic in controller when step fails before image digest exporter #2222

Merged
merged 1 commit into from Mar 17, 2020
Merged

Panic in controller when step fails before image digest exporter #2222

merged 1 commit into from Mar 17, 2020

Commits on Mar 16, 2020

  1. Panic in controller when step fails before image digest exporter

    The image digest exporter (part of the Image Output Resource) is
    configured with `"terminationMessagePolicy": "FallbackToLogsOnError",`.
    
    When a previous step has failed in a Task our entrypoint wrapping the
    exporter emits a log line like `2020/03/13 12:03:26 Skipping
    step because a previous step failed`. Because the image digest exporter
    is set to FallbackToLogsOnError Kubernetes slurps up this log line as
    the termination message.
    
    That line gets read by the Tekton controller, which is looking for JSON
    in the termination message. It fails to parse and stops trying to read
    step statuses.
    
    That in turn results in a mismatch in the length of the list of steps and
    the length of the list of step statuses. Finally we attempt to sort
    the list of step statuses alongside the list of steps. This method
    panics with an out of bounds error because it assumes the lengths of the two
    lists are the same.
    
    So, this PR does the following things:
    
    1. The image digest exporter has the FallbackToLogsOnError policy
    removed. I can't think of a reason that we need this anymore.
    2. The Tekton controller no longer breaks out of the loop while it's
    parsing step statuses and instead simply ignores non-JSON termination
    messages.
    Scott committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    7a59431 View commit details
    Browse the repository at this point in the history