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

Refactor koperator reserved label keys #841

Merged
merged 2 commits into from Jul 29, 2022
Merged

Conversation

panyuenlau
Copy link
Member

@panyuenlau panyuenlau commented Jul 28, 2022

Q A
Bug fix? no
New feature? no
API breaks? no
Deprecations? no
License Apache 2.0

What's in this PR?

This PR refactors current implementation to replace all the hard-coded koperator reserved label keys ("app, "kafka_cr", and "brokerId")with const variables

Why?

Using hard-coded strings for the reserved label keys comes with some drawbacks:

  • Kinda bad coding style
  • Hard to maintain (especially for people that are not familiar with the existing implementation)
  • Increased chances of introducing careless bugs
  • May introduce inconsistency between koperator and projects that have koperator as a depenency

Therefore this PR aims to replace the label keys with const variables defined along with the kafkacluster resource

Checklist

  • Implementation tested
  • Error handling code meets the guideline
  • Logging code meets the guideline
  • User guide and development docs updated (if needed)

@panyuenlau panyuenlau requested a review from a team as a code owner July 28, 2022 09:45
Copy link
Member

@pregnor pregnor left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you so much for this. 👍

@panyuenlau panyuenlau merged commit 84cf27a into master Jul 29, 2022
@panyuenlau panyuenlau deleted the label-keys-refactor branch July 29, 2022 07:04
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.

None yet

3 participants