func setCertificatesDefaults(config *restclient.Config) error { // if certificates group is not registered, return an error g, err := registered.Group(certificates.GroupName) if err != nil { return err } config.APIPath = defaultAPIPath if config.UserAgent == "" { config.UserAgent = restclient.DefaultKubernetesUserAgent() } // TODO: Unconditionally set the config.Version, until we fix the config. //if config.Version == "" { copyGroupVersion := g.GroupVersion config.GroupVersion = ©GroupVersion //} config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs if config.QPS == 0 { config.QPS = 5 } if config.Burst == 0 { config.Burst = 10 } return nil }
func setPolicyDefaults(config *restclient.Config) error { g, err := registered.Group(policy.GroupName) if err != nil { return err } config.APIPath = defaultAPIPath if config.UserAgent == "" { config.UserAgent = restclient.DefaultKubernetesUserAgent() } // TODO: Unconditionally set the config.Version, until we fix the config. //if config.Version == "" { copyGroupVersion := g.GroupVersion config.GroupVersion = ©GroupVersion //} config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs return nil }
func setBatchDefaults(config *restclient.Config, gv *unversioned.GroupVersion) error { // if batch group is not registered, return an error g, err := registered.Group(batch.GroupName) if err != nil { return err } config.APIPath = defaultAPIPath if config.UserAgent == "" { config.UserAgent = restclient.DefaultKubernetesUserAgent() } // TODO: Unconditionally set the config.Version, until we fix the config. //if config.Version == "" { copyGroupVersion := g.GroupVersion if gv != nil { copyGroupVersion = *gv } config.GroupVersion = ©GroupVersion //} config.Codec = api.Codecs.LegacyCodec(*config.GroupVersion) config.NegotiatedSerializer = api.Codecs return nil }