Skip to content

Commit

Permalink
java control plane 1.0.45 (#422)
Browse files Browse the repository at this point in the history
* java control plane 1.0.45

* update envoy in tests

* fix OutlierDetectionTest
  • Loading branch information
kozjan authored Jul 16, 2024
1 parent 1f83855 commit 7e08f1d
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Lists all changes with user impact.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).


## [0.20.15]
### Changed
- Java-control-plane update to 1.0.45

## [0.20.14]
### Changed
- Added test to check circuit breaker metric value
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ allprojects {
apply plugin: 'io.spring.dependency-management'

project.ext.versions = [
java_controlplane : '1.0.37',
java_controlplane : '1.0.45',
spring_boot : '3.1.2',
grpc : '1.48.1',
ecwid_consul : '1.4.1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Watch createWatch(
XdsRequest request,
Set<String> knownResourceNames,
Consumer<Response> responseConsumer) {
return createWatch(ads, request, knownResourceNames, responseConsumer, false);
return createWatch(ads, request, knownResourceNames, responseConsumer, false, false);
}

/**
Expand All @@ -106,7 +106,8 @@ public Watch createWatch(
XdsRequest request,
Set<String> knownResourceNames,
Consumer<Response> responseConsumer,
boolean hasClusterChanged) {
boolean hasClusterChanged,
boolean allowDefaultEmptyEdsUpdate) {
Resources.ResourceType requestResourceType = request.getResourceType();
Preconditions.checkNotNull(requestResourceType, "unsupported type URL %s",
request.getTypeUrl());
Expand All @@ -123,7 +124,7 @@ public Watch createWatch(
U snapshot = snapshots.get(group);
String version = snapshot == null ? "" : snapshot.version(requestResourceType, request.getResourceNamesList());

Watch watch = new Watch(ads, request, responseConsumer);
Watch watch = new Watch(ads, allowDefaultEmptyEdsUpdate, request, responseConsumer);

if (snapshot != null) {
Set<String> requestedResources = ImmutableSet.copyOf(request.getResourceNamesList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,22 @@ internal class GroupChangeWatcher(

override fun createWatch(
ads: Boolean,
request: XdsRequest,
knownResourceNames: MutableSet<String>,
responseConsumer: Consumer<Response>,
hasClusterChanged: Boolean
request: XdsRequest?,
knownResourceNames: MutableSet<String>?,
responseConsumer: Consumer<Response>?,
hasClusterChanged: Boolean,
allowDefaultEmptyEdsUpdate: Boolean
): Watch {
val oldGroups = cache.groups()

val watch = cache.createWatch(ads, request, knownResourceNames, responseConsumer, hasClusterChanged)
val watch = cache.createWatch(
ads,
request,
knownResourceNames,
responseConsumer,
hasClusterChanged,
allowDefaultEmptyEdsUpdate
)
val groups = cache.groups()
metrics.setCacheGroupsCount(groups.size)
if (oldGroups != groups) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public void invalidNamesListShouldReturnWatcherWithNoResponseInAdsMode() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

assertThatWatchIsOpenWithNoResponses(new WatchAndTracker(watch, responseTracker));
}
Expand All @@ -114,7 +116,9 @@ public void invalidNamesListShouldReturnWatcherWithResponseInXdsMode() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

assertThat(watch.isCancelled()).isFalse();
assertThat(responseTracker.responses).isNotEmpty();
Expand All @@ -138,7 +142,9 @@ public void successfullyWatchAllResourceTypesWithSetBeforeWatch() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

assertThat(watch.request().getTypeUrl()).isEqualTo(typeUrl);
assertThat(watch.request().getResourceNamesList()).containsExactlyElementsOf(
Expand Down Expand Up @@ -166,7 +172,9 @@ public void shouldSendEdsWhenClusterChangedButEdsVersionDidnt() {
.build()),
Sets.newHashSet(""),
responseTracker,
true);
true,
false
);

assertThat(watch.request().getTypeUrl()).isEqualTo(Resources.V3.ENDPOINT_TYPE_URL);
assertThat(watch.request().getResourceNamesList()).containsExactlyElementsOf(
Expand Down Expand Up @@ -194,7 +202,9 @@ public void successfullyWatchAllResourceTypesWithSetAfterWatch() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}));
Expand Down Expand Up @@ -236,7 +246,9 @@ public void successfullyWatchAllResourceTypesWithSetBeforeWatchWithRequestVersio
responseTracker.accept(r);
responseOrderTracker.accept(r);
},
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}))
Expand Down Expand Up @@ -288,7 +300,9 @@ public void successfullyWatchAllResourceTypesWithSetBeforeWatchWithSameRequestVe
.build()),
SNAPSHOT2.resources(typeUrl).keySet(),
responseTracker,
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}));
Expand Down Expand Up @@ -333,7 +347,9 @@ public void successfullyWatchAllResourceTypesWithSetBeforeWatchWithSameRequestVe
.build()),
SNAPSHOT2.resources(typeUrl).keySet(),
responseTracker,
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}));
Expand Down Expand Up @@ -366,7 +382,9 @@ public void setSnapshotWithVersionMatchingRequestShouldLeaveWatchOpenWithoutAddi
.build()),
SNAPSHOT1.resources(typeUrl).keySet(),
responseTracker,
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}));
Expand Down Expand Up @@ -403,7 +421,9 @@ public void watchesAreReleasedAfterCancel() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

return new WatchAndTracker(watch, responseTracker);
}));
Expand Down Expand Up @@ -435,7 +455,9 @@ public void watchIsLeftOpenIfNotRespondedImmediately() {
.build()),
Collections.singleton(ROUTE_NAME),
responseTracker,
false);
false,
false
);

assertThatWatchIsOpenWithNoResponses(new WatchAndTracker(watch, responseTracker));
}
Expand Down Expand Up @@ -475,7 +497,9 @@ public void clearSnapshotWithWatches() {
.build()),
Collections.emptySet(),
r -> { },
false);
false,
false
);

// clearSnapshot should fail and the snapshot should be left untouched
assertThat(cache.clearSnapshot(SingleNodeGroup.GROUP)).isFalse();
Expand All @@ -502,7 +526,9 @@ public void groups() {
.build()),
Collections.emptySet(),
r -> { },
false);
false,
false
);

assertThat(cache.groups()).containsExactly(SingleNodeGroup.GROUP);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public void missingNamesListShouldReturnWatcherWithResponseInAdsMode() {
.build()),
Collections.emptySet(),
responseTracker,
false);
false,
false
);

assertThatWatchReceivesSnapshotWithMissingResources(new WatchAndTracker(watch, responseTracker), SNAPSHOT_WITH_MISSING_RESOURCES);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,8 @@ class SnapshotUpdaterTest {
request: XdsRequest,
knownResourceNames: MutableSet<String>,
responseConsumer: Consumer<Response>,
hasClusterChanged: Boolean
hasClusterChanged: Boolean,
allowDefaultEmptyEdsUpdate: Boolean
): Watch {
throw UnsupportedOperationException("not used in testing")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.junit.jupiter.api.extension.RegisterExtension
import pl.allegro.tech.servicemesh.envoycontrol.assertions.isFrom
import pl.allegro.tech.servicemesh.envoycontrol.assertions.isOk
import pl.allegro.tech.servicemesh.envoycontrol.assertions.untilAsserted
import pl.allegro.tech.servicemesh.envoycontrol.config.RandomConfigFile
import pl.allegro.tech.servicemesh.envoycontrol.config.consul.ConsulExtension
import pl.allegro.tech.servicemesh.envoycontrol.config.service.EchoServiceExtension
import pl.allegro.tech.servicemesh.envoycontrol.config.envoy.EnvoyExtension
Expand Down Expand Up @@ -33,9 +34,18 @@ class OutlierDetectionTest {
@RegisterExtension
val unhealthyService = EchoServiceExtension()

// necessary since Envoy 1.28.0 to keep the same behaviour (https://www.envoyproxy.io/docs/envoy/latest/version_history/v1.28/v1.28.0)
private val outlierEjectionConfig = """
layered_runtime:
layers:
- name: static_layer
static_layer:
envoy.reloadable_features.check_mep_on_first_eject: false
""".trimIndent()

@JvmField
@RegisterExtension
val envoy = EnvoyExtension(envoyControl)
val envoy = EnvoyExtension(envoyControl, config = RandomConfigFile.copy(configOverride = outlierEjectionConfig))
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class EnvoyContainer(
private const val ADMIN_PORT = 10000

private const val MIN_SUPPORTED_ENVOY_VERSION = "v1.22.7"
private const val MAX_SUPPORTED_ENVOY_VERSION = "v1.24.0"
private const val MAX_SUPPORTED_ENVOY_VERSION = "v1.30.4"

val DEFAULT_IMAGE = run {
val version =
Expand Down
2 changes: 1 addition & 1 deletion tools/envoy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM envoyproxy/envoy:v1.24.0
FROM envoyproxy/envoy:v1.30.4

ENV PORT=9999:9999
ENV PORT=80:80
Expand Down

0 comments on commit 7e08f1d

Please sign in to comment.