Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cassandra #9932

Merged
merged 1 commit into from
Apr 6, 2021
Merged

Conversation

tianon
Copy link
Member

@tianon tianon commented Apr 6, 2021

Changes:

Changes:

- docker-library/cassandra@f536e44: Merge pull request docker-library/cassandra#225 from infosiftr/link-local
- docker-library/cassandra@51b30b5: Ignore link-local addresses when getting IP
@github-actions
Copy link

github-actions bot commented Apr 6, 2021

Diff for febbc46:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 4905d11..5160382 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,25 +3,25 @@ GitRepo: https://github.com/docker-library/cassandra.git
 
 Tags: 2.1.22, 2.1
 Architectures: amd64, ppc64le
-GitCommit: 4542823efa4a2b91575a65266906b1fe314f839d
+GitCommit: 51b30b5d78616d8db73153dede5df440d0ea7fc4
 Directory: 2.1
 
 Tags: 2.2.19, 2.2, 2
 Architectures: amd64, ppc64le
-GitCommit: 4542823efa4a2b91575a65266906b1fe314f839d
+GitCommit: 51b30b5d78616d8db73153dede5df440d0ea7fc4
 Directory: 2.2
 
 Tags: 3.0.24, 3.0
 Architectures: amd64, ppc64le
-GitCommit: ae74e95f49d635ad12af342bac020ac0453e356f
+GitCommit: 51b30b5d78616d8db73153dede5df440d0ea7fc4
 Directory: 3.0
 
 Tags: 3.11.10, 3.11, 3, latest
 Architectures: amd64, ppc64le
-GitCommit: 5670b9eb72220c08446731a5aa39bbb1eaec0cbd
+GitCommit: 51b30b5d78616d8db73153dede5df440d0ea7fc4
 Directory: 3.11
 
 Tags: 4.0-beta4, 4.0
 Architectures: amd64, arm32v7, arm64v8, ppc64le
-GitCommit: 4542823efa4a2b91575a65266906b1fe314f839d
+GitCommit: 51b30b5d78616d8db73153dede5df440d0ea7fc4
 Directory: 4.0
diff --git a/cassandra_2.1/docker-entrypoint.sh b/cassandra_2.1/docker-entrypoint.sh
index b50a726..6549f83 100755
--- a/cassandra_2.1/docker-entrypoint.sh
+++ b/cassandra_2.1/docker-entrypoint.sh
@@ -18,7 +18,11 @@ _ip_address() {
 	# scrape the first non-localhost IP address of the container
 	# in Swarm Mode, we often get two IPs -- the container IP, and the (shared) VIP, and the container IP should always be first
 	ip address | awk '
-		$1 == "inet" && $NF != "lo" {
+		$1 != "inet" { next } # only lines with ip addresses
+		$NF == "lo" { next } # skip loopback devices
+		$2 ~ /^127[.]/ { next } # skip loopback addresses
+		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+		{
 			gsub(/\/.+$/, "", $2)
 			print $2
 			exit
diff --git a/cassandra_2/docker-entrypoint.sh b/cassandra_2/docker-entrypoint.sh
index b50a726..6549f83 100755
--- a/cassandra_2/docker-entrypoint.sh
+++ b/cassandra_2/docker-entrypoint.sh
@@ -18,7 +18,11 @@ _ip_address() {
 	# scrape the first non-localhost IP address of the container
 	# in Swarm Mode, we often get two IPs -- the container IP, and the (shared) VIP, and the container IP should always be first
 	ip address | awk '
-		$1 == "inet" && $NF != "lo" {
+		$1 != "inet" { next } # only lines with ip addresses
+		$NF == "lo" { next } # skip loopback devices
+		$2 ~ /^127[.]/ { next } # skip loopback addresses
+		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+		{
 			gsub(/\/.+$/, "", $2)
 			print $2
 			exit
diff --git a/cassandra_3.0/docker-entrypoint.sh b/cassandra_3.0/docker-entrypoint.sh
index b50a726..6549f83 100755
--- a/cassandra_3.0/docker-entrypoint.sh
+++ b/cassandra_3.0/docker-entrypoint.sh
@@ -18,7 +18,11 @@ _ip_address() {
 	# scrape the first non-localhost IP address of the container
 	# in Swarm Mode, we often get two IPs -- the container IP, and the (shared) VIP, and the container IP should always be first
 	ip address | awk '
-		$1 == "inet" && $NF != "lo" {
+		$1 != "inet" { next } # only lines with ip addresses
+		$NF == "lo" { next } # skip loopback devices
+		$2 ~ /^127[.]/ { next } # skip loopback addresses
+		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+		{
 			gsub(/\/.+$/, "", $2)
 			print $2
 			exit
diff --git a/cassandra_4.0/docker-entrypoint.sh b/cassandra_4.0/docker-entrypoint.sh
index b50a726..6549f83 100755
--- a/cassandra_4.0/docker-entrypoint.sh
+++ b/cassandra_4.0/docker-entrypoint.sh
@@ -18,7 +18,11 @@ _ip_address() {
 	# scrape the first non-localhost IP address of the container
 	# in Swarm Mode, we often get two IPs -- the container IP, and the (shared) VIP, and the container IP should always be first
 	ip address | awk '
-		$1 == "inet" && $NF != "lo" {
+		$1 != "inet" { next } # only lines with ip addresses
+		$NF == "lo" { next } # skip loopback devices
+		$2 ~ /^127[.]/ { next } # skip loopback addresses
+		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+		{
 			gsub(/\/.+$/, "", $2)
 			print $2
 			exit
diff --git a/cassandra_latest/docker-entrypoint.sh b/cassandra_latest/docker-entrypoint.sh
index b50a726..6549f83 100755
--- a/cassandra_latest/docker-entrypoint.sh
+++ b/cassandra_latest/docker-entrypoint.sh
@@ -18,7 +18,11 @@ _ip_address() {
 	# scrape the first non-localhost IP address of the container
 	# in Swarm Mode, we often get two IPs -- the container IP, and the (shared) VIP, and the container IP should always be first
 	ip address | awk '
-		$1 == "inet" && $NF != "lo" {
+		$1 != "inet" { next } # only lines with ip addresses
+		$NF == "lo" { next } # skip loopback devices
+		$2 ~ /^127[.]/ { next } # skip loopback addresses
+		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+		{
 			gsub(/\/.+$/, "", $2)
 			print $2
 			exit

@yosifkit yosifkit merged commit 92d0e47 into docker-library:master Apr 6, 2021
@yosifkit yosifkit deleted the cassandra branch April 6, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants