Skip to content

refactor: cleanup shutdown hook registration method documentation#3381

Closed
metacosm wants to merge 0 commit into
mainfrom
leader-election
Closed

refactor: cleanup shutdown hook registration method documentation#3381
metacosm wants to merge 0 commit into
mainfrom
leader-election

Conversation

@metacosm
Copy link
Copy Markdown
Collaborator

  • refactor: cleanup shutdown hook registration method documentation
  • refactor: minor improvements

Copilot AI review requested due to automatic review settings May 27, 2026 10:54
@metacosm metacosm self-assigned this May 27, 2026
@openshift-ci openshift-ci Bot requested review from csviri and xstefank May 27, 2026 10:54
Copy link
Copy Markdown
Contributor

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

Cleans up the installShutdownHook API documentation by formally deprecating the Duration-based overload (whose argument is now ignored in favor of ConfigurationService#reconciliationTerminationTimeout()) and adds a Javadoc to stop(). Also makes minor refactoring improvements in LeaderElectionManager: extracting REQUIRED_VERBS as a constant, using an unmodifiable set for collected verbs, and joining missing verbs into a comma-separated string for the error message.

Changes:

  • Split installShutdownHook(Duration) into a deprecated delegating overload plus a documented no-arg installShutdownHook(), and add Javadoc to stop().
  • Extract REQUIRED_VERBS constant and switch verb collection to toUnmodifiableSet() in LeaderElectionManager#checkLeaseAccess.
  • Format the missing-verbs portion of the OperatorException message as a comma-separated string.

Reviewed changes

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

File Description
operator-framework-core/.../Operator.java Deprecates installShutdownHook(Duration), adds Javadoc for new no-arg overload and stop().
operator-framework-core/.../LeaderElectionManager.java Refactors lease access check: constant for required verbs, unmodifiable set, joined missing-verb message.

@csviri
Copy link
Copy Markdown
Collaborator

csviri commented May 28, 2026

@metacosm feel free to merge this, thx!

@metacosm
Copy link
Copy Markdown
Collaborator Author

@metacosm feel free to merge this, thx!

OK, this will most likely create conflicts with #3383, though…

@csviri
Copy link
Copy Markdown
Collaborator

csviri commented May 28, 2026

Will merge that, PR, please rebase this on it.

@metacosm metacosm closed this May 28, 2026
@metacosm metacosm deleted the leader-election branch May 28, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants