furiko-io / furiko

Kubernetes cron and batch job platform
https://furiko.io
Apache License 2.0
483 stars 21 forks source link

feat(cli): Implement various filter flags for list subcommands #124

Closed irvinlim closed 1 year ago

irvinlim commented 1 year ago

Implements various filter flags for list subcommands.

Changes

Overall changes

  1. Support --selector and --field-selector flags for all list subcommands.
  2. Convert WatchAndPrint to use generics.
  3. Add pkg/util/sets package to implement generic version of k8s.io/apimachinery/pkg/util/sets.

list jobs

  1. Adds --states flag to match Jobs with the given state(s) for list jobs.
  2. Adds --running, --active and --queued as shorthands for --states for list jobs.

list jobconfigs

  1. Adds --scheduled, --schedule-enabled and --adhoc-only flags to match JobConfigs with given schedule spec.
codecov[bot] commented 1 year ago

Codecov Report

Base: 69.53% // Head: 70.12% // Increases project coverage by +0.58% :tada:

Coverage data is based on head (4c1352c) compared to base (18f2148). Patch coverage: 87.76% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #124 +/- ## ========================================== + Coverage 69.53% 70.12% +0.58% ========================================== Files 192 193 +1 Lines 9802 10042 +240 ========================================== + Hits 6816 7042 +226 - Misses 2622 2630 +8 - Partials 364 370 +6 ``` | [Impacted Files](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io) | Coverage Δ | | |---|---|---| | [pkg/runtime/testing/command.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL3J1bnRpbWUvdGVzdGluZy9jb21tYW5kLmdv) | `74.07% <25.00%> (-3.10%)` | :arrow_down: | | [pkg/cli/cmd/watch.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvd2F0Y2guZ28=) | `31.25% <28.57%> (-4.24%)` | :arrow_down: | | [pkg/cli/cmd/cmd\_list.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2xpc3QuZ28=) | `78.57% <65.38%> (-11.43%)` | :arrow_down: | | [pkg/utils/sets/generic.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL3V0aWxzL3NldHMvZ2VuZXJpYy5nbw==) | `92.47% <92.47%> (ø)` | | | [pkg/cli/cmd/cmd\_list\_jobconfig.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2xpc3Rfam9iY29uZmlnLmdv) | `90.85% <94.28%> (+2.05%)` | :arrow_up: | | [pkg/cli/cmd/cmd\_list\_job.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2NsaS9jbWQvY21kX2xpc3Rfam9iLmdv) | `90.05% <94.93%> (+8.99%)` | :arrow_up: | | [pkg/execution/util/jobconfig/state.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-cGtnL2V4ZWN1dGlvbi91dGlsL2pvYmNvbmZpZy9zdGF0ZS5nbw==) | `100.00% <100.00%> (ø)` | | | [apis/execution/v1alpha1/job\_types.go](https://codecov.io/gh/furiko-io/furiko/pull/124?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io#diff-YXBpcy9leGVjdXRpb24vdjFhbHBoYTEvam9iX3R5cGVzLmdv) | `100.00% <0.00%> (+14.63%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=furiko-io)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.