diff --git a/Gopkg.lock b/Gopkg.lock index bd8fa3f899..f0ffeaacd8 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -330,23 +330,28 @@ [[projects]] branch = "master" - digest = "1:1f25979b12588648720041882e8fabcbcfa4e9de934047679aef520680b3c356" + digest = "1:f5576684f0b7beec89acd50a6d2c994dc283f6b3f174bed169517ffed644bada" name = "github.com/openshift/api" packages = ["config/v1"] pruneopts = "NUT" - revision = "677153041bd22c1aa01fef67b68a8502ab1333d5" + revision = "4912e102a00fa8bb4bf27f83808dce6ef1b6887d" [[projects]] branch = "master" - digest = "1:9b36e103bff05a4057fa060dc76376fc6cb80354be0d25e91f87f8626b00cc6c" + digest = "1:4241aef3caf317fe26568856891fef34c6b0d33c04a6426c2f7336462e87bbdd" name = "github.com/openshift/client-go" packages = [ "config/clientset/versioned", "config/clientset/versioned/scheme", "config/clientset/versioned/typed/config/v1", + "config/informers/externalversions", + "config/informers/externalversions/config", + "config/informers/externalversions/config/v1", + "config/informers/externalversions/internalinterfaces", + "config/listers/config/v1", ] pruneopts = "NUT" - revision = "1540772775fa910515f0ff094d83ef41735d470b" + revision = "43eeb8cff295868f3cd8faa3347bcfbdc9b2a9c0" [[projects]] digest = "1:f9c1fc8da2b44ba323ec3b338f0da9f375e26c787bc3a6ea241f9cb3f191cb62" @@ -976,6 +981,10 @@ "github.com/imdario/mergo", "github.com/openshift/api/config/v1", "github.com/openshift/client-go/config/clientset/versioned", + "github.com/openshift/client-go/config/clientset/versioned/scheme", + "github.com/openshift/client-go/config/informers/externalversions", + "github.com/openshift/client-go/config/informers/externalversions/config/v1", + "github.com/openshift/client-go/config/listers/config/v1", "github.com/openshift/installer/pkg/types", "github.com/openshift/kubernetes-drain", "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers", diff --git a/cmd/common/controller_context.go b/cmd/common/controller_context.go index f0c5f5d4f6..dbd590632f 100644 --- a/cmd/common/controller_context.go +++ b/cmd/common/controller_context.go @@ -3,6 +3,7 @@ package common import ( "time" + configinformers "github.com/openshift/client-go/config/informers/externalversions" mcfginformers "github.com/openshift/machine-config-operator/pkg/generated/informers/externalversions" apiextinformers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" "k8s.io/apimachinery/pkg/runtime/schema" @@ -18,6 +19,7 @@ type ControllerContext struct { KubeInformerFactory informers.SharedInformerFactory KubeNamespacedInformerFactory informers.SharedInformerFactory APIExtInformerFactory apiextinformers.SharedInformerFactory + ConfigInformerFactory configinformers.SharedInformerFactory AvailableResources map[schema.GroupVersionResource]bool @@ -25,8 +27,6 @@ type ControllerContext struct { InformersStarted chan struct{} - KubeInformersStarted chan struct{} - ResyncPeriod func() time.Duration } @@ -35,11 +35,13 @@ func CreateControllerContext(cb *ClientBuilder, stop <-chan struct{}, targetName client := cb.MachineConfigClientOrDie("machine-config-shared-informer") kubeClient := cb.KubeClientOrDie("kube-shared-informer") apiExtClient := cb.APIExtClientOrDie("apiext-shared-informer") + configClient := cb.ConfigClientOrDie("config-shared-informer") sharedInformers := mcfginformers.NewSharedInformerFactory(client, resyncPeriod()()) sharedNamespacedInformers := mcfginformers.NewFilteredSharedInformerFactory(client, resyncPeriod()(), targetNamespace, nil) kubeSharedInformer := informers.NewSharedInformerFactory(kubeClient, resyncPeriod()()) kubeNamespacedSharedInformer := informers.NewFilteredSharedInformerFactory(kubeClient, resyncPeriod()(), targetNamespace, nil) apiExtSharedInformer := apiextinformers.NewSharedInformerFactory(apiExtClient, resyncPeriod()()) + configSharedInformer := configinformers.NewSharedInformerFactory(configClient, resyncPeriod()()) return &ControllerContext{ ClientBuilder: cb, @@ -48,9 +50,9 @@ func CreateControllerContext(cb *ClientBuilder, stop <-chan struct{}, targetName KubeInformerFactory: kubeSharedInformer, KubeNamespacedInformerFactory: kubeNamespacedSharedInformer, APIExtInformerFactory: apiExtSharedInformer, - Stop: stop, - InformersStarted: make(chan struct{}), - KubeInformersStarted: make(chan struct{}), - ResyncPeriod: resyncPeriod(), + ConfigInformerFactory: configSharedInformer, + Stop: stop, + InformersStarted: make(chan struct{}), + ResyncPeriod: resyncPeriod(), } } diff --git a/cmd/machine-config-controller/start.go b/cmd/machine-config-controller/start.go index d4885276aa..2ba0d83a1f 100644 --- a/cmd/machine-config-controller/start.go +++ b/cmd/machine-config-controller/start.go @@ -58,7 +58,6 @@ func runStartCmd(cmd *cobra.Command, args []string) { ctrlctx.InformerFactory.Start(ctrlctx.Stop) ctrlctx.KubeInformerFactory.Start(ctrlctx.Stop) close(ctrlctx.InformersStarted) - close(ctrlctx.KubeInformersStarted) select {} } diff --git a/cmd/machine-config-daemon/start.go b/cmd/machine-config-daemon/start.go index a540f3358e..0f7ed3a461 100644 --- a/cmd/machine-config-daemon/start.go +++ b/cmd/machine-config-daemon/start.go @@ -159,7 +159,7 @@ func runStartCmd(cmd *cobra.Command, args []string) { dn.EnterDegradedState(errors.Wrapf(err, "Checking initial state")) } ctx.KubeInformerFactory.Start(stopCh) - close(ctx.KubeInformersStarted) + close(ctx.InformersStarted) } glog.Info("Starting MachineConfigDaemon") diff --git a/cmd/machine-config-operator/bootstrap.go b/cmd/machine-config-operator/bootstrap.go index 5f9d8a54e0..393da00e3a 100644 --- a/cmd/machine-config-operator/bootstrap.go +++ b/cmd/machine-config-operator/bootstrap.go @@ -29,6 +29,8 @@ var ( pullSecretFile string configFile string oscontentImage string + infraConfigFile string + networkConfigFile string imagesConfigMapFile string mccImage string mcsImage string @@ -60,6 +62,8 @@ func init() { bootstrapCmd.MarkFlagRequired("setup-etcd-env-image") bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.configFile, "config-file", "", "ClusterConfig ConfigMap file.") bootstrapCmd.MarkFlagRequired("config-file") + bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.infraConfigFile, "infra-config-file", "/assets/manifests/cluster-infrastructure-02-config.yml", "File containing infrastructure.config.openshift.io manifest.") + bootstrapCmd.PersistentFlags().StringVar(&bootstrapOpts.networkConfigFile, "network-config-file", "/assets/manifests/cluster-network-02-config.yml", "File containing network.config.openshift.io manifest.") } func runBootstrapCmd(cmd *cobra.Command, args []string) { @@ -71,15 +75,16 @@ func runBootstrapCmd(cmd *cobra.Command, args []string) { imgs := operator.Images{ MachineConfigController: bootstrapOpts.mccImage, - MachineConfigDaemon: bootstrapOpts.mcdImage, - MachineConfigServer: bootstrapOpts.mcsImage, - MachineOSContent: bootstrapOpts.oscontentImage, - Etcd: bootstrapOpts.etcdImage, - SetupEtcdEnv: bootstrapOpts.setupEtcdEnvImage, + MachineConfigDaemon: bootstrapOpts.mcdImage, + MachineConfigServer: bootstrapOpts.mcsImage, + MachineOSContent: bootstrapOpts.oscontentImage, + Etcd: bootstrapOpts.etcdImage, + SetupEtcdEnv: bootstrapOpts.setupEtcdEnvImage, } if err := operator.RenderBootstrap( bootstrapOpts.configFile, + bootstrapOpts.infraConfigFile, bootstrapOpts.networkConfigFile, bootstrapOpts.etcdCAFile, bootstrapOpts.rootCAFile, bootstrapOpts.pullSecretFile, imgs, bootstrapOpts.destinationDir, diff --git a/cmd/machine-config-operator/start.go b/cmd/machine-config-operator/start.go index c939e6e042..a74d5e3025 100644 --- a/cmd/machine-config-operator/start.go +++ b/cmd/machine-config-operator/start.go @@ -57,7 +57,8 @@ func runStartCmd(cmd *cobra.Command, args []string) { ctrlctx.KubeInformerFactory.Start(ctrlctx.Stop) ctrlctx.KubeNamespacedInformerFactory.Start(ctrlctx.Stop) ctrlctx.APIExtInformerFactory.Start(ctrlctx.Stop) - close(ctrlctx.KubeInformersStarted) + ctrlctx.ConfigInformerFactory.Start(ctrlctx.Stop) + close(ctrlctx.InformersStarted) select {} } @@ -93,6 +94,8 @@ func startControllers(ctx *common.ControllerContext) error { ctx.KubeNamespacedInformerFactory.Rbac().V1().ClusterRoles(), ctx.KubeNamespacedInformerFactory.Rbac().V1().ClusterRoleBindings(), ctx.KubeNamespacedInformerFactory.Core().V1().ConfigMaps(), + ctx.ConfigInformerFactory.Config().V1().Infrastructures(), + ctx.ConfigInformerFactory.Config().V1().Networks(), ctx.ClientBuilder.MachineConfigClientOrDie(componentName), ctx.ClientBuilder.KubeClientOrDie(componentName), ctx.ClientBuilder.APIExtClientOrDie(componentName), diff --git a/lib/resourcemerge/machineconfig.go b/lib/resourcemerge/machineconfig.go index 520efddc02..6db90f9d84 100644 --- a/lib/resourcemerge/machineconfig.go +++ b/lib/resourcemerge/machineconfig.go @@ -54,9 +54,8 @@ func ensureMachineConfigSpec(modified *bool, existing *mcfgv1.MachineConfigSpec, func ensureControllerConfigSpec(modified *bool, existing *mcfgv1.ControllerConfigSpec, required mcfgv1.ControllerConfigSpec) { setStringIfSet(modified, &existing.ClusterDNSIP, required.ClusterDNSIP) setStringIfSet(modified, &existing.CloudProviderConfig, required.CloudProviderConfig) - setStringIfSet(modified, &existing.ClusterName, required.ClusterName) setStringIfSet(modified, &existing.Platform, required.Platform) - setStringIfSet(modified, &existing.BaseDomain, required.BaseDomain) + setStringIfSet(modified, &existing.EtcdDiscoveryDomain, required.EtcdDiscoveryDomain) setStringIfSet(modified, &existing.SSHKey, required.SSHKey) setStringIfSet(modified, &existing.OSImageURL, required.OSImageURL) diff --git a/manifests/machineconfigserver/daemonset.yaml b/manifests/machineconfigserver/daemonset.yaml index 774c455eef..28275fadda 100644 --- a/manifests/machineconfigserver/daemonset.yaml +++ b/manifests/machineconfigserver/daemonset.yaml @@ -18,7 +18,7 @@ spec: image: {{.Images.MachineConfigServer}} args: - "start" - - "--apiserver-url=https://{{.ControllerConfig.ClusterName}}-api.{{.ControllerConfig.BaseDomain}}:6443" + - "--apiserver-url={{.APIServerURL}}" resources: requests: cpu: 20m diff --git a/pkg/apis/machineconfiguration.openshift.io/v1/types.go b/pkg/apis/machineconfiguration.openshift.io/v1/types.go index cc38d0d514..7829ddffb6 100644 --- a/pkg/apis/machineconfiguration.openshift.io/v1/types.go +++ b/pkg/apis/machineconfiguration.openshift.io/v1/types.go @@ -51,16 +51,6 @@ type MCOConfig struct { // MCOConfigSpec is the spec for MCOConfig resource. type MCOConfigSpec struct { - ClusterDNSIP string `json:"clusterDNSIP"` - CloudProviderConfig string `json:"cloudProviderConfig"` - ClusterName string `json:"clusterName"` - - // The openshift platform, e.g. "libvirt", "openstack", "aws", or "none" - Platform string `json:"platform"` - - BaseDomain string `json:"baseDomain"` - - SSHKey string `json:"sshKey"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -120,12 +110,11 @@ type ControllerConfig struct { type ControllerConfigSpec struct { ClusterDNSIP string `json:"clusterDNSIP"` CloudProviderConfig string `json:"cloudProviderConfig"` - ClusterName string `json:"clusterName"` // The openshift platform, e.g. "libvirt", "openstack", "aws", or "none" Platform string `json:"platform"` - BaseDomain string `json:"baseDomain"` + EtcdDiscoveryDomain string `json:"etcdDiscoveryDomain"` // CAs EtcdCAData []byte `json:"etcdCAData"` diff --git a/pkg/controller/kubelet-config/kubelet_config_controller_test.go b/pkg/controller/kubelet-config/kubelet_config_controller_test.go index d89226187d..a7f4aca1aa 100644 --- a/pkg/controller/kubelet-config/kubelet_config_controller_test.go +++ b/pkg/controller/kubelet-config/kubelet_config_controller_test.go @@ -1,6 +1,7 @@ package kubeletconfig import ( + "fmt" "reflect" "testing" "time" @@ -76,8 +77,7 @@ func newControllerConfig(name string) *mcfgv1.ControllerConfig { TypeMeta: metav1.TypeMeta{APIVersion: mcfgv1.SchemeGroupVersion.String()}, ObjectMeta: metav1.ObjectMeta{Name: name, UID: types.UID(utilrand.String(5))}, Spec: mcfgv1.ControllerConfigSpec{ - ClusterName: name, - BaseDomain: "tt.testing", + EtcdDiscoveryDomain: fmt.Sprintf("%s.tt.testing", name), }, } return cc diff --git a/pkg/controller/template/render.go b/pkg/controller/template/render.go index 45c2860fd8..5585efcb01 100644 --- a/pkg/controller/template/render.go +++ b/pkg/controller/template/render.go @@ -302,7 +302,6 @@ func renderTemplate(config RenderConfig, path string, b []byte) ([]byte, error) funcs["skip"] = skipMissing funcs["etcdServerCertDNSNames"] = etcdServerCertDNSNames funcs["etcdPeerCertDNSNames"] = etcdPeerCertDNSNames - funcs["apiServerURL"] = apiServerURL funcs["cloudProvider"] = cloudProvider tmpl, err := template.New(path).Funcs(funcs).Parse(string(b)) if err != nil { @@ -330,10 +329,6 @@ func skipMissing(key string) (interface{}, error) { // Process the {{etcdPeerCertDNSNames}} and {{etcdServerCertDNSNames}} func etcdServerCertDNSNames(cfg RenderConfig) (interface{}, error) { - if cfg.BaseDomain == "" { - return nil, fmt.Errorf("invalid configuration") - } - var dnsNames = []string{ "localhost", "etcd.kube-system.svc", // sign for the local etcd service name that cluster-network apiservers use to communicate @@ -344,25 +339,17 @@ func etcdServerCertDNSNames(cfg RenderConfig) (interface{}, error) { } func etcdPeerCertDNSNames(cfg RenderConfig) (interface{}, error) { - if cfg.ClusterName == "" || cfg.BaseDomain == "" { + if cfg.EtcdDiscoveryDomain == "" { return nil, fmt.Errorf("invalid configuration") } var dnsNames = []string{ "${ETCD_DNS_NAME}", - fmt.Sprintf("%s.%s", cfg.ClusterName, cfg.BaseDomain), // https://github.com/etcd-io/etcd/blob/583763261f1c843e07c1bf7fea5fb4cfb684fe87/Documentation/op-guide/clustering.md#dns-discovery + cfg.EtcdDiscoveryDomain, // https://github.com/etcd-io/etcd/blob/583763261f1c843e07c1bf7fea5fb4cfb684fe87/Documentation/op-guide/clustering.md#dns-discovery } return strings.Join(dnsNames, ","), nil } -// generate apiserver url using cluster-name, basename -func apiServerURL(cfg RenderConfig) (interface{}, error) { - if cfg.ClusterName == "" || cfg.BaseDomain == "" { - return nil, fmt.Errorf("invalid configuration") - } - return fmt.Sprintf("https://%s-api.%s:6443", cfg.ClusterName, cfg.BaseDomain), nil -} - func cloudProvider(cfg RenderConfig) (interface{}, error) { switch cfg.Platform { case platformAWS: diff --git a/pkg/controller/template/render_test.go b/pkg/controller/template/render_test.go index b62730b036..37793dffd4 100644 --- a/pkg/controller/template/render_test.go +++ b/pkg/controller/template/render_test.go @@ -65,89 +65,29 @@ func TestCloudProvider(t *testing.T) { } } -func TestAPIServerURL(t *testing.T) { - dummyTemplate := []byte(`{{apiServerURL .}}`) - - cases := []struct { - clusterName string - baseDomain string - - url string - err bool - }{{ - clusterName: "", - baseDomain: "", - url: "", - err: true, - }, { - clusterName: "test-cluster", - baseDomain: "", - url: "", - err: true, - }, { - clusterName: "test-cluster", - baseDomain: "tt.testing", - url: "https://test-cluster-api.tt.testing:6443", - err: false, - }} - for idx, c := range cases { - name := fmt.Sprintf("case #%d", idx) - t.Run(name, func(t *testing.T) { - config := &mcfgv1.ControllerConfig{ - Spec: mcfgv1.ControllerConfigSpec{ - BaseDomain: c.baseDomain, - ClusterName: c.clusterName, - }, - } - got, err := renderTemplate(RenderConfig{&config.Spec, `{"dummy":"dummy"}`}, name, dummyTemplate) - if err != nil && !c.err { - t.Fatalf("expected nil error %v", err) - } - - if string(got) != c.url { - t.Fatalf("mismatch got: %s want: %s", got, c.url) - } - }) - } -} - func TestEtcdPeerCertDNSNames(t *testing.T) { dummyTemplate := []byte(`{{etcdPeerCertDNSNames .}}`) cases := []struct { - clusterName string - baseDomain string + etcdDiscoveryDomain string url string err bool }{{ - clusterName: "", - baseDomain: "", - url: "", - err: true, - }, { - clusterName: "my-test-cluster", - baseDomain: "", - url: "", - err: true, + etcdDiscoveryDomain: "", + url: "", + err: true, }, { - clusterName: "", - baseDomain: "tt.testing", - url: "", - err: true, - }, { - clusterName: "my-test-cluster", - baseDomain: "tt.testing", - url: "${ETCD_DNS_NAME},my-test-cluster.tt.testing", - err: false, + etcdDiscoveryDomain: "my-test-cluster.tt.testing", + url: "${ETCD_DNS_NAME},my-test-cluster.tt.testing", + err: false, }} for idx, c := range cases { name := fmt.Sprintf("case #%d", idx) t.Run(name, func(t *testing.T) { config := &mcfgv1.ControllerConfig{ Spec: mcfgv1.ControllerConfigSpec{ - ClusterName: c.clusterName, - BaseDomain: c.baseDomain, + EtcdDiscoveryDomain: c.etcdDiscoveryDomain, }, } got, err := renderTemplate(RenderConfig{&config.Spec, `{"dummy":"dummy"}`}, name, dummyTemplate) @@ -166,26 +106,17 @@ func TestEtcdServerCertDNSNames(t *testing.T) { dummyTemplate := []byte(`{{etcdServerCertDNSNames .}}`) cases := []struct { - baseDomain string - url string err bool }{{ - baseDomain: "", - url: "", - err: true, - }, { - baseDomain: "tt.testing", - url: "localhost,etcd.kube-system.svc,etcd.kube-system.svc.cluster.local,${ETCD_DNS_NAME}", - err: false, + url: "localhost,etcd.kube-system.svc,etcd.kube-system.svc.cluster.local,${ETCD_DNS_NAME}", + err: false, }} for idx, c := range cases { name := fmt.Sprintf("case #%d", idx) t.Run(name, func(t *testing.T) { config := &mcfgv1.ControllerConfig{ - Spec: mcfgv1.ControllerConfigSpec{ - BaseDomain: c.baseDomain, - }, + Spec: mcfgv1.ControllerConfigSpec{}, } got, err := renderTemplate(RenderConfig{&config.Spec, `{"dummy":"dummy"}`}, name, dummyTemplate) if err != nil && !c.err { diff --git a/pkg/controller/template/template_controller_test.go b/pkg/controller/template/template_controller_test.go index 9fffcd6b53..f06ec77a72 100644 --- a/pkg/controller/template/template_controller_test.go +++ b/pkg/controller/template/template_controller_test.go @@ -1,6 +1,7 @@ package template import ( + "fmt" "reflect" "testing" "time" @@ -56,10 +57,9 @@ func newControllerConfig(name string) *mcfgv1.ControllerConfig { TypeMeta: metav1.TypeMeta{APIVersion: mcfgv1.SchemeGroupVersion.String()}, ObjectMeta: metav1.ObjectMeta{Name: name, Generation: 1}, Spec: mcfgv1.ControllerConfigSpec{ - ClusterDNSIP: "10.3.0.1/16", - ClusterName: name, - BaseDomain: "openshift.testing", - Platform: "libvirt", + ClusterDNSIP: "10.3.0.1/16", + EtcdDiscoveryDomain: fmt.Sprintf("%s.openshift.testing", name), + Platform: "libvirt", PullSecret: &corev1.ObjectReference{ Namespace: "default", Name: "coreos-pull-secret", diff --git a/pkg/controller/template/test_data/controller_config_aws.yaml b/pkg/controller/template/test_data/controller_config_aws.yaml index 5410a7e84e..310e8bce63 100644 --- a/pkg/controller/template/test_data/controller_config_aws.yaml +++ b/pkg/controller/template/test_data/controller_config_aws.yaml @@ -3,8 +3,7 @@ kind: "ControllerConfig" spec: clusterDNSIP: "10.3.0.10" cloudProviderConfig: "" - clusterName: "my-test-cluster" - baseDomain: "installer.team.coreos.systems" + etcdDiscoveryDomain: "my-test-cluster.installer.team.coreos.systems" etcdInitialCount: 3 platform: "aws" etcdCAData: ZHVtbXkgZXRjZC1jYQo= diff --git a/pkg/controller/template/test_data/controller_config_libvirt.yaml b/pkg/controller/template/test_data/controller_config_libvirt.yaml index 780d84f129..35292bc011 100644 --- a/pkg/controller/template/test_data/controller_config_libvirt.yaml +++ b/pkg/controller/template/test_data/controller_config_libvirt.yaml @@ -3,8 +3,7 @@ kind: "ControllerConfig" spec: clusterDNSIP: "10.3.0.10" cloudProviderConfig: "" - clusterName: "my-test-cluster" - baseDomain: "installer.team.coreos.systems" + etcdDiscoveryDomain: "my-test-cluster.installer.team.coreos.systems" etcdInitialCount: 3 platform: "libvirt" etcdCAData: ZHVtbXkgZXRjZC1jYQo= diff --git a/pkg/controller/template/test_data/controller_config_none.yaml b/pkg/controller/template/test_data/controller_config_none.yaml index b08e0aca2e..61c783938e 100644 --- a/pkg/controller/template/test_data/controller_config_none.yaml +++ b/pkg/controller/template/test_data/controller_config_none.yaml @@ -3,8 +3,7 @@ kind: "ControllerConfig" spec: clusterDNSIP: "10.3.0.10" cloudProviderConfig: "" - clusterName: "my-test-cluster" - baseDomain: "installer.team.coreos.systems" + etcdDiscoveryDomain: "my-test-cluster.installer.team.coreos.systems" etcdInitialCount: 3 platform: "none" etcdCAData: ZHVtbXkgZXRjZC1jYQo= diff --git a/pkg/controller/template/test_data/controller_config_openstack.yaml b/pkg/controller/template/test_data/controller_config_openstack.yaml index a5583d187b..a4383eeea4 100644 --- a/pkg/controller/template/test_data/controller_config_openstack.yaml +++ b/pkg/controller/template/test_data/controller_config_openstack.yaml @@ -3,8 +3,7 @@ kind: "ControllerConfig" spec: clusterDNSIP: "10.3.0.10" cloudProviderConfig: "" - clusterName: "my-test-cluster" - baseDomain: "installer.team.coreos.systems" + etcdDiscoveryDomain: "my-test-cluster.installer.team.coreos.systems" etcdInitialCount: 3 platform: "openstack" etcdCAData: ZHVtbXkgZXRjZC1jYQo= diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go index a926b8ae8b..fda24d03da 100644 --- a/pkg/operator/assets/bindata.go +++ b/pkg/operator/assets/bindata.go @@ -957,7 +957,7 @@ spec: image: {{.Images.MachineConfigServer}} args: - "start" - - "--apiserver-url=https://{{.ControllerConfig.ClusterName}}-api.{{.ControllerConfig.BaseDomain}}:6443" + - "--apiserver-url={{.APIServerURL}}" resources: requests: cpu: 20m diff --git a/pkg/operator/bootstrap.go b/pkg/operator/bootstrap.go index 3007240996..b2d1b62541 100644 --- a/pkg/operator/bootstrap.go +++ b/pkg/operator/bootstrap.go @@ -8,14 +8,21 @@ import ( "github.com/golang/glog" installertypes "github.com/openshift/installer/pkg/types" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" + + configv1 "github.com/openshift/api/config/v1" + configscheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + + templatectrl "github.com/openshift/machine-config-operator/pkg/controller/template" ) // RenderBootstrap writes to destinationDir static Pods. func RenderBootstrap( clusterConfigConfigMapFile string, + infraFile, networkFile string, etcdCAFile, rootCAFile string, pullSecretFile string, imgs Images, destinationDir string, @@ -23,11 +30,8 @@ func RenderBootstrap( filesData := map[string][]byte{} files := []string{ clusterConfigConfigMapFile, - rootCAFile, - etcdCAFile, - } - if pullSecretFile != "" { - files = append(files, pullSecretFile) + infraFile, networkFile, + rootCAFile, etcdCAFile, pullSecretFile, } for _, file := range files { data, err := ioutil.ReadFile(file) @@ -37,12 +41,43 @@ func RenderBootstrap( filesData[file] = data } - mcoconfig, err := discoverMCOConfig(getInstallConfigFromFile(filesData[clusterConfigConfigMapFile])) + // create ControllerConfigSpec + ic, err := getInstallConfigFromFile(filesData[clusterConfigConfigMapFile]) + if err != nil { + return fmt.Errorf("error reading InstallConfig from file %q", clusterConfigConfigMapFile) + } + obji, err := runtime.Decode(configscheme.Codecs.UniversalDecoder(configv1.SchemeGroupVersion), filesData[infraFile]) if err != nil { - return fmt.Errorf("error discovering MCOConfig from %q: %v", clusterConfigConfigMapFile, err) + return err + } + infra, ok := obji.(*configv1.Infrastructure) + if !ok { + return fmt.Errorf("expected *configv1.Infrastructure found %T", obji) } - config := getRenderConfig(mcoconfig, filesData[etcdCAFile], filesData[rootCAFile], nil, imgs) + obji, err = runtime.Decode(configscheme.Codecs.UniversalDecoder(configv1.SchemeGroupVersion), filesData[networkFile]) + if err != nil { + return err + } + network, ok := obji.(*configv1.Network) + if !ok { + return fmt.Errorf("expected *configv1.Network found %T", obji) + } + spec, err := createDiscoveredControllerConfigSpec(infra, network) + if err != nil { + return err + } + spec.EtcdCAData = filesData[etcdCAFile] + spec.RootCAData = filesData[rootCAFile] + spec.PullSecret = nil + spec.SSHKey = ic.SSHKey + spec.OSImageURL = imgs.MachineOSContent + spec.Images = map[string]string{ + templatectrl.EtcdImageKey: imgs.Etcd, + templatectrl.SetupEtcdEnvKey: imgs.SetupEtcdEnv, + } + + config := getRenderConfig("", spec, imgs, infra.Status.APIServerURL) manifests := []struct { name string @@ -98,17 +133,15 @@ func RenderBootstrap( return nil } -func getInstallConfigFromFile(cmData []byte) installConfigGetter { - return func() (installertypes.InstallConfig, error) { - obji, err := runtime.Decode(scheme.Codecs.UniversalDecoder(corev1.SchemeGroupVersion), cmData) - if err != nil { - return installertypes.InstallConfig{}, err - } - cm, ok := obji.(*corev1.ConfigMap) - if !ok { - return installertypes.InstallConfig{}, fmt.Errorf("expected *corev1.ConfigMap found %T", obji) - } - - return icFromClusterConfig(cm) +func getInstallConfigFromFile(cmData []byte) (installertypes.InstallConfig, error) { + obji, err := runtime.Decode(scheme.Codecs.UniversalDecoder(corev1.SchemeGroupVersion), cmData) + if err != nil { + return installertypes.InstallConfig{}, err } + cm, ok := obji.(*corev1.ConfigMap) + if !ok { + return installertypes.InstallConfig{}, fmt.Errorf("expected *corev1.ConfigMap found %T", obji) + } + + return icFromClusterConfig(cm) } diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 5a2c3e3162..b281a1edf5 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -24,13 +24,16 @@ import ( "k8s.io/client-go/kubernetes" coreclientsetv1 "k8s.io/client-go/kubernetes/typed/core/v1" appslisterv1 "k8s.io/client-go/listers/apps/v1" - corelisterv1 "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" + configv1 "github.com/openshift/api/config/v1" configclientset "github.com/openshift/client-go/config/clientset/versioned" + configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" installertypes "github.com/openshift/installer/pkg/types" + mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" templatectrl "github.com/openshift/machine-config-operator/pkg/controller/template" mcfgclientset "github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned" @@ -77,13 +80,15 @@ type Operator struct { mcLister mcfglistersv1.MachineConfigLister deployLister appslisterv1.DeploymentLister daemonsetLister appslisterv1.DaemonSetLister - cmLister corelisterv1.ConfigMapLister + infraLister configlistersv1.InfrastructureLister + networkLister configlistersv1.NetworkLister crdListerSynced cache.InformerSynced mcoconfigListerSynced cache.InformerSynced deployListerSynced cache.InformerSynced daemonsetListerSynced cache.InformerSynced - cmListerSynced cache.InformerSynced + infraListerSynced cache.InformerSynced + networkListerSynced cache.InformerSynced // queue only ever has one item, but it has nice error handling backoff/retry semantics queue workqueue.RateLimitingInterface @@ -105,6 +110,8 @@ func New( clusterRoleInformer rbacinformersv1.ClusterRoleInformer, clusterRoleBindingInformer rbacinformersv1.ClusterRoleBindingInformer, cmInformer coreinformersv1.ConfigMapInformer, + infraInformer configinformersv1.InfrastructureInformer, + networkInformer configinformersv1.NetworkInformer, client mcfgclientset.Interface, kubeClient kubernetes.Interface, apiExtClient apiextclientset.Interface, @@ -139,6 +146,8 @@ func New( clusterRoleInformer.Informer().AddEventHandler(optr.eventHandler()) clusterRoleBindingInformer.Informer().AddEventHandler(optr.eventHandler()) cmInformer.Informer().AddEventHandler(optr.eventHandler()) + infraInformer.Informer().AddEventHandler(optr.eventHandler()) + networkInformer.Informer().AddEventHandler(optr.eventHandler()) optr.syncHandler = optr.sync @@ -153,8 +162,10 @@ func New( optr.deployListerSynced = deployInformer.Informer().HasSynced optr.daemonsetLister = daemonsetInformer.Lister() optr.daemonsetListerSynced = daemonsetInformer.Informer().HasSynced - optr.cmLister = cmInformer.Lister() - optr.cmListerSynced = cmInformer.Informer().HasSynced + optr.infraLister = infraInformer.Lister() + optr.infraListerSynced = infraInformer.Informer().HasSynced + optr.networkLister = networkInformer.Lister() + optr.networkListerSynced = networkInformer.Informer().HasSynced return optr } @@ -182,8 +193,9 @@ func (optr *Operator) Run(workers int, stopCh <-chan struct{}) { optr.crdListerSynced, optr.mcoconfigListerSynced, optr.deployListerSynced, - optr.cmListerSynced, - optr.daemonsetListerSynced) { + optr.daemonsetListerSynced, + optr.infraListerSynced, + optr.networkListerSynced) { glog.Error("failed to sync caches") return } @@ -252,25 +264,12 @@ func (optr *Operator) sync(key string) error { return err } - namespace, name, err := cache.SplitMetaNamespaceKey(key) - if err != nil { - return err - } - - var obj *mcfgv1.MCOConfig - obj, err = optr.mcoconfigLister.MCOConfigs(namespace).Get(name) - if apierrors.IsNotFound(err) { - obj, err = discoverMCOConfig(optr.getInstallConfig) - if err == nil { - obj.SetNamespace(namespace) - obj.SetName(name) - } - } + namespace, _, err := cache.SplitMetaNamespaceKey(key) if err != nil { return err } - mcoconfig := obj.DeepCopy() + // sync up the images used by operands. imgsRaw, err := ioutil.ReadFile(optr.imagesFile) if err != nil { return err @@ -280,6 +279,7 @@ func (optr *Operator) sync(key string) error { return err } + // sync up CAs etcdCA, err := optr.getCAsFromConfigMap("kube-system", "etcd-serving-ca", "ca-bundle.crt") if err != nil { return err @@ -289,13 +289,39 @@ func (optr *Operator) sync(key string) error { return err } + // sync up os image url + // TODO: this should probably be part of the imgs osimageurl, err := optr.getOsImageURL(namespace) if err != nil { return err } imgs.MachineOSContent = osimageurl - rc := getRenderConfig(mcoconfig, etcdCA, rootCA, &v1.ObjectReference{Namespace: "kube-system", Name: "coreos-pull-secret"}, imgs) + // sync up the ControllerConfigSpec + ic, err := optr.getInstallConfig() + if err != nil { + return err + } + infra, network, err := optr.getGlobalConfig() + if err != nil { + return err + } + spec, err := createDiscoveredControllerConfigSpec(infra, network) + if err != nil { + return err + } + spec.EtcdCAData = etcdCA + spec.RootCAData = rootCA + spec.PullSecret = &v1.ObjectReference{Namespace: "kube-system", Name: "coreos-pull-secret"} + spec.SSHKey = ic.SSHKey + spec.OSImageURL = imgs.MachineOSContent + spec.Images = map[string]string{ + templatectrl.EtcdImageKey: imgs.Etcd, + templatectrl.SetupEtcdEnvKey: imgs.SetupEtcdEnv, + } + + // create renderConfig + rc := getRenderConfig(namespace, spec, imgs, infra.Status.APIServerURL) return optr.syncAll(rc) } @@ -339,6 +365,20 @@ func (optr *Operator) getInstallConfig() (installertypes.InstallConfig, error) { return icFromClusterConfig(clusterConfig) } +// getGlobalConfig gets global configuration for the cluster, namely, the Infrastructure and Network types. +// Each type of global configuration is named `cluster` for easy discovery in the cluster. +func (optr *Operator) getGlobalConfig() (*configv1.Infrastructure, *configv1.Network, error) { + infra, err := optr.infraLister.Get("cluster") + if err != nil { + return nil, nil, err + } + network, err := optr.networkLister.Get("cluster") + if err != nil { + return nil, nil, err + } + return infra, network, nil +} + func icFromClusterConfig(cm *v1.ConfigMap) (installertypes.InstallConfig, error) { var ( icKey = "install-config" @@ -355,27 +395,12 @@ func icFromClusterConfig(cm *v1.ConfigMap) (installertypes.InstallConfig, error) return ic, nil } -func getRenderConfig(mc *mcfgv1.MCOConfig, etcdCAData, rootCAData []byte, ps *v1.ObjectReference, imgs Images) renderConfig { - controllerconfig := mcfgv1.ControllerConfigSpec{ - ClusterDNSIP: mc.Spec.ClusterDNSIP, - CloudProviderConfig: mc.Spec.CloudProviderConfig, - ClusterName: mc.Spec.ClusterName, - Platform: mc.Spec.Platform, - BaseDomain: mc.Spec.BaseDomain, - EtcdCAData: etcdCAData, - RootCAData: rootCAData, - PullSecret: ps, - SSHKey: mc.Spec.SSHKey, - OSImageURL: imgs.MachineOSContent, - Images: map[string]string{ - templatectrl.EtcdImageKey: imgs.Etcd, - templatectrl.SetupEtcdEnvKey: imgs.SetupEtcdEnv, - }, - } +func getRenderConfig(tnamespace string, ccSpec *mcfgv1.ControllerConfigSpec, imgs Images, apiServerURL string) renderConfig { return renderConfig{ - TargetNamespace: mc.GetNamespace(), + TargetNamespace: tnamespace, Version: version.Raw, - ControllerConfig: controllerconfig, + ControllerConfig: *ccSpec, Images: imgs, + APIServerURL: apiServerURL, } } diff --git a/pkg/operator/render.go b/pkg/operator/render.go index 387bb3d6fc..7c6fd81047 100644 --- a/pkg/operator/render.go +++ b/pkg/operator/render.go @@ -9,8 +9,9 @@ import ( "github.com/Masterminds/sprig" "github.com/apparentlymart/go-cidr/cidr" "github.com/ghodss/yaml" - "github.com/golang/glog" - installertypes "github.com/openshift/installer/pkg/types" + + configv1 "github.com/openshift/api/config/v1" + mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/openshift/machine-config-operator/pkg/operator/assets" ) @@ -19,6 +20,7 @@ type renderConfig struct { TargetNamespace string Version string ControllerConfig mcfgv1.ControllerConfigSpec + APIServerURL string Images Images } @@ -51,51 +53,37 @@ func toYAML(i interface{}) []byte { return out } -type installConfigGetter func() (installertypes.InstallConfig, error) - -func discoverMCOConfig(f installConfigGetter) (*mcfgv1.MCOConfig, error) { - ic, err := f() - if err != nil { - return nil, err +// createDiscoveredControllerConfigSpec uses the Infrastructure and Network global configuration to discover various +// fields for the controller spec. +// Infrastructure provides information about the platform, etcd discovery domain. +// Network provides the service network that is used to calculate the cluster DNS IP. +func createDiscoveredControllerConfigSpec(infra *configv1.Infrastructure, network *configv1.Network) (*mcfgv1.ControllerConfigSpec, error) { + if len(network.Spec.ServiceNetwork) == 0 { + return nil, fmt.Errorf("service cidr is empty in Network") } - dnsIP, err := clusterDNSIP(ic.Networking.ServiceCIDR.String()) + dnsIP, err := clusterDNSIP(network.Spec.ServiceNetwork[0]) if err != nil { return nil, err } - platform, err := platformFromInstallConfig(ic) - if err != nil { - glog.Warningf("Warning: %v, using %s", err, platform) + platform := "none" + switch infra.Status.Platform { + case configv1.AWSPlatform: + platform = "aws" + case configv1.OpenStackPlatform: + platform = "openstack" + case configv1.LibvirtPlatform: + platform = "libvirt" } - return &mcfgv1.MCOConfig{ - Spec: mcfgv1.MCOConfigSpec{ - ClusterDNSIP: dnsIP, - CloudProviderConfig: "", - ClusterName: ic.ObjectMeta.Name, - Platform: platform, - BaseDomain: ic.BaseDomain, - SSHKey: ic.SSHKey, - }, + return &mcfgv1.ControllerConfigSpec{ + ClusterDNSIP: dnsIP, + CloudProviderConfig: "", + EtcdDiscoveryDomain: infra.Status.EtcdDiscoveryDomain, + Platform: platform, }, nil } -func platformFromInstallConfig(ic installertypes.InstallConfig) (string, error) { - // TODO: these constants are wrong, they should match what is reported by the infrastructure provider - switch { - case ic.Platform.AWS != nil: - return "aws", nil - case ic.Platform.OpenStack != nil: - return "openstack", nil - case ic.Libvirt != nil: - return "libvirt", nil - case ic.None != nil: - return "none", nil - default: - return "none", fmt.Errorf("the install config referenced a platform other than 'aws', 'libvirt', 'openstack', or 'none'") - } -} - func clusterDNSIP(iprange string) (string, error) { _, network, err := net.ParseCIDR(iprange) if err != nil { diff --git a/pkg/operator/render_test.go b/pkg/operator/render_test.go index d3953ce627..49bc3d5761 100644 --- a/pkg/operator/render_test.go +++ b/pkg/operator/render_test.go @@ -3,9 +3,6 @@ package operator import ( "fmt" "testing" - - "github.com/ghodss/yaml" - installertypes "github.com/openshift/installer/pkg/types" ) func TestClusterDNSIP(t *testing.T) { @@ -38,67 +35,3 @@ func TestClusterDNSIP(t *testing.T) { }) } } - -var ( - testInstallConfig = []byte(` -sshKey: ssh-rsa AAAA.... -baseDomain: tt.testing -clusterID: 2d149e46-90ee-3436-018a-1b02f6864006 -machines: -- name: master - platform: - libvirt: - qcowImagePath: /path/rhcos-qemu.qcow2 - replicas: 1 -- name: worker - platform: - libvirt: - qcowImagePath: /path/rhcos-qemu.qcow2 - replicas: 2 -metadata: - creationTimestamp: null - name: test-0 -networking: - podCIDR: 10.2.0.0/16 - serviceCIDR: 10.3.0.0/16 - type: flannel -platform: - libvirt: - URI: qemu:///system - masterIPs: null - network: - if: tt0 - ipRange: 192.168.124.0/24 - name: tectonic - resolver: 8.8.8.8 -pullSecret: '' -`) -) - -func TestDiscoverMCOConfig(t *testing.T) { - icgetter := func() (installertypes.InstallConfig, error) { - var ic installertypes.InstallConfig - if err := yaml.Unmarshal(testInstallConfig, &ic); err != nil { - return ic, err - } - return ic, nil - } - - mco, err := discoverMCOConfig(icgetter) - if err != nil { - t.Fatalf("couldn't parse installconfig: %v", err) - } - - if got, want := mco.Spec.ClusterDNSIP, "10.3.0.10"; got != want { - t.Fatalf("mismatch got = %v want = %v", got, want) - } - if got, want := mco.Spec.ClusterName, "test-0"; got != want { - t.Fatalf("mismatch got = %v want = %v", got, want) - } - if got, want := mco.Spec.Platform, "libvirt"; got != want { - t.Fatalf("mismatch got = %v want = %v", got, want) - } - if got, want := mco.Spec.BaseDomain, "tt.testing"; got != want { - t.Fatalf("mismatch got = %v want = %v", got, want) - } -} diff --git a/templates/master/00-master/_base/files/etc-kubernetes-manifests-etcd-member.yaml b/templates/master/00-master/_base/files/etc-kubernetes-manifests-etcd-member.yaml index e3c8d39746..c5f923b800 100644 --- a/templates/master/00-master/_base/files/etc-kubernetes-manifests-etcd-member.yaml +++ b/templates/master/00-master/_base/files/etc-kubernetes-manifests-etcd-member.yaml @@ -16,7 +16,7 @@ contents: image: "{{.Images.setupEtcdEnv}}" args: - "run" - - "--discovery-srv={{.ClusterName}}.{{.BaseDomain}}" + - "--discovery-srv={{.EtcdDiscoveryDomain}}" - "--output-file=/run/etcd/environment" - "--v=4" securityContext: @@ -83,7 +83,7 @@ contents: source /run/etcd/environment etcd \ - --discovery-srv {{.ClusterName}}.{{.BaseDomain}} \ + --discovery-srv {{.EtcdDiscoveryDomain}} \ --initial-advertise-peer-urls=https://${ETCD_IPV4_ADDRESS}:2380 \ --cert-file=/etc/ssl/etcd/system:etcd-server:${ETCD_DNS_NAME}.crt \ --key-file=/etc/ssl/etcd/system:etcd-server:${ETCD_DNS_NAME}.key \ diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go index 42efc79db9..425ac3a2bb 100644 --- a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -7,7 +7,6 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // Infrastructure holds cluster-wide information about Infrastructure. The canonical name is `cluster` -// TODO this object is an example of a possible grouping and is subject to change or removal type Infrastructure struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. @@ -19,39 +18,64 @@ type Infrastructure struct { Status InfrastructureStatus `json:"status"` } +// InfrastructureSpec contains settings that apply to the cluster infrastructure. type InfrastructureSpec struct { // secret reference? // configmap reference to file? } +// InfrastructureStatus describes the infrastructure the cluster is leveraging. type InfrastructureStatus struct { // platform is the underlying infrastructure provider for the cluster. This // value controls whether infrastructure automation such as service load // balancers, dynamic volume provisioning, machine creation and deletion, and // other integrations are enabled. If None, no infrastructure automation is - // enabled. + // enabled. Allowed values are "AWS", "Azure", "GCP", "Libvirt", + // "OpenStack", "VSphere", and "None". Individual components may not support + // all platforms, and must handle unrecognized platforms as None if they do + // not support that platform. Platform PlatformType `json:"platform,omitempty"` + + // etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering + // etcd servers and clients. + // For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery + EtcdDiscoveryDomain string `json:"etcdDiscoveryDomain"` + + // apiServerURL is a valid URL with scheme(http/https), address and port. + // apiServerURL can be used by components like kubelet on machines, to contact the `apisever` + // using the infrastructure provider rather than the kubernetes networking. + APIServerURL string `json:"apiServerURL"` } -// platformType is a specific supported infrastructure provider. +// PlatformType is a specific supported infrastructure provider. type PlatformType string const ( - // awsPlatform represents Amazon AWS. + // AWSPlatform represents Amazon Web Services infrastructure. AWSPlatform PlatformType = "AWS" - // openStackPlatform represents OpenStack. - OpenStackPlatform PlatformType = "OpenStack" + // AzurePlatform represents Microsoft Azure infrastructure. + AzurePlatform PlatformType = "Azure" + + // GCPPlatform represents Google Cloud Platform infrastructure. + GCPPlatform PlatformType = "GCP" - // libvirtPlatform represents libvirt. + // LibvirtPlatform represents libvirt infrastructure. LibvirtPlatform PlatformType = "Libvirt" - // nonePlatform means there is no infrastructure provider. + // OpenStackPlatform represents OpenStack infrastructure. + OpenStackPlatform PlatformType = "OpenStack" + + // NonePlatform means there is no infrastructure provider. NonePlatform PlatformType = "None" + + // VSpherePlatform represents VMWare vSphere infrastructure. + VSpherePlatform PlatformType = "VSphere" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// InfrastructureList is type InfrastructureList struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go index 744da73cae..476c2e2d98 100644 --- a/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go @@ -660,6 +660,7 @@ func (Infrastructure) SwaggerDoc() map[string]string { } var map_InfrastructureList = map[string]string{ + "": "InfrastructureList is", "metadata": "Standard object's metadata.", } @@ -667,8 +668,19 @@ func (InfrastructureList) SwaggerDoc() map[string]string { return map_InfrastructureList } +var map_InfrastructureSpec = map[string]string{ + "": "InfrastructureSpec contains settings that apply to the cluster infrastructure.", +} + +func (InfrastructureSpec) SwaggerDoc() map[string]string { + return map_InfrastructureSpec +} + var map_InfrastructureStatus = map[string]string{ - "platform": "platform is the underlying infrastructure provider for the cluster. This value controls whether infrastructure automation such as service load balancers, dynamic volume provisioning, machine creation and deletion, and other integrations are enabled. If None, no infrastructure automation is enabled.", + "": "InfrastructureStatus describes the infrastructure the cluster is leveraging.", + "platform": "platform is the underlying infrastructure provider for the cluster. This value controls whether infrastructure automation such as service load balancers, dynamic volume provisioning, machine creation and deletion, and other integrations are enabled. If None, no infrastructure automation is enabled. Allowed values are \"AWS\", \"Azure\", \"GCP\", \"Libvirt\", \"OpenStack\", \"VSphere\", and \"None\". Individual components may not support all platforms, and must handle unrecognized platforms as None if they do not support that platform.", + "etcdDiscoveryDomain": "etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering etcd servers and clients. For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery", + "apiServerURL": "apiServerURL is a valid URL with scheme(http/https), address and port. apiServerURL can be used by components like kubelet on machines, to contact the `apisever` using the infrastructure provider rather than the kubernetes networking.", } func (InfrastructureStatus) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/interface.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/interface.go new file mode 100644 index 0000000000..544faaaead --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/interface.go @@ -0,0 +1,30 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package config + +import ( + v1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/apiserver.go new file mode 100644 index 0000000000..d79c40c186 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/apiserver.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// APIServerInformer provides access to a shared informer and lister for +// APIServers. +type APIServerInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.APIServerLister +} + +type aPIServerInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAPIServerInformer constructs a new informer for APIServer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAPIServerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAPIServerInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAPIServerInformer constructs a new informer for APIServer type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAPIServerInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().APIServers().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().APIServers().Watch(options) + }, + }, + &config_v1.APIServer{}, + resyncPeriod, + indexers, + ) +} + +func (f *aPIServerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAPIServerInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *aPIServerInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.APIServer{}, f.defaultInformer) +} + +func (f *aPIServerInformer) Lister() v1.APIServerLister { + return v1.NewAPIServerLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/authentication.go new file mode 100644 index 0000000000..beb6f1252e --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/authentication.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// AuthenticationInformer provides access to a shared informer and lister for +// Authentications. +type AuthenticationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.AuthenticationLister +} + +type authenticationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewAuthenticationInformer constructs a new informer for Authentication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewAuthenticationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredAuthenticationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredAuthenticationInformer constructs a new informer for Authentication type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredAuthenticationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Authentications().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Authentications().Watch(options) + }, + }, + &config_v1.Authentication{}, + resyncPeriod, + indexers, + ) +} + +func (f *authenticationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredAuthenticationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *authenticationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Authentication{}, f.defaultInformer) +} + +func (f *authenticationInformer) Lister() v1.AuthenticationLister { + return v1.NewAuthenticationLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/build.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/build.go new file mode 100644 index 0000000000..15f8762bc6 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/build.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// BuildInformer provides access to a shared informer and lister for +// Builds. +type BuildInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.BuildLister +} + +type buildInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewBuildInformer constructs a new informer for Build type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBuildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBuildInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredBuildInformer constructs a new informer for Build type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBuildInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Builds().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Builds().Watch(options) + }, + }, + &config_v1.Build{}, + resyncPeriod, + indexers, + ) +} + +func (f *buildInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBuildInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *buildInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Build{}, f.defaultInformer) +} + +func (f *buildInformer) Lister() v1.BuildLister { + return v1.NewBuildLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusteroperator.go new file mode 100644 index 0000000000..51d4a084cf --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusteroperator.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterOperatorInformer provides access to a shared informer and lister for +// ClusterOperators. +type ClusterOperatorInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterOperatorLister +} + +type clusterOperatorInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterOperatorInformer constructs a new informer for ClusterOperator type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterOperatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterOperatorInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterOperatorInformer constructs a new informer for ClusterOperator type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterOperatorInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().ClusterOperators().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().ClusterOperators().Watch(options) + }, + }, + &config_v1.ClusterOperator{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterOperatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterOperatorInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterOperatorInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.ClusterOperator{}, f.defaultInformer) +} + +func (f *clusterOperatorInformer) Lister() v1.ClusterOperatorLister { + return v1.NewClusterOperatorLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusterversion.go new file mode 100644 index 0000000000..028bb3eb0a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusterversion.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterVersionInformer provides access to a shared informer and lister for +// ClusterVersions. +type ClusterVersionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterVersionLister +} + +type clusterVersionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterVersionInformer constructs a new informer for ClusterVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterVersionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterVersionInformer constructs a new informer for ClusterVersion type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterVersionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().ClusterVersions().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().ClusterVersions().Watch(options) + }, + }, + &config_v1.ClusterVersion{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterVersionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterVersionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.ClusterVersion{}, f.defaultInformer) +} + +func (f *clusterVersionInformer) Lister() v1.ClusterVersionLister { + return v1.NewClusterVersionLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/console.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/console.go new file mode 100644 index 0000000000..8db715652d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/console.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ConsoleInformer provides access to a shared informer and lister for +// Consoles. +type ConsoleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ConsoleLister +} + +type consoleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewConsoleInformer constructs a new informer for Console type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewConsoleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredConsoleInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredConsoleInformer constructs a new informer for Console type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredConsoleInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Consoles().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Consoles().Watch(options) + }, + }, + &config_v1.Console{}, + resyncPeriod, + indexers, + ) +} + +func (f *consoleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredConsoleInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *consoleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Console{}, f.defaultInformer) +} + +func (f *consoleInformer) Lister() v1.ConsoleLister { + return v1.NewConsoleLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/dns.go new file mode 100644 index 0000000000..06cf826d16 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/dns.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DNSInformer provides access to a shared informer and lister for +// DNSs. +type DNSInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.DNSLister +} + +type dNSInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewDNSInformer constructs a new informer for DNS type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDNSInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDNSInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredDNSInformer constructs a new informer for DNS type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDNSInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().DNSs().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().DNSs().Watch(options) + }, + }, + &config_v1.DNS{}, + resyncPeriod, + indexers, + ) +} + +func (f *dNSInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDNSInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *dNSInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.DNS{}, f.defaultInformer) +} + +func (f *dNSInformer) Lister() v1.DNSLister { + return v1.NewDNSLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/image.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/image.go new file mode 100644 index 0000000000..7a463a54a9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/image.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ImageInformer provides access to a shared informer and lister for +// Images. +type ImageInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ImageLister +} + +type imageInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewImageInformer constructs a new informer for Image type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredImageInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredImageInformer constructs a new informer for Image type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Images().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Images().Watch(options) + }, + }, + &config_v1.Image{}, + resyncPeriod, + indexers, + ) +} + +func (f *imageInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredImageInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *imageInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Image{}, f.defaultInformer) +} + +func (f *imageInformer) Lister() v1.ImageLister { + return v1.NewImageLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/infrastructure.go new file mode 100644 index 0000000000..c1f9c48064 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/infrastructure.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InfrastructureInformer provides access to a shared informer and lister for +// Infrastructures. +type InfrastructureInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.InfrastructureLister +} + +type infrastructureInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewInfrastructureInformer constructs a new informer for Infrastructure type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInfrastructureInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInfrastructureInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredInfrastructureInformer constructs a new informer for Infrastructure type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInfrastructureInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Infrastructures().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Infrastructures().Watch(options) + }, + }, + &config_v1.Infrastructure{}, + resyncPeriod, + indexers, + ) +} + +func (f *infrastructureInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInfrastructureInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *infrastructureInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Infrastructure{}, f.defaultInformer) +} + +func (f *infrastructureInformer) Lister() v1.InfrastructureLister { + return v1.NewInfrastructureLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/ingress.go new file mode 100644 index 0000000000..3daba25c5b --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/ingress.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// IngressInformer provides access to a shared informer and lister for +// Ingresses. +type IngressInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IngressLister +} + +type ingressInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIngressInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIngressInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIngressInformer constructs a new informer for Ingress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIngressInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Ingresses().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Ingresses().Watch(options) + }, + }, + &config_v1.Ingress{}, + resyncPeriod, + indexers, + ) +} + +func (f *ingressInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIngressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *ingressInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Ingress{}, f.defaultInformer) +} + +func (f *ingressInformer) Lister() v1.IngressLister { + return v1.NewIngressLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go new file mode 100644 index 0000000000..d5c7ac48f9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go @@ -0,0 +1,127 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // APIServers returns a APIServerInformer. + APIServers() APIServerInformer + // Authentications returns a AuthenticationInformer. + Authentications() AuthenticationInformer + // Builds returns a BuildInformer. + Builds() BuildInformer + // ClusterOperators returns a ClusterOperatorInformer. + ClusterOperators() ClusterOperatorInformer + // ClusterVersions returns a ClusterVersionInformer. + ClusterVersions() ClusterVersionInformer + // Consoles returns a ConsoleInformer. + Consoles() ConsoleInformer + // DNSs returns a DNSInformer. + DNSs() DNSInformer + // Images returns a ImageInformer. + Images() ImageInformer + // Infrastructures returns a InfrastructureInformer. + Infrastructures() InfrastructureInformer + // Ingresses returns a IngressInformer. + Ingresses() IngressInformer + // Networks returns a NetworkInformer. + Networks() NetworkInformer + // OAuths returns a OAuthInformer. + OAuths() OAuthInformer + // Projects returns a ProjectInformer. + Projects() ProjectInformer + // Proxies returns a ProxyInformer. + Proxies() ProxyInformer + // Schedulings returns a SchedulingInformer. + Schedulings() SchedulingInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// APIServers returns a APIServerInformer. +func (v *version) APIServers() APIServerInformer { + return &aPIServerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Authentications returns a AuthenticationInformer. +func (v *version) Authentications() AuthenticationInformer { + return &authenticationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Builds returns a BuildInformer. +func (v *version) Builds() BuildInformer { + return &buildInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterOperators returns a ClusterOperatorInformer. +func (v *version) ClusterOperators() ClusterOperatorInformer { + return &clusterOperatorInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// ClusterVersions returns a ClusterVersionInformer. +func (v *version) ClusterVersions() ClusterVersionInformer { + return &clusterVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Consoles returns a ConsoleInformer. +func (v *version) Consoles() ConsoleInformer { + return &consoleInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// DNSs returns a DNSInformer. +func (v *version) DNSs() DNSInformer { + return &dNSInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Images returns a ImageInformer. +func (v *version) Images() ImageInformer { + return &imageInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Infrastructures returns a InfrastructureInformer. +func (v *version) Infrastructures() InfrastructureInformer { + return &infrastructureInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Ingresses returns a IngressInformer. +func (v *version) Ingresses() IngressInformer { + return &ingressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Networks returns a NetworkInformer. +func (v *version) Networks() NetworkInformer { + return &networkInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// OAuths returns a OAuthInformer. +func (v *version) OAuths() OAuthInformer { + return &oAuthInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Projects returns a ProjectInformer. +func (v *version) Projects() ProjectInformer { + return &projectInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Proxies returns a ProxyInformer. +func (v *version) Proxies() ProxyInformer { + return &proxyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// Schedulings returns a SchedulingInformer. +func (v *version) Schedulings() SchedulingInformer { + return &schedulingInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/network.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/network.go new file mode 100644 index 0000000000..1e5d6d53e3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/network.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// NetworkInformer provides access to a shared informer and lister for +// Networks. +type NetworkInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.NetworkLister +} + +type networkInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewNetworkInformer constructs a new informer for Network type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewNetworkInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredNetworkInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredNetworkInformer constructs a new informer for Network type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredNetworkInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Networks().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Networks().Watch(options) + }, + }, + &config_v1.Network{}, + resyncPeriod, + indexers, + ) +} + +func (f *networkInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredNetworkInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *networkInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Network{}, f.defaultInformer) +} + +func (f *networkInformer) Lister() v1.NetworkLister { + return v1.NewNetworkLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/oauth.go new file mode 100644 index 0000000000..da9050168c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/oauth.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// OAuthInformer provides access to a shared informer and lister for +// OAuths. +type OAuthInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.OAuthLister +} + +type oAuthInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewOAuthInformer constructs a new informer for OAuth type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewOAuthInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredOAuthInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredOAuthInformer constructs a new informer for OAuth type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredOAuthInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().OAuths().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().OAuths().Watch(options) + }, + }, + &config_v1.OAuth{}, + resyncPeriod, + indexers, + ) +} + +func (f *oAuthInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredOAuthInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *oAuthInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.OAuth{}, f.defaultInformer) +} + +func (f *oAuthInformer) Lister() v1.OAuthLister { + return v1.NewOAuthLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/project.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/project.go new file mode 100644 index 0000000000..b5a00203af --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/project.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProjectInformer provides access to a shared informer and lister for +// Projects. +type ProjectInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProjectLister +} + +type projectInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProjectInformer constructs a new informer for Project type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProjectInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProjectInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProjectInformer constructs a new informer for Project type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProjectInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Projects().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Projects().Watch(options) + }, + }, + &config_v1.Project{}, + resyncPeriod, + indexers, + ) +} + +func (f *projectInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProjectInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *projectInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Project{}, f.defaultInformer) +} + +func (f *projectInformer) Lister() v1.ProjectLister { + return v1.NewProjectLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/proxy.go new file mode 100644 index 0000000000..374ffc9cea --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/proxy.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ProxyInformer provides access to a shared informer and lister for +// Proxies. +type ProxyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ProxyLister +} + +type proxyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewProxyInformer constructs a new informer for Proxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewProxyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredProxyInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredProxyInformer constructs a new informer for Proxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredProxyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Proxies().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Proxies().Watch(options) + }, + }, + &config_v1.Proxy{}, + resyncPeriod, + indexers, + ) +} + +func (f *proxyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredProxyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *proxyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Proxy{}, f.defaultInformer) +} + +func (f *proxyInformer) Lister() v1.ProxyLister { + return v1.NewProxyLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/scheduling.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/scheduling.go new file mode 100644 index 0000000000..71757c7ea4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/scheduling.go @@ -0,0 +1,72 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + time "time" + + config_v1 "github.com/openshift/api/config/v1" + versioned "github.com/openshift/client-go/config/clientset/versioned" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "github.com/openshift/client-go/config/listers/config/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SchedulingInformer provides access to a shared informer and lister for +// Schedulings. +type SchedulingInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.SchedulingLister +} + +type schedulingInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewSchedulingInformer constructs a new informer for Scheduling type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSchedulingInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSchedulingInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredSchedulingInformer constructs a new informer for Scheduling type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSchedulingInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Schedulings().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().Schedulings().Watch(options) + }, + }, + &config_v1.Scheduling{}, + resyncPeriod, + indexers, + ) +} + +func (f *schedulingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSchedulingInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *schedulingInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.Scheduling{}, f.defaultInformer) +} + +func (f *schedulingInformer) Lister() v1.SchedulingLister { + return v1.NewSchedulingLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go new file mode 100644 index 0000000000..ff9a302a22 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go @@ -0,0 +1,164 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/openshift/client-go/config/clientset/versioned" + config "github.com/openshift/client-go/config/informers/externalversions/config" + internalinterfaces "github.com/openshift/client-go/config/informers/externalversions/internalinterfaces" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Config() config.Interface +} + +func (f *sharedInformerFactory) Config() config.Interface { + return config.New(f, f.namespace, f.tweakListOptions) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go new file mode 100644 index 0000000000..31124f6325 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1 "github.com/openshift/api/config/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=config.openshift.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("apiservers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().APIServers().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("authentications"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Authentications().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("builds"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Builds().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusteroperators"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().ClusterOperators().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("clusterversions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().ClusterVersions().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("consoles"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Consoles().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("dnss"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().DNSs().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("images"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Images().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("infrastructures"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Infrastructures().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("ingresses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Ingresses().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("networks"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Networks().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("oauths"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().OAuths().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("projects"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Projects().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("proxies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Proxies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("schedulings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().Schedulings().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/vendor/github.com/openshift/client-go/config/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..a8ea630ae9 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,22 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/openshift/client-go/config/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go new file mode 100644 index 0000000000..63bb7ecfdc --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/apiserver.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// APIServerLister helps list APIServers. +type APIServerLister interface { + // List lists all APIServers in the indexer. + List(selector labels.Selector) (ret []*v1.APIServer, err error) + // Get retrieves the APIServer from the index for a given name. + Get(name string) (*v1.APIServer, error) + APIServerListerExpansion +} + +// aPIServerLister implements the APIServerLister interface. +type aPIServerLister struct { + indexer cache.Indexer +} + +// NewAPIServerLister returns a new APIServerLister. +func NewAPIServerLister(indexer cache.Indexer) APIServerLister { + return &aPIServerLister{indexer: indexer} +} + +// List lists all APIServers in the indexer. +func (s *aPIServerLister) List(selector labels.Selector) (ret []*v1.APIServer, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.APIServer)) + }) + return ret, err +} + +// Get retrieves the APIServer from the index for a given name. +func (s *aPIServerLister) Get(name string) (*v1.APIServer, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("apiserver"), name) + } + return obj.(*v1.APIServer), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go new file mode 100644 index 0000000000..27c113a902 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// AuthenticationLister helps list Authentications. +type AuthenticationLister interface { + // List lists all Authentications in the indexer. + List(selector labels.Selector) (ret []*v1.Authentication, err error) + // Get retrieves the Authentication from the index for a given name. + Get(name string) (*v1.Authentication, error) + AuthenticationListerExpansion +} + +// authenticationLister implements the AuthenticationLister interface. +type authenticationLister struct { + indexer cache.Indexer +} + +// NewAuthenticationLister returns a new AuthenticationLister. +func NewAuthenticationLister(indexer cache.Indexer) AuthenticationLister { + return &authenticationLister{indexer: indexer} +} + +// List lists all Authentications in the indexer. +func (s *authenticationLister) List(selector labels.Selector) (ret []*v1.Authentication, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Authentication)) + }) + return ret, err +} + +// Get retrieves the Authentication from the index for a given name. +func (s *authenticationLister) Get(name string) (*v1.Authentication, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("authentication"), name) + } + return obj.(*v1.Authentication), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go new file mode 100644 index 0000000000..e8fa1c564f --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/build.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BuildLister helps list Builds. +type BuildLister interface { + // List lists all Builds in the indexer. + List(selector labels.Selector) (ret []*v1.Build, err error) + // Get retrieves the Build from the index for a given name. + Get(name string) (*v1.Build, error) + BuildListerExpansion +} + +// buildLister implements the BuildLister interface. +type buildLister struct { + indexer cache.Indexer +} + +// NewBuildLister returns a new BuildLister. +func NewBuildLister(indexer cache.Indexer) BuildLister { + return &buildLister{indexer: indexer} +} + +// List lists all Builds in the indexer. +func (s *buildLister) List(selector labels.Selector) (ret []*v1.Build, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Build)) + }) + return ret, err +} + +// Get retrieves the Build from the index for a given name. +func (s *buildLister) Get(name string) (*v1.Build, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("build"), name) + } + return obj.(*v1.Build), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go new file mode 100644 index 0000000000..bb88edee61 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterOperatorLister helps list ClusterOperators. +type ClusterOperatorLister interface { + // List lists all ClusterOperators in the indexer. + List(selector labels.Selector) (ret []*v1.ClusterOperator, err error) + // Get retrieves the ClusterOperator from the index for a given name. + Get(name string) (*v1.ClusterOperator, error) + ClusterOperatorListerExpansion +} + +// clusterOperatorLister implements the ClusterOperatorLister interface. +type clusterOperatorLister struct { + indexer cache.Indexer +} + +// NewClusterOperatorLister returns a new ClusterOperatorLister. +func NewClusterOperatorLister(indexer cache.Indexer) ClusterOperatorLister { + return &clusterOperatorLister{indexer: indexer} +} + +// List lists all ClusterOperators in the indexer. +func (s *clusterOperatorLister) List(selector labels.Selector) (ret []*v1.ClusterOperator, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterOperator)) + }) + return ret, err +} + +// Get retrieves the ClusterOperator from the index for a given name. +func (s *clusterOperatorLister) Get(name string) (*v1.ClusterOperator, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clusteroperator"), name) + } + return obj.(*v1.ClusterOperator), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go new file mode 100644 index 0000000000..c053383a16 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterVersionLister helps list ClusterVersions. +type ClusterVersionLister interface { + // List lists all ClusterVersions in the indexer. + List(selector labels.Selector) (ret []*v1.ClusterVersion, err error) + // Get retrieves the ClusterVersion from the index for a given name. + Get(name string) (*v1.ClusterVersion, error) + ClusterVersionListerExpansion +} + +// clusterVersionLister implements the ClusterVersionLister interface. +type clusterVersionLister struct { + indexer cache.Indexer +} + +// NewClusterVersionLister returns a new ClusterVersionLister. +func NewClusterVersionLister(indexer cache.Indexer) ClusterVersionLister { + return &clusterVersionLister{indexer: indexer} +} + +// List lists all ClusterVersions in the indexer. +func (s *clusterVersionLister) List(selector labels.Selector) (ret []*v1.ClusterVersion, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterVersion)) + }) + return ret, err +} + +// Get retrieves the ClusterVersion from the index for a given name. +func (s *clusterVersionLister) Get(name string) (*v1.ClusterVersion, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clusterversion"), name) + } + return obj.(*v1.ClusterVersion), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go new file mode 100644 index 0000000000..8a17d3e2b0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/console.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ConsoleLister helps list Consoles. +type ConsoleLister interface { + // List lists all Consoles in the indexer. + List(selector labels.Selector) (ret []*v1.Console, err error) + // Get retrieves the Console from the index for a given name. + Get(name string) (*v1.Console, error) + ConsoleListerExpansion +} + +// consoleLister implements the ConsoleLister interface. +type consoleLister struct { + indexer cache.Indexer +} + +// NewConsoleLister returns a new ConsoleLister. +func NewConsoleLister(indexer cache.Indexer) ConsoleLister { + return &consoleLister{indexer: indexer} +} + +// List lists all Consoles in the indexer. +func (s *consoleLister) List(selector labels.Selector) (ret []*v1.Console, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Console)) + }) + return ret, err +} + +// Get retrieves the Console from the index for a given name. +func (s *consoleLister) Get(name string) (*v1.Console, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("console"), name) + } + return obj.(*v1.Console), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go new file mode 100644 index 0000000000..64fd4d0016 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// DNSLister helps list DNSs. +type DNSLister interface { + // List lists all DNSs in the indexer. + List(selector labels.Selector) (ret []*v1.DNS, err error) + // Get retrieves the DNS from the index for a given name. + Get(name string) (*v1.DNS, error) + DNSListerExpansion +} + +// dNSLister implements the DNSLister interface. +type dNSLister struct { + indexer cache.Indexer +} + +// NewDNSLister returns a new DNSLister. +func NewDNSLister(indexer cache.Indexer) DNSLister { + return &dNSLister{indexer: indexer} +} + +// List lists all DNSs in the indexer. +func (s *dNSLister) List(selector labels.Selector) (ret []*v1.DNS, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.DNS)) + }) + return ret, err +} + +// Get retrieves the DNS from the index for a given name. +func (s *dNSLister) Get(name string) (*v1.DNS, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("dns"), name) + } + return obj.(*v1.DNS), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go new file mode 100644 index 0000000000..dcd4a714f3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go @@ -0,0 +1,63 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// APIServerListerExpansion allows custom methods to be added to +// APIServerLister. +type APIServerListerExpansion interface{} + +// AuthenticationListerExpansion allows custom methods to be added to +// AuthenticationLister. +type AuthenticationListerExpansion interface{} + +// BuildListerExpansion allows custom methods to be added to +// BuildLister. +type BuildListerExpansion interface{} + +// ClusterOperatorListerExpansion allows custom methods to be added to +// ClusterOperatorLister. +type ClusterOperatorListerExpansion interface{} + +// ClusterVersionListerExpansion allows custom methods to be added to +// ClusterVersionLister. +type ClusterVersionListerExpansion interface{} + +// ConsoleListerExpansion allows custom methods to be added to +// ConsoleLister. +type ConsoleListerExpansion interface{} + +// DNSListerExpansion allows custom methods to be added to +// DNSLister. +type DNSListerExpansion interface{} + +// ImageListerExpansion allows custom methods to be added to +// ImageLister. +type ImageListerExpansion interface{} + +// InfrastructureListerExpansion allows custom methods to be added to +// InfrastructureLister. +type InfrastructureListerExpansion interface{} + +// IngressListerExpansion allows custom methods to be added to +// IngressLister. +type IngressListerExpansion interface{} + +// NetworkListerExpansion allows custom methods to be added to +// NetworkLister. +type NetworkListerExpansion interface{} + +// OAuthListerExpansion allows custom methods to be added to +// OAuthLister. +type OAuthListerExpansion interface{} + +// ProjectListerExpansion allows custom methods to be added to +// ProjectLister. +type ProjectListerExpansion interface{} + +// ProxyListerExpansion allows custom methods to be added to +// ProxyLister. +type ProxyListerExpansion interface{} + +// SchedulingListerExpansion allows custom methods to be added to +// SchedulingLister. +type SchedulingListerExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go new file mode 100644 index 0000000000..0696e718a6 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/image.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ImageLister helps list Images. +type ImageLister interface { + // List lists all Images in the indexer. + List(selector labels.Selector) (ret []*v1.Image, err error) + // Get retrieves the Image from the index for a given name. + Get(name string) (*v1.Image, error) + ImageListerExpansion +} + +// imageLister implements the ImageLister interface. +type imageLister struct { + indexer cache.Indexer +} + +// NewImageLister returns a new ImageLister. +func NewImageLister(indexer cache.Indexer) ImageLister { + return &imageLister{indexer: indexer} +} + +// List lists all Images in the indexer. +func (s *imageLister) List(selector labels.Selector) (ret []*v1.Image, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Image)) + }) + return ret, err +} + +// Get retrieves the Image from the index for a given name. +func (s *imageLister) Get(name string) (*v1.Image, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("image"), name) + } + return obj.(*v1.Image), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go new file mode 100644 index 0000000000..90e4e54a96 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// InfrastructureLister helps list Infrastructures. +type InfrastructureLister interface { + // List lists all Infrastructures in the indexer. + List(selector labels.Selector) (ret []*v1.Infrastructure, err error) + // Get retrieves the Infrastructure from the index for a given name. + Get(name string) (*v1.Infrastructure, error) + InfrastructureListerExpansion +} + +// infrastructureLister implements the InfrastructureLister interface. +type infrastructureLister struct { + indexer cache.Indexer +} + +// NewInfrastructureLister returns a new InfrastructureLister. +func NewInfrastructureLister(indexer cache.Indexer) InfrastructureLister { + return &infrastructureLister{indexer: indexer} +} + +// List lists all Infrastructures in the indexer. +func (s *infrastructureLister) List(selector labels.Selector) (ret []*v1.Infrastructure, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Infrastructure)) + }) + return ret, err +} + +// Get retrieves the Infrastructure from the index for a given name. +func (s *infrastructureLister) Get(name string) (*v1.Infrastructure, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("infrastructure"), name) + } + return obj.(*v1.Infrastructure), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go new file mode 100644 index 0000000000..7fff5b0554 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IngressLister helps list Ingresses. +type IngressLister interface { + // List lists all Ingresses in the indexer. + List(selector labels.Selector) (ret []*v1.Ingress, err error) + // Get retrieves the Ingress from the index for a given name. + Get(name string) (*v1.Ingress, error) + IngressListerExpansion +} + +// ingressLister implements the IngressLister interface. +type ingressLister struct { + indexer cache.Indexer +} + +// NewIngressLister returns a new IngressLister. +func NewIngressLister(indexer cache.Indexer) IngressLister { + return &ingressLister{indexer: indexer} +} + +// List lists all Ingresses in the indexer. +func (s *ingressLister) List(selector labels.Selector) (ret []*v1.Ingress, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Ingress)) + }) + return ret, err +} + +// Get retrieves the Ingress from the index for a given name. +func (s *ingressLister) Get(name string) (*v1.Ingress, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("ingress"), name) + } + return obj.(*v1.Ingress), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go new file mode 100644 index 0000000000..18c2fa73d7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/network.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// NetworkLister helps list Networks. +type NetworkLister interface { + // List lists all Networks in the indexer. + List(selector labels.Selector) (ret []*v1.Network, err error) + // Get retrieves the Network from the index for a given name. + Get(name string) (*v1.Network, error) + NetworkListerExpansion +} + +// networkLister implements the NetworkLister interface. +type networkLister struct { + indexer cache.Indexer +} + +// NewNetworkLister returns a new NetworkLister. +func NewNetworkLister(indexer cache.Indexer) NetworkLister { + return &networkLister{indexer: indexer} +} + +// List lists all Networks in the indexer. +func (s *networkLister) List(selector labels.Selector) (ret []*v1.Network, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Network)) + }) + return ret, err +} + +// Get retrieves the Network from the index for a given name. +func (s *networkLister) Get(name string) (*v1.Network, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("network"), name) + } + return obj.(*v1.Network), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go new file mode 100644 index 0000000000..b09ca24b31 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// OAuthLister helps list OAuths. +type OAuthLister interface { + // List lists all OAuths in the indexer. + List(selector labels.Selector) (ret []*v1.OAuth, err error) + // Get retrieves the OAuth from the index for a given name. + Get(name string) (*v1.OAuth, error) + OAuthListerExpansion +} + +// oAuthLister implements the OAuthLister interface. +type oAuthLister struct { + indexer cache.Indexer +} + +// NewOAuthLister returns a new OAuthLister. +func NewOAuthLister(indexer cache.Indexer) OAuthLister { + return &oAuthLister{indexer: indexer} +} + +// List lists all OAuths in the indexer. +func (s *oAuthLister) List(selector labels.Selector) (ret []*v1.OAuth, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.OAuth)) + }) + return ret, err +} + +// Get retrieves the OAuth from the index for a given name. +func (s *oAuthLister) Get(name string) (*v1.OAuth, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("oauth"), name) + } + return obj.(*v1.OAuth), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go new file mode 100644 index 0000000000..18c7fbd08d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/project.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProjectLister helps list Projects. +type ProjectLister interface { + // List lists all Projects in the indexer. + List(selector labels.Selector) (ret []*v1.Project, err error) + // Get retrieves the Project from the index for a given name. + Get(name string) (*v1.Project, error) + ProjectListerExpansion +} + +// projectLister implements the ProjectLister interface. +type projectLister struct { + indexer cache.Indexer +} + +// NewProjectLister returns a new ProjectLister. +func NewProjectLister(indexer cache.Indexer) ProjectLister { + return &projectLister{indexer: indexer} +} + +// List lists all Projects in the indexer. +func (s *projectLister) List(selector labels.Selector) (ret []*v1.Project, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Project)) + }) + return ret, err +} + +// Get retrieves the Project from the index for a given name. +func (s *projectLister) Get(name string) (*v1.Project, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("project"), name) + } + return obj.(*v1.Project), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go new file mode 100644 index 0000000000..032f5d125d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/proxy.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ProxyLister helps list Proxies. +type ProxyLister interface { + // List lists all Proxies in the indexer. + List(selector labels.Selector) (ret []*v1.Proxy, err error) + // Get retrieves the Proxy from the index for a given name. + Get(name string) (*v1.Proxy, error) + ProxyListerExpansion +} + +// proxyLister implements the ProxyLister interface. +type proxyLister struct { + indexer cache.Indexer +} + +// NewProxyLister returns a new ProxyLister. +func NewProxyLister(indexer cache.Indexer) ProxyLister { + return &proxyLister{indexer: indexer} +} + +// List lists all Proxies in the indexer. +func (s *proxyLister) List(selector labels.Selector) (ret []*v1.Proxy, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Proxy)) + }) + return ret, err +} + +// Get retrieves the Proxy from the index for a given name. +func (s *proxyLister) Get(name string) (*v1.Proxy, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("proxy"), name) + } + return obj.(*v1.Proxy), nil +} diff --git a/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduling.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduling.go new file mode 100644 index 0000000000..9e923d2021 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/scheduling.go @@ -0,0 +1,49 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// SchedulingLister helps list Schedulings. +type SchedulingLister interface { + // List lists all Schedulings in the indexer. + List(selector labels.Selector) (ret []*v1.Scheduling, err error) + // Get retrieves the Scheduling from the index for a given name. + Get(name string) (*v1.Scheduling, error) + SchedulingListerExpansion +} + +// schedulingLister implements the SchedulingLister interface. +type schedulingLister struct { + indexer cache.Indexer +} + +// NewSchedulingLister returns a new SchedulingLister. +func NewSchedulingLister(indexer cache.Indexer) SchedulingLister { + return &schedulingLister{indexer: indexer} +} + +// List lists all Schedulings in the indexer. +func (s *schedulingLister) List(selector labels.Selector) (ret []*v1.Scheduling, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Scheduling)) + }) + return ret, err +} + +// Get retrieves the Scheduling from the index for a given name. +func (s *schedulingLister) Get(name string) (*v1.Scheduling, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("scheduling"), name) + } + return obj.(*v1.Scheduling), nil +}