Skip to content

Commit e54e662

Browse files
committed
fix tags with key flag
1 parent 727abcd commit e54e662

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

enterprise/cli/provisionerdaemonstart.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,14 @@ func (r *RootCmd) provisionerDaemonStart() *serpent.Command {
154154
// When authorizing with a PSK / provisioner key, we automatically scope the provisionerd
155155
// to organization. Scoping to user with PSK / provisioner key auth is not a valid configuration.
156156
if preSharedKey != "" || provisionerKey != "" {
157-
logger.Info(ctx, "psk or provisioner key auth automatically sets tag "+provisionersdk.TagScope+"="+provisionersdk.ScopeOrganization)
157+
logger.Info(ctx, "psk automatically sets tag "+provisionersdk.TagScope+"="+provisionersdk.ScopeOrganization)
158158
tags[provisionersdk.TagScope] = provisionersdk.ScopeOrganization
159159
}
160+
if provisionerKey != "" {
161+
logger.Info(ctx, "provisioner key auth automatically sets tag "+provisionersdk.TagScope+" empty")
162+
// no scope tag will default to org scope
163+
delete(tags, provisionersdk.TagScope)
164+
}
160165

161166
err = os.MkdirAll(cacheDir, 0o700)
162167
if err != nil {

0 commit comments

Comments
 (0)