@@ -513,7 +513,7 @@ func run(cmd *cobra.Command, _ []string) {
513513 }
514514 }
515515 if httpsProxy != nil && * httpsProxy != input .DoubleQuotesToRemove {
516- err = interactive . IsURL (* httpsProxy )
516+ err = ocm . ValidateHTTPSProxy (* httpsProxy )
517517 if err != nil {
518518 r .Reporter .Errorf ("%s" , err )
519519 os .Exit (1 )
@@ -562,10 +562,7 @@ func run(cmd *cobra.Command, _ []string) {
562562 }
563563
564564 /******* AdditionalTrustBundle *******/
565- updateAdditionalTrustBundle := false
566- if additionalTrustBundleFile != nil {
567- updateAdditionalTrustBundle = true
568- }
565+ updateAdditionalTrustBundle := additionalTrustBundleFile != nil
569566 if useExistingVPC && ! updateAdditionalTrustBundle && additionalTrustBundleFile == nil &&
570567 interactive .Enabled () {
571568 updateAdditionalTrustBundleValue , err := interactive .GetBool (interactive.Input {
@@ -620,10 +617,7 @@ func run(cmd *cobra.Command, _ []string) {
620617 }
621618
622619 /******* AdditionalAllowedPrincipals *******/
623- updateAdditionalAllowedPrincipals := false
624- if additionalAllowedPrincipals != nil {
625- updateAdditionalAllowedPrincipals = true
626- }
620+ updateAdditionalAllowedPrincipals := additionalAllowedPrincipals != nil
627621 if ! updateAdditionalAllowedPrincipals && additionalAllowedPrincipals == nil &&
628622 interactive .Enabled () {
629623 updateAdditionalAllowedPrincipalsValue , err := interactive .GetBool (interactive.Input {
@@ -1013,15 +1007,15 @@ func warnUserForOAuthHCPVisibility(r *rosa.Runtime, clusterKey string, cluster *
10131007func validateExpiration () (expiration time.Time , err error ) {
10141008 // Validate options
10151009 if len (args .expirationTime ) > 0 && args .expirationDuration != 0 {
1016- err = errors .New ("At most one of 'expiration-time' or 'expiration' may be specified" )
1010+ err = errors .New ("at most one of 'expiration-time' or 'expiration' may be specified" )
10171011 return
10181012 }
10191013
10201014 // Parse the expiration options
10211015 if len (args .expirationTime ) > 0 {
10221016 t , err := parseRFC3339 (args .expirationTime )
10231017 if err != nil {
1024- err = fmt .Errorf ("Failed to parse expiration-time: %s" , err )
1018+ err = fmt .Errorf ("failed to parse expiration-time: %s" , err )
10251019 return expiration , err
10261020 }
10271021
@@ -1039,7 +1033,7 @@ func validateExpiration() (expiration time.Time, err error) {
10391033func validateOvnInternalSubnetConfiguration () (ovnInternalSubnets map [string ]string , err error ) {
10401034 if len (args .ovnInternalSubnets ) > 0 {
10411035 if args .networkType == "" {
1042- err = fmt .Errorf ("Expected a value for %s when supplying the flag %s" , ocm .NetworkTypeFlagName ,
1036+ err = fmt .Errorf ("expected a value for %s when supplying the flag %s" , ocm .NetworkTypeFlagName ,
10431037 ocm .OvnInternalSubnetsFlagName )
10441038 return
10451039 }
@@ -1052,7 +1046,7 @@ func validateOvnInternalSubnetConfiguration() (ovnInternalSubnets map[string]str
10521046func validateNetworkType () (networkConfig string , err error ) {
10531047 if len (args .networkType ) > 0 {
10541048 if args .networkType != ocm .NetworkTypeOvn && args .networkType != ocm .NetworkTypeOvnAlias {
1055- err = fmt .Errorf ("Incorrect network type '%s', please use '%s' or remove the flag" ,
1049+ err = fmt .Errorf ("incorrect network type '%s', please use '%s' or remove the flag" ,
10561050 args .networkType , ocm .NetworkTypeOvn )
10571051 } else {
10581052 networkConfig = ocm .NetworkTypeOvn // allows use of alias (OVN-Kubernetes)- but sets it to correct value for API
@@ -1088,11 +1082,11 @@ func setAuditLogForwarding(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv1.Cl
10881082 argValuePtr * string , err error ) {
10891083 if cmd .Flags ().Changed ("audit-log-arn" ) {
10901084 if ! aws .IsHostedCP (cluster ) {
1091- return nil , fmt .Errorf ("Audit log forwarding to AWS CloudWatch is only supported for Hosted Control Plane clusters" )
1085+ return nil , fmt .Errorf ("audit log forwarding to AWS CloudWatch is only supported for Hosted Control Plane clusters" )
10921086
10931087 }
10941088 if auditLogArn != "" && ! aws .RoleArnRE .MatchString (auditLogArn ) {
1095- return nil , fmt .Errorf ("Expected a valid value for audit-log-arn matching %s" , aws .RoleArnRE .String ())
1089+ return nil , fmt .Errorf ("expected a valid value for audit-log-arn matching %s" , aws .RoleArnRE .String ())
10961090 }
10971091 argValuePtr := new (string )
10981092 * argValuePtr = auditLogArn
@@ -1129,7 +1123,7 @@ func auditLogInteractivePrompt(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv
11291123 Required : true ,
11301124 })
11311125 if err != nil {
1132- return nil , fmt .Errorf ("Expected a valid value: %s" , err )
1126+ return nil , fmt .Errorf ("expected a valid value: %s" , err )
11331127 }
11341128 if requestAuditLogForwarding {
11351129
@@ -1146,7 +1140,7 @@ func auditLogInteractivePrompt(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv
11461140 },
11471141 })
11481142 if err != nil {
1149- return nil , fmt .Errorf ("Expected a valid value for audit-log-arn: %s" , err )
1143+ return nil , fmt .Errorf ("expected a valid value for audit-log-arn: %s" , err )
11501144 }
11511145 * auditLogRolePtr = auditLogRoleValue
11521146 return auditLogRolePtr , nil
@@ -1159,7 +1153,7 @@ func auditLogInteractivePrompt(r *rosa.Runtime, cmd *cobra.Command, cluster *cmv
11591153 Default : false ,
11601154 })
11611155 if err != nil {
1162- return nil , fmt .Errorf ("Expected a valid value: %s" , err )
1156+ return nil , fmt .Errorf ("expected a valid value: %s" , err )
11631157 }
11641158 if disableAuditLog {
11651159 * auditLogRolePtr = ""
@@ -1190,7 +1184,7 @@ func BuildClusterConfigWithRegistry(clusterConfig ocm.Spec, allowedRegistries []
11901184 ca , err := clusterregistryconfig .BuildAdditionalTrustedCAFromInputFile (additionalTrustedCa )
11911185 if err != nil {
11921186 return clusterConfig , fmt .Errorf (
1193- "Failed to build the additional trusted ca from file %s, got error: %s" ,
1187+ "failed to build the additional trusted ca from file %s, got error: %s" ,
11941188 additionalTrustedCa , err )
11951189 }
11961190 clusterConfig .AdditionalTrustedCa = ca
0 commit comments