-
Notifications
You must be signed in to change notification settings - Fork 224
fix: startup all resource indexing #2881
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
Conversation
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
This reverts commit faf9bdf.
.../java/io/javaoperatorsdk/operator/baseapi/startsecondaryaccess/StartupSecondaryAccessIT.java
Show resolved
Hide resolved
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
* Used to initialize resources when the namespace is generated but the operator is not started | ||
* yet. | ||
*/ | ||
public Builder withBeforeStartHook(Consumer<LocallyRunOperatorExtension> beforeStartHook) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need a "before-shutdown" hook as well to perform clean-up if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is usually not needed strictly , since one can clean the resources at the end of the test, so functionally that is doable. But agree that might be a nicer api.
SECONDARY_NUMBER); | ||
|
||
if (secondary.size() != cached.size()) { | ||
secondaryAndCacheSameAmount = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not simply:
secondaryAndCacheSameAmount = secondary.size() == cache.size();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would not work if later is the same value would overwrite the false, so here the aim is that if once false therefore always false
@@ -44,6 +44,22 @@ void dependentResourceCanReferenceEachOther() { | |||
assertThat(operator.get(Secret.class, TEST_RESOURCE_NAME + i)).isNotNull(); | |||
} | |||
}); | |||
|
|||
for (int i = 0; i < EXECUTION_NUMBER; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this test was failing with a different version of the fix, and improved it while investigating, I can make it as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor nitpicks.
Indexes all the resources in the cache on startup, making sure that all resources are on the index for first reconiliation.