File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -372,6 +372,8 @@ func setResourceName(resource *hclwrite.Block, name string) {
372372 resource .SetLabels (labels )
373373}
374374
375+ // getResourceName returns the first label of a block, if it exists.
376+ // e.g. in resource "mongodbatlas_cluster" "mycluster", the first label is "mongodbatlas_cluster".
375377func getResourceName (resource * hclwrite.Block ) string {
376378 labels := resource .Labels ()
377379 if len (labels ) == 0 {
@@ -380,6 +382,8 @@ func getResourceName(resource *hclwrite.Block) string {
380382 return labels [0 ]
381383}
382384
385+ // getResourceLabel returns the second label of a block, if it exists.
386+ // e.g. in resource "mongodbatlas_cluster" "mycluster", the second label is "mycluster".
383387func getResourceLabel (resource * hclwrite.Block ) string {
384388 labels := resource .Labels ()
385389 if len (labels ) <= 1 {
You can’t perform that action at this time.
0 commit comments