Fix cluster network mapping (#375)
* Make cluster network computed * Replace computed with better mapping * Fix comment * Update unit test§
This commit is contained in:
parent
35b10c602b
commit
ecaf622f55
2 changed files with 16 additions and 7 deletions
|
|
@ -1486,6 +1486,17 @@ func mapNetwork(cl *ske.Cluster, m *Model) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// If the network field is not provided, the SKE API returns an empty object.
|
||||
// If we parse that object into the terraform model, it will produce an inconsistent result after apply error
|
||||
|
||||
emptyNetwork := &ske.V1Network{}
|
||||
if *cl.Network == *emptyNetwork && m.Network.IsNull() {
|
||||
if m.Network.Attributes() == nil {
|
||||
m.Network = types.ObjectNull(networkTypes)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
id := types.StringNull()
|
||||
if cl.Network.Id != nil {
|
||||
id = types.StringValue(*cl.Network.Id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue