Example #1
0
func AddToScheme(scheme *runtime.Scheme) {
	docker10.AddToScheme(scheme)
	dockerpre012.AddToScheme(scheme)
	addKnownTypes(scheme)
	addDefaultingFuncs(scheme)
	addConversionFuncs(scheme)
}
Example #2
0
func addVersionsToScheme(externalVersions ...unversioned.GroupVersion) {
	// add the internal version to Scheme
	api.AddToScheme(kapi.Scheme)
	// add the enabled external versions to Scheme
	for _, v := range externalVersions {
		if !registered.IsEnabledVersion(v) {
			glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v)
			continue
		}
		switch v {
		case v1.SchemeGroupVersion:
			v1.AddToScheme(kapi.Scheme)
		case v1beta3.SchemeGroupVersion:
			v1beta3.AddToScheme(kapi.Scheme)
		case docker10.SchemeGroupVersion:
			docker10.AddToScheme(kapi.Scheme)
		case dockerpre012.SchemeGroupVersion:
			dockerpre012.AddToScheme(kapi.Scheme)

		default:
			glog.Errorf("Version %s is not known, so it will not be added to the Scheme.", v)
			continue
		}
	}
}