|
48 | 48 | "logging.level.org.springframework.cloud.kubernetes.fabric8.config.reload=debug",
|
49 | 49 | "spring.cloud.bootstrap.enabled=true" })
|
50 | 50 | @ActiveProfiles("two")
|
51 |
| -class Fabric8EventReloadInformIT extends Fabric8EventReloadBase { |
| 51 | +class Fabric8EventReloadConfigMapBootstrapIT extends Fabric8EventReloadBase { |
52 | 52 |
|
53 | 53 | private static final String LEFT_NAMESPACE = "left";
|
54 | 54 |
|
@@ -109,7 +109,27 @@ void test(CapturedOutput output) {
|
109 | 109 | assertThat(leftProperties.getValue()).isEqualTo("left-initial");
|
110 | 110 | assertThat(rightProperties.getValue()).isEqualTo("right-initial");
|
111 | 111 |
|
112 |
| - // then deploy a new version of right-configmap |
| 112 | + // then deploy a new version of right-configmap, but without changing its data, |
| 113 | + // only add a label, thus no refresh happens |
| 114 | + ConfigMap configMap = new ConfigMapBuilder() |
| 115 | + .withMetadata(new ObjectMetaBuilder().withLabels(Map.of("new-label", "abc")) |
| 116 | + .withNamespace(RIGHT_NAMESPACE) |
| 117 | + .withName("right-configmap") |
| 118 | + .build()) |
| 119 | + .withData(Map.of("right.value", "right-initial")) |
| 120 | + .build(); |
| 121 | + |
| 122 | + replaceConfigMap(kubernetesClient, configMap, RIGHT_NAMESPACE); |
| 123 | + |
| 124 | + await().atMost(Duration.ofSeconds(60)) |
| 125 | + .pollDelay(Duration.ofSeconds(1)) |
| 126 | + .until(() -> output.getOut().contains("ConfigMap right-configmap was updated in namespace right")); |
| 127 | + |
| 128 | + await().atMost(Duration.ofSeconds(60)) |
| 129 | + .pollDelay(Duration.ofSeconds(1)) |
| 130 | + .until(() -> output.getOut().contains("data in configmap has not changed, will not reload")); |
| 131 | + |
| 132 | + // then deploy a new version of right-configmap, that actually changes some data |
113 | 133 | ConfigMap rightConfigMapAfterChange = new ConfigMapBuilder()
|
114 | 134 | .withMetadata(new ObjectMetaBuilder().withNamespace(RIGHT_NAMESPACE).withName("right-configmap").build())
|
115 | 135 | .withData(Map.of("right.value", "right-after-change"))
|
|
0 commit comments