feat: add --key flag to provisionerd start#14002
Merged
Merged
Conversation
17 tasks
5d4cbc0 to
47aa9c4
Compare
Emyrk
approved these changes
Jul 25, 2024
Comment on lines
+160
to
+164
| 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) | ||
| } |
Member
There was a problem hiding this comment.
Is this because it's all done on coderd? And we should be passing no tags into the provisioner daemon?
Member
Author
There was a problem hiding this comment.
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{}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes:
--keyflag tocoder provisionerd startfor providing a provisioner key to authenticate with.--tagor--pskwhen using--keyflag.