Make cluster IP range an argument to ginkgo to fix firewall test

This commit is contained in:
Shyam Jeedigunta
2017-06-29 16:13:05 +02:00
parent 5731e0d6c9
commit c1a76fbb57
5 changed files with 6 additions and 11 deletions

View File

@@ -141,21 +141,12 @@ func GetClusterName(instancePrefix string) string {
return instancePrefix
}
// GetClusterIpRange returns the CLUSTER_IP_RANGE env we set for e2e cluster.
//
// Warning: this MUST be consistent with the CLUSTER_IP_RANGE set in
// gce/config-test.sh.
func GetClusterIpRange() string {
return "10.100.0.0/14"
}
// GetE2eFirewalls returns all firewall rules we create for an e2e cluster.
// From cluster/gce/util.sh, all firewall rules should be consistent with the ones created by startup scripts.
func GetE2eFirewalls(masterName, masterTag, nodeTag, network string) []*compute.Firewall {
func GetE2eFirewalls(masterName, masterTag, nodeTag, network, clusterIpRange string) []*compute.Firewall {
instancePrefix, err := GetInstancePrefix(masterName)
Expect(err).NotTo(HaveOccurred())
clusterName := GetClusterName(instancePrefix)
clusterIpRange := GetClusterIpRange()
fws := []*compute.Firewall{}
fws = append(fws, &compute.Firewall{