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:
blink-so[bot]
2025-09-19 20:33:11 +00:00
co-authored by angrycub
parent 6ca0aa4e79
commit 7343a34193
2 changed files with 2 additions and 2 deletions
+1 -2
View File
@@ -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",
})