@@ -55,16 +55,16 @@ type validatePullSecretExtOptions struct {
5555
5656const VPSExample string = `
5757 # Compare OCM Access-Token, OCM Registry-Credentials, and OCM Account Email against cluster's pull secret
58- osdctl cluster validate-pull-secret-ext ${CLUSTER_ID} --reason "OSD-XYZ"
58+ osdctl cluster validate-pull-secret-ext --cluster-id ${CLUSTER_ID} --reason "OSD-XYZ"
5959
6060 # Exclude Access-Token, and Registry-Credential checks...
61- osdctl cluster validate-pull-secret-ext ${CLUSTER_ID} --reason "OSD-XYZ" --skip-access-token --skip-registry-creds
61+ osdctl cluster validate-pull-secret-ext --cluster-id ${CLUSTER_ID} --reason "OSD-XYZ" --skip-access-token --skip-registry-creds
6262`
6363
6464func newCmdValidatePullSecretExt () * cobra.Command {
6565 ops := newValidatePullSecretExtOptions ()
6666 validatePullSecretCmd := & cobra.Command {
67- Use : "validate-pull-secret-ext [ CLUSTER_ID] " ,
67+ Use : "validate-pull-secret-ext --cluster-id $ CLUSTER_ID" ,
6868 Short : "Extended checks to confirm pull-secret data is synced with current OCM data" ,
6969 Long : `
7070 Attempts to validate if a cluster's pull-secret auth values are in sync with the account's email,
@@ -73,13 +73,13 @@ func newCmdValidatePullSecretExt() *cobra.Command {
7373 Region Lead permissions are required to view and validate the OCM AccessToken.
7474` ,
7575 Example : VPSExample ,
76- Args : cobra .ExactArgs (1 ),
7776 DisableAutoGenTag : true ,
78- PreRun : func (cmd * cobra.Command , args []string ) { cmdutil .CheckErr (ops .preRun (cmd , args )) },
77+ PreRun : func (cmd * cobra.Command , args []string ) { cmdutil .CheckErr (ops .preRun (cmd )) },
7978 Run : func (cmd * cobra.Command , args []string ) {
8079 cmdutil .CheckErr (ops .run ())
8180 },
8281 }
82+ validatePullSecretCmd .Flags ().StringVarP (& ops .clusterID , "cluster-id" , "C" , "" , "Provide internal ID of the cluster" )
8383 validatePullSecretCmd .Flags ().StringVar (& ops .reason , "reason" , "" , "Mandatory reason for this command to be run (usually includes an OHSS or PD ticket)" )
8484 validatePullSecretCmd .Flags ().StringVarP (& ops .verboseLevel , "log-level" , "l" , "info" , "debug, info, warn, error. (default=info)" )
8585 validatePullSecretCmd .Flags ().Bool ("skip-registry-creds" , false , "Exclude OCM Registry Credentials checks against cluster secret" )
@@ -93,11 +93,7 @@ func newValidatePullSecretExtOptions() *validatePullSecretExtOptions {
9393 return & validatePullSecretExtOptions {}
9494}
9595
96- func (o * validatePullSecretExtOptions ) preRun (cmd * cobra.Command , args []string ) error {
97- if len (args ) != 1 {
98- return cmdutil .UsageErrorf (cmd , "Required 1 positional arg for 'Cluster ID'" )
99- }
100- o .clusterID = args [0 ]
96+ func (o * validatePullSecretExtOptions ) preRun (cmd * cobra.Command ) error {
10197 o .useAccessToken = true
10298 o .useRegCreds = true
10399
0 commit comments