Update docs and deprecate the --all flag
Update the docs to reflect the latest stable version and deprecate the --all flag for runner list and pool list. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
bb45324dcd
commit
80735ac2eb
6 changed files with 40 additions and 28 deletions
|
|
@ -128,12 +128,9 @@ Example:
|
|||
listEnterprisePoolsReq := apiClientEnterprises.NewListEnterprisePoolsParams()
|
||||
listEnterprisePoolsReq.EnterpriseID = poolEnterprise
|
||||
response, err = apiCli.Enterprises.ListEnterprisePools(listEnterprisePoolsReq, authToken)
|
||||
} else if cmd.Flags().Changed("all") {
|
||||
} else {
|
||||
listPoolsReq := apiClientPools.NewListPoolsParams()
|
||||
response, err = apiCli.Pools.ListPools(listPoolsReq, authToken)
|
||||
} else {
|
||||
cmd.Help() //nolint
|
||||
os.Exit(0)
|
||||
}
|
||||
default:
|
||||
cmd.Help() //nolint
|
||||
|
|
@ -409,11 +406,12 @@ func init() {
|
|||
poolListCmd.Flags().StringVarP(&poolRepository, "repo", "r", "", "List all pools within this repository.")
|
||||
poolListCmd.Flags().StringVarP(&poolOrganization, "org", "o", "", "List all pools within this organization.")
|
||||
poolListCmd.Flags().StringVarP(&poolEnterprise, "enterprise", "e", "", "List all pools within this enterprise.")
|
||||
poolListCmd.Flags().BoolVarP(&poolAll, "all", "a", false, "List all pools, regardless of org or repo.")
|
||||
poolListCmd.Flags().BoolVarP(&poolAll, "all", "a", true, "List all pools, regardless of org or repo.")
|
||||
poolListCmd.Flags().BoolVarP(&long, "long", "l", false, "Include additional info.")
|
||||
poolListCmd.Flags().StringVar(&endpointName, "endpoint", "", "When using the name of an entity, the endpoint must be specified when multiple entities with the same name exist.")
|
||||
|
||||
poolListCmd.MarkFlagsMutuallyExclusive("repo", "org", "all", "enterprise")
|
||||
poolListCmd.Flags().MarkDeprecated("all", "all pools are listed by default in the absence of --repo, --org or --enterprise.")
|
||||
poolListCmd.MarkFlagsMutuallyExclusive("repo", "org", "enterprise", "all")
|
||||
|
||||
poolUpdateCmd.Flags().StringVar(&poolImage, "image", "", "The provider-specific image name to use for runners in this pool.")
|
||||
poolUpdateCmd.Flags().UintVar(&priority, "priority", 0, "When multiple pools match the same labels, priority dictates the order by which they are returned, in descending order.")
|
||||
|
|
|
|||
|
|
@ -104,23 +104,32 @@ Example:
|
|||
response, err = apiCli.Instances.ListPoolInstances(listPoolInstancesReq, authToken)
|
||||
case 0:
|
||||
if cmd.Flags().Changed("repo") {
|
||||
runnerRepo, resErr := resolveRepository(runnerRepository, endpointName)
|
||||
if resErr != nil {
|
||||
return resErr
|
||||
}
|
||||
listRepoInstancesReq := apiClientRepos.NewListRepoInstancesParams()
|
||||
listRepoInstancesReq.RepoID = runnerRepository
|
||||
listRepoInstancesReq.RepoID = runnerRepo
|
||||
response, err = apiCli.Repositories.ListRepoInstances(listRepoInstancesReq, authToken)
|
||||
} else if cmd.Flags().Changed("org") {
|
||||
runnerOrg, resErr := resolveOrganization(runnerOrganization, endpointName)
|
||||
if resErr != nil {
|
||||
return resErr
|
||||
}
|
||||
listOrgInstancesReq := apiClientOrgs.NewListOrgInstancesParams()
|
||||
listOrgInstancesReq.OrgID = runnerOrganization
|
||||
listOrgInstancesReq.OrgID = runnerOrg
|
||||
response, err = apiCli.Organizations.ListOrgInstances(listOrgInstancesReq, authToken)
|
||||
} else if cmd.Flags().Changed("enterprise") {
|
||||
runnerEnt, resErr := resolveEnterprise(runnerEnterprise, endpointName)
|
||||
if resErr != nil {
|
||||
return resErr
|
||||
}
|
||||
listEnterpriseInstancesReq := apiClientEnterprises.NewListEnterpriseInstancesParams()
|
||||
listEnterpriseInstancesReq.EnterpriseID = runnerEnterprise
|
||||
listEnterpriseInstancesReq.EnterpriseID = runnerEnt
|
||||
response, err = apiCli.Enterprises.ListEnterpriseInstances(listEnterpriseInstancesReq, authToken)
|
||||
} else if cmd.Flags().Changed("all") {
|
||||
} else {
|
||||
listInstancesReq := apiClientInstances.NewListInstancesParams()
|
||||
response, err = apiCli.Instances.ListInstances(listInstancesReq, authToken)
|
||||
} else {
|
||||
cmd.Help() //nolint
|
||||
os.Exit(0)
|
||||
}
|
||||
default:
|
||||
cmd.Help() //nolint
|
||||
|
|
@ -205,9 +214,12 @@ func init() {
|
|||
runnerListCmd.Flags().StringVarP(&runnerRepository, "repo", "r", "", "List all runners from all pools within this repository.")
|
||||
runnerListCmd.Flags().StringVarP(&runnerOrganization, "org", "o", "", "List all runners from all pools within this organization.")
|
||||
runnerListCmd.Flags().StringVarP(&runnerEnterprise, "enterprise", "e", "", "List all runners from all pools within this enterprise.")
|
||||
runnerListCmd.Flags().BoolVarP(&runnerAll, "all", "a", false, "List all runners, regardless of org or repo.")
|
||||
runnerListCmd.Flags().BoolVarP(&runnerAll, "all", "a", true, "List all runners, regardless of org or repo. (deprecated)")
|
||||
runnerListCmd.Flags().BoolVarP(&long, "long", "l", false, "Include additional info.")
|
||||
runnerListCmd.MarkFlagsMutuallyExclusive("repo", "org", "enterprise", "all")
|
||||
runnerListCmd.Flags().StringVar(&endpointName, "endpoint", "", "When using the name of an entity, the endpoint must be specified when multiple entities with the same name exist.")
|
||||
|
||||
runnerListCmd.Flags().MarkDeprecated("all", "all runners are listed by default in the absence of --repo, --org or --enterprise.")
|
||||
|
||||
runnerDeleteCmd.Flags().BoolVarP(&forceRemove, "force-remove-runner", "f", false, "Forcefully remove a runner. If set to true, GARM will ignore provider errors when removing the runner.")
|
||||
runnerDeleteCmd.Flags().BoolVarP(&bypassGHUnauthorized, "bypass-github-unauthorized", "b", false, "Ignore Unauthorized errors from GitHub and proceed with removing runner from provider and DB. This is useful when credentials are no longer valid and you want to remove your runners. Warning, this has the potential to leave orphaned runners in GitHub. You will need to update your credentials to properly consolidate.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue