mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Correct permissions on cassandra run script and fix provider.
We must handle null addresses in the cassandra seed provider. This can occur when there are 'notReadyAddresses' but no 'addresses'. While we're at it, update the makefile to build the jar.
This commit is contained in:
parent
500493a3ac
commit
f4b4ca2989
@ -19,7 +19,7 @@ COPY logback.xml /etc/cassandra/logback.xml
|
||||
COPY run.sh /run.sh
|
||||
COPY kubernetes-cassandra.jar /kubernetes-cassandra.jar
|
||||
|
||||
RUN chmod a+x /run.sh && \
|
||||
RUN chmod a+rx /run.sh && \
|
||||
mkdir -p /cassandra_data/data && \
|
||||
chown -R cassandra.cassandra /etc/cassandra /cassandra_data && \
|
||||
chmod o+w -R /etc/cassandra /cassandra_data
|
||||
|
@ -4,11 +4,15 @@ VERSION=v7
|
||||
|
||||
all: build
|
||||
|
||||
# TODO: build the jar and copy it in
|
||||
build:
|
||||
docker build -t gcr.io/google_containers/cassandra:${VERSION} .
|
||||
kubernetes-cassandra.jar: ../java/* ../java/src/io/k8s/cassandra/*.java
|
||||
cd ../java && mvn package
|
||||
mv ../java/target/kubernetes-cassandra*.jar kubernetes-cassandra.jar
|
||||
cd ../java && mvn clean
|
||||
|
||||
build: kubernetes-cassandra.jar
|
||||
docker build -t gcr.io/google_containers/cassandra:${VERSION} .
|
||||
|
||||
push: build
|
||||
gcloud docker push gcr.io/google_containers/cassandra:${VERSION}
|
||||
gcloud docker push gcr.io/google_containers/cassandra:${VERSION}
|
||||
|
||||
.PHONY: all
|
||||
.PHONY: all build push
|
||||
|
Binary file not shown.
@ -129,8 +129,10 @@ public class KubernetesSeedProvider implements SeedProvider {
|
||||
// Here is a problem point, endpoints.subsets can be null in first node cases.
|
||||
if (endpoints.subsets != null && !endpoints.subsets.isEmpty()){
|
||||
for (Subset subset : endpoints.subsets) {
|
||||
for (Address address : subset.addresses) {
|
||||
list.add(InetAddress.getByName(address.ip));
|
||||
if (subset.addresses != null && !subset.addresses.isEmpty()) {
|
||||
for (Address address : subset.addresses) {
|
||||
list.add(InetAddress.getByName(address.ip));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user