Matthias Andreas Benkard | 832a54e | 2019-01-29 09:27:38 +0100 | [diff] [blame^] | 1 | /* |
| 2 | Copyright The Kubernetes Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | // Code generated by informer-gen. DO NOT EDIT. |
| 18 | |
| 19 | package informers |
| 20 | |
| 21 | import ( |
| 22 | "fmt" |
| 23 | |
| 24 | v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" |
| 25 | v1beta1 "k8s.io/api/admissionregistration/v1beta1" |
| 26 | v1 "k8s.io/api/apps/v1" |
| 27 | apps_v1beta1 "k8s.io/api/apps/v1beta1" |
| 28 | v1beta2 "k8s.io/api/apps/v1beta2" |
| 29 | autoscaling_v1 "k8s.io/api/autoscaling/v1" |
| 30 | v2beta1 "k8s.io/api/autoscaling/v2beta1" |
| 31 | batch_v1 "k8s.io/api/batch/v1" |
| 32 | batch_v1beta1 "k8s.io/api/batch/v1beta1" |
| 33 | v2alpha1 "k8s.io/api/batch/v2alpha1" |
| 34 | certificates_v1beta1 "k8s.io/api/certificates/v1beta1" |
| 35 | core_v1 "k8s.io/api/core/v1" |
| 36 | events_v1beta1 "k8s.io/api/events/v1beta1" |
| 37 | extensions_v1beta1 "k8s.io/api/extensions/v1beta1" |
| 38 | networking_v1 "k8s.io/api/networking/v1" |
| 39 | policy_v1beta1 "k8s.io/api/policy/v1beta1" |
| 40 | rbac_v1 "k8s.io/api/rbac/v1" |
| 41 | rbac_v1alpha1 "k8s.io/api/rbac/v1alpha1" |
| 42 | rbac_v1beta1 "k8s.io/api/rbac/v1beta1" |
| 43 | scheduling_v1alpha1 "k8s.io/api/scheduling/v1alpha1" |
| 44 | scheduling_v1beta1 "k8s.io/api/scheduling/v1beta1" |
| 45 | settings_v1alpha1 "k8s.io/api/settings/v1alpha1" |
| 46 | storage_v1 "k8s.io/api/storage/v1" |
| 47 | storage_v1alpha1 "k8s.io/api/storage/v1alpha1" |
| 48 | storage_v1beta1 "k8s.io/api/storage/v1beta1" |
| 49 | schema "k8s.io/apimachinery/pkg/runtime/schema" |
| 50 | cache "k8s.io/client-go/tools/cache" |
| 51 | ) |
| 52 | |
| 53 | // GenericInformer is type of SharedIndexInformer which will locate and delegate to other |
| 54 | // sharedInformers based on type |
| 55 | type GenericInformer interface { |
| 56 | Informer() cache.SharedIndexInformer |
| 57 | Lister() cache.GenericLister |
| 58 | } |
| 59 | |
| 60 | type genericInformer struct { |
| 61 | informer cache.SharedIndexInformer |
| 62 | resource schema.GroupResource |
| 63 | } |
| 64 | |
| 65 | // Informer returns the SharedIndexInformer. |
| 66 | func (f *genericInformer) Informer() cache.SharedIndexInformer { |
| 67 | return f.informer |
| 68 | } |
| 69 | |
| 70 | // Lister returns the GenericLister. |
| 71 | func (f *genericInformer) Lister() cache.GenericLister { |
| 72 | return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) |
| 73 | } |
| 74 | |
| 75 | // ForResource gives generic access to a shared informer of the matching type |
| 76 | // TODO extend this to unknown resources with a client pool |
| 77 | func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { |
| 78 | switch resource { |
| 79 | // Group=admissionregistration.k8s.io, Version=v1alpha1 |
| 80 | case v1alpha1.SchemeGroupVersion.WithResource("initializerconfigurations"): |
| 81 | return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().InitializerConfigurations().Informer()}, nil |
| 82 | |
| 83 | // Group=admissionregistration.k8s.io, Version=v1beta1 |
| 84 | case v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): |
| 85 | return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().MutatingWebhookConfigurations().Informer()}, nil |
| 86 | case v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): |
| 87 | return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingWebhookConfigurations().Informer()}, nil |
| 88 | |
| 89 | // Group=apps, Version=v1 |
| 90 | case v1.SchemeGroupVersion.WithResource("controllerrevisions"): |
| 91 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ControllerRevisions().Informer()}, nil |
| 92 | case v1.SchemeGroupVersion.WithResource("daemonsets"): |
| 93 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().DaemonSets().Informer()}, nil |
| 94 | case v1.SchemeGroupVersion.WithResource("deployments"): |
| 95 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().Deployments().Informer()}, nil |
| 96 | case v1.SchemeGroupVersion.WithResource("replicasets"): |
| 97 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ReplicaSets().Informer()}, nil |
| 98 | case v1.SchemeGroupVersion.WithResource("statefulsets"): |
| 99 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().StatefulSets().Informer()}, nil |
| 100 | |
| 101 | // Group=apps, Version=v1beta1 |
| 102 | case apps_v1beta1.SchemeGroupVersion.WithResource("controllerrevisions"): |
| 103 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().ControllerRevisions().Informer()}, nil |
| 104 | case apps_v1beta1.SchemeGroupVersion.WithResource("deployments"): |
| 105 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().Deployments().Informer()}, nil |
| 106 | case apps_v1beta1.SchemeGroupVersion.WithResource("statefulsets"): |
| 107 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().StatefulSets().Informer()}, nil |
| 108 | |
| 109 | // Group=apps, Version=v1beta2 |
| 110 | case v1beta2.SchemeGroupVersion.WithResource("controllerrevisions"): |
| 111 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().ControllerRevisions().Informer()}, nil |
| 112 | case v1beta2.SchemeGroupVersion.WithResource("daemonsets"): |
| 113 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().DaemonSets().Informer()}, nil |
| 114 | case v1beta2.SchemeGroupVersion.WithResource("deployments"): |
| 115 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().Deployments().Informer()}, nil |
| 116 | case v1beta2.SchemeGroupVersion.WithResource("replicasets"): |
| 117 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().ReplicaSets().Informer()}, nil |
| 118 | case v1beta2.SchemeGroupVersion.WithResource("statefulsets"): |
| 119 | return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta2().StatefulSets().Informer()}, nil |
| 120 | |
| 121 | // Group=autoscaling, Version=v1 |
| 122 | case autoscaling_v1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): |
| 123 | return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V1().HorizontalPodAutoscalers().Informer()}, nil |
| 124 | |
| 125 | // Group=autoscaling, Version=v2beta1 |
| 126 | case v2beta1.SchemeGroupVersion.WithResource("horizontalpodautoscalers"): |
| 127 | return &genericInformer{resource: resource.GroupResource(), informer: f.Autoscaling().V2beta1().HorizontalPodAutoscalers().Informer()}, nil |
| 128 | |
| 129 | // Group=batch, Version=v1 |
| 130 | case batch_v1.SchemeGroupVersion.WithResource("jobs"): |
| 131 | return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1().Jobs().Informer()}, nil |
| 132 | |
| 133 | // Group=batch, Version=v1beta1 |
| 134 | case batch_v1beta1.SchemeGroupVersion.WithResource("cronjobs"): |
| 135 | return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V1beta1().CronJobs().Informer()}, nil |
| 136 | |
| 137 | // Group=batch, Version=v2alpha1 |
| 138 | case v2alpha1.SchemeGroupVersion.WithResource("cronjobs"): |
| 139 | return &genericInformer{resource: resource.GroupResource(), informer: f.Batch().V2alpha1().CronJobs().Informer()}, nil |
| 140 | |
| 141 | // Group=certificates.k8s.io, Version=v1beta1 |
| 142 | case certificates_v1beta1.SchemeGroupVersion.WithResource("certificatesigningrequests"): |
| 143 | return &genericInformer{resource: resource.GroupResource(), informer: f.Certificates().V1beta1().CertificateSigningRequests().Informer()}, nil |
| 144 | |
| 145 | // Group=core, Version=v1 |
| 146 | case core_v1.SchemeGroupVersion.WithResource("componentstatuses"): |
| 147 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ComponentStatuses().Informer()}, nil |
| 148 | case core_v1.SchemeGroupVersion.WithResource("configmaps"): |
| 149 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ConfigMaps().Informer()}, nil |
| 150 | case core_v1.SchemeGroupVersion.WithResource("endpoints"): |
| 151 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Endpoints().Informer()}, nil |
| 152 | case core_v1.SchemeGroupVersion.WithResource("events"): |
| 153 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Events().Informer()}, nil |
| 154 | case core_v1.SchemeGroupVersion.WithResource("limitranges"): |
| 155 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().LimitRanges().Informer()}, nil |
| 156 | case core_v1.SchemeGroupVersion.WithResource("namespaces"): |
| 157 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Namespaces().Informer()}, nil |
| 158 | case core_v1.SchemeGroupVersion.WithResource("nodes"): |
| 159 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Nodes().Informer()}, nil |
| 160 | case core_v1.SchemeGroupVersion.WithResource("persistentvolumes"): |
| 161 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PersistentVolumes().Informer()}, nil |
| 162 | case core_v1.SchemeGroupVersion.WithResource("persistentvolumeclaims"): |
| 163 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PersistentVolumeClaims().Informer()}, nil |
| 164 | case core_v1.SchemeGroupVersion.WithResource("pods"): |
| 165 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Pods().Informer()}, nil |
| 166 | case core_v1.SchemeGroupVersion.WithResource("podtemplates"): |
| 167 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().PodTemplates().Informer()}, nil |
| 168 | case core_v1.SchemeGroupVersion.WithResource("replicationcontrollers"): |
| 169 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ReplicationControllers().Informer()}, nil |
| 170 | case core_v1.SchemeGroupVersion.WithResource("resourcequotas"): |
| 171 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ResourceQuotas().Informer()}, nil |
| 172 | case core_v1.SchemeGroupVersion.WithResource("secrets"): |
| 173 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Secrets().Informer()}, nil |
| 174 | case core_v1.SchemeGroupVersion.WithResource("services"): |
| 175 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Services().Informer()}, nil |
| 176 | case core_v1.SchemeGroupVersion.WithResource("serviceaccounts"): |
| 177 | return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().ServiceAccounts().Informer()}, nil |
| 178 | |
| 179 | // Group=events.k8s.io, Version=v1beta1 |
| 180 | case events_v1beta1.SchemeGroupVersion.WithResource("events"): |
| 181 | return &genericInformer{resource: resource.GroupResource(), informer: f.Events().V1beta1().Events().Informer()}, nil |
| 182 | |
| 183 | // Group=extensions, Version=v1beta1 |
| 184 | case extensions_v1beta1.SchemeGroupVersion.WithResource("daemonsets"): |
| 185 | return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().DaemonSets().Informer()}, nil |
| 186 | case extensions_v1beta1.SchemeGroupVersion.WithResource("deployments"): |
| 187 | return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().Deployments().Informer()}, nil |
| 188 | case extensions_v1beta1.SchemeGroupVersion.WithResource("ingresses"): |
| 189 | return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().Ingresses().Informer()}, nil |
| 190 | case extensions_v1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): |
| 191 | return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().PodSecurityPolicies().Informer()}, nil |
| 192 | case extensions_v1beta1.SchemeGroupVersion.WithResource("replicasets"): |
| 193 | return &genericInformer{resource: resource.GroupResource(), informer: f.Extensions().V1beta1().ReplicaSets().Informer()}, nil |
| 194 | |
| 195 | // Group=networking.k8s.io, Version=v1 |
| 196 | case networking_v1.SchemeGroupVersion.WithResource("networkpolicies"): |
| 197 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().NetworkPolicies().Informer()}, nil |
| 198 | |
| 199 | // Group=policy, Version=v1beta1 |
| 200 | case policy_v1beta1.SchemeGroupVersion.WithResource("poddisruptionbudgets"): |
| 201 | return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil |
| 202 | case policy_v1beta1.SchemeGroupVersion.WithResource("podsecuritypolicies"): |
| 203 | return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodSecurityPolicies().Informer()}, nil |
| 204 | |
| 205 | // Group=rbac.authorization.k8s.io, Version=v1 |
| 206 | case rbac_v1.SchemeGroupVersion.WithResource("clusterroles"): |
| 207 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().ClusterRoles().Informer()}, nil |
| 208 | case rbac_v1.SchemeGroupVersion.WithResource("clusterrolebindings"): |
| 209 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().ClusterRoleBindings().Informer()}, nil |
| 210 | case rbac_v1.SchemeGroupVersion.WithResource("roles"): |
| 211 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().Roles().Informer()}, nil |
| 212 | case rbac_v1.SchemeGroupVersion.WithResource("rolebindings"): |
| 213 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1().RoleBindings().Informer()}, nil |
| 214 | |
| 215 | // Group=rbac.authorization.k8s.io, Version=v1alpha1 |
| 216 | case rbac_v1alpha1.SchemeGroupVersion.WithResource("clusterroles"): |
| 217 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoles().Informer()}, nil |
| 218 | case rbac_v1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings"): |
| 219 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoleBindings().Informer()}, nil |
| 220 | case rbac_v1alpha1.SchemeGroupVersion.WithResource("roles"): |
| 221 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().Roles().Informer()}, nil |
| 222 | case rbac_v1alpha1.SchemeGroupVersion.WithResource("rolebindings"): |
| 223 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().RoleBindings().Informer()}, nil |
| 224 | |
| 225 | // Group=rbac.authorization.k8s.io, Version=v1beta1 |
| 226 | case rbac_v1beta1.SchemeGroupVersion.WithResource("clusterroles"): |
| 227 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().ClusterRoles().Informer()}, nil |
| 228 | case rbac_v1beta1.SchemeGroupVersion.WithResource("clusterrolebindings"): |
| 229 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().ClusterRoleBindings().Informer()}, nil |
| 230 | case rbac_v1beta1.SchemeGroupVersion.WithResource("roles"): |
| 231 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().Roles().Informer()}, nil |
| 232 | case rbac_v1beta1.SchemeGroupVersion.WithResource("rolebindings"): |
| 233 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil |
| 234 | |
| 235 | // Group=scheduling.k8s.io, Version=v1alpha1 |
| 236 | case scheduling_v1alpha1.SchemeGroupVersion.WithResource("priorityclasses"): |
| 237 | return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1alpha1().PriorityClasses().Informer()}, nil |
| 238 | |
| 239 | // Group=scheduling.k8s.io, Version=v1beta1 |
| 240 | case scheduling_v1beta1.SchemeGroupVersion.WithResource("priorityclasses"): |
| 241 | return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1beta1().PriorityClasses().Informer()}, nil |
| 242 | |
| 243 | // Group=settings.k8s.io, Version=v1alpha1 |
| 244 | case settings_v1alpha1.SchemeGroupVersion.WithResource("podpresets"): |
| 245 | return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil |
| 246 | |
| 247 | // Group=storage.k8s.io, Version=v1 |
| 248 | case storage_v1.SchemeGroupVersion.WithResource("storageclasses"): |
| 249 | return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().StorageClasses().Informer()}, nil |
| 250 | |
| 251 | // Group=storage.k8s.io, Version=v1alpha1 |
| 252 | case storage_v1alpha1.SchemeGroupVersion.WithResource("volumeattachments"): |
| 253 | return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha1().VolumeAttachments().Informer()}, nil |
| 254 | |
| 255 | // Group=storage.k8s.io, Version=v1beta1 |
| 256 | case storage_v1beta1.SchemeGroupVersion.WithResource("storageclasses"): |
| 257 | return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil |
| 258 | case storage_v1beta1.SchemeGroupVersion.WithResource("volumeattachments"): |
| 259 | return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil |
| 260 | |
| 261 | } |
| 262 | |
| 263 | return nil, fmt.Errorf("no informer found for %v", resource) |
| 264 | } |