Skip to content

Conversation

@knanao
Copy link
Member

@knanao knanao commented Feb 28, 2022

What this PR does / why we need it:
If you want piped to monitor only certain applications, appSelector is useful.
If not specified, all application will be suggested when you add an application.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Allow filtering suggested applications by using a new appSelector field in Piped config

@knanao knanao changed the title Enable to filter applications that specific piped will handle Enable to filter suggested applications when you add an application from controlplane Feb 28, 2022
@pipecd-bot pipecd-bot added size/L and removed size/S labels Feb 28, 2022
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.58%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/datastore/commandstore.go commandCollection.Decode -- 87.50% +87.50%
pkg/datastore/filedb/codec.go decode -- 0.00% +0.00%
pkg/datastore/filedb/codec.go merge -- 78.57% +78.57%
pkg/datastore/filedb/filedb.go WithLogger -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go NewFileDB -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.fetch -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Get -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Create -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Update -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Close -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go makeHotStorageFilePath -- 0.00% +0.00%
pkg/model/apikey.go APIKey.SetUpdatedAt -- 0.00% +0.00%
pkg/model/application.go Application.SetUpdatedAt -- 0.00% +0.00%
pkg/model/command.go Command.SetUpdatedAt -- 0.00% +0.00%
pkg/model/deployment.go Deployment.SetUpdatedAt -- 0.00% +0.00%
pkg/model/deployment_chain.go DeploymentChain.SetUpdatedAt -- 0.00% +0.00%
pkg/model/event.go Event.SetUpdatedAt -- 0.00% +0.00%
pkg/model/piped.go Piped.SetUpdatedAt -- 0.00% +0.00%
pkg/model/project.go Project.SetUpdatedAt -- 0.00% +0.00%
pkg/model/common.go ApplicationInfo.ContainLabels 77.78% 88.89% +11.11%
pkg/app/piped/appconfigreporter/appconfigreporter.go Reporter.findUnregisteredApps 74.19% 75.76% +1.56%
pkg/datastore/commandstore.go commandCollection.ListInUsedShards 0.00% 100.00% +100.00%

@nghialv
Copy link
Member

nghialv commented Feb 28, 2022

Nice.
/lgtm

Just a nit about the release note:

Allow filtering suggested applications by using a new appSelector field in Piped config

@pipecd-bot pipecd-bot removed the lgtm label Feb 28, 2022
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.58%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/datastore/commandstore.go commandCollection.Decode -- 87.50% +87.50%
pkg/datastore/filedb/codec.go decode -- 0.00% +0.00%
pkg/datastore/filedb/codec.go merge -- 78.57% +78.57%
pkg/datastore/filedb/filedb.go WithLogger -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go NewFileDB -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.fetch -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Find -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Get -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Create -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Update -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go FileDB.Close -- 0.00% +0.00%
pkg/datastore/filedb/filedb.go makeHotStorageFilePath -- 0.00% +0.00%
pkg/model/apikey.go APIKey.SetUpdatedAt -- 0.00% +0.00%
pkg/model/application.go Application.SetUpdatedAt -- 0.00% +0.00%
pkg/model/command.go Command.SetUpdatedAt -- 0.00% +0.00%
pkg/model/deployment.go Deployment.SetUpdatedAt -- 0.00% +0.00%
pkg/model/deployment_chain.go DeploymentChain.SetUpdatedAt -- 0.00% +0.00%
pkg/model/event.go Event.SetUpdatedAt -- 0.00% +0.00%
pkg/model/piped.go Piped.SetUpdatedAt -- 0.00% +0.00%
pkg/model/project.go Project.SetUpdatedAt -- 0.00% +0.00%
pkg/app/piped/appconfigreporter/appconfigreporter.go Reporter.findUnregisteredApps 74.19% 75.76% +1.56%
pkg/datastore/commandstore.go commandCollection.ListInUsedShards 0.00% 100.00% +100.00%
pkg/model/common.go ApplicationInfo.ContainLabels 77.78% 88.89% +11.11%

@nghialv
Copy link
Member

nghialv commented Feb 28, 2022

Thank you.
/lgtm

| eventWatcher | [EventWatcher](/docs/operator-manual/piped/configuration-reference/#eventwatcher) | Optional Event watcher settings. | No |
| secretManagement | [SecretManagement](/docs/operator-manual/piped/configuration-reference/#secretmanagement) | The using secret management method. | No |
| notifications | [Notifications](/docs/operator-manual/piped/configuration-reference/#notifications) | Sending notifications to Slack, Webhook... | No |
| appSelector | map[string]string | List of labels to filter all applications this piped will handle. Currently, it is only be used to filter the applications suggested for adding from the control plane. | No |
Copy link
Member

Choose a reason for hiding this comment

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

not really related to this pull but I just realized that this is List of ... so should we change the name as appSelectors?

Copy link
Member Author

@knanao knanao Feb 28, 2022

Choose a reason for hiding this comment

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

This is based on k8s selector.
But it seems good to combine appSelectors with labels. wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

Then it will be appLabelsSelector right? 😄

Copy link
Member

Choose a reason for hiding this comment

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

on the second thought, I guess labels is unnecessary, so I think we should keep it as is. Sorry for the interruption 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

Umm.., It took me a while to think appSelector is okay.
Do you feel a bit strange?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, so lets keep it as is, thank you 🙌

@khanhtc1202
Copy link
Member

Nice work, thanks
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants