-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mcobbett-mutex-locking-in-mock-filesystem
- Loading branch information
Showing
31 changed files
with
1,846 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## galasactl roles | ||
|
||
Manage roles stored in the Galasa service | ||
|
||
### Synopsis | ||
|
||
The parent command for operations to manipulate Roles in the Galasa service | ||
|
||
### Options | ||
|
||
``` | ||
-b, --bootstrap string Bootstrap URL. Should start with 'http://' or 'file://'. If it starts with neither, it is assumed to be a fully-qualified path. If missing, it defaults to use the 'bootstrap.properties' file in your GALASA_HOME. Example: http://example.com/bootstrap, file:///user/myuserid/.galasa/bootstrap.properties , file://C:/Users/myuserid/.galasa/bootstrap.properties | ||
-h, --help Displays the options for the 'roles' command. | ||
--rate-limit-retries int The maximum number of retries that should be made when requests to the Galasa Service fail due to rate limits being exceeded. Must be a whole number. Defaults to 3 retries (default 3) | ||
--rate-limit-retry-backoff-secs float The amount of time in seconds to wait before retrying a command if it failed due to rate limits being exceeded. Defaults to 1 second. (default 1) | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--galasahome string Path to a folder where Galasa will read and write files and configuration settings. The default is '${HOME}/.galasa'. This overrides the GALASA_HOME environment variable which may be set instead. | ||
-l, --log string File to which log information will be sent. Any folder referred to must exist. An existing file will be overwritten. Specify "-" to log to stderr. Defaults to not logging. | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [galasactl](galasactl.md) - CLI for Galasa | ||
* [galasactl roles get](galasactl_roles_get.md) - Get Roles used in a Galasa service | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## galasactl roles get | ||
|
||
Get Roles used in a Galasa service | ||
|
||
### Synopsis | ||
|
||
Get a list of Roles from a Galasa service | ||
|
||
``` | ||
galasactl roles get [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--format string the output format of the returned Roles. Supported formats are: 'summary', 'yaml'. (default "summary") | ||
-h, --help Displays the options for the 'roles get' command. | ||
--name string An optional flag that identifies the secret to be retrieved. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
-b, --bootstrap string Bootstrap URL. Should start with 'http://' or 'file://'. If it starts with neither, it is assumed to be a fully-qualified path. If missing, it defaults to use the 'bootstrap.properties' file in your GALASA_HOME. Example: http://example.com/bootstrap, file:///user/myuserid/.galasa/bootstrap.properties , file://C:/Users/myuserid/.galasa/bootstrap.properties | ||
--galasahome string Path to a folder where Galasa will read and write files and configuration settings. The default is '${HOME}/.galasa'. This overrides the GALASA_HOME environment variable which may be set instead. | ||
-l, --log string File to which log information will be sent. Any folder referred to must exist. An existing file will be overwritten. Specify "-" to log to stderr. Defaults to not logging. | ||
--rate-limit-retries int The maximum number of retries that should be made when requests to the Galasa Service fail due to rate limits being exceeded. Must be a whole number. Defaults to 3 retries (default 3) | ||
--rate-limit-retry-backoff-secs float The amount of time in seconds to wait before retrying a command if it failed due to rate limits being exceeded. Defaults to 1 second. (default 1) | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [galasactl roles](galasactl_roles.md) - Manage roles stored in the Galasa service | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright contributors to the Galasa project | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"github.com/galasa-dev/cli/pkg/spi" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type RolesCmdValues struct { | ||
name string | ||
} | ||
|
||
type RolesCommand struct { | ||
cobraCommand *cobra.Command | ||
values *RolesCmdValues | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
// Constructors | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
func NewRolesCmd(rootCommand spi.GalasaCommand, commsFlagSet GalasaFlagSet) (spi.GalasaCommand, error) { | ||
cmd := new(RolesCommand) | ||
err := cmd.init(rootCommand, commsFlagSet) | ||
return cmd, err | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
// Public functions | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
func (cmd *RolesCommand) Name() string { | ||
return COMMAND_NAME_ROLES | ||
} | ||
|
||
func (cmd *RolesCommand) CobraCommand() *cobra.Command { | ||
return cmd.cobraCommand | ||
} | ||
|
||
func (cmd *RolesCommand) Values() interface{} { | ||
return cmd.values | ||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
// Private functions | ||
// ------------------------------------------------------------------------------------------------ | ||
|
||
func (cmd *RolesCommand) init(rootCommand spi.GalasaCommand, commsFlagSet GalasaFlagSet) error { | ||
|
||
var err error | ||
|
||
cmd.values = &RolesCmdValues{} | ||
cmd.cobraCommand, err = cmd.createCobraCommand(rootCommand, commsFlagSet) | ||
|
||
return err | ||
} | ||
|
||
func (cmd *RolesCommand) createCobraCommand(rootCommand spi.GalasaCommand, commsFlagSet GalasaFlagSet) (*cobra.Command, error) { | ||
|
||
var err error | ||
|
||
RolesCobraCmd := &cobra.Command{ | ||
Use: "roles", | ||
Short: "Manage roles stored in the Galasa service", | ||
Long: "The parent command for operations to manipulate Roles in the Galasa service", | ||
} | ||
|
||
RolesCobraCmd.PersistentFlags().AddFlagSet(commsFlagSet.Flags()) | ||
rootCommand.CobraCommand().AddCommand(RolesCobraCmd) | ||
|
||
return RolesCobraCmd, err | ||
} | ||
|
||
func addRolesNameFlag(cmd *cobra.Command, isMandatory bool, RolesCmdValues *RolesCmdValues) { | ||
|
||
flagName := "name" | ||
var description string | ||
if isMandatory { | ||
description = "A mandatory flag that identifies the secret to be created or manipulated." | ||
} else { | ||
description = "An optional flag that identifies the secret to be retrieved." | ||
} | ||
|
||
cmd.Flags().StringVar(&RolesCmdValues.name, flagName, "", description) | ||
|
||
if isMandatory { | ||
cmd.MarkFlagRequired(flagName) | ||
} | ||
} |
Oops, something went wrong.