Skip to content

Conversation

@embik
Copy link
Member

@embik embik commented Mar 13, 2025

Summary

As per the example in #7, we were unable to List or Get objects that are not watched by the controller. This change attempts to emulate what upstream controller-runtime's cache implementation does: When an informer has not been started yet, we should try to start one.

The way we start a new informer is a bit hacky due to our custom NewInformer logic, but this should do the trick.

Related issue(s)

Fixes #8

Release Notes

NONE

On-behalf-of: SAP <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
@kcp-ci-bot kcp-ci-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 13, 2025
@embik embik requested a review from sttts March 13, 2025 10:16
return reconcile.Result{}, err
}

log.Info("Found Secret objects in Workspace of ConfigMap", "count", len(secrets.Items))
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this here in the example. We need e2e tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree. I can remove it from the example, I just needed a way to validate it. With the sdk changes to include a testing framework, we can write e2e tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sttts removed the example code changes.

@embik embik force-pushed the start-informers branch from 1651603 to bfff729 Compare March 13, 2025 15:53
@embik embik force-pushed the start-informers branch from bfff729 to e66c5ab Compare March 13, 2025 15:55
@embik embik requested a review from sttts March 14, 2025 07:23
@sttts
Copy link
Member

sttts commented Mar 16, 2025

From now on, after this PR, we need tests.

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2025
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5d934ec788e4e16ec9261b0a747f1482b7002d0c

@sttts
Copy link
Member

sttts commented Mar 16, 2025

/approve

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

The pull request process is described here

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

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2025
@kcp-ci-bot kcp-ci-bot merged commit 42599a8 into main Mar 16, 2025
8 checks passed
@kcp-ci-bot kcp-ci-bot deleted the start-informers branch March 16, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.

bug: Failed to get object, not in cache

4 participants