Skip to content

Fabric8 configmap event reload patch refactor part 3#1467

Merged
ryanjbaxter merged 23 commits intospring-cloud:3.0.xfrom
wind57:fabric8-configmap-event-reload-patch-refactor-part-3
Oct 6, 2023
Merged

Fabric8 configmap event reload patch refactor part 3#1467
ryanjbaxter merged 23 commits intospring-cloud:3.0.xfrom
wind57:fabric8-configmap-event-reload-patch-refactor-part-3

Conversation

@wind57
Copy link
Copy Markdown
Contributor

@wind57 wind57 commented Oct 5, 2023

No description provided.

<module>spring-cloud-kubernetes-fabric8-istio-it</module>
<module>spring-cloud-kubernetes-fabric8-client-discovery</module>
<module>spring-cloud-kubernetes-fabric8-client-loadbalancer</module>
<module>spring-cloud-kubernetes-fabric8-client-configmap-polling-reload</module>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this is the easiest way to look at this PR: I drop spring-cloud-kubernetes-fabric8-client-configmap-polling-reload and refactor all of its tests by placing them into spring-cloud-kubernetes-fabric8-client-reload.

Logically, the tests do not change at all, just merge them in a different project and use PATCH like testing for them

testInformFromOneNamespaceEventTriggered();
testInform();
testInformFromOneNamespaceEventTriggeredSecretsDisabled();
testDataChangesInConfigMap();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all methods that were in the spring-cloud-kubernetes-fabric8-client-configmap-polling-reload were ported in this test now

LOG.info("appPodName : ->" + appPodName + "<-");
// we issue a pollDelay to let the logs sync in, otherwise the results are not
// going to be correctly asserted
await().pollDelay(20, TimeUnit.SECONDS).pollInterval(Duration.ofSeconds(5)).atMost(Duration.ofSeconds(600))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

lower the interval from 600 to 120

@wind57 wind57 marked this pull request as ready for review October 6, 2023 16:49
@wind57
Copy link
Copy Markdown
Contributor Author

wind57 commented Oct 6, 2023

@ryanjbaxter ready to be looked at. thank you

Commons.waitForLogStatement("will add file-based property source : /tmp/application.properties", container,
appLabelValue);
// (3)
WebClient webClient = builder().baseUrl("http://localhost/key").build();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why use WebClient instad of RestClient?

Copy link
Copy Markdown
Contributor Author

@wind57 wind57 Oct 6, 2023

Choose a reason for hiding this comment

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

all of our integration tests are using WebClient... not exactly sure what you are trying to suggest tbh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huh, I guess I never noticed. It just seemed odd to me to use WebClient and then block when you could just use RestTemplate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

huh! good point :) I think that initially we used it because of RestTemplate deprecation, but now that you put it like this, I can't recall the exact history behind it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

RestTemplate isn't going anywhere. Anyways it is no big deal, its a test

<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<!-- not bootstrap starter, because we want to be able to disable bootstrap per-test -->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where are the tests that are not using bootstrap?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ConfigMapPollingReloadDelegate.testConfigMapPollingReload

and

ConfigMapMountPollingReloadDelegate.testConfigMapMountPollingReload

The way to find out this info after our refactoring is to look where the body is for the PATCH and there will be an environment variable in the form:

{
	"name": "SPRING_CLOUD_BOOTSTRAP_ENABLED",
	"value": "FALSE"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Now I see things clearer. For some reason before I was just looking at a single commit and not all the changes. Sorry for the dumb question.

Copy link
Copy Markdown
Contributor Author

@wind57 wind57 Oct 6, 2023

Choose a reason for hiding this comment

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

ah, no! every question we discuss closes a few gaps here and there.

@wind57 wind57 requested a review from ryanjbaxter October 6, 2023 19:21
@ryanjbaxter ryanjbaxter merged commit 4ab2406 into spring-cloud:3.0.x Oct 6, 2023
@ryanjbaxter ryanjbaxter added this to the 3.0.6 milestone Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants