github.com/hernad/nomad@v1.6.112/jobspec2/test-fixtures/config-compatibility.hcl (about) 1 # Copyright (c) HashiCorp, Inc. 2 # SPDX-License-Identifier: MPL-2.0 3 4 job "example" { 5 group "group" { 6 task "task" { 7 config { 8 ## arbitrary structures to compare HCLv1 and HCLv2 9 ## HCLv2 must parse the same way HCLv1 parser does 10 11 12 # primitive attrs 13 attr_string = "b" 14 attr_int = 3 15 attr_large_int = 21474836470 16 attr_float = 3.2 17 18 # lists attrs 19 attr_list_string = ["a", "b"] 20 attr_list_int = [1, 2, 4] 21 attr_list_float = [1.2, 2.3, 4.2] 22 attr_list_hetro = [1, "a", 3.4, { "k" = "v" }] 23 attr_list_empty = [] 24 25 # map attrs 26 attr_map = { "KEY" = "VAL", "KEY2" = "VAL2" } 27 attr_map_empty = {} 28 29 # simple blocks 30 block1 { 31 k = "b" 32 key2 = "v2" 33 } 34 labeled_block "label1" { 35 k = "b" 36 } 37 multi_labeled_block "label1" "label2" "label3" { 38 k = "b" 39 } 40 41 # repeated block 42 repeated_block_type { 43 a = 2 44 } 45 repeated_block_type { 46 b = 3 47 } 48 49 # repeated blocks with labels 50 label_repeated "l1" { 51 a = 1 52 } 53 label_repeated "l1" { 54 a = 2 55 } 56 label_repeated "l2" "l21" { 57 a = 3 58 } 59 label_repeated "l2" "l21" "l23" { 60 a = 4 61 } 62 label_repeated "l3" { 63 a = 5 64 } 65 66 # nested blocks 67 outer_block "l1" { 68 level = 1 69 inner_block "l2" { 70 level = 2 71 most_inner "l3" { 72 level = 3 73 74 inner_map = { "K" = "V" } 75 } 76 } 77 } 78 } 79 } 80 } 81 }