Skip to content

Commit e0efbf0

Browse files
Merge pull request #93 from dkeohane/OSD-5505
[OSD-5505] Add flag to open AWS console url upon generation
2 parents d9ddb02 + c06e05b commit e0efbf0

File tree

5 files changed

+17
-40
lines changed

5 files changed

+17
-40
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ osdctl account console -a test-cr
112112

113113
# generate console URL via AWS Account ID
114114
osdctl account console -i 1111111111
115+
116+
# The --launch flag will open the url in the browser
117+
osdctl account console -i 1111111111 --launch
115118
```
116119

117120
### Cleanup Velero managed snapshots
@@ -129,14 +132,14 @@ osdctl account clean-velero-snapshots -p <profile name> -c <config file path>
129132

130133
### AWS Account IAM User Credentials validation
131134

132-
`check-secrets` command checks the IAM User Secret associated with Account Accout CR.
135+
`verify-secrets` command verifies the IAM User Secret associated with Account Accout CR.
133136

134137
```bash
135-
# no argument, check all account secrets
136-
osdctl account check-secrets
138+
# no argument, verify all account secrets
139+
osdctl account verify-secrets
137140

138-
# specify the Account CR name, then only check the IAM User Secret for that Account.
139-
osdctl account check-secrets <Account CR Name>
141+
# specify the Account CR name, then only verify the IAM User Secret for that Account.
142+
osdctl account verify-secrets <Account CR Name>
140143
```
141144

142145
### Match AWS Account with AWS Account Operator related resources

cmd/account/console.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"github.com/aws/aws-sdk-go/aws"
7+
"github.com/pkg/browser"
78
"github.com/spf13/cobra"
89

910
"k8s.io/cli-runtime/pkg/genericclioptions"
@@ -30,6 +31,7 @@ func newCmdConsole(streams genericclioptions.IOStreams, flags *genericclioptions
3031
ops.k8sclusterresourcefactory.AttachCobraCliFlags(consoleCmd)
3132

3233
consoleCmd.Flags().BoolVarP(&ops.verbose, "verbose", "", false, "Verbose output")
34+
consoleCmd.Flags().BoolVar(&ops.launch, "launch", false, "Launch web browser directly")
3335

3436
return consoleCmd
3537
}
@@ -39,6 +41,7 @@ type consoleOptions struct {
3941
k8sclusterresourcefactory k8spkg.ClusterResourceFactoryOptions
4042

4143
verbose bool
44+
launch bool
4245

4346
genericclioptions.IOStreams
4447
}
@@ -84,5 +87,9 @@ func (o *consoleOptions) run() error {
8487
}
8588
fmt.Fprintf(o.IOStreams.Out, "The AWS Console URL is:\n%s\n", consoleURL)
8689

90+
if o.launch {
91+
return browser.OpenURL(consoleURL)
92+
}
93+
8794
return nil
8895
}

docs/command/osdctl_account_check-secrets.md

Lines changed: 0 additions & 35 deletions
This file was deleted.

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/openshift/api v3.9.1-0.20191111211345-a27ff30ebf09+incompatible
1414
github.com/openshift/aws-account-operator v0.0.0-20200914143350-bbda1c91242b
1515
github.com/openshift/hive v1.0.5
16+
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
1617
github.com/pkg/errors v0.9.1
1718
github.com/prometheus/common v0.11.1
1819
github.com/sirupsen/logrus v1.6.0

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,7 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
16411641
github.com/pierrec/lz4 v2.2.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
16421642
github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
16431643
github.com/pierrec/lz4 v2.3.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
1644+
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=
16441645
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
16451646
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
16461647
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

0 commit comments

Comments
 (0)