mirror of
https://github.com/Luzifer/ots.git
synced 2025-07-22 06:08:51 -04:00
Implement attachment checking in CLI (#141)
This commit is contained in:
parent
34275baa2f
commit
9a530e1c66
16 changed files with 374 additions and 17 deletions
|
@ -93,7 +93,7 @@ func createRunE(cmd *cobra.Command, _ []string) (err error) {
|
|||
})
|
||||
}
|
||||
|
||||
// Create the secret
|
||||
// Get flags for creation
|
||||
logrus.Info("creating the secret...")
|
||||
instanceURL, err := cmd.Flags().GetString("instance")
|
||||
if err != nil {
|
||||
|
@ -105,6 +105,12 @@ func createRunE(cmd *cobra.Command, _ []string) (err error) {
|
|||
return fmt.Errorf("getting expire flag: %w", err)
|
||||
}
|
||||
|
||||
// Execute sanity checks
|
||||
if err = client.SanityCheck(instanceURL, secret); err != nil {
|
||||
return fmt.Errorf("sanity checking secret: %w", err)
|
||||
}
|
||||
|
||||
// Create the secret
|
||||
secretURL, expiresAt, err := client.Create(instanceURL, secret, expire)
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating secret: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue