Skip to content

Commit

Permalink
Merge pull request kubernetes#5808 from mikeln/issue-5737
Browse files Browse the repository at this point in the history
Cassandra Cluster Example Add Check for Null Endpoints (redo2)
  • Loading branch information
brendandburns committed Mar 24, 2015
2 parents aee9bdd + bbca721 commit 9707a94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,13 @@ public class KubernetesSeedProvider implements SeedProvider {
ObjectMapper mapper = new ObjectMapper();
Endpoints endpoints = mapper.readValue(url, Endpoints.class);
if (endpoints != null) {
// Here is a problem point, endpoints.endpoints can be null in first node cases.
if (endpoints.endpoints != null){
for (String endpoint : endpoints.endpoints) {
String[] parts = endpoint.split(":");
list.add(InetAddress.getByName(parts[0]));
}
}
}
} catch (IOException ex) {
logger.warn("Request to kubernetes apiserver failed");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ public List<InetAddress> getSeeds() {
ObjectMapper mapper = new ObjectMapper();
Endpoints endpoints = mapper.readValue(url, Endpoints.class);
if (endpoints != null) {
// Here is a problem point, endpoints.endpoints can be null in first node cases.
if (endpoints.endpoints != null){
for (String endpoint : endpoints.endpoints) {
String[] parts = endpoint.split(":");
list.add(InetAddress.getByName(parts[0]));
}
}
}
} catch (IOException ex) {
logger.warn("Request to kubernetes apiserver failed");
Expand Down

0 comments on commit 9707a94

Please sign in to comment.