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

Use kmeta.ChildName for child resources #4361

Merged
merged 1 commit into from
Nov 17, 2021

Commits on Nov 17, 2021

  1. Use kmeta.ChildName for child resources

    When a reconciler generates a child resource, it risks creating a
    duplicate resource because of stale informer cache. This may happen
    for instance when two reconciliations of the same resource happen
    almost at the same time.
    To avoid this risk, children resources should use a name that is uniquely
    associated to that of the parent, so that any attempt of recreation would
    fail. Such failure, when it happens, is considered as a transient error,
    and it does not cause the TaskRun or the PipelineRun to fail.
    
    We use kmeta.ChildName to generate the names. This applies to Pods
    generated by TaskRuns and TaskRuns and Runs generated by PipelineRuns.
    ChildName combines a base name with a suffix, and if the resulting name is
    too long it shortens it by truncating it and appending an hash of the
    original name: https://pkg.go.dev/github.com/knative/pkg/kmeta#ChildName
    
    Resources that are not k8s resources, such as steps or scripts, are not
    affected by this change.
    
    Fixes tektoncd#4358
    
    Signed-off-by: Andrea Frittoli <[email protected]>
    afrittoli committed Nov 17, 2021
    Configuration menu
    Copy the full SHA
    82a43dc View commit details
    Browse the repository at this point in the history