Skip to content

Commit

Permalink
fix(mdc): fix propagation of exection id (#2475)
Browse files Browse the repository at this point in the history
- also fixes DefaultNodeIdentity tests when running on a host
that disallows connections between en* and lo0
  • Loading branch information
asher committed Mar 31, 2018
1 parent a1f22b3 commit 2024913
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ allprojects {
apply plugin: 'groovy'

ext {
spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.145.0'
spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.149.0'
}

def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class DynomiteCacheSpec extends WriteableCacheSpec {

def localHostSupplier = new HostSupplier() {
@Override
Collection<Host> getHosts() {
List<Host> getHosts() {
return [localHost]
}
}
Expand Down Expand Up @@ -227,7 +227,7 @@ class DynomiteCacheSpec extends WriteableCacheSpec {

def localHostSupplier = new HostSupplier() {
@Override
Collection<Host> getHosts() {
List<Host> getHosts() {
return [localHost]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ private static String getHostName(String validationHost, int validationPort) {
} catch (SocketException ignored) {
return UNKNOWN_HOST;
}
if (interfaces == null) {
if (interfaces == null || validationHost == null) {
return UNKNOWN_HOST;
}

for (NetworkInterface networkInterface : Collections.list(interfaces)) {
try {
if (networkInterface.isLoopback()) {
if (networkInterface.isLoopback() &&
!validationHost.equals("localhost") &&
!validationHost.startsWith("127.")) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class DynomiteCacheConfig {
}

@Override
Collection<Host> getHosts() {
List<Host> getHosts() {
return hosts
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DynomiteConfig {
}

@Override
Collection<Host> getHosts() {
List<Host> getHosts() {
return hosts
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class DefaultOrchestrationProcessor implements OrchestrationProcessor {
try {
MDC.remove(AuthenticatedRequest.SPINNAKER_USER)
MDC.remove(AuthenticatedRequest.SPINNAKER_ACCOUNTS)
MDC.remove(AuthenticatedRequest.SPINNAKER_EXECUTION_ID)
} catch (Exception e) {
log.error("Unable to clear thread locals, reason: ${e.message}")
}
Expand Down

0 comments on commit 2024913

Please sign in to comment.