-
Notifications
You must be signed in to change notification settings - Fork 887
feat: add --key flag to provisionerd start #14002
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
5d4cbc0
to
47aa9c4
Compare
if provisionerKey != "" { | ||
logger.Info(ctx, "provisioner key auth automatically sets tag "+provisionersdk.TagScope+" empty") | ||
// no scope tag will default to org scope | ||
delete(tags, provisionersdk.TagScope) | ||
} |
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.
Is this because it's all done on coderd? And we should be passing no tags into the provisioner daemon?
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.
Correct, the API will actually fail if you pass any tags + a provisioner key. I felt this was a good opportunity to break that behavior altogether.
// If using PSK auth, the daemon is, by definition, scoped to the organization. | ||
tags = provisionersdk.MutateTags(uuid.Nil, tags) | ||
return tags, nil | ||
if tags != nil && !maps.Equal(tags, map[string]string{}) { |
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.
TIL maps.Equal
What this changes:
--key
flag tocoder provisionerd start
for providing a provisioner key to authenticate with.--tag
or--psk
when using--key
flag.