mirror of https://github.com/kubernetes/kops.git
gce: Only select forwardingRules for our cluster
Avoids issues when we have two clusters in the same GCP project.
This commit is contained in:
parent
3cce79d4e4
commit
8765d73ed3
|
|
@ -327,10 +327,17 @@ func (c *gceCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]f
|
|||
}
|
||||
}
|
||||
|
||||
clusterLabel := LabelForCluster(cluster.Name)
|
||||
|
||||
for _, forwardingRule := range forwardingRules {
|
||||
if !strings.HasPrefix(forwardingRule.Name, "api-") {
|
||||
continue
|
||||
}
|
||||
|
||||
if clusterLabel.Value != forwardingRule.Labels[clusterLabel.Key] {
|
||||
continue
|
||||
}
|
||||
|
||||
if forwardingRule.IPAddress == "" {
|
||||
return nil, fmt.Errorf("found forward rule %q, but it did not have an IPAddress", forwardingRule.Name)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue