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: introduce index for DataPlanes referencing KongPluginInstallations #666

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

programmer04
Copy link
Member

What this PR does / why we need it:

Implements what was mentioned in the comment #476 (comment) during the review - index for DataPlanes that references KongPluginInstallations to avoid fetching all of them and filtering in the code.

Which issue this PR fixes

Improvement for #380

Special notes for your reviewer:

The code for indices for Konnect entities and other ones may one day be merged, but this is out of the scope of this PR. Only to make it similar in terms of what is logged has been addressed. Furthermore, log format seems a little redundant

KongPluginBinding	creating index	{"entityTypeName": "KongPluginBinding", "indexObject": {"metadata":{"creationTimestamp":null},"spec":{"pluginRef":{"name":""},"targets":{}},"status":{}}, "indexField": "kongPluginRef"}
KongPluginBinding	creating index	{"entityTypeName": "KongPluginBinding", "indexObject": {"metadata":{"creationTimestamp":null},"spec":{"pluginRef":{"name":""},"targets":{}},"status":{}}, "indexField": "kongServiceRef"}
KongPluginBinding	creating index	{"entityTypeName": "KongPluginBinding", "indexObject": {"metadata":{"creationTimestamp":null},"spec":{"pluginRef":{"name":""},"targets":{}},"status":{}}, "indexField": "kongRouteRef"}
KongPluginBinding	creating index	{"entityTypeName": "KongPluginBinding", "indexObject": {"metadata":{"creationTimestamp":null},"spec":{"pluginRef":{"name":""},"targets":{}},"status":{}}, "indexField": "kongConsumerRef"}

Now it's like that

2024-09-27T17:46:22+02:00	INFO	ControlPlane	creating index	{"indexField": "dataplane"}
2024-09-27T17:46:22+02:00	INFO	DataPlane	creating index	{"indexField": "KongPluginInstallations"}
2024-09-27T17:46:22+02:00	INFO	KongPluginBinding	creating index	{"indexField": "kongPluginRef"}
2024-09-27T17:46:22+02:00	INFO	KongPluginBinding	creating index	{"indexField": "kongServiceRef"}
2024-09-27T17:46:22+02:00	INFO	KongPluginBinding	creating index	{"indexField": "kongRouteRef"}
2024-09-27T17:46:22+02:00	INFO	KongPluginBinding	creating index	{"indexField": "kongConsumerRef"}
2024-09-27T17:46:22+02:00	INFO	KongPluginBinding	creating index	{"indexField": "kongConsumerGroupRef"}

@programmer04 programmer04 added enhancement New feature or request area/maintenance labels Sep 27, 2024
@programmer04 programmer04 added this to the KGO v1.4.x milestone Sep 27, 2024
@programmer04 programmer04 self-assigned this Sep 27, 2024
@programmer04 programmer04 requested a review from a team as a code owner September 27, 2024 16:05
@programmer04 programmer04 enabled auto-merge (squash) September 27, 2024 16:05
Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

Some nits but overall this looks good.

internal/utils/index/index.go Outdated Show resolved Hide resolved
modules/manager/controller_setup.go Show resolved Hide resolved
@programmer04 programmer04 merged commit fb23412 into main Sep 29, 2024
21 checks passed
@programmer04 programmer04 deleted the index branch September 29, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maintenance enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants