feat(influx): extend CLI org type to support config orgs in global config
parent
5cd57d4f1e
commit
43b7d65d02
|
@ -6,6 +6,7 @@
|
|||
|
||||
1. [17618](https://github.com/influxdata/influxdb/pull/17618): Add index for URM by user ID to improve lookup performance
|
||||
1. [17751](https://github.com/influxdata/influxdb/pull/17751): Existing session expiration time is respected on session renewal
|
||||
1. [17817](https://github.com/influxdata/influxdb/pull/17817): Make CLI respect env vars and flags in addition to the configs and extend support for config orgs to all commands
|
||||
|
||||
### UI Improvements
|
||||
|
||||
|
|
|
@ -408,16 +408,25 @@ func (o *organization) getID(orgSVC influxdb.OrganizationService) (influxdb.ID,
|
|||
return 0, fmt.Errorf("invalid org ID provided: %s", err.Error())
|
||||
}
|
||||
return *influxOrgID, nil
|
||||
} else if o.name != "" {
|
||||
}
|
||||
|
||||
getOrgByName := func(name string) (influxdb.ID, error) {
|
||||
org, err := orgSVC.FindOrganization(context.Background(), influxdb.OrganizationFilter{
|
||||
Name: &o.name,
|
||||
Name: &name,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("%v", err)
|
||||
return 0, err
|
||||
}
|
||||
return org.ID, nil
|
||||
}
|
||||
return 0, fmt.Errorf("failed to locate an organization id")
|
||||
if o.name != "" {
|
||||
return getOrgByName(o.name)
|
||||
}
|
||||
// last check is for the org set in the CLI config. This will be last in priority.
|
||||
if flags.Org != "" {
|
||||
return getOrgByName(flags.Org)
|
||||
}
|
||||
return 0, fmt.Errorf("failed to locate organization criteria")
|
||||
}
|
||||
|
||||
func (o *organization) validOrgFlags(f *globalFlags) error {
|
||||
|
|
Loading…
Reference in New Issue