@@ -189,8 +189,8 @@ func (m *MetricsLevelValue) IsCumulative() bool {
189189type SkipValidation int
190190
191191const (
192- SkipHostValidation SkipValidation = 1
193- SkipKubeValidation SkipValidation = 2
192+ SkipHostValidation SkipValidation = 1
193+ SkipExperimentalValidation SkipValidation = 2
194194)
195195
196196const (
@@ -702,7 +702,7 @@ func (c *Config) Validate(skips ...SkipValidation) error {
702702 }
703703 }
704704 // Experimental Platform validation
705- if experimentalErrs := c .validateExperimentalConfig (); len (experimentalErrs ) > 0 {
705+ if experimentalErrs := c .validateExperimentalConfig (validationSkipped ); len (experimentalErrs ) > 0 {
706706 errs = append (errs , experimentalErrs ... )
707707 }
708708
@@ -714,19 +714,21 @@ func (c *Config) Validate(skips ...SkipValidation) error {
714714}
715715
716716// validateExperimentalConfig validates experimental configuration settings
717- func (c * Config ) validateExperimentalConfig () []string {
718- if ! c .experimentalFeatureEnabled () {
717+ func (c * Config ) validateExperimentalConfig (validationSkipped map [ SkipValidation ] bool ) []string {
718+ if ! c .experimentalFeatureEnabled () || validationSkipped [ SkipExperimentalValidation ] {
719719 return nil
720720 }
721721
722722 var errs []string
723723
724- if c .IsFeatureEnabled (ExperimentalRedfishFeature ) {
725- if c .Experimental .Platform .Redfish .ConfigFile == "" {
726- errs = append (errs , fmt .Sprintf ("%s not supplied but %s set to true" , ExperimentalPlatformRedfishConfigFlag , ExperimentalPlatformRedfishEnabledFlag ))
727- } else {
728- if err := canReadFile (c .Experimental .Platform .Redfish .ConfigFile ); err != nil {
729- errs = append (errs , fmt .Sprintf ("unreadable Redfish config file: %s: %s" , c .Experimental .Platform .Redfish .ConfigFile , err .Error ()))
724+ { // Validate experimental settings
725+ if c .IsFeatureEnabled (ExperimentalRedfishFeature ) {
726+ if c .Experimental .Platform .Redfish .ConfigFile == "" {
727+ errs = append (errs , fmt .Sprintf ("%s not supplied but %s set to true" , ExperimentalPlatformRedfishConfigFlag , ExperimentalPlatformRedfishEnabledFlag ))
728+ } else {
729+ if err := canReadFile (c .Experimental .Platform .Redfish .ConfigFile ); err != nil {
730+ errs = append (errs , fmt .Sprintf ("unreadable Redfish config file: %s: %s" , c .Experimental .Platform .Redfish .ConfigFile , err .Error ()))
731+ }
730732 }
731733 }
732734 }
0 commit comments