@@ -56,6 +56,10 @@ type cluster struct {
5656// }
5757
5858func (c * cluster ) TagsAttribute (ctx context.Context , d diag.Diagnostics ) []* console.TagAttributes {
59+ if c .Tags .IsNull () {
60+ return nil
61+ }
62+
5963 result := make ([]* console.TagAttributes , 0 )
6064 elements := make (map [string ]types.String , len (c .Tags .Elements ()))
6165 d .Append (c .Tags .ElementsAs (ctx , & elements , false )... )
@@ -107,7 +111,7 @@ func (c *cluster) From(cl *console.ClusterFragment, ctx context.Context, d diag.
107111 c .Handle = types .StringPointerValue (cl .Handle )
108112 // c.DesiredVersion = c.ClusterVersionFrom(cl.Provider, cl.Version, cl.CurrentVersion)
109113 c .Protect = types .BoolPointerValue (cl .Protect )
110- c .Tags = common .ClusterTagsFrom (cl .Tags , d )
114+ c .Tags = common .TagsFrom (cl . Tags , c .Tags , d )
111115 // c.ProviderId = common.ClusterProviderIdFrom(cl.Provider)
112116 // c.NodePools = common.ClusterNodePoolsFrom(cl.NodePools, c.NodePools, ctx, d)
113117 c .Metadata = types .StringValue (string (metadata ))
@@ -120,7 +124,7 @@ func (c *cluster) FromCreate(cc *console.CreateCluster, ctx context.Context, d d
120124 c .Handle = types .StringPointerValue (cc .CreateCluster .Handle )
121125 // c.DesiredVersion = c.ClusterVersionFrom(cc.CreateCluster.Provider, cc.CreateCluster.Version, cc.CreateCluster.CurrentVersion)
122126 c .Protect = types .BoolPointerValue (cc .CreateCluster .Protect )
123- c .Tags = common .ClusterTagsFrom (cc .CreateCluster .Tags , d )
127+ c .Tags = common .TagsFrom (cc .CreateCluster . Tags , c .Tags , d )
124128 // c.ProviderId = common.ClusterProviderIdFrom(cc.CreateCluster.Provider)
125129 // c.NodePools = common.ClusterNodePoolsFrom(cc.CreateCluster.NodePools, c.NodePools, ctx, d)
126130}
0 commit comments