Skip to content

Commit

Permalink
Introduce last fix to catch nil pointer (#221)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Hoppe <robert.hoppe@mail.schwarz>
  • Loading branch information
roberth1988 and Robert Hoppe authored Feb 20, 2024
1 parent 9515af6 commit e6637ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stackit/internal/data-sources/kubernetes/cluster/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ func transform(c *Cluster, cl *cluster.Cluster) {
}
c.KubernetesVersion = types.StringValue(cl.Kubernetes.Version)
c.KubernetesVersionUsed = types.StringValue(cl.Kubernetes.Version)
c.NetworkID = types.StringValue(*cl.Network.ID)

// NetworkID is optional
if cl.Network != nil && cl.Network.ID != nil {
c.NetworkID = types.StringValue(*cl.Network.ID)
}

if cl.Status.Aggregated != nil {
c.Status = types.StringValue(string(*cl.Status.Aggregated))
}
Expand Down

0 comments on commit e6637ce

Please sign in to comment.