-
Notifications
You must be signed in to change notification settings - Fork 23
feat: Add "coder_metadata" resource #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Optional: true, | ||
Default: false, | ||
}, | ||
"is_null": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we just assume an empty string is null? Maybe that's too lossy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly! I implemented it this way because the original ticket asked for null support, and I figured somebody who's used to Terraform's semantics wouldn't necessarily be expecting us to conflate null and "" the way Go does. But if we're OK with that behavior, I definitely wouldn't mind getting rid of this hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make gen
should be used to generate docs- I'm looking for alternatives to names to
pair
, but I have no ideas! Maybe @mafredri has some thoughts 👀
Done! I added an example as well.
Hmm, a few other possibilities that come to mind:
|
pair { | ||
key = "pod_uid" | ||
value = kubernetes_pod.dev[0].uid | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused about why key
and value
were nested until @kylecarbs explained to me that HCL allows multiple pair blocks. We should demonstrate that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I updated the example to use multiple blocks, and also to demonstrate the sensitive
attribute.
I do like Some other options:
And some more "out there" options:
I'd read these as "attach/add key value to coder metadata". |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename pair
to item
and it LGTM! We'll do a release immediately after too :)
This PR adds support for the
coder_metadata
resource, which allows attaching arbitrary key/value metadata to other resources in a template, as described in coder/coder#2989.