diff --git a/authmate/authmate.go b/authmate/authmate.go index d6ed17f74..f2686788f 100644 --- a/authmate/authmate.go +++ b/authmate/authmate.go @@ -110,12 +110,19 @@ func (a *Agent) checkContainer(ctx context.Context, cid *cid.ID, friendlyName st return nil, fmt.Errorf("failed to build placement policy: %w", err) } - cnr := container.New( + cnrOptions := []container.Option{ container.WithPolicy(pp), container.WithCustomBasicACL(defaultAuthContainerBasicACL), - container.WithAttribute(container.AttributeName, friendlyName), - container.WithAttribute(container.AttributeTimestamp, strconv.FormatInt(time.Now().Unix(), 10))) - container.SetNativeName(cnr, friendlyName) + container.WithAttribute(container.AttributeTimestamp, strconv.FormatInt(time.Now().Unix(), 10)), + } + if friendlyName != "" { + cnrOptions = append(cnrOptions, container.WithAttribute(container.AttributeName, friendlyName)) + } + + cnr := container.New(cnrOptions...) + if friendlyName != "" { + container.SetNativeName(cnr, friendlyName) + } cid, err = a.pool.PutContainer(ctx, cnr) if err != nil { diff --git a/cmd/authmate/main.go b/cmd/authmate/main.go index 27cc28cf3..b1dd89145 100644 --- a/cmd/authmate/main.go +++ b/cmd/authmate/main.go @@ -197,7 +197,6 @@ func issueSecret() *cli.Command { Usage: "friendly name of auth container to put the secret into", Required: false, Destination: &containerFriendlyName, - Value: "auth-container", }, &cli.BoolFlag{ Name: "create-session-token",