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

Rename labels matcher function and update test #3856

Merged
merged 2 commits into from
Aug 18, 2022
Merged

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented Aug 18, 2022

What this PR does / why we need it:

This PR does:

  • Rename FindPlatformProvidersByLabel to FindPlatformProvidersByLabels
  • Change the FindPlatformProvidersByLabels function signature to same as FindPlatformProviderByName
  • Fix warning unrequired typedef in test (lint warn)

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@khanhtc1202 khanhtc1202 enabled auto-merge (squash) August 18, 2022 08:00
// FindPlatformProvidersByLabel finds all PlatformProviders which match the provided labels.
func (s *PipedSpec) FindPlatformProvidersByLabel(labels map[string]string, t model.ApplicationKind) []PipedPlatformProvider {
// FindPlatformProvidersByLabels finds all PlatformProviders which match the provided labels.
func (s *PipedSpec) FindPlatformProvidersByLabels(labels map[string]string, t model.ApplicationKind) ([]PipedPlatformProvider, bool) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need the found return value?
I feel that only slice is enough and closer with Go conventions. 🤔

Copy link
Member Author

@khanhtc1202 khanhtc1202 Aug 18, 2022

Choose a reason for hiding this comment

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

I feel you, just want to keep this function signature as same as FindPlatformProviderByName 👍 Lets me remove it

Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed by 3be3f14

Copy link
Member

@nghialv nghialv left a comment

Choose a reason for hiding this comment

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

👍

@khanhtc1202 khanhtc1202 merged commit 7982ddf into master Aug 18, 2022
@khanhtc1202 khanhtc1202 deleted the labels-matcher branch August 18, 2022 08:18
@github-actions github-actions bot mentioned this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants