Skip to content

Commit 4148a03

Browse files
feat: Add option to hide resources from the UI (#47)
* feat: Add roption to hide resources from the UI * Add tests to hide * fix tesst
1 parent 7172f9c commit 4148a03

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: internal/provider/provider.go

+6
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,12 @@ func New() *schema.Provider {
400400
ForceNew: true,
401401
Required: true,
402402
},
403+
"hide": {
404+
Type: schema.TypeBool,
405+
Description: "Hide the resource from the UI.",
406+
ForceNew: true,
407+
Optional: true,
408+
},
403409
"item": {
404410
Type: schema.TypeList,
405411
Description: "Each \"item\" block defines a single metadata item consisting of a key/value pair.",

Diff for: internal/provider/provider_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ func TestMetadata(t *testing.T) {
263263
}
264264
resource "coder_metadata" "agent" {
265265
resource_id = coder_agent.dev.id
266+
hide = true
266267
item {
267268
key = "foo"
268269
value = "bar"
@@ -295,6 +296,7 @@ func TestMetadata(t *testing.T) {
295296
t.Logf("metadata attributes: %#v", metadata.Primary.Attributes)
296297
for key, expected := range map[string]string{
297298
"resource_id": agent.Primary.Attributes["id"],
299+
"hide": "true",
298300
"item.#": "5",
299301
"item.0.key": "foo",
300302
"item.0.value": "bar",

0 commit comments

Comments
 (0)