Skip to content

Commit

Permalink
asset/tfvar: Add ValidateAndLog() for the converted tfvars.
Browse files Browse the repository at this point in the history
ValidateAndLog() will help us to catch some early errors on config
generation.
  • Loading branch information
Yifan Gu authored and crawford committed Sep 23, 2018
1 parent 070b77c commit f8bf4f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/types/config/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ func ConvertInstallConfigToTFVars(cfg *types.InstallConfig, bootstrapIgn string,
Type: tectonicnetwork.NetworkType(cfg.Networking.Type),
ServiceCIDR: cfg.Networking.ServiceCIDR.String(),
PodCIDR: cfg.Networking.PodCIDR.String(),
// TODO(yifan): Remove this when we drop the old installer binary.
MTU: "1480",
},
BaseDomain: cfg.BaseDomain,
Name: cfg.Name,
Expand Down Expand Up @@ -248,5 +250,10 @@ func ConvertInstallConfigToTFVars(cfg *types.InstallConfig, bootstrapIgn string,

}

// Validate the TFVars.
if err := cluster.ValidateAndLog(); err != nil {
return nil, err
}

return cluster, nil
}

0 comments on commit f8bf4f2

Please sign in to comment.