Limit GCE router name to 63 chars

This commit is contained in:
Ciprian Hacman 2022-07-01 07:22:02 +03:00
parent 3792e9bc1b
commit 7fbf2705dd
2 changed files with 5 additions and 1 deletions

View File

@ -119,6 +119,10 @@ func (c *GCEModelContext) NameForHealthcheck(id string) string {
return c.SafeSuffixedObjectName(id)
}
func (c *GCEModelContext) NameForRouter(id string) string {
return c.SafeSuffixedObjectName(id)
}
func (c *GCEModelContext) NameForFirewallRule(id string) string {
return gce.ClusterSuffixedName(id, c.Cluster.ObjectMeta.Name, 63)
}

View File

@ -129,7 +129,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error {
return nil
}
r := &gcetasks.Router{
Name: s(b.SafeObjectName("nat")),
Name: s(b.NameForRouter("nat")),
Lifecycle: b.Lifecycle,
Network: network,
Region: s(b.Region),