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

chore(tools): add to resource-gen.go generation of kumactl options #2469

Merged
merged 3 commits into from
Aug 5, 2021

Conversation

lahabana
Copy link
Contributor

First commit is #2466

@lahabana lahabana requested a review from jpeach July 30, 2021 14:44
@lahabana lahabana requested a review from a team as a code owner July 30, 2021 14:44
@lahabana lahabana force-pushed the chore/generate_kumactldefs branch from 5987f76 to 421ea72 Compare July 30, 2021 14:50
@codecov-commenter
Copy link

Codecov Report

Merging #2469 (421ea72) into master (4d7e7c0) will decrease coverage by 0.06%.
The diff coverage is 53.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2469      +/-   ##
==========================================
- Coverage   52.56%   52.50%   -0.07%     
==========================================
  Files         887      867      -20     
  Lines       48394    48383      -11     
==========================================
- Hits        25439    25402      -37     
- Misses      20906    20931      +25     
- Partials     2049     2050       +1     
Impacted Files Coverage Δ
api/mesh/options.pb.go 19.09% <0.00%> (-6.52%) ⬇️
api/mesh/v1alpha1/circuit_breaker.pb.go 46.08% <ø> (ø)
api/mesh/v1alpha1/dataplane.pb.go 37.85% <ø> (ø)
api/mesh/v1alpha1/dataplane_insight.pb.go 41.66% <ø> (ø)
api/mesh/v1alpha1/dataplane_overview.pb.go 43.28% <ø> (ø)
api/mesh/v1alpha1/externalservice.pb.go 51.65% <ø> (ø)
api/mesh/v1alpha1/fault_injection.pb.go 47.29% <ø> (ø)
api/mesh/v1alpha1/gateway.pb.go 33.57% <ø> (ø)
api/mesh/v1alpha1/health_check.pb.go 30.54% <ø> (ø)
api/mesh/v1alpha1/mesh.pb.go 32.60% <ø> (ø)
... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d7e7c0...421ea72. Read the comment docs.

// Preserve backward compatibility for this typo before this was auto generated
if All[i].Singular == "health-check" {
All[i].Plural = "healthchecks"
All[i].Singular = "healthcheck"
Copy link
Contributor

Choose a reason for hiding this comment

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

proxytemplate is wrong in the same way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proxy template is wrong is a different way:

  • Healthcheck has a rest endpoint: health-check and a kumactl healthcheck
  • Proxytemplate: has both rest and kumactl to proxytemplate

So for proxytemplate while it's incoherent with how we right things it's coherent between rest and kumactl so no need to do an exception here.

api/mesh/options.proto Outdated Show resolved Hide resolved
api/mesh/options.proto Outdated Show resolved Hide resolved
@@ -103,15 +84,11 @@ func DefaultRootContext() *RootContext {
}

func (rc *RootContext) TypeForArg(arg string) (core_model.ResourceType, error) {
typ, ok := rc.TypeArgs[arg]
typ, ok := entities.ByName[arg]
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, this needs to skip insight type that users should not delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done this with a better error message just down there

This removes some more manually written code that currently
makes policy creation error prone

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana force-pushed the chore/generate_kumactldefs branch from 421ea72 to 766181e Compare August 3, 2021 15:35
flags+=("--offset=")
two_word_flags+=("--offset")
flags+=("--size=")
two_word_flags+=("--size")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reasons there was no pagination on secrets and global secrets. @jakubdyszkiewicz do you know if it was for a specific reason?

@lahabana lahabana requested a review from jpeach August 3, 2021 15:41
@lahabana
Copy link
Contributor Author

lahabana commented Aug 3, 2021

I've forced-push because it was very different from the original.
I've taken into account you suggestion and also moved the ws inside the extension to keep things simple (like I mentioned in #2466).

Adding custom table printer is now simpler and doesn't rely on funky codegen.

Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

Just a few nits and quibbles.

app/kumactl/cmd/get/table_printer.go Outdated Show resolved Hide resolved
app/kumactl/pkg/cmd/root_context.go Outdated Show resolved Hide resolved
app/kumactl/pkg/cmd/root_context.go Outdated Show resolved Hide resolved
app/kumactl/pkg/entities/entities.go Show resolved Hide resolved
pkg/plugins/runtime/gateway/kumactl/plugin.go Show resolved Hide resolved
Signed-off-by: Charly Molter <charly.molter@konghq.com>
…umactldefs

Signed-off-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana merged commit aa0bd89 into kumahq:master Aug 5, 2021
mergify bot pushed a commit that referenced this pull request Aug 5, 2021
…2469)

This removes some more manually written code that currently
makes policy creation error prone

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit aa0bd89)

# Conflicts:
#	pkg/plugins/runtime/gateway/kumactl/plugin.go
jpeach pushed a commit that referenced this pull request Aug 11, 2021
…2469)

This removes some more manually written code that currently
makes policy creation error prone

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit aa0bd89)
jpeach pushed a commit that referenced this pull request Aug 11, 2021
…2469)

This removes some more manually written code that currently
makes policy creation error prone

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit aa0bd89)
jpeach pushed a commit that referenced this pull request Aug 11, 2021
…2469) (#2504)

This removes some more manually written code that currently
makes policy creation error prone

Signed-off-by: Charly Molter <charly.molter@konghq.com>
(cherry picked from commit aa0bd89)

Co-authored-by: Charly Molter <charly.molter@konghq.com>
@lahabana lahabana deleted the chore/generate_kumactldefs branch March 29, 2024 12:38
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.

3 participants