Browse Source

shell: update s3.configure to list users instead of full config

pull/8126/head
Chris Lu 2 days ago
parent
commit
f3304ead53
  1. 10
      weed/shell/command_s3_configure.go

10
weed/shell/command_s3_configure.go

@ -138,14 +138,14 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io
func (c *commandS3Configure) listConfiguration(commandEnv *CommandEnv, writer io.Writer) error {
return pb.WithGrpcClient(false, 0, func(conn *grpc.ClientConn) error {
client := iam_pb.NewSeaweedIdentityAccessManagementClient(conn)
resp, err := client.GetConfiguration(context.Background(), &iam_pb.GetConfigurationRequest{})
resp, err := client.ListUsers(context.Background(), &iam_pb.ListUsersRequest{})
if err != nil {
return err
}
var buf bytes.Buffer
filer.ProtoToText(&buf, resp.Configuration)
fmt.Fprint(writer, buf.String())
fmt.Fprintln(writer)
fmt.Fprintln(writer, "Users:")
for _, user := range resp.Usernames {
fmt.Fprintf(writer, "- %s\n", user)
}
return nil
}, commandEnv.option.FilerAddress.ToGrpcAddress(), false, commandEnv.option.GrpcDialOption)
}

Loading…
Cancel
Save