Skip to content

Conversation

@erikgb
Copy link
Member

@erikgb erikgb commented Sep 26, 2023

This PR eliminates the dedicated target cache and fixes the TODO related to source/target ConfigMap caches. Now the cache should only cache full configmaps in source namespace and cache configmap metadata cluster-wide.

I wished to simplify this a bit before anyone tries to add secrets as targets.

I am pretty sure that ConfigMap and PartialMetadata (for configmaps) should be treated independently in caches now. But feel free to check this @inteon - if you think the tests are not covering this area well enough. I asked about this in controller-runtime channel on Slack: https://kubernetes.slack.com/archives/C02MRBMN00Z/p1695564370173869. And also had a look at kubernetes-sigs/controller-runtime#1174. So if this isn't working as expected, I think we should create an issue in controller-runtime.

/cc @inteon

@jetstack-bot jetstack-bot requested a review from inteon September 26, 2023 21:51
@jetstack-bot jetstack-bot added the dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. label Sep 26, 2023
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joshvanl for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 26, 2023
@erikgb
Copy link
Member Author

erikgb commented Sep 26, 2023

/retest

1 similar comment
@erikgb
Copy link
Member Author

erikgb commented Sep 26, 2023

/retest

@jetstack-bot
Copy link
Contributor

@erikgb: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-trust-manager-smoke 1de42f5 link true /test pull-trust-manager-smoke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

},
&corev1.ConfigMap{}: {
// Watch full config maps across all namespaces.
// TODO: create a seperate cache for targets and sources and only
Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised that this comment is still present in the codebase. Since it has been fixed &a separate cache was added.

ByObject: map[client.Object]cache.ByObject{
// Cache metadata for ConfigMaps cluster-wide
&metav1.PartialObjectMetadata{
TypeMeta: metav1.TypeMeta{
Copy link
Member

Choose a reason for hiding this comment

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

I fear that controller runtime does not differentiate between the partial metadata object and the typed object. There will be a config collision.

Copy link
Member

Choose a reason for hiding this comment

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

See #172

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@inteon inteon left a comment

Choose a reason for hiding this comment

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

I propose we keep the dedicated cache until c/r supports differentiating between partial metadata objects and full objects (see #187 (comment)).

However, I would like to remove the // TODO: comment already, I think this is something that we missed in #89 (I feel like it might have been lost while rebasing).

@erikgb
Copy link
Member Author

erikgb commented Sep 27, 2023

I propose we keep the dedicated cache until c/r supports differentiating between partial metadata objects and full objects

@inteon agreed! Sorry for not testing this better. It got late yesterday. 😉 I'll update the PR.

@erikgb
Copy link
Member Author

erikgb commented Sep 27, 2023

Replaced by #188 - ref. comment above.

@erikgb erikgb closed this Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants