Skip to content

chore: Update controller finalizer name to include explicit part #2099

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

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented May 22, 2025

  • The finalizer name used by the controller was updated.
  • A new constant FinalizerName was introduced for the explicit part of the
    name.
  • The finalizer name was updated to combine the group name and the new
    constant.
  • This change aligns the finalizer naming with common Kubernetes conventions and avoid this warning in controller ∙ 12:08:22 pac-watcher API Warning: metadata.finalizers: "pipelinesascode.tekton.dev": prefer a domain-qualified finalizer name including a path (/) to avoid accidental conflicts with other finalizer writers
  • update some bad pattern across the code where we use filepath.Join instead of path.Join (since os dependent) for annotation

Fixes #1763

Changes

Submitter Checklist

  • 📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).

  • ♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.

  • ✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).

  • 📖 Document any user-facing features or changes in behavior.

  • 🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.

  • 🎁 If feasible, add an end-to-end test. See README for details.

  • 🔎 Address any CI test flakiness before merging, or provide a valid reason to bypass it (e.g., token rate limitations).

  • If adding a provider feature, fill in the following details:

    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

    (update the provider documentation accordingly)

@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 10:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request updates the controller's finalizer naming by introducing a new constant and combining it with the group name, aligning with Kubernetes naming conventions.

  • Updated the finalizer name assignment in the controller.
  • Adjusted the corresponding test to validate the new finalizer format.
  • Introduced a new constant FinalizerName in the register package.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
pkg/reconciler/controller_test.go Updated test assertion to match the new finalizer name format.
pkg/reconciler/controller.go Modified finalizer name initialization to use filepath.Join.
pkg/apis/pipelinesascode/register.go Added a new constant FinalizerName for the explicit finalizer part.

*   The finalizer name used by the controller was updated.
*   A new constant `FinalizerName` was introduced for the explicit part of the
name.
*   The finalizer name was updated to combine the group name and the new
constant.
*   This change aligns the finalizer naming with common Kubernetes conventions.

Fixes openshift-pipelines#1763

Signed-off-by: Chmouel Boudjnah <[email protected]>
@chmouel chmouel force-pushed the issue-1763-warning-on-watchers-finalizer branch from ad0984a to 23944fb Compare May 22, 2025 10:40
@chmouel chmouel added the fix label May 22, 2025
@zakisk
Copy link
Contributor

zakisk commented May 26, 2025

/test

@zakisk zakisk merged commit a0bcb6f into openshift-pipelines:main May 26, 2025
4 of 6 checks passed
@chmouel chmouel deleted the issue-1763-warning-on-watchers-finalizer branch May 26, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Warning on watchers finalizer
2 participants