mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Merge pull request #10718 from justinsb/e2e_aws_block_master_by_ip
e2e: For AWS, block master by (hard-coded) IP
This commit is contained in:
commit
a60638d760
@ -335,7 +335,15 @@ func performTemporaryNetworkFailure(c *client.Client, ns, rcName string, replica
|
||||
// and cause it to fail if DNS is absent or broken.
|
||||
// Use the IP address instead.
|
||||
|
||||
iptablesRule := fmt.Sprintf("OUTPUT --destination %s --jump DROP", testContext.CloudConfig.MasterName)
|
||||
destination := testContext.CloudConfig.MasterName
|
||||
if providerIs("aws") {
|
||||
// This is the (internal) IP address used on AWS for the master
|
||||
// TODO: Use IP address for all clouds?
|
||||
// TODO: Avoid hard-coding this
|
||||
destination = "172.20.0.9"
|
||||
}
|
||||
|
||||
iptablesRule := fmt.Sprintf("OUTPUT --destination %s --jump DROP", destination)
|
||||
defer func() {
|
||||
// This code will execute even if setting the iptables rule failed.
|
||||
// It is on purpose because we may have an error even if the new rule
|
||||
|
Loading…
Reference in New Issue
Block a user