// applyDefaults roundtrips the config to v1 and back to ensure proper defaults are set.
774052
func applyDefaults(config runtime.Object, version schema.GroupVersion) (runtime.Object, error) {
	ext, err := configapi.Scheme.ConvertToVersion(config, version)
	if err != nil {
		return nil, err
	}
	configapi.Scheme.Default(ext)
	return configapi.Scheme.ConvertToVersion(ext, configapi.SchemeGroupVersion)
}
280288
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1alpha1.PodPreset{}, func(obj interface{}) { SetObjectDefaults_PodPreset(obj.(*v1alpha1.PodPreset)) })
	scheme.AddTypeDefaultingFunc(&v1alpha1.PodPresetList{}, func(obj interface{}) { SetObjectDefaults_PodPresetList(obj.(*v1alpha1.PodPresetList)) })
	return nil
}
744064
func (c *ConfigPolicyNode) Defaults() map[string]ctypes.ConfigValue {
	defaults := map[string]ctypes.ConfigValue{}
	for name, rule := range c.rules {
		if def := rule.Default(); def != nil {
			defaults[name] = def
		}
	}
	return defaults
}
175311
func DefaultConfig() Config {
	return Config{
		Filters:        make(map[string]FilterFunction),
		Globals:        make(map[string]interface{}, 0),
		DebugTemplates: false,
	}
}
754032
func (c *defaultConfigurator) GetConfigDefaults() schema.Defaults {
	return schema.Defaults{
		"use-floating-ip":      false,
		"use-default-secgroup": false,
		"network":              "",
		"external-network":     "",
		"use-openstack-gbp":    false,
		"policy-target-group":  "",
	}
}
278292
func DefaultSettings(c context.Context) Settings {
	// Disable local cache on devserver by default to allows changes to local
	// configs to propagate instantly. This is usually preferred when developing
	// locally.
	exp := 0
	if !info.IsDevAppServer(c) {
		exp = int(DefaultExpire.Seconds())
	}
	return Settings{
		CacheExpirationSec:  exp,
		DatastoreCacheMode:  DSCacheDisabled,
		AdministratorsGroup: configServiceAdmins,
	}
}
489375
func (s *CloneStackInput) SetDefaultOs(v string) *CloneStackInput {
	s.DefaultOs = &v
	return s
}
907305
func setDefault(dataMap map[string]interface{}, key string, defaultVal interface{}) {
	_, ok := dataMap[key]
	if !ok {
		dataMap[key] = defaultVal
	}
}
1090196
func (o *Options) SetDefaults() {
	// Set the socket type.
	if o.HTTPSocketType != HTTPSocketTypeNone &&
		o.HTTPSocketType != HTTPSocketTypeTCP &&
		o.HTTPSocketType != HTTPSocketTypeUnix {
		o.HTTPSocketType = HTTPSocketTypeTCP
	}

	// Set the listen address.
	if len(o.HTTPListenAddress) == 0 {
		o.HTTPListenAddress = ":80"
	}

	// Set the handle URL.
	if len(o.HTTPHandleURL) == 0 {
		o.HTTPHandleURL = "/glue/"
	}

	// Be sure that the handle URL ends with a slash.
	if !strings.HasSuffix(o.HTTPHandleURL, "/") {
		o.HTTPHandleURL += "/"
	}

	// Set the default check origin function if not set.
	if o.CheckOrigin == nil {
		o.CheckOrigin = checkSameOrigin
	}
}
1148563
func setDefaults() {
	formats = defaultFormats()
	tests = defaultTests()
	codecs = defaultCodecs()
	paths = defaultPaths()
	globs = []string{"*.txt", "*.bin"}
	levels = []int{1, 6, 9}
	sizes = []int{1e4, 1e5, 1e6}
}
737307
func (c ConnStr) SetDefaults() ConnStr {
	c["user"] = getVar("PGUSER", getVar("USER", "postgres"))
	c["dbname"] = getVar("PGDATABASE", getVar("USER", "postgres"))
	c["host"] = getVar("PGHOST", "localhost")
	c["port"] = getVar("PGPORT", "5432")
	c["password"] = getVar("PGPASSWD", "")
	c["sslmode"] = getVar("PGSSLMODE", "disable")

	return c
}
972968
func (s *Layer) SetDefaultRecipes(v *Recipes) *Layer {
	s.DefaultRecipes = v
	return s
}
460306
func (s *CreateFunctionDefinitionVersionInput) SetDefaultConfig(v *FunctionDefaultConfig) *CreateFunctionDefinitionVersionInput {
	s.DefaultConfig = v
	return s
}
535160
func (c *Client) SetModelDefaults(cloud, region string, config map[string]interface{}) error {
	var cloudTag string
	if cloud != "" {
		cloudTag = names.NewCloudTag(cloud).String()
	}
	args := params.SetModelDefaults{
		Config: []params.ModelDefaultValues{{
			Config:      config,
			CloudTag:    cloudTag,
			CloudRegion: region,
		}},
	}
	var result params.ErrorResults
	err := c.facade.FacadeCall("SetModelDefaults", args, &result)
	if err != nil {
		return err
	}
	return result.OneError()
}
532881
func (c *ConfigDataNode) ApplyDefaults(defaults map[string]ctypes.ConfigValue) {
	// Lock here since we are modifying c.table
	c.mutex.Lock()
	defer c.mutex.Unlock()
	for name, def := range defaults {
		if _, ok := c.table[name]; !ok {
			c.table[name] = def
		}
	}
}
51757
func (r *Route) SetDefaults() {
	if r.Memory == 0 {
		r.Memory = 128
	}

	if r.Type == TypeNone {
		r.Type = TypeSync
	}

	if r.Format == "" {
		r.Format = FormatDefault
	}

	if r.MaxConcurrency == 0 {
		r.MaxConcurrency = 1
	}

	if r.Headers == nil {
		r.Headers = http.Header{}
	}

	if r.Config == nil {
		r.Config = map[string]string{}
	}

	if r.Timeout == 0 {
		r.Timeout = defaultRouteTimeout
	}

	//if r.IdleTimeout == 0 {
	//	r.IdleTimeout = htfnScaleDownTimeout
	//}
}
596092
func (s *UpdateStageInput) SetDefaultRouteSettings(v *RouteSettings) *UpdateStageInput {
	s.DefaultRouteSettings = v
	return s
}