forked from redboxllc/scuttle
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove outdated kill method to stop sidecar
Sending the kill signal was needed for Istio < v1.3 and 1.3 has been released 4 years ago. If the `ENVOY_ADMIN_API` is set to the default port `15000` the `ISTIO_QUIT_API` configured correctly by default. On deployments that restart the containers the shutdown behaviour might be undesirable. The Istio sidecar will be restarted but when the pod has multiple containers that means that meaningful work in the containers that did not crash could be interrupted. So for pods that have multiple containers that need traffic through the service mesh, it is recommended to set `NEVER_KILL_ISTIO` to `true`.
- Loading branch information
Showing
4 changed files
with
75 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package main | ||
|
||
import "testing" | ||
|
||
func Test_replacePort(t *testing.T) { | ||
type args struct { | ||
sourceURL string | ||
original int | ||
replacement int | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want string | ||
}{ | ||
{ | ||
name: "Happy flow", | ||
args: args{ | ||
sourceURL: "http://localhost:15000", | ||
original: 15000, | ||
replacement: 15020, | ||
}, | ||
want: "http://localhost:15020", | ||
}, | ||
{ | ||
name: "Invalid URL", | ||
args: args{ | ||
sourceURL: "notaurl^^ :15000", | ||
original: 15000, | ||
replacement: 15020, | ||
}, | ||
want: "", | ||
}, | ||
{ | ||
name: "Port not matching", | ||
args: args{ | ||
sourceURL: "http://localhost:14000", | ||
original: 15000, | ||
replacement: 15020, | ||
}, | ||
want: "", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := replacePort(tt.args.sourceURL, tt.args.original, tt.args.replacement); got != tt.want { | ||
t.Errorf("replacePort() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |