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: delete custom entities #3262

Merged
merged 1 commit into from
Jan 9, 2023
Merged

refactor: delete custom entities #3262

merged 1 commit into from
Jan 9, 2023

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Dec 14, 2022

What this PR does / why we need it:

It seems that custom entities where never used (at least in a handful of recent versions).

The notion of them was "somehow" introduced in #1339 and #2296 made sendconfig.PerformUpdate() always pass nil in place for "custom entities".

Since it's always nil we may as well just delete it altogether.

Special notes for your reviewer:

There is still the CLI flag

	flagSet.StringVar(&c.KongCustomEntitiesSecret, "kong-custom-entities-secret", "", `A Secret containing custom entities for DB-less mode, in "namespace/name" format`)

I'd argue that we can add a deprecation notice and state that it doesn't do anything now and that it will be removed in next major release. WDYT?

This PR marked the flag as deprecated with flagSet.MarkDeprecated.

@pmalek pmalek self-assigned this Dec 14, 2022
@pmalek pmalek requested a review from a team as a code owner December 14, 2022 21:25
@pmalek pmalek force-pushed the delete-custom-entities branch 2 times, most recently from 5dae850 to 8690132 Compare December 15, 2022 18:22
@rainest
Copy link
Contributor

rainest commented Dec 15, 2022

I guess we never filled out that bit of functionality in v2. we did process them in the v1 PerformUpdate call:

https://github.com/Kong/kubernetes-ingress-controller/blob/v1.3.4/internal/ingress/controller/kong.go#L37-L58

This was supposed to work in v2 also, but we forgot to add it. There seems to be little use of it in practice given that there are no user reports of it breaking. We may consider removing it as such, which would make custom entities only usable in DB-backed mode (which does not require this, since you can instead add the custom entities directly, without KIC, although they won't be KIC-managed).

I don't know if we have stats on how often we see custom plugins with custom DAOs in the wild. Anecdotally they're fairly uncommon.

@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Base: 74.0% // Head: 74.1% // Increases project coverage by +0.1% 🎉

Coverage data is based on head (22dd7bd) compared to base (ef97785).
Patch coverage: 100.0% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3262     +/-   ##
=======================================
+ Coverage   74.0%   74.1%   +0.1%     
=======================================
  Files        110     110             
  Lines      13268   13227     -41     
=======================================
- Hits        9826    9811     -15     
+ Misses      2811    2792     -19     
+ Partials     631     624      -7     
Impacted Files Coverage Δ
internal/dataplane/kong_client.go 85.0% <ø> (-0.1%) ⬇️
internal/dataplane/deckgen/deckgen.go 70.1% <100.0%> (+1.2%) ⬆️
internal/dataplane/sendconfig/sendconfig.go 78.1% <100.0%> (+1.1%) ⬆️
internal/manager/config.go 91.5% <100.0%> (+0.1%) ⬆️
internal/dataplane/kongstate/service.go 66.0% <0.0%> (-1.3%) ⬇️
internal/dataplane/parser/parser.go 90.7% <0.0%> (+1.6%) ⬆️
...ternal/controllers/gateway/httproute_controller.go 55.8% <0.0%> (+1.6%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@pmalek pmalek added this to the KIC v2.9.0 milestone Jan 5, 2023
@pmalek pmalek linked an issue Jan 9, 2023 that may be closed by this pull request
1 task
@pmalek pmalek merged commit e3c862d into main Jan 9, 2023
@pmalek pmalek deleted the delete-custom-entities branch January 9, 2023 15:29
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.

--kong-custom-entities-secret flag has no effect
3 participants