mirror of https://github.com/kubernetes/kops.git
Remove redundant literal function. LiteralFromStringValue is more commonly used.
This commit is contained in:
parent
e4ca5a000d
commit
7d845e5c38
|
|
@ -479,9 +479,7 @@ func addNetworks(network *Network, subnet *Subnet, networkInterfaces []*compute.
|
||||||
for _, gac := range g.AccessConfigs {
|
for _, gac := range g.AccessConfigs {
|
||||||
tac := &terraformAccessConfig{}
|
tac := &terraformAccessConfig{}
|
||||||
natIP := gac.NatIP
|
natIP := gac.NatIP
|
||||||
if strings.HasPrefix(natIP, "${") {
|
if natIP != "" {
|
||||||
tac.NatIP = terraform.LiteralExpression(natIP)
|
|
||||||
} else if natIP != "" {
|
|
||||||
tac.NatIP = terraform.LiteralFromStringValue(natIP)
|
tac.NatIP = terraform.LiteralFromStringValue(natIP)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,6 @@ func (l *Literal) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(&l.Value)
|
return json.Marshal(&l.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LiteralExpression(s string) *Literal {
|
|
||||||
return &Literal{Value: s}
|
|
||||||
}
|
|
||||||
|
|
||||||
func LiteralFileExpression(modulePath string) *Literal {
|
func LiteralFileExpression(modulePath string) *Literal {
|
||||||
return &Literal{
|
return &Literal{
|
||||||
Value: fmt.Sprintf("${file(%q)}", modulePath),
|
Value: fmt.Sprintf("${file(%q)}", modulePath),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue