@@ -60,77 +60,6 @@ func ParameterContextsEvalHook(input Input) func(ctx *tfcontext.Context, blocks
60
60
continue
61
61
}
62
62
ctx .Set (obj , path ... )
63
- //
64
- //ref := block.Reference()
65
- //refKey := ref.RawKey()
66
- //
67
- //fmt.Println(refKey)
68
- //
69
- //countAttr, countExists := block.Attributes()["count"]
70
- //if countExists {
71
- // // Omit count = 0 values!
72
- // countVal := countAttr.Value()
73
- // if !countVal.Type().Equals(cty.Number) {
74
- // continue // Probably unknown
75
- // }
76
- // v, _ := countVal.AsBigFloat().Int64()
77
- // if v < 1 {
78
- // // Non-one counts are incorrect
79
- // // Zero counts are ignored as the blocks are omitted
80
- // continue
81
- // }
82
- //}
83
- //
84
- //nameAttr := block.GetAttribute("name")
85
- //nameVal := nameAttr.Value()
86
- //if !nameVal.Type().Equals(cty.String) {
87
- // continue // Ignore the errors at this point
88
- //}
89
- //
90
- //// Set the default value as the 'value' attribute
91
- //path := []string{
92
- // "data",
93
- // "coder_parameter",
94
- // block.Reference().NameLabel(),
95
- //}
96
- //if countExists {
97
- // // Append to the existing tuple
98
- // existing := ctx.Get(path...)
99
- // if existing.IsNull() {
100
- // continue
101
- // }
102
- //
103
- // if !existing.Type().IsTupleType() {
104
- // continue
105
- // }
106
- //
107
- // if existing.LengthInt() > 1 {
108
- // // coder_parameters can only ever have a count of 0 or 1.
109
- // // More than that is invalid. So ignore invalid blocks.
110
- // continue
111
- // }
112
- //
113
- // it := existing.ElementIterator()
114
- // if !it.Next() {
115
- // continue
116
- // }
117
- //
118
- // _, v := it.Element()
119
- // merged := hclext.MergeObjects(v, cty.ObjectVal(map[string]cty.Value{
120
- // "value": value,
121
- // }))
122
- //
123
- // // Since our count can only equal 1, we can safely set the
124
- // // value to a tuple of length 1 in all cases.
125
- // ctx.Set(cty.TupleVal([]cty.Value{merged}), path...)
126
- // continue
127
- //}
128
- //
129
- //path = append(path, "value")
130
- //// The current context is in the `coder_parameter` block.
131
- //// Use the parent context to "export" the value
132
- //ctx.Set(value, path...)
133
- //block.Context().Parent().Set(value, path...)
134
63
}
135
64
}
136
65
}
0 commit comments