mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
fix(lint): address revive and ruleguard warnings
- Replace single-case switch with if for PSK env tags ignore - Suppress ruleguard warning in new test with nolint:gocritic Co-authored-by: angrycub <464492+angrycub@users.noreply.github.com>
This commit is contained in:
co-authored by
angrycub
parent
6ca0aa4e79
commit
7343a34193
@@ -126,8 +126,7 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
|
||||
if preSharedKey != "" && len(rawTags) > 0 {
|
||||
for _, opt := range inv.Command.Options {
|
||||
if opt.Env == "CODER_PROVISIONERD_TAGS" {
|
||||
switch opt.ValueSource {
|
||||
case serpent.ValueSourceEnv:
|
||||
if opt.ValueSource == serpent.ValueSourceEnv {
|
||||
cliui.Warn(inv.Stderr, "CODER_PROVISIONERD_TAGS is set but will be ignored when using --psk.")
|
||||
rawTags = nil
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ func TestProvisionerDaemon_EnvTagsIgnoredWithKey(t *testing.T) {
|
||||
},
|
||||
},
|
||||
})
|
||||
//nolint:gocritic // ignore This client is operating as the owner user, which has unrestricted permissions
|
||||
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
|
||||
Name: "env-tags-ignored",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user