func ValidateConfig(cfg *externaldns.Config) error {
	// TODO: Should probably return field.ErrorList
	if cfg.LogFormat != "text" && cfg.LogFormat != "json" {
		return fmt.Errorf("unsupported log format: %s", cfg.LogFormat)
	}
	if len(cfg.Sources) == 0 {
		return errors.New("no sources specified")
	}
	if cfg.Provider == "" {
		return errors.New("no provider specified")
	}

	// Azure provider specific validations
	if cfg.Provider == "azure" {
		if cfg.AzureConfigFile == "" {
			return errors.New("no Azure config file specified")
		}
	}

	// Infoblox provider specific validations
	if cfg.Provider == "infoblox" {
		if cfg.InfobloxGridHost == "" {
			return errors.New("no Infoblox Grid Manager host specified")
		}
		if cfg.InfobloxWapiPassword == "" {
			return errors.New("no Infoblox WAPI password specified")
		}
	}

	if cfg.Provider == "dyn" {
		if cfg.DynUsername == "" {
			return errors.New("no Dyn username specified")
		}
		if cfg.DynCustomerName == "" {
			return errors.New("no Dyn customer name specified")
		}

		if cfg.DynMinTTLSeconds < 0 {
			return errors.New("TTL specified for Dyn is negative")
		}
	}

	if cfg.IgnoreHostnameAnnotation && cfg.FQDNTemplate == "" {
		return errors.New("FQDN Template must be set if ignoring annotations")
	}
	return nil
}
func ValidateConfig(cfg *externaldns.Config) error {
	
	if cfg.LogFormat != "text" && cfg.LogFormat != "json" {
		return fmt.Errorf("unsupported log format: %s", cfg.LogFormat)
	}
	if len(cfg.Sources) == 0 {
		return errors.New("no sources specified")
	}
	if cfg.Provider == "" {
		return errors.New("no provider specified")
	}

	
	if cfg.Provider == "azure" {
		if cfg.AzureConfigFile == "" {
			return errors.New("no Azure config file specified")
		}
	}

	
	if cfg.Provider == "infoblox" {
		if cfg.InfobloxGridHost == "" {
			return errors.New("no Infoblox Grid Manager host specified")
		}
		if cfg.InfobloxWapiPassword == "" {
			return errors.New("no Infoblox WAPI password specified")
		}
	}

	if cfg.Provider == "dyn" {
		if cfg.DynUsername == "" {
			return errors.New("no Dyn username specified")
		}
		if cfg.DynCustomerName == "" {
			return errors.New("no Dyn customer name specified")
		}

		if cfg.DynMinTTLSeconds < 0 {
			return errors.New("TTL specified for Dyn is negative")
		}
	}

	if cfg.IgnoreHostnameAnnotation && cfg.FQDNTemplate == "" {
		return errors.New("FQDN Template must be set if ignoring annotations")
	}
	return nil
}
func ValidateConfig ( cfg * externaldns . Config ) error { // TODO: Should probably return field.ErrorList if cfg . LogFormat != " " && cfg . LogFormat != " " { return fmt . Errorf ( " " , cfg . LogFormat ) } if len ( cfg . Sources ) == 0 { return errors . New ( " " ) } if cfg . Provider == " " { return errors . New ( " " ) } // Azure provider specific validations if cfg . Provider == " " { if cfg . AzureConfigFile == " " { return errors . New ( " " ) } } // Infoblox provider specific validations if cfg . Provider == " " { if cfg . InfobloxGridHost == " " { return errors . New ( " " ) } if cfg . InfobloxWapiPassword == " " { return errors . New ( " " ) } } if cfg . Provider == " " { if cfg . DynUsername == " " { return errors . New ( " " ) } if cfg . DynCustomerName == " " { return errors . New ( " " ) } if cfg . DynMinTTLSeconds < 0 { return errors . New ( " " ) } } if cfg . IgnoreHostnameAnnotation && cfg . FQDNTemplate == " " { return errors . New ( " " ) } return nil }
// ValidateConfig performs validation on the Config object
ValidateConfig performs validation on the Config object