Skip to content

Commit

Permalink
fix: improved init command excluded unnecessary flags (#365)
Browse files Browse the repository at this point in the history
# Description 

Excluded unnecessary flags in "metal init"
  • Loading branch information
cprivitere authored Oct 16, 2023
2 parents 5746b18 + dd93c3a commit 230615a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func (c *Client) NewCommand() *cobra.Command {
c.UserService = *metalGoClient.UsersApi
c.ProjectService = *metalGoClient.ProjectsApi

user, _, err := c.UserService.FindCurrentUser(context.Background()).Execute()
include := []string{} // []string | Nested attributes to include. Included objects will return their full attributes. Attribute names can be dotted (up to 3 levels) to included deeply nested objects. (optional)
exclude := []string{"devices", "members", "memberships", "invitations", "ssh_keys", "volumes", "backend_transfer_enabled", "updated_at", "customdata", "event_alert_configuration",
"timezone", "features", "avatar_url", "avatar_thumb_url", "two_factor_auth", "mailing_address", "max_projects", "verification_stage", "emails", "phone_number", "restricted",
"full_name", "email", "social_accounts", "opt_in_updated_at", "opt_in", "first_name", "last_name", "last_login_at"}
user, _, err := c.UserService.FindCurrentUser(context.Background()).Include(include).Exclude(exclude).Execute()
if err != nil {
return err
}
Expand Down

0 comments on commit 230615a

Please sign in to comment.