From ea850152cafbab0f8bf871ab564d23f6b2f7054b Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Thu, 15 Nov 2018 13:55:17 -0500 Subject: [PATCH 1/4] vendor: Update the client-go and api libraries to pick up new config apis --- Gopkg.lock | 34 +- .../github.com/openshift/api/config/v1/doc.go | 7 + .../openshift/api/config/v1/register.go | 65 + .../openshift/api/config/v1/stringsource.go | 31 + .../openshift/api/config/v1/types.go | 276 +++ .../api/config/v1/types_authentication.go | 39 + .../openshift/api/config/v1/types_build.go | 96 + .../api/config/v1/types_cluster_operator.go | 106 + .../api/config/v1/types_cluster_version.go | 166 ++ .../openshift/api/config/v1/types_console.go | 37 + .../openshift/api/config/v1/types_dns.go | 36 + .../openshift/api/config/v1/types_idp.go | 36 + .../openshift/api/config/v1/types_image.go | 76 + .../api/config/v1/types_infrastructure.go | 38 + .../openshift/api/config/v1/types_ingress.go | 36 + .../openshift/api/config/v1/types_network.go | 39 + .../openshift/api/config/v1/types_oauth.go | 37 + .../openshift/api/config/v1/types_project.go | 37 + .../api/config/v1/types_scheduling.go | 36 + .../config/v1/types_swagger_doc_generated.go | 218 ++ .../api/config/v1/zz_generated.deepcopy.go | 1858 +++++++++++++++++ .../api/image/docker10/dockertypes.go | 2 +- .../api/image/dockerpre012/dockertypes.go | 2 +- .../openshift/api/image/v1/types.go | 36 +- .../image/v1/types_swagger_doc_generated.go | 32 +- .../config/clientset/versioned/clientset.go | 82 + .../config/clientset/versioned/doc.go | 4 + .../versioned/fake/clientset_generated.go | 66 + .../config/clientset/versioned/fake/doc.go | 4 + .../clientset/versioned/fake/register.go | 38 + .../config/clientset/versioned/scheme/doc.go | 4 + .../clientset/versioned/scheme/register.go | 38 + .../typed/config/v1/authentication.go | 147 ++ .../versioned/typed/config/v1/build.go | 131 ++ .../typed/config/v1/clusteroperator.go | 147 ++ .../typed/config/v1/clusterversion.go | 147 ++ .../typed/config/v1/config_client.go | 139 ++ .../versioned/typed/config/v1/console.go | 147 ++ .../versioned/typed/config/v1/dns.go | 147 ++ .../versioned/typed/config/v1/doc.go | 4 + .../versioned/typed/config/v1/fake/doc.go | 4 + .../config/v1/fake/fake_authentication.go | 115 + .../typed/config/v1/fake/fake_build.go | 104 + .../config/v1/fake/fake_clusteroperator.go | 115 + .../config/v1/fake/fake_clusterversion.go | 115 + .../config/v1/fake/fake_config_client.go | 76 + .../typed/config/v1/fake/fake_console.go | 115 + .../typed/config/v1/fake/fake_dns.go | 115 + .../config/v1/fake/fake_identityprovider.go | 115 + .../typed/config/v1/fake/fake_image.go | 115 + .../config/v1/fake/fake_infrastructure.go | 115 + .../typed/config/v1/fake/fake_ingress.go | 115 + .../typed/config/v1/fake/fake_network.go | 115 + .../typed/config/v1/fake/fake_oauth.go | 115 + .../typed/config/v1/fake/fake_project.go | 115 + .../typed/config/v1/fake/fake_scheduling.go | 115 + .../typed/config/v1/generated_expansion.go | 31 + .../typed/config/v1/identityprovider.go | 147 ++ .../versioned/typed/config/v1/image.go | 147 ++ .../typed/config/v1/infrastructure.go | 147 ++ .../versioned/typed/config/v1/ingress.go | 147 ++ .../versioned/typed/config/v1/network.go | 147 ++ .../versioned/typed/config/v1/oauth.go | 147 ++ .../versioned/typed/config/v1/project.go | 147 ++ .../versioned/typed/config/v1/scheduling.go | 147 ++ .../externalversions/config/interface.go | 30 + .../config/v1/authentication.go | 72 + .../externalversions/config/v1/build.go | 72 + .../config/v1/clusteroperator.go | 72 + .../config/v1/clusterversion.go | 72 + .../externalversions/config/v1/console.go | 72 + .../externalversions/config/v1/dns.go | 72 + .../config/v1/identityprovider.go | 72 + .../externalversions/config/v1/image.go | 72 + .../config/v1/infrastructure.go | 72 + .../externalversions/config/v1/ingress.go | 72 + .../externalversions/config/v1/interface.go | 120 ++ .../externalversions/config/v1/network.go | 72 + .../externalversions/config/v1/oauth.go | 72 + .../externalversions/config/v1/project.go | 72 + .../externalversions/config/v1/scheduling.go | 72 + .../informers/externalversions/factory.go | 164 ++ .../informers/externalversions/generic.go | 72 + .../internalinterfaces/factory_interfaces.go | 22 + .../listers/config/v1/authentication.go | 49 + .../config/listers/config/v1/build.go | 49 + .../listers/config/v1/clusteroperator.go | 49 + .../listers/config/v1/clusterversion.go | 49 + .../config/listers/config/v1/console.go | 49 + .../client-go/config/listers/config/v1/dns.go | 49 + .../listers/config/v1/expansion_generated.go | 59 + .../listers/config/v1/identityprovider.go | 49 + .../config/listers/config/v1/image.go | 49 + .../listers/config/v1/infrastructure.go | 49 + .../config/listers/config/v1/ingress.go | 49 + .../config/listers/config/v1/network.go | 49 + .../config/listers/config/v1/oauth.go | 49 + .../config/listers/config/v1/project.go | 49 + .../config/listers/config/v1/scheduling.go | 49 + .../apimachinery/pkg/api/validation/doc.go | 18 + .../pkg/api/validation/generic.go | 85 + .../pkg/api/validation/objectmeta.go | 308 +++ .../pkg/apis/meta/v1/validation/validation.go | 90 + 103 files changed, 10126 insertions(+), 43 deletions(-) create mode 100644 vendor/github.com/openshift/api/config/v1/doc.go create mode 100644 vendor/github.com/openshift/api/config/v1/register.go create mode 100644 vendor/github.com/openshift/api/config/v1/stringsource.go create mode 100644 vendor/github.com/openshift/api/config/v1/types.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_authentication.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_build.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_cluster_operator.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_cluster_version.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_console.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_dns.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_idp.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_image.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_infrastructure.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_ingress.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_network.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_oauth.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_project.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_scheduling.go create mode 100644 vendor/github.com/openshift/api/config/v1/types_swagger_doc_generated.go create mode 100644 vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_identityprovider.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduling.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/identityprovider.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go create mode 100644 vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduling.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/interface.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/authentication.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/build.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusteroperator.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/clusterversion.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/console.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/dns.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/identityprovider.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/image.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/infrastructure.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/ingress.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/network.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/oauth.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/project.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/scheduling.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/factory.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go create mode 100644 vendor/github.com/openshift/client-go/config/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/authentication.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/build.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/clusteroperator.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/clusterversion.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/console.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/dns.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/identityprovider.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/image.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/infrastructure.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/ingress.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/network.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/oauth.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/project.go create mode 100644 vendor/github.com/openshift/client-go/config/listers/config/v1/scheduling.go create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validation/doc.go create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validation/generic.go create mode 100644 vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go diff --git a/Gopkg.lock b/Gopkg.lock index 16b13dfe01..476511f319 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -182,27 +182,38 @@ [[projects]] branch = "master" - digest = "1:d19bfb7d7a7ea78247347809f9a1a8c41deab3bc81331a537fa657d590a9f802" + digest = "1:bada18f8cc9cf347266c81ee2ab8956b7c20ff6bf798b3d848e92f63a5c57330" name = "github.com/openshift/api" packages = [ + "config/v1", "image/docker10", "image/dockerpre012", "image/v1", "security/v1", ] pruneopts = "NUT" - revision = "4507dcb6a81f6593aa336c5b47927cf0ae297b72" + revision = "8dce450af78098c96d68dc2a0c2fb8e917993fb4" [[projects]] branch = "master" - digest = "1:31493a29ce9941368a58428e797b24764b6faf801aad841ac2311d4496b6114a" + digest = "1:53d888e3997c192aaea6ec6de71fc19ae8a4795dba7f5e29999535658ffb64ca" name = "github.com/openshift/client-go" packages = [ + "config/clientset/versioned", + "config/clientset/versioned/fake", + "config/clientset/versioned/scheme", + "config/clientset/versioned/typed/config/v1", + "config/clientset/versioned/typed/config/v1/fake", + "config/informers/externalversions", + "config/informers/externalversions/config", + "config/informers/externalversions/config/v1", + "config/informers/externalversions/internalinterfaces", + "config/listers/config/v1", "security/clientset/versioned/scheme", "security/clientset/versioned/typed/security/v1", ] pruneopts = "NUT" - revision = "431ec9a26e5021f35fa41ee9a89842db9bfdb370" + revision = "960f72aa32a8e9b4dd769b90ff1cb5bd4c898eec" [[projects]] branch = "master" @@ -439,16 +450,18 @@ version = "kubernetes-1.11.1" [[projects]] - digest = "1:159c095dfb7597e624380203dc6151fe870f7c52b4950a3459ecf1890f6500e2" + digest = "1:4ce71708bf40d216379e96d210e58caa09d168fc3b883fab8312e439b3c86e8f" name = "k8s.io/apimachinery" packages = [ "pkg/api/equality", "pkg/api/errors", "pkg/api/meta", "pkg/api/resource", + "pkg/api/validation", "pkg/apis/meta/internalversion", "pkg/apis/meta/v1", "pkg/apis/meta/v1/unstructured", + "pkg/apis/meta/v1/validation", "pkg/apis/meta/v1beta1", "pkg/conversion", "pkg/conversion/queryparams", @@ -698,8 +711,16 @@ "github.com/davecgh/go-spew/spew", "github.com/golang/glog", "github.com/google/uuid", + "github.com/openshift/api/config/v1", "github.com/openshift/api/image/v1", "github.com/openshift/api/security/v1", + "github.com/openshift/client-go/config/clientset/versioned", + "github.com/openshift/client-go/config/clientset/versioned/fake", + "github.com/openshift/client-go/config/clientset/versioned/scheme", + "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1", + "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/client-go/security/clientset/versioned/typed/security/v1", "github.com/pkg/errors", "github.com/prometheus/client_golang/prometheus", @@ -719,6 +740,7 @@ "k8s.io/apimachinery/pkg/api/equality", "k8s.io/apimachinery/pkg/api/errors", "k8s.io/apimachinery/pkg/api/meta", + "k8s.io/apimachinery/pkg/api/validation", "k8s.io/apimachinery/pkg/apis/meta/v1", "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "k8s.io/apimachinery/pkg/labels", @@ -737,7 +759,6 @@ "k8s.io/apimachinery/pkg/watch", "k8s.io/client-go/discovery", "k8s.io/client-go/discovery/cached", - "k8s.io/client-go/discovery/fake", "k8s.io/client-go/dynamic", "k8s.io/client-go/informers", "k8s.io/client-go/kubernetes", @@ -755,7 +776,6 @@ "k8s.io/client-go/tools/leaderelection", "k8s.io/client-go/tools/leaderelection/resourcelock", "k8s.io/client-go/tools/record", - "k8s.io/client-go/util/flowcontrol", "k8s.io/client-go/util/workqueue", "k8s.io/code-generator/cmd/client-gen", "k8s.io/gengo/types", diff --git a/vendor/github.com/openshift/api/config/v1/doc.go b/vendor/github.com/openshift/api/config/v1/doc.go new file mode 100644 index 0000000000..fa6f8d9242 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/doc.go @@ -0,0 +1,7 @@ +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +k8s:openapi-gen=true + +// +groupName=config.openshift.io +// Package v1 is the v1 version of the API. +package v1 diff --git a/vendor/github.com/openshift/api/config/v1/register.go b/vendor/github.com/openshift/api/config/v1/register.go new file mode 100644 index 0000000000..0a2ad39357 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/register.go @@ -0,0 +1,65 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + GroupName = "config.openshift.io" + GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // Install is a function which adds this version to a scheme + Install = schemeBuilder.AddToScheme + + // SchemeGroupVersion generated code relies on this name + // Deprecated + SchemeGroupVersion = GroupVersion + // AddToScheme exists solely to keep the old generators creating valid code + // DEPRECATED + AddToScheme = schemeBuilder.AddToScheme +) + +// Resource generated code relies on this being here, but it logically belongs to the group +// DEPRECATED +func Resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: GroupName, Resource: resource} +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, + &Authentication{}, + &AuthenticationList{}, + &Build{}, + &BuildList{}, + &ClusterOperator{}, + &ClusterOperatorList{}, + &ClusterVersion{}, + &ClusterVersionList{}, + &Console{}, + &ConsoleList{}, + &DNS{}, + &DNSList{}, + &GenericControllerConfig{}, + &IdentityProvider{}, + &IdentityProviderList{}, + &Image{}, + &ImageList{}, + &Infrastructure{}, + &InfrastructureList{}, + &Ingress{}, + &IngressList{}, + &Network{}, + &NetworkList{}, + &OAuth{}, + &OAuthList{}, + &Project{}, + &ProjectList{}, + &Scheduling{}, + &SchedulingList{}, + ) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/github.com/openshift/api/config/v1/stringsource.go b/vendor/github.com/openshift/api/config/v1/stringsource.go new file mode 100644 index 0000000000..6a5718c1db --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/stringsource.go @@ -0,0 +1,31 @@ +package v1 + +import "encoding/json" + +// UnmarshalJSON implements the json.Unmarshaller interface. +// If the value is a string, it sets the Value field of the StringSource. +// Otherwise, it is unmarshaled into the StringSourceSpec struct +func (s *StringSource) UnmarshalJSON(value []byte) error { + // If we can unmarshal to a simple string, just set the value + var simpleValue string + if err := json.Unmarshal(value, &simpleValue); err == nil { + s.Value = simpleValue + return nil + } + + // Otherwise do the full struct unmarshal + return json.Unmarshal(value, &s.StringSourceSpec) +} + +// MarshalJSON implements the json.Marshaller interface. +// If the StringSource contains only a string Value (or is empty), it is marshaled as a JSON string. +// Otherwise, the StringSourceSpec struct is marshaled as a JSON object. +func (s *StringSource) MarshalJSON() ([]byte, error) { + // If we have only a cleartext value set, do a simple string marshal + if s.StringSourceSpec == (StringSourceSpec{Value: s.Value}) { + return json.Marshal(s.Value) + } + + // Otherwise do the full struct marshal of the externalized bits + return json.Marshal(s.StringSourceSpec) +} diff --git a/vendor/github.com/openshift/api/config/v1/types.go b/vendor/github.com/openshift/api/config/v1/types.go new file mode 100644 index 0000000000..370c265c08 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types.go @@ -0,0 +1,276 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// ConfigMapReference references the location of a configmap. +type ConfigMapReference struct { + Namespace string `json:"namespace"` + Name string `json:"name"` + // Key allows pointing to a specific key/value inside of the configmap. This is useful for logical file references. + Key string `json:"filename,omitempty"` +} + +// HTTPServingInfo holds configuration for serving HTTP +type HTTPServingInfo struct { + // ServingInfo is the HTTP serving information + ServingInfo `json:",inline"` + // MaxRequestsInFlight is the number of concurrent requests allowed to the server. If zero, no limit. + MaxRequestsInFlight int64 `json:"maxRequestsInFlight"` + // RequestTimeoutSeconds is the number of seconds before requests are timed out. The default is 60 minutes, if + // -1 there is no limit on requests. + RequestTimeoutSeconds int64 `json:"requestTimeoutSeconds"` +} + +// ServingInfo holds information about serving web pages +type ServingInfo struct { + // BindAddress is the ip:port to serve on + BindAddress string `json:"bindAddress"` + // BindNetwork is the type of network to bind to - defaults to "tcp4", accepts "tcp", + // "tcp4", and "tcp6" + BindNetwork string `json:"bindNetwork"` + // CertInfo is the TLS cert info for serving secure traffic. + // this is anonymous so that we can inline it for serialization + CertInfo `json:",inline"` + // ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates + ClientCA string `json:"clientCA"` + // NamedCertificates is a list of certificates to use to secure requests to specific hostnames + NamedCertificates []NamedCertificate `json:"namedCertificates"` + // MinTLSVersion is the minimum TLS version supported. + // Values must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants + MinTLSVersion string `json:"minTLSVersion,omitempty"` + // CipherSuites contains an overridden list of ciphers for the server to support. + // Values must match cipher suite IDs from https://golang.org/pkg/crypto/tls/#pkg-constants + CipherSuites []string `json:"cipherSuites,omitempty"` +} + +// CertInfo relates a certificate with a private key +type CertInfo struct { + // CertFile is a file containing a PEM-encoded certificate + CertFile string `json:"certFile"` + // KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile + KeyFile string `json:"keyFile"` +} + +// NamedCertificate specifies a certificate/key, and the names it should be served for +type NamedCertificate struct { + // Names is a list of DNS names this certificate should be used to secure + // A name can be a normal DNS name, or can contain leading wildcard segments. + Names []string `json:"names"` + // CertInfo is the TLS cert info for serving secure traffic + CertInfo `json:",inline"` +} + +// LeaderElection provides information to elect a leader +type LeaderElection struct { + // disable allows leader election to be suspended while allowing a fully defaulted "normal" startup case. + Disable bool `json:"disable,omitempty"` + // namespace indicates which namespace the resource is in + Namespace string `json:"namespace,omitempty"` + // name indicates what name to use for the resource + Name string `json:"name,omitempty"` + + // leaseDuration is the duration that non-leader candidates will wait + // after observing a leadership renewal until attempting to acquire + // leadership of a led but unrenewed leader slot. This is effectively the + // maximum duration that a leader can be stopped before it is replaced + // by another candidate. This is only applicable if leader election is + // enabled. + LeaseDuration metav1.Duration `json:"leaseDuration,omitempty"` + // renewDeadline is the interval between attempts by the acting master to + // renew a leadership slot before it stops leading. This must be less + // than or equal to the lease duration. This is only applicable if leader + // election is enabled. + RenewDeadline metav1.Duration `json:"renewDeadline,omitempty"` + // retryPeriod is the duration the clients should wait between attempting + // acquisition and renewal of a leadership. This is only applicable if + // leader election is enabled. + RetryPeriod metav1.Duration `json:"retryPeriod,omitempty"` +} + +// StringSource allows specifying a string inline, or externally via env var or file. +// When it contains only a string value, it marshals to a simple JSON string. +type StringSource struct { + // StringSourceSpec specifies the string value, or external location + StringSourceSpec `json:",inline"` +} + +// StringSourceSpec specifies a string value, or external location +type StringSourceSpec struct { + // Value specifies the cleartext value, or an encrypted value if keyFile is specified. + Value string `json:"value"` + + // Env specifies an envvar containing the cleartext value, or an encrypted value if the keyFile is specified. + Env string `json:"env"` + + // File references a file containing the cleartext value, or an encrypted value if a keyFile is specified. + File string `json:"file"` + + // KeyFile references a file containing the key to use to decrypt the value. + KeyFile string `json:"keyFile"` +} + +// RemoteConnectionInfo holds information necessary for establishing a remote connection +type RemoteConnectionInfo struct { + // URL is the remote URL to connect to + URL string `json:"url"` + // CA is the CA for verifying TLS connections + CA string `json:"ca"` + // CertInfo is the TLS client cert information to present + // this is anonymous so that we can inline it for serialization + CertInfo `json:",inline"` +} + +// AdmissionPluginConfig holds the necessary configuration options for admission plugins +type AdmissionPluginConfig struct { + // Location is the path to a configuration file that contains the plugin's + // configuration + Location string `json:"location"` + + // Configuration is an embedded configuration object to be used as the plugin's + // configuration. If present, it will be used instead of the path to the configuration file. + Configuration runtime.RawExtension `json:"configuration"` +} + +type LogFormatType string + +type WebHookModeType string + +const ( + // LogFormatLegacy saves event in 1-line text format. + LogFormatLegacy LogFormatType = "legacy" + // LogFormatJson saves event in structured json format. + LogFormatJson LogFormatType = "json" + + // WebHookModeBatch indicates that the webhook should buffer audit events + // internally, sending batch updates either once a certain number of + // events have been received or a certain amount of time has passed. + WebHookModeBatch WebHookModeType = "batch" + // WebHookModeBlocking causes the webhook to block on every attempt to process + // a set of events. This causes requests to the API server to wait for a + // round trip to the external audit service before sending a response. + WebHookModeBlocking WebHookModeType = "blocking" +) + +// AuditConfig holds configuration for the audit capabilities +type AuditConfig struct { + // If this flag is set, audit log will be printed in the logs. + // The logs contains, method, user and a requested URL. + Enabled bool `json:"enabled"` + // All requests coming to the apiserver will be logged to this file. + AuditFilePath string `json:"auditFilePath"` + // Maximum number of days to retain old log files based on the timestamp encoded in their filename. + MaximumFileRetentionDays int32 `json:"maximumFileRetentionDays"` + // Maximum number of old log files to retain. + MaximumRetainedFiles int32 `json:"maximumRetainedFiles"` + // Maximum size in megabytes of the log file before it gets rotated. Defaults to 100MB. + MaximumFileSizeMegabytes int32 `json:"maximumFileSizeMegabytes"` + + // PolicyFile is a path to the file that defines the audit policy configuration. + PolicyFile string `json:"policyFile"` + // PolicyConfiguration is an embedded policy configuration object to be used + // as the audit policy configuration. If present, it will be used instead of + // the path to the policy file. + PolicyConfiguration runtime.RawExtension `json:"policyConfiguration"` + + // Format of saved audits (legacy or json). + LogFormat LogFormatType `json:"logFormat"` + + // Path to a .kubeconfig formatted file that defines the audit webhook configuration. + WebHookKubeConfig string `json:"webHookKubeConfig"` + // Strategy for sending audit events (block or batch). + WebHookMode WebHookModeType `json:"webHookMode"` +} + +// EtcdConnectionInfo holds information necessary for connecting to an etcd server +type EtcdConnectionInfo struct { + // URLs are the URLs for etcd + URLs []string `json:"urls"` + // CA is a file containing trusted roots for the etcd server certificates + CA string `json:"ca"` + // CertInfo is the TLS client cert information for securing communication to etcd + // this is anonymous so that we can inline it for serialization + CertInfo `json:",inline"` +} + +type EtcdStorageConfig struct { + EtcdConnectionInfo `json:",inline"` + + // StoragePrefix is the path within etcd that the OpenShift resources will + // be rooted under. This value, if changed, will mean existing objects in etcd will + // no longer be located. + StoragePrefix string `json:"storagePrefix"` +} + +// GenericAPIServerConfig is an inline-able struct for aggregated apiservers that need to store data in etcd +type GenericAPIServerConfig struct { + // ServingInfo describes how to start serving + ServingInfo HTTPServingInfo `json:"servingInfo"` + + // CORSAllowedOrigins + CORSAllowedOrigins []string `json:"corsAllowedOrigins"` + + // AuditConfig describes how to configure audit information + AuditConfig AuditConfig `json:"auditConfig"` + + // StorageConfig contains information about how to use + StorageConfig EtcdStorageConfig `json:"storageConfig"` + + AdmissionPluginConfig map[string]AdmissionPluginConfig `json:"admissionPluginConfig"` + + KubeClientConfig KubeClientConfig `json:"kubeClientConfig"` +} + +type KubeClientConfig struct { + // kubeConfig is a .kubeconfig filename for going to the owning kube-apiserver. Empty uses an in-cluster-config + KubeConfig string `json:"kubeConfig"` + + // connectionOverrides specifies client overrides for system components to loop back to this master. + ConnectionOverrides ClientConnectionOverrides `json:"connectionOverrides"` +} + +type ClientConnectionOverrides struct { + // acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the + // default value of 'application/json'. This field will control all connections to the server used by a particular + // client. + AcceptContentTypes string `json:"acceptContentTypes"` + // contentType is the content type used when sending data to the server from this client. + ContentType string `json:"contentType"` + + // qps controls the number of queries per second allowed for this connection. + QPS float32 `json:"qps"` + // burst allows extra queries to accumulate when a client is exceeding its rate. + Burst int32 `json:"burst"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// GenericControllerConfig provides information to configure a controller +type GenericControllerConfig struct { + metav1.TypeMeta `json:",inline"` + + // ServingInfo is the HTTP serving information for the controller's endpoints + ServingInfo HTTPServingInfo `json:"servingInfo,omitempty"` + + // leaderElection provides information to elect a leader. Only override this if you have a specific need + LeaderElection LeaderElection `json:"leaderElection,omitempty"` + + // authentication allows configuration of authentication for the endpoints + Authentication DelegatedAuthentication `json:"authentication,omitempty"` + // authorization allows configuration of authentication for the endpoints + Authorization DelegatedAuthorization `json:"authorization,omitempty"` +} + +// DelegatedAuthentication allows authentication to be disabled. +type DelegatedAuthentication struct { + // disabled indicates that authentication should be disabled. By default it will use delegated authentication. + Disabled bool `json:"disabled,omitempty"` +} + +// DelegatedAuthorization allows authorization to be disabled. +type DelegatedAuthorization struct { + // disabled indicates that authorization should be disabled. By default it will use delegated authorization. + Disabled bool `json:"disabled,omitempty"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_authentication.go b/vendor/github.com/openshift/api/config/v1/types_authentication.go new file mode 100644 index 0000000000..281dca7acd --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_authentication.go @@ -0,0 +1,39 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Authentication holds cluster-wide information about Authentication. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Authentication struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec AuthenticationSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status AuthenticationStatus `json:"status"` +} + +type AuthenticationSpec struct { + // webhook token auth config (ttl) + // external token address + // serviceAccountOAuthGrantMethod or remove/disallow it as an option +} + +type AuthenticationStatus struct { + // internal token address +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type AuthenticationList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Authentication `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_build.go b/vendor/github.com/openshift/api/config/v1/types_build.go new file mode 100644 index 0000000000..480c1d321c --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_build.go @@ -0,0 +1,96 @@ +package v1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Build holds cluster-wide information on how to handle builds. The canonical name is `cluster` +type Build struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // Spec holds user-settable values for the build controller configuration + // +optional + Spec BuildSpec `json:"spec,omitempty"` +} + +type BuildSpec struct { + // AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that + // should be trusted for image pushes and pulls during builds. + // +optional + AdditionalTrustedCA ConfigMapReference `json:"additionalTrustedCA,omitempty"` + // BuildDefaults controls the default information for Builds + // +optional + BuildDefaults BuildDefaults `json:"buildDefaults,omitempty"` + // BuildOverrides controls override settings for builds + // +optional + BuildOverrides BuildOverrides `json:"buildOverrides,omitempty"` +} + +type BuildDefaults struct { + // GitHTTPProxy is the location of the HTTPProxy for Git source + // +optional + GitHTTPProxy string `json:"gitHTTPProxy,omitempty"` + + // GitHTTPSProxy is the location of the HTTPSProxy for Git source + // +optional + GitHTTPSProxy string `json:"gitHTTPSProxy,omitempty"` + + // GitNoProxy is the list of domains for which the proxy should not be used + // +optional + GitNoProxy string `json:"gitNoProxy,omitempty"` + + // Env is a set of default environment variables that will be applied to the + // build if the specified variables do not exist on the build + // +optional + Env []corev1.EnvVar `json:"env,omitempty"` + + // ImageLabels is a list of docker labels that are applied to the resulting image. + // User can override a default label by providing a label with the same name in their + // Build/BuildConfig. + // +optional + ImageLabels []ImageLabel `json:"imageLabels,omitempty"` + + // Resources defines resource requirements to execute the build. + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty"` +} + +type ImageLabel struct { + // Name defines the name of the label. It must have non-zero length. + Name string `json:"name"` + + // Value defines the literal value of the label. + // +optional + Value string `json:"value,omitempty"` +} + +type BuildOverrides struct { + // ImageLabels is a list of docker labels that are applied to the resulting image. + // If user provided a label in their Build/BuildConfig with the same name as one in this + // list, the user's label will be overwritten. + // +optional + ImageLabels []ImageLabel `json:"imageLabels,omitempty"` + + // NodeSelector is a selector which must be true for the build pod to fit on a node + // +optional + NodeSelector metav1.LabelSelector `json:"nodeSelector,omitempty"` + + // Tolerations is a list of Tolerations that will override any existing + // tolerations set on a build pod. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type BuildList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Build `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go b/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go new file mode 100644 index 0000000000..d0c89ecf7a --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_cluster_operator.go @@ -0,0 +1,106 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterOperator is the Custom Resource object which holds the current state +// of an operator. This object is used by operators to convey their state to +// the rest of the cluster. +type ClusterOperator struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + + // spec hold the intent of how this operator should behave. + Spec ClusterOperatorSpec `json:"spec"` + + // status holds the information about the state of an operator. It is consistent with status information across + // the kube ecosystem. + Status ClusterOperatorStatus `json:"status"` +} + +// ClusterOperatorSpec is empty for now, but you could imagine holding information like "pause". +type ClusterOperatorSpec struct { +} + +// ClusterOperatorStatus provides information about the status of the operator. +// +k8s:deepcopy-gen=true +type ClusterOperatorStatus struct { + // conditions describes the state of the operator's reconciliation functionality. + // +patchMergeKey=type + // +patchStrategy=merge + Conditions []ClusterOperatorStatusCondition `json:"conditions" patchStrategy:"merge" patchMergeKey:"type"` + + // version indicates which version of the operator updated the current + // status object. + Version string `json:"version"` + + // extension contains any additional status information specific to the + // operator which owns this status object. + Extension runtime.RawExtension `json:"extension,omitempty"` +} + +type ConditionStatus string + +// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. +// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes +// can't decide if a resource is in the condition or not. In the future, we could add other +// intermediate conditions, e.g. ConditionDegraded. +const ( + ConditionTrue ConditionStatus = "True" + ConditionFalse ConditionStatus = "False" + ConditionUnknown ConditionStatus = "Unknown" +) + +// ClusterOperatorStatusCondition represents the state of the operator's +// reconciliation functionality. +// +k8s:deepcopy-gen=true +type ClusterOperatorStatusCondition struct { + // type specifies the state of the operator's reconciliation functionality. + Type ClusterStatusConditionType `json:"type"` + + // status of the condition, one of True, False, Unknown. + Status ConditionStatus `json:"status"` + + // lastTransitionTime is the time of the last update to the current status object. + LastTransitionTime metav1.Time `json:"lastTransitionTime"` + + // reason is the reason for the condition's last transition. Reasons are CamelCase + Reason string `json:"reason,omitempty"` + + // message provides additional information about the current condition. + // This is only to be consumed by humans. + Message string `json:"message,omitempty"` +} + +// ClusterStatusConditionType is the state of the operator's reconciliation functionality. +type ClusterStatusConditionType string + +const ( + // OperatorAvailable indicates that the binary maintained by the operator (eg: openshift-apiserver for the + // openshift-apiserver-operator), is functional and available in the cluster. + OperatorAvailable ClusterStatusConditionType = "Available" + + // OperatorProgressing indicates that the operator is actively making changes to the binary maintained by the + // operator (eg: openshift-apiserver for the openshift-apiserver-operator). + OperatorProgressing ClusterStatusConditionType = "Progressing" + + // OperatorFailing indicates that the operator has encountered an error that is preventing it from working properly. + // The binary maintained by the operator (eg: openshift-apiserver for the openshift-apiserver-operator) may still be + // available, but the user intent cannot be fulfilled. + OperatorFailing ClusterStatusConditionType = "Failing" +) + +// ClusterOperatorList is a list of OperatorStatus resources. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterOperatorList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ClusterOperator `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_cluster_version.go b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go new file mode 100644 index 0000000000..e012443ea2 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_cluster_version.go @@ -0,0 +1,166 @@ +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterVersion is the configuration for the ClusterVersionOperator. This is where +// parameters related to automatic updates can be set. +type ClusterVersion struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of the cluster version - the operator will work + // to ensure that the desired version is applied to the cluster. + Spec ClusterVersionSpec `json:"spec"` + // status contains information about the available updates and any in-progress + // updates. + Status ClusterVersionStatus `json:"status"` +} + +// ClusterVersionSpec is the desired version state of the cluster. It includes +// the version the cluster should be at, how the cluster is identified, and +// where the cluster should look for version updates. +// +k8s:deepcopy-gen=true +type ClusterVersionSpec struct { + // clusterID uniquely identifies this cluster. This is expected to be + // an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in + // hexadecimal values). This is a required field. + ClusterID ClusterID `json:"clusterID"` + + // desiredUpdate is an optional field that indicates the desired value of + // the cluster version. Setting this value will trigger an upgrade (if + // the current version does not match the desired version). The set of + // recommended update values is listed as part of available updates in + // status, and setting values outside that range may cause the upgrade + // to fail. + // + // If an upgrade fails the operator will halt and report status + // about the failing component. Setting the desired update value back to + // the previous version will cause a rollback to be attempted. Not all + // rollbacks will succeed. + // + // +optional + DesiredUpdate *Update `json:"desiredUpdate"` + + // upstream may be used to specify the preferred update server. By default + // it will use the appropriate update server for the cluster and region. + // + // +optional + Upstream URL `json:"upstream"` + // channel is an identifier for explicitly requesting that a non-default + // set of updates be applied to this cluster. The default channel will be + // contain stable updates that are appropriate for production clusters. + // + // +optional + Channel string `json:"channel"` + + // overrides is list of overides for components that are managed by + // cluster version operator. Marking a component unmanaged will prevent + // the operator from creating or updating the object. + // +optional + Overrides []ComponentOverride `json:"overrides,omitempty"` +} + +// ClusterVersionStatus reports the status of the cluster versioning, +// including any upgrades that are in progress. The current field will +// be set to whichever version the cluster is reconciling to, and the +// conditions array will report whether the update succeeded, is in +// progress, or is failing. +// +k8s:deepcopy-gen=true +type ClusterVersionStatus struct { + // current is the version that the cluster will be reconciled to. This + // value may be empty during cluster startup, and then will be set whenever + // a new update is being applied. Use the conditions array to know whether + // the update is complete. + Current Update `json:"current"` + + // generation reports which version of the spec is being processed. + // If this value is not equal to metadata.generation, then the + // current and conditions fields have not yet been updated to reflect + // the latest request. + Generation int64 `json:"generation"` + + // versionHash is a fingerprint of the content that the cluster will be + // updated with. It is used by the operator to avoid unnecessary work + // and is for internal use only. + VersionHash string `json:"versionHash"` + + // conditions provides information about the cluster version. The condition + // "Available" is set to true if the desiredUpdate has been reached. The + // condition "Progressing" is set to true if an update is being applied. + // The condition "Failing" is set to true if an update is currently blocked + // by a temporary or permanent error. Conditions are only valid for the + // current desiredUpdate when metadata.generation is equal to + // status.generation. + Conditions []ClusterOperatorStatusCondition `json:"conditions"` + + // availableUpdates contains the list of updates that are appropriate + // for this cluster. This list may be empty if no updates are recommended, + // if the update service is unavailable, or if an invalid channel has + // been specified. + AvailableUpdates []Update `json:"availableUpdates"` +} + +// ClusterID is string RFC4122 uuid. +type ClusterID string + +// ComponentOverride allows overriding cluster version operator's behavior +// for a component. +// +k8s:deepcopy-gen=true +type ComponentOverride struct { + // kind indentifies which object to override. + Kind string `json:"kind"` + // group identifies the API group that the kind is in. + Group string `json:"group"` + + // namespace is the component's namespace. If the resource is cluster + // scoped, the namespace should be empty. + Namespace string `json:"namespace"` + // name is the component's name. + Name string `json:"name"` + + // unmanaged controls if cluster version operator should stop managing the + // resources in this cluster. + // Default: false + Unmanaged bool `json:"unmanaged"` +} + +// URL is a thin wrapper around string that ensures the string is a valid URL. +type URL string + +// Update represents a release of the ClusterVersionOperator, referenced by the +// Payload member. +// +k8s:deepcopy-gen=true +type Update struct { + // version is a semantic versioning identifying the update version. When this + // field is part of spec, version is optional if payload is specified. + // + // +optional + Version string `json:"version"` + // payload is a container image location that contains the update. When this + // field is part of spec, payload is optional if version is specified and the + // availableUpdates field contains a matching version. + // + // +optional + Payload string `json:"payload"` +} + +// RetrievedUpdates reports whether available updates have been retrieved from +// the upstream update server. The condition is Unknown before retrieval, False +// if the updates could not be retrieved or recently failed, or True if the +// availableUpdates field is accurate and recent. +const RetrievedUpdates ClusterStatusConditionType = "RetrievedUpdates" + +// ClusterVersionList is a list of ClusterVersion resources. +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type ClusterVersionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ClusterVersion `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_console.go b/vendor/github.com/openshift/api/config/v1/types_console.go new file mode 100644 index 0000000000..36beb4113c --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_console.go @@ -0,0 +1,37 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Console holds cluster-wide information about Console. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Console struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec ConsoleSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status ConsoleStatus `json:"status"` +} + +type ConsoleSpec struct { + // special console public url? +} + +type ConsoleStatus struct { + // console public url +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ConsoleList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Console `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_dns.go b/vendor/github.com/openshift/api/config/v1/types_dns.go new file mode 100644 index 0000000000..44fa6e4d27 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_dns.go @@ -0,0 +1,36 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DNS holds cluster-wide information about DNS. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type DNS struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec DNSSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status DNSStatus `json:"status"` +} + +type DNSSpec struct { +} + +type DNSStatus struct { + // dnsSuffix (service-ca amongst others) +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type DNSList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []DNS `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_idp.go b/vendor/github.com/openshift/api/config/v1/types_idp.go new file mode 100644 index 0000000000..c2425a068f --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_idp.go @@ -0,0 +1,36 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// IdentityProvider holds cluster-wide information about IdentityProvider. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type IdentityProvider struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec IdentityProviderSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status IdentityProviderStatus `json:"status"` +} + +type IdentityProviderSpec struct { + // all the IDP settings +} + +type IdentityProviderStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type IdentityProviderList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []IdentityProvider `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_image.go b/vendor/github.com/openshift/api/config/v1/types_image.go new file mode 100644 index 0000000000..3b5b82964b --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_image.go @@ -0,0 +1,76 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Image holds cluster-wide information about how to handle images. The canonical name is `cluster` +type Image struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec ImageSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status ImageStatus `json:"status"` +} + +type ImageSpec struct { + // AllowedRegistriesForImport limits the container image registries that normal users may import + // images from. Set this list to the registries that you trust to contain valid Docker + // images and that you want applications to be able to import from. Users with + // permission to create Images or ImageStreamMappings via the API are not affected by + // this policy - typically only administrators or system integrations will have those + // permissions. + AllowedRegistriesForImport []RegistryLocation `json:"allowedRegistriesForImport,omitempty"` + + // externalRegistryHostnames provides the hostnames for the default external image + // registry. The external hostname should be set only when the image registry + // is exposed externally. The first value is used in 'publicDockerImageRepository' + // field in ImageStreams. The value must be in "hostname[:port]" format. + ExternalRegistryHostnames []string `json:"externalRegistryHostnames,omitempty"` + + // AdditionalTrustedCA is a reference to a ConfigMap containing additional CAs that + // should be trusted during imagestream import. + AdditionalTrustedCA ConfigMapReference `json:"additionalTrustedCA,omitempty"` +} + +type ImageStatus struct { + + // this value is set by the image registry operator which controls the internal registry hostname + // InternalRegistryHostname sets the hostname for the default internal image + // registry. The value must be in "hostname[:port]" format. + // For backward compatibility, users can still use OPENSHIFT_DEFAULT_REGISTRY + // environment variable but this setting overrides the environment variable. + InternalRegistryHostname string `json:"internalRegistryHostname,omitempty"` + + // externalRegistryHostnames provides the hostnames for the default external image + // registry. The external hostname should be set only when the image registry + // is exposed externally. The first value is used in 'publicDockerImageRepository' + // field in ImageStreams. The value must be in "hostname[:port]" format. + ExternalRegistryHostnames []string `json:"externalRegistryHostnames,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ImageList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Image `json:"items"` +} + +// RegistryLocation contains a location of the registry specified by the registry domain +// name. The domain name might include wildcards, like '*' or '??'. +type RegistryLocation struct { + // DomainName specifies a domain name for the registry + // In case the registry use non-standard (80 or 443) port, the port should be included + // in the domain name as well. + DomainName string `json:"domainName"` + // Insecure indicates whether the registry is secure (https) or insecure (http) + // By default (if not specified) the registry is assumed as secure. + Insecure bool `json:"insecure,omitempty"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_infrastructure.go b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go new file mode 100644 index 0000000000..234e872c0b --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_infrastructure.go @@ -0,0 +1,38 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +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. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec InfrastructureSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status InfrastructureStatus `json:"status"` +} + +type InfrastructureSpec struct { + // secret reference? + // configmap reference to file? +} + +type InfrastructureStatus struct { + // type +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type InfrastructureList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Infrastructure `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_ingress.go b/vendor/github.com/openshift/api/config/v1/types_ingress.go new file mode 100644 index 0000000000..e8467a0906 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_ingress.go @@ -0,0 +1,36 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Ingress holds cluster-wide information about Ingress. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Ingress struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec IngressSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status IngressStatus `json:"status"` +} + +type IngressSpec struct { + // default suffix. It goes here or it gets removed from server +} + +type IngressStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type IngressList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Ingress `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_network.go b/vendor/github.com/openshift/api/config/v1/types_network.go new file mode 100644 index 0000000000..aaea1aab14 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_network.go @@ -0,0 +1,39 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Network holds cluster-wide information about Network. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Network struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec NetworkSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status NetworkStatus `json:"status"` +} + +type NetworkSpec struct { + // serviceCIDR + // servicePortRange + // vxlanPort + // ClusterNetworks []ClusterNetworkEntry `json:"clusterNetworks"` +} + +type NetworkStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type NetworkList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Network `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_oauth.go b/vendor/github.com/openshift/api/config/v1/types_oauth.go new file mode 100644 index 0000000000..d4402ed338 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_oauth.go @@ -0,0 +1,37 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OAuth holds cluster-wide information about OAuth. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type OAuth struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec OAuthSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status OAuthStatus `json:"status"` +} + +type OAuthSpec struct { + // options for configuring the embedded oauth server. + // possibly wellknown? +} + +type OAuthStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type OAuthList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []OAuth `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_project.go b/vendor/github.com/openshift/api/config/v1/types_project.go new file mode 100644 index 0000000000..4280614fbf --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_project.go @@ -0,0 +1,37 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Project holds cluster-wide information about Project. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Project struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec ProjectSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status ProjectStatus `json:"status"` +} + +type ProjectSpec struct { + // project request message + // project request template +} + +type ProjectStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ProjectList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Project `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_scheduling.go b/vendor/github.com/openshift/api/config/v1/types_scheduling.go new file mode 100644 index 0000000000..603ed90544 --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_scheduling.go @@ -0,0 +1,36 @@ +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Scheduling holds cluster-wide information about Scheduling. The canonical name is `cluster` +// TODO this object is an example of a possible grouping and is subject to change or removal +type Scheduling struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec holds user settable values for configuration + Spec SchedulingSpec `json:"spec"` + // status holds observed values from the cluster. They may not be overridden. + Status SchedulingStatus `json:"status"` +} + +type SchedulingSpec struct { + // default node selector (I would be happy to see this die....) +} + +type SchedulingStatus struct { +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type SchedulingList struct { + metav1.TypeMeta `json:",inline"` + // Standard object's metadata. + metav1.ListMeta `json:"metadata,omitempty"` + Items []Scheduling `json:"items"` +} diff --git a/vendor/github.com/openshift/api/config/v1/types_swagger_doc_generated.go b/vendor/github.com/openshift/api/config/v1/types_swagger_doc_generated.go new file mode 100644 index 0000000000..1fd8c16e8a --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/types_swagger_doc_generated.go @@ -0,0 +1,218 @@ +package v1 + +// This file contains a collection of methods that can be used from go-restful to +// generate Swagger API documentation for its models. Please read this PR for more +// information on the implementation: https://github.com/emicklei/go-restful/pull/215 +// +// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if +// they are on one line! For multiple line or blocks that you want to ignore use ---. +// Any context after a --- is ignored. +// +// Those methods can be generated by using hack/update-generated-swagger-docs.sh + +// AUTO-GENERATED FUNCTIONS START HERE +var map_AdmissionPluginConfig = map[string]string{ + "": "AdmissionPluginConfig holds the necessary configuration options for admission plugins", + "location": "Location is the path to a configuration file that contains the plugin's configuration", + "configuration": "Configuration is an embedded configuration object to be used as the plugin's configuration. If present, it will be used instead of the path to the configuration file.", +} + +func (AdmissionPluginConfig) SwaggerDoc() map[string]string { + return map_AdmissionPluginConfig +} + +var map_AuditConfig = map[string]string{ + "": "AuditConfig holds configuration for the audit capabilities", + "enabled": "If this flag is set, audit log will be printed in the logs. The logs contains, method, user and a requested URL.", + "auditFilePath": "All requests coming to the apiserver will be logged to this file.", + "maximumFileRetentionDays": "Maximum number of days to retain old log files based on the timestamp encoded in their filename.", + "maximumRetainedFiles": "Maximum number of old log files to retain.", + "maximumFileSizeMegabytes": "Maximum size in megabytes of the log file before it gets rotated. Defaults to 100MB.", + "policyFile": "PolicyFile is a path to the file that defines the audit policy configuration.", + "policyConfiguration": "PolicyConfiguration is an embedded policy configuration object to be used as the audit policy configuration. If present, it will be used instead of the path to the policy file.", + "logFormat": "Format of saved audits (legacy or json).", + "webHookKubeConfig": "Path to a .kubeconfig formatted file that defines the audit webhook configuration.", + "webHookMode": "Strategy for sending audit events (block or batch).", +} + +func (AuditConfig) SwaggerDoc() map[string]string { + return map_AuditConfig +} + +var map_CertInfo = map[string]string{ + "": "CertInfo relates a certificate with a private key", + "certFile": "CertFile is a file containing a PEM-encoded certificate", + "keyFile": "KeyFile is a file containing a PEM-encoded private key for the certificate specified by CertFile", +} + +func (CertInfo) SwaggerDoc() map[string]string { + return map_CertInfo +} + +var map_ClientConnectionOverrides = map[string]string{ + "acceptContentTypes": "acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the default value of 'application/json'. This field will control all connections to the server used by a particular client.", + "contentType": "contentType is the content type used when sending data to the server from this client.", + "qps": "qps controls the number of queries per second allowed for this connection.", + "burst": "burst allows extra queries to accumulate when a client is exceeding its rate.", +} + +func (ClientConnectionOverrides) SwaggerDoc() map[string]string { + return map_ClientConnectionOverrides +} + +var map_ConfigMapReference = map[string]string{ + "": "ConfigMapReference references the location of a configmap.", + "filename": "Key allows pointing to a specific key/value inside of the configmap. This is useful for logical file references.", +} + +func (ConfigMapReference) SwaggerDoc() map[string]string { + return map_ConfigMapReference +} + +var map_DelegatedAuthentication = map[string]string{ + "": "DelegatedAuthentication allows authentication to be disabled.", + "disabled": "disabled indicates that authentication should be disabled. By default it will use delegated authentication.", +} + +func (DelegatedAuthentication) SwaggerDoc() map[string]string { + return map_DelegatedAuthentication +} + +var map_DelegatedAuthorization = map[string]string{ + "": "DelegatedAuthorization allows authorization to be disabled.", + "disabled": "disabled indicates that authorization should be disabled. By default it will use delegated authorization.", +} + +func (DelegatedAuthorization) SwaggerDoc() map[string]string { + return map_DelegatedAuthorization +} + +var map_EtcdConnectionInfo = map[string]string{ + "": "EtcdConnectionInfo holds information necessary for connecting to an etcd server", + "urls": "URLs are the URLs for etcd", + "ca": "CA is a file containing trusted roots for the etcd server certificates", +} + +func (EtcdConnectionInfo) SwaggerDoc() map[string]string { + return map_EtcdConnectionInfo +} + +var map_EtcdStorageConfig = map[string]string{ + "storagePrefix": "StoragePrefix is the path within etcd that the OpenShift resources will be rooted under. This value, if changed, will mean existing objects in etcd will no longer be located.", +} + +func (EtcdStorageConfig) SwaggerDoc() map[string]string { + return map_EtcdStorageConfig +} + +var map_GenericAPIServerConfig = map[string]string{ + "": "GenericAPIServerConfig is an inline-able struct for aggregated apiservers that need to store data in etcd", + "servingInfo": "ServingInfo describes how to start serving", + "corsAllowedOrigins": "CORSAllowedOrigins", + "auditConfig": "AuditConfig describes how to configure audit information", + "storageConfig": "StorageConfig contains information about how to use", +} + +func (GenericAPIServerConfig) SwaggerDoc() map[string]string { + return map_GenericAPIServerConfig +} + +var map_GenericControllerConfig = map[string]string{ + "": "GenericControllerConfig provides information to configure a controller", + "servingInfo": "ServingInfo is the HTTP serving information for the controller's endpoints", + "leaderElection": "leaderElection provides information to elect a leader. Only override this if you have a specific need", + "authentication": "authentication allows configuration of authentication for the endpoints", + "authorization": "authorization allows configuration of authentication for the endpoints", +} + +func (GenericControllerConfig) SwaggerDoc() map[string]string { + return map_GenericControllerConfig +} + +var map_HTTPServingInfo = map[string]string{ + "": "HTTPServingInfo holds configuration for serving HTTP", + "maxRequestsInFlight": "MaxRequestsInFlight is the number of concurrent requests allowed to the server. If zero, no limit.", + "requestTimeoutSeconds": "RequestTimeoutSeconds is the number of seconds before requests are timed out. The default is 60 minutes, if -1 there is no limit on requests.", +} + +func (HTTPServingInfo) SwaggerDoc() map[string]string { + return map_HTTPServingInfo +} + +var map_KubeClientConfig = map[string]string{ + "kubeConfig": "kubeConfig is a .kubeconfig filename for going to the owning kube-apiserver. Empty uses an in-cluster-config", + "connectionOverrides": "connectionOverrides specifies client overrides for system components to loop back to this master.", +} + +func (KubeClientConfig) SwaggerDoc() map[string]string { + return map_KubeClientConfig +} + +var map_LeaderElection = map[string]string{ + "": "LeaderElection provides information to elect a leader", + "disable": "disable allows leader election to be suspended while allowing a fully defaulted \"normal\" startup case.", + "namespace": "namespace indicates which namespace the resource is in", + "name": "name indicates what name to use for the resource", + "leaseDuration": "leaseDuration is the duration that non-leader candidates will wait after observing a leadership renewal until attempting to acquire leadership of a led but unrenewed leader slot. This is effectively the maximum duration that a leader can be stopped before it is replaced by another candidate. This is only applicable if leader election is enabled.", + "renewDeadline": "renewDeadline is the interval between attempts by the acting master to renew a leadership slot before it stops leading. This must be less than or equal to the lease duration. This is only applicable if leader election is enabled.", + "retryPeriod": "retryPeriod is the duration the clients should wait between attempting acquisition and renewal of a leadership. This is only applicable if leader election is enabled.", +} + +func (LeaderElection) SwaggerDoc() map[string]string { + return map_LeaderElection +} + +var map_NamedCertificate = map[string]string{ + "": "NamedCertificate specifies a certificate/key, and the names it should be served for", + "names": "Names is a list of DNS names this certificate should be used to secure A name can be a normal DNS name, or can contain leading wildcard segments.", +} + +func (NamedCertificate) SwaggerDoc() map[string]string { + return map_NamedCertificate +} + +var map_RemoteConnectionInfo = map[string]string{ + "": "RemoteConnectionInfo holds information necessary for establishing a remote connection", + "url": "URL is the remote URL to connect to", + "ca": "CA is the CA for verifying TLS connections", +} + +func (RemoteConnectionInfo) SwaggerDoc() map[string]string { + return map_RemoteConnectionInfo +} + +var map_ServingInfo = map[string]string{ + "": "ServingInfo holds information about serving web pages", + "bindAddress": "BindAddress is the ip:port to serve on", + "bindNetwork": "BindNetwork is the type of network to bind to - defaults to \"tcp4\", accepts \"tcp\", \"tcp4\", and \"tcp6\"", + "clientCA": "ClientCA is the certificate bundle for all the signers that you'll recognize for incoming client certificates", + "namedCertificates": "NamedCertificates is a list of certificates to use to secure requests to specific hostnames", + "minTLSVersion": "MinTLSVersion is the minimum TLS version supported. Values must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants", + "cipherSuites": "CipherSuites contains an overridden list of ciphers for the server to support. Values must match cipher suite IDs from https://golang.org/pkg/crypto/tls/#pkg-constants", +} + +func (ServingInfo) SwaggerDoc() map[string]string { + return map_ServingInfo +} + +var map_StringSource = map[string]string{ + "": "StringSource allows specifying a string inline, or externally via env var or file. When it contains only a string value, it marshals to a simple JSON string.", +} + +func (StringSource) SwaggerDoc() map[string]string { + return map_StringSource +} + +var map_StringSourceSpec = map[string]string{ + "": "StringSourceSpec specifies a string value, or external location", + "value": "Value specifies the cleartext value, or an encrypted value if keyFile is specified.", + "env": "Env specifies an envvar containing the cleartext value, or an encrypted value if the keyFile is specified.", + "file": "File references a file containing the cleartext value, or an encrypted value if a keyFile is specified.", + "keyFile": "KeyFile references a file containing the key to use to decrypt the value.", +} + +func (StringSourceSpec) SwaggerDoc() map[string]string { + return map_StringSourceSpec +} + +// AUTO-GENERATED FUNCTIONS END HERE diff --git a/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..2e376017cf --- /dev/null +++ b/vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go @@ -0,0 +1,1858 @@ +// +build !ignore_autogenerated + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + core_v1 "k8s.io/api/core/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AdmissionPluginConfig) DeepCopyInto(out *AdmissionPluginConfig) { + *out = *in + in.Configuration.DeepCopyInto(&out.Configuration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdmissionPluginConfig. +func (in *AdmissionPluginConfig) DeepCopy() *AdmissionPluginConfig { + if in == nil { + return nil + } + out := new(AdmissionPluginConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuditConfig) DeepCopyInto(out *AuditConfig) { + *out = *in + in.PolicyConfiguration.DeepCopyInto(&out.PolicyConfiguration) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditConfig. +func (in *AuditConfig) DeepCopy() *AuditConfig { + if in == nil { + return nil + } + out := new(AuditConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Authentication) DeepCopyInto(out *Authentication) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authentication. +func (in *Authentication) DeepCopy() *Authentication { + if in == nil { + return nil + } + out := new(Authentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Authentication) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationList) DeepCopyInto(out *AuthenticationList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Authentication, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationList. +func (in *AuthenticationList) DeepCopy() *AuthenticationList { + if in == nil { + return nil + } + out := new(AuthenticationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AuthenticationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationSpec) DeepCopyInto(out *AuthenticationSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationSpec. +func (in *AuthenticationSpec) DeepCopy() *AuthenticationSpec { + if in == nil { + return nil + } + out := new(AuthenticationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuthenticationStatus) DeepCopyInto(out *AuthenticationStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationStatus. +func (in *AuthenticationStatus) DeepCopy() *AuthenticationStatus { + if in == nil { + return nil + } + out := new(AuthenticationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Build) DeepCopyInto(out *Build) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Build. +func (in *Build) DeepCopy() *Build { + if in == nil { + return nil + } + out := new(Build) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Build) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildDefaults) DeepCopyInto(out *BuildDefaults) { + *out = *in + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]core_v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ImageLabels != nil { + in, out := &in.ImageLabels, &out.ImageLabels + *out = make([]ImageLabel, len(*in)) + copy(*out, *in) + } + in.Resources.DeepCopyInto(&out.Resources) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildDefaults. +func (in *BuildDefaults) DeepCopy() *BuildDefaults { + if in == nil { + return nil + } + out := new(BuildDefaults) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildList) DeepCopyInto(out *BuildList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Build, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildList. +func (in *BuildList) DeepCopy() *BuildList { + if in == nil { + return nil + } + out := new(BuildList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BuildList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildOverrides) DeepCopyInto(out *BuildOverrides) { + *out = *in + if in.ImageLabels != nil { + in, out := &in.ImageLabels, &out.ImageLabels + *out = make([]ImageLabel, len(*in)) + copy(*out, *in) + } + in.NodeSelector.DeepCopyInto(&out.NodeSelector) + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]core_v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildOverrides. +func (in *BuildOverrides) DeepCopy() *BuildOverrides { + if in == nil { + return nil + } + out := new(BuildOverrides) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildSpec) DeepCopyInto(out *BuildSpec) { + *out = *in + out.AdditionalTrustedCA = in.AdditionalTrustedCA + in.BuildDefaults.DeepCopyInto(&out.BuildDefaults) + in.BuildOverrides.DeepCopyInto(&out.BuildOverrides) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildSpec. +func (in *BuildSpec) DeepCopy() *BuildSpec { + if in == nil { + return nil + } + out := new(BuildSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertInfo) DeepCopyInto(out *CertInfo) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertInfo. +func (in *CertInfo) DeepCopy() *CertInfo { + if in == nil { + return nil + } + out := new(CertInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClientConnectionOverrides) DeepCopyInto(out *ClientConnectionOverrides) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientConnectionOverrides. +func (in *ClientConnectionOverrides) DeepCopy() *ClientConnectionOverrides { + if in == nil { + return nil + } + out := new(ClientConnectionOverrides) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperator) DeepCopyInto(out *ClusterOperator) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperator. +func (in *ClusterOperator) DeepCopy() *ClusterOperator { + if in == nil { + return nil + } + out := new(ClusterOperator) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterOperator) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperatorList) DeepCopyInto(out *ClusterOperatorList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterOperator, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorList. +func (in *ClusterOperatorList) DeepCopy() *ClusterOperatorList { + if in == nil { + return nil + } + out := new(ClusterOperatorList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterOperatorList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperatorSpec) DeepCopyInto(out *ClusterOperatorSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorSpec. +func (in *ClusterOperatorSpec) DeepCopy() *ClusterOperatorSpec { + if in == nil { + return nil + } + out := new(ClusterOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperatorStatus) DeepCopyInto(out *ClusterOperatorStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ClusterOperatorStatusCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Extension.DeepCopyInto(&out.Extension) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorStatus. +func (in *ClusterOperatorStatus) DeepCopy() *ClusterOperatorStatus { + if in == nil { + return nil + } + out := new(ClusterOperatorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterOperatorStatusCondition) DeepCopyInto(out *ClusterOperatorStatusCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorStatusCondition. +func (in *ClusterOperatorStatusCondition) DeepCopy() *ClusterOperatorStatusCondition { + if in == nil { + return nil + } + out := new(ClusterOperatorStatusCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVersion) DeepCopyInto(out *ClusterVersion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersion. +func (in *ClusterVersion) DeepCopy() *ClusterVersion { + if in == nil { + return nil + } + out := new(ClusterVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVersionList) DeepCopyInto(out *ClusterVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionList. +func (in *ClusterVersionList) DeepCopy() *ClusterVersionList { + if in == nil { + return nil + } + out := new(ClusterVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVersionSpec) DeepCopyInto(out *ClusterVersionSpec) { + *out = *in + if in.DesiredUpdate != nil { + in, out := &in.DesiredUpdate, &out.DesiredUpdate + if *in == nil { + *out = nil + } else { + *out = new(Update) + **out = **in + } + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ComponentOverride, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionSpec. +func (in *ClusterVersionSpec) DeepCopy() *ClusterVersionSpec { + if in == nil { + return nil + } + out := new(ClusterVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVersionStatus) DeepCopyInto(out *ClusterVersionStatus) { + *out = *in + out.Current = in.Current + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ClusterOperatorStatusCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AvailableUpdates != nil { + in, out := &in.AvailableUpdates, &out.AvailableUpdates + *out = make([]Update, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionStatus. +func (in *ClusterVersionStatus) DeepCopy() *ClusterVersionStatus { + if in == nil { + return nil + } + out := new(ClusterVersionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComponentOverride) DeepCopyInto(out *ComponentOverride) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentOverride. +func (in *ComponentOverride) DeepCopy() *ComponentOverride { + if in == nil { + return nil + } + out := new(ComponentOverride) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapReference) DeepCopyInto(out *ConfigMapReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapReference. +func (in *ConfigMapReference) DeepCopy() *ConfigMapReference { + if in == nil { + return nil + } + out := new(ConfigMapReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Console) DeepCopyInto(out *Console) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Console. +func (in *Console) DeepCopy() *Console { + if in == nil { + return nil + } + out := new(Console) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Console) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsoleList) DeepCopyInto(out *ConsoleList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Console, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsoleList. +func (in *ConsoleList) DeepCopy() *ConsoleList { + if in == nil { + return nil + } + out := new(ConsoleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConsoleList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsoleSpec) DeepCopyInto(out *ConsoleSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsoleSpec. +func (in *ConsoleSpec) DeepCopy() *ConsoleSpec { + if in == nil { + return nil + } + out := new(ConsoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsoleStatus) DeepCopyInto(out *ConsoleStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsoleStatus. +func (in *ConsoleStatus) DeepCopy() *ConsoleStatus { + if in == nil { + return nil + } + out := new(ConsoleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNS) DeepCopyInto(out *DNS) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNS. +func (in *DNS) DeepCopy() *DNS { + if in == nil { + return nil + } + out := new(DNS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNS) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSList) DeepCopyInto(out *DNSList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DNS, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSList. +func (in *DNSList) DeepCopy() *DNSList { + if in == nil { + return nil + } + out := new(DNSList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DNSList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSSpec) DeepCopyInto(out *DNSSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSSpec. +func (in *DNSSpec) DeepCopy() *DNSSpec { + if in == nil { + return nil + } + out := new(DNSSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSStatus) DeepCopyInto(out *DNSStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSStatus. +func (in *DNSStatus) DeepCopy() *DNSStatus { + if in == nil { + return nil + } + out := new(DNSStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DelegatedAuthentication) DeepCopyInto(out *DelegatedAuthentication) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DelegatedAuthentication. +func (in *DelegatedAuthentication) DeepCopy() *DelegatedAuthentication { + if in == nil { + return nil + } + out := new(DelegatedAuthentication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DelegatedAuthorization) DeepCopyInto(out *DelegatedAuthorization) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DelegatedAuthorization. +func (in *DelegatedAuthorization) DeepCopy() *DelegatedAuthorization { + if in == nil { + return nil + } + out := new(DelegatedAuthorization) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdConnectionInfo) DeepCopyInto(out *EtcdConnectionInfo) { + *out = *in + if in.URLs != nil { + in, out := &in.URLs, &out.URLs + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.CertInfo = in.CertInfo + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdConnectionInfo. +func (in *EtcdConnectionInfo) DeepCopy() *EtcdConnectionInfo { + if in == nil { + return nil + } + out := new(EtcdConnectionInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EtcdStorageConfig) DeepCopyInto(out *EtcdStorageConfig) { + *out = *in + in.EtcdConnectionInfo.DeepCopyInto(&out.EtcdConnectionInfo) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EtcdStorageConfig. +func (in *EtcdStorageConfig) DeepCopy() *EtcdStorageConfig { + if in == nil { + return nil + } + out := new(EtcdStorageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GenericAPIServerConfig) DeepCopyInto(out *GenericAPIServerConfig) { + *out = *in + in.ServingInfo.DeepCopyInto(&out.ServingInfo) + if in.CORSAllowedOrigins != nil { + in, out := &in.CORSAllowedOrigins, &out.CORSAllowedOrigins + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.AuditConfig.DeepCopyInto(&out.AuditConfig) + in.StorageConfig.DeepCopyInto(&out.StorageConfig) + if in.AdmissionPluginConfig != nil { + in, out := &in.AdmissionPluginConfig, &out.AdmissionPluginConfig + *out = make(map[string]AdmissionPluginConfig, len(*in)) + for key, val := range *in { + newVal := new(AdmissionPluginConfig) + val.DeepCopyInto(newVal) + (*out)[key] = *newVal + } + } + out.KubeClientConfig = in.KubeClientConfig + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericAPIServerConfig. +func (in *GenericAPIServerConfig) DeepCopy() *GenericAPIServerConfig { + if in == nil { + return nil + } + out := new(GenericAPIServerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GenericControllerConfig) DeepCopyInto(out *GenericControllerConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ServingInfo.DeepCopyInto(&out.ServingInfo) + out.LeaderElection = in.LeaderElection + out.Authentication = in.Authentication + out.Authorization = in.Authorization + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericControllerConfig. +func (in *GenericControllerConfig) DeepCopy() *GenericControllerConfig { + if in == nil { + return nil + } + out := new(GenericControllerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GenericControllerConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPServingInfo) DeepCopyInto(out *HTTPServingInfo) { + *out = *in + in.ServingInfo.DeepCopyInto(&out.ServingInfo) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPServingInfo. +func (in *HTTPServingInfo) DeepCopy() *HTTPServingInfo { + if in == nil { + return nil + } + out := new(HTTPServingInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProvider) DeepCopyInto(out *IdentityProvider) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProvider. +func (in *IdentityProvider) DeepCopy() *IdentityProvider { + if in == nil { + return nil + } + out := new(IdentityProvider) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IdentityProvider) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProviderList) DeepCopyInto(out *IdentityProviderList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IdentityProvider, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProviderList. +func (in *IdentityProviderList) DeepCopy() *IdentityProviderList { + if in == nil { + return nil + } + out := new(IdentityProviderList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IdentityProviderList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProviderSpec) DeepCopyInto(out *IdentityProviderSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProviderSpec. +func (in *IdentityProviderSpec) DeepCopy() *IdentityProviderSpec { + if in == nil { + return nil + } + out := new(IdentityProviderSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProviderStatus) DeepCopyInto(out *IdentityProviderStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProviderStatus. +func (in *IdentityProviderStatus) DeepCopy() *IdentityProviderStatus { + if in == nil { + return nil + } + out := new(IdentityProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Image) DeepCopyInto(out *Image) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Image. +func (in *Image) DeepCopy() *Image { + if in == nil { + return nil + } + out := new(Image) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Image) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageLabel) DeepCopyInto(out *ImageLabel) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageLabel. +func (in *ImageLabel) DeepCopy() *ImageLabel { + if in == nil { + return nil + } + out := new(ImageLabel) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageList) DeepCopyInto(out *ImageList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Image, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageList. +func (in *ImageList) DeepCopy() *ImageList { + if in == nil { + return nil + } + out := new(ImageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ImageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageSpec) DeepCopyInto(out *ImageSpec) { + *out = *in + if in.AllowedRegistriesForImport != nil { + in, out := &in.AllowedRegistriesForImport, &out.AllowedRegistriesForImport + *out = make([]RegistryLocation, len(*in)) + copy(*out, *in) + } + if in.ExternalRegistryHostnames != nil { + in, out := &in.ExternalRegistryHostnames, &out.ExternalRegistryHostnames + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.AdditionalTrustedCA = in.AdditionalTrustedCA + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageSpec. +func (in *ImageSpec) DeepCopy() *ImageSpec { + if in == nil { + return nil + } + out := new(ImageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ImageStatus) DeepCopyInto(out *ImageStatus) { + *out = *in + if in.ExternalRegistryHostnames != nil { + in, out := &in.ExternalRegistryHostnames, &out.ExternalRegistryHostnames + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageStatus. +func (in *ImageStatus) DeepCopy() *ImageStatus { + if in == nil { + return nil + } + out := new(ImageStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Infrastructure) DeepCopyInto(out *Infrastructure) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Infrastructure. +func (in *Infrastructure) DeepCopy() *Infrastructure { + if in == nil { + return nil + } + out := new(Infrastructure) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Infrastructure) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureList) DeepCopyInto(out *InfrastructureList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Infrastructure, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureList. +func (in *InfrastructureList) DeepCopy() *InfrastructureList { + if in == nil { + return nil + } + out := new(InfrastructureList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InfrastructureList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureSpec) DeepCopyInto(out *InfrastructureSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureSpec. +func (in *InfrastructureSpec) DeepCopy() *InfrastructureSpec { + if in == nil { + return nil + } + out := new(InfrastructureSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureStatus) DeepCopyInto(out *InfrastructureStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureStatus. +func (in *InfrastructureStatus) DeepCopy() *InfrastructureStatus { + if in == nil { + return nil + } + out := new(InfrastructureStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Ingress) DeepCopyInto(out *Ingress) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ingress. +func (in *Ingress) DeepCopy() *Ingress { + if in == nil { + return nil + } + out := new(Ingress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Ingress) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressList) DeepCopyInto(out *IngressList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Ingress, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressList. +func (in *IngressList) DeepCopy() *IngressList { + if in == nil { + return nil + } + out := new(IngressList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IngressList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressSpec) DeepCopyInto(out *IngressSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressSpec. +func (in *IngressSpec) DeepCopy() *IngressSpec { + if in == nil { + return nil + } + out := new(IngressSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressStatus) DeepCopyInto(out *IngressStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressStatus. +func (in *IngressStatus) DeepCopy() *IngressStatus { + if in == nil { + return nil + } + out := new(IngressStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubeClientConfig) DeepCopyInto(out *KubeClientConfig) { + *out = *in + out.ConnectionOverrides = in.ConnectionOverrides + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeClientConfig. +func (in *KubeClientConfig) DeepCopy() *KubeClientConfig { + if in == nil { + return nil + } + out := new(KubeClientConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LeaderElection) DeepCopyInto(out *LeaderElection) { + *out = *in + out.LeaseDuration = in.LeaseDuration + out.RenewDeadline = in.RenewDeadline + out.RetryPeriod = in.RetryPeriod + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaderElection. +func (in *LeaderElection) DeepCopy() *LeaderElection { + if in == nil { + return nil + } + out := new(LeaderElection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamedCertificate) DeepCopyInto(out *NamedCertificate) { + *out = *in + if in.Names != nil { + in, out := &in.Names, &out.Names + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.CertInfo = in.CertInfo + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedCertificate. +func (in *NamedCertificate) DeepCopy() *NamedCertificate { + if in == nil { + return nil + } + out := new(NamedCertificate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Network) DeepCopyInto(out *Network) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. +func (in *Network) DeepCopy() *Network { + if in == nil { + return nil + } + out := new(Network) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Network) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkList) DeepCopyInto(out *NetworkList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Network, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkList. +func (in *NetworkList) DeepCopy() *NetworkList { + if in == nil { + return nil + } + out := new(NetworkList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OAuth) DeepCopyInto(out *OAuth) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuth. +func (in *OAuth) DeepCopy() *OAuth { + if in == nil { + return nil + } + out := new(OAuth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OAuth) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OAuthList) DeepCopyInto(out *OAuthList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OAuth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuthList. +func (in *OAuthList) DeepCopy() *OAuthList { + if in == nil { + return nil + } + out := new(OAuthList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OAuthList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OAuthSpec) DeepCopyInto(out *OAuthSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuthSpec. +func (in *OAuthSpec) DeepCopy() *OAuthSpec { + if in == nil { + return nil + } + out := new(OAuthSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OAuthStatus) DeepCopyInto(out *OAuthStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAuthStatus. +func (in *OAuthStatus) DeepCopy() *OAuthStatus { + if in == nil { + return nil + } + out := new(OAuthStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Project) DeepCopyInto(out *Project) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Project. +func (in *Project) DeepCopy() *Project { + if in == nil { + return nil + } + out := new(Project) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Project) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectList) DeepCopyInto(out *ProjectList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Project, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectList. +func (in *ProjectList) DeepCopy() *ProjectList { + if in == nil { + return nil + } + out := new(ProjectList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProjectList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectSpec. +func (in *ProjectSpec) DeepCopy() *ProjectSpec { + if in == nil { + return nil + } + out := new(ProjectSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectStatus) DeepCopyInto(out *ProjectStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectStatus. +func (in *ProjectStatus) DeepCopy() *ProjectStatus { + if in == nil { + return nil + } + out := new(ProjectStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistryLocation) DeepCopyInto(out *RegistryLocation) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryLocation. +func (in *RegistryLocation) DeepCopy() *RegistryLocation { + if in == nil { + return nil + } + out := new(RegistryLocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RemoteConnectionInfo) DeepCopyInto(out *RemoteConnectionInfo) { + *out = *in + out.CertInfo = in.CertInfo + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteConnectionInfo. +func (in *RemoteConnectionInfo) DeepCopy() *RemoteConnectionInfo { + if in == nil { + return nil + } + out := new(RemoteConnectionInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Scheduling) DeepCopyInto(out *Scheduling) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduling. +func (in *Scheduling) DeepCopy() *Scheduling { + if in == nil { + return nil + } + out := new(Scheduling) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Scheduling) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchedulingList) DeepCopyInto(out *SchedulingList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Scheduling, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingList. +func (in *SchedulingList) DeepCopy() *SchedulingList { + if in == nil { + return nil + } + out := new(SchedulingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SchedulingList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchedulingSpec) DeepCopyInto(out *SchedulingSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingSpec. +func (in *SchedulingSpec) DeepCopy() *SchedulingSpec { + if in == nil { + return nil + } + out := new(SchedulingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SchedulingStatus) DeepCopyInto(out *SchedulingStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulingStatus. +func (in *SchedulingStatus) DeepCopy() *SchedulingStatus { + if in == nil { + return nil + } + out := new(SchedulingStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServingInfo) DeepCopyInto(out *ServingInfo) { + *out = *in + out.CertInfo = in.CertInfo + if in.NamedCertificates != nil { + in, out := &in.NamedCertificates, &out.NamedCertificates + *out = make([]NamedCertificate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CipherSuites != nil { + in, out := &in.CipherSuites, &out.CipherSuites + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServingInfo. +func (in *ServingInfo) DeepCopy() *ServingInfo { + if in == nil { + return nil + } + out := new(ServingInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StringSource) DeepCopyInto(out *StringSource) { + *out = *in + out.StringSourceSpec = in.StringSourceSpec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringSource. +func (in *StringSource) DeepCopy() *StringSource { + if in == nil { + return nil + } + out := new(StringSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StringSourceSpec) DeepCopyInto(out *StringSourceSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringSourceSpec. +func (in *StringSourceSpec) DeepCopy() *StringSourceSpec { + if in == nil { + return nil + } + out := new(StringSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Update) DeepCopyInto(out *Update) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Update. +func (in *Update) DeepCopy() *Update { + if in == nil { + return nil + } + out := new(Update) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/openshift/api/image/docker10/dockertypes.go b/vendor/github.com/openshift/api/image/docker10/dockertypes.go index a26a0f2b53..a985553db4 100644 --- a/vendor/github.com/openshift/api/image/docker10/dockertypes.go +++ b/vendor/github.com/openshift/api/image/docker10/dockertypes.go @@ -6,7 +6,7 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// DockerImage is the type representing a docker image and its various properties when +// DockerImage is the type representing a container image and its various properties when // retrieved from the Docker client API. type DockerImage struct { metav1.TypeMeta `json:",inline"` diff --git a/vendor/github.com/openshift/api/image/dockerpre012/dockertypes.go b/vendor/github.com/openshift/api/image/dockerpre012/dockertypes.go index fdc090bb19..685e0b68c5 100644 --- a/vendor/github.com/openshift/api/image/dockerpre012/dockertypes.go +++ b/vendor/github.com/openshift/api/image/dockerpre012/dockertypes.go @@ -9,7 +9,7 @@ import ( // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DockerImage is for earlier versions of the Docker API (pre-012 to be specific). It is also the -// version of metadata that the Docker registry uses to persist metadata. +// version of metadata that the container image registry uses to persist metadata. type DockerImage struct { metav1.TypeMeta `json:",inline"` diff --git a/vendor/github.com/openshift/api/image/v1/types.go b/vendor/github.com/openshift/api/image/v1/types.go index 8084558521..90b70f4670 100644 --- a/vendor/github.com/openshift/api/image/v1/types.go +++ b/vendor/github.com/openshift/api/image/v1/types.go @@ -43,7 +43,7 @@ type ImageList struct { // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// Image is an immutable representation of a Docker image and metadata at a point in time. +// Image is an immutable representation of a container image and metadata at a point in time. type Image struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. @@ -184,7 +184,7 @@ type ImageStreamList struct { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ImageStream stores a mapping of tags to images, metadata overrides that are applied -// when images are tagged in a stream, and an optional reference to a Docker image +// when images are tagged in a stream, and an optional reference to a container image // repository on a registry. type ImageStream struct { metav1.TypeMeta `json:",inline"` @@ -201,7 +201,7 @@ type ImageStream struct { type ImageStreamSpec struct { // lookupPolicy controls how other resources reference images within this namespace. LookupPolicy ImageLookupPolicy `json:"lookupPolicy,omitempty" protobuf:"bytes,3,opt,name=lookupPolicy"` - // dockerImageRepository is optional, if specified this stream is backed by a Docker repository on this server + // dockerImageRepository is optional, if specified this stream is backed by a container repository on this server // Deprecated: This field is deprecated as of v3.7 and will be removed in a future release. // Specify the source for the tags to be imported in each tag via the spec.tags.from reference instead. DockerImageRepository string `json:"dockerImageRepository,omitempty" protobuf:"bytes,1,opt,name=dockerImageRepository"` @@ -280,7 +280,7 @@ type TagReferencePolicy struct { // Type determines how the image pull spec should be transformed when the image stream tag is used in // deployment config triggers or new builds. The default value is `Source`, indicating the original // location of the image should be used (if imported). The user may also specify `Local`, indicating - // that the pull spec should point to the integrated Docker registry and leverage the registry's + // that the pull spec should point to the integrated container image registry and leverage the registry's // ability to proxy the pull to an upstream registry. `Local` allows the credentials used to pull this // image to be managed from the image stream's namespace, so others on the platform can access a remote // image but have no access to the remote secret. It also allows the image layers to be mirrored into @@ -355,14 +355,14 @@ type TagEventCondition struct { // +genclient:method=Create,verb=create,result=k8s.io/apimachinery/pkg/apis/meta/v1.Status // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// ImageStreamMapping represents a mapping from a single tag to a Docker image as -// well as the reference to the Docker image stream the image came from. +// ImageStreamMapping represents a mapping from a single tag to a container image as +// well as the reference to the container image stream the image came from. type ImageStreamMapping struct { metav1.TypeMeta `json:",inline"` // Standard object's metadata. metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - // Image is a Docker image. + // Image is a container image. Image Image `json:"image" protobuf:"bytes,2,opt,name=image"` // Tag is a string value this image can be located with inside the stream. Tag string `json:"tag" protobuf:"bytes,3,opt,name=tag"` @@ -425,17 +425,17 @@ type ImageStreamImage struct { Image Image `json:"image" protobuf:"bytes,2,opt,name=image"` } -// DockerImageReference points to a Docker image. +// DockerImageReference points to a container image. type DockerImageReference struct { - // Registry is the registry that contains the Docker image + // Registry is the registry that contains the container image Registry string `protobuf:"bytes,1,opt,name=registry"` - // Namespace is the namespace that contains the Docker image + // Namespace is the namespace that contains the container image Namespace string `protobuf:"bytes,2,opt,name=namespace"` - // Name is the name of the Docker image + // Name is the name of the container image Name string `protobuf:"bytes,3,opt,name=name"` - // Tag is which tag of the Docker image is being referenced + // Tag is which tag of the container image is being referenced Tag string `protobuf:"bytes,4,opt,name=tag"` - // ID is the identifier for the Docker image + // ID is the identifier for the container image ID string `protobuf:"bytes,5,opt,name=iD"` } @@ -486,8 +486,8 @@ type ImageLayerData struct { // +genclient:onlyVerbs=create // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// The image stream import resource provides an easy way for a user to find and import Docker images -// from other Docker registries into the server. Individual images or an entire image repository may +// The image stream import resource provides an easy way for a user to find and import container images +// from other container image registries into the server. Individual images or an entire image repository may // be imported, and users may choose to see the results of the import prior to tagging the resulting // images into the specified image stream. // @@ -510,7 +510,7 @@ type ImageStreamImportSpec struct { // Import indicates whether to perform an import - if so, the specified tags are set on the spec // and status of the image stream defined by the type meta. Import bool `json:"import" protobuf:"varint,1,opt,name=import"` - // Repository is an optional import of an entire Docker image repository. A maximum limit on the + // Repository is an optional import of an entire container image repository. A maximum limit on the // number of tags imported this way is imposed by the server. Repository *RepositoryImportSpec `json:"repository,omitempty" protobuf:"bytes,2,opt,name=repository"` // Images are a list of individual images to import. @@ -527,9 +527,9 @@ type ImageStreamImportStatus struct { Images []ImageImportStatus `json:"images,omitempty" protobuf:"bytes,3,rep,name=images"` } -// RepositoryImportSpec describes a request to import images from a Docker image repository. +// RepositoryImportSpec describes a request to import images from a container image repository. type RepositoryImportSpec struct { - // From is the source for the image repository to import; only kind DockerImage and a name of a Docker image repository is allowed + // From is the source for the image repository to import; only kind DockerImage and a name of a container image repository is allowed From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` // ImportPolicy is the policy controlling how the image is imported diff --git a/vendor/github.com/openshift/api/image/v1/types_swagger_doc_generated.go b/vendor/github.com/openshift/api/image/v1/types_swagger_doc_generated.go index 09a971757e..aa779c8518 100644 --- a/vendor/github.com/openshift/api/image/v1/types_swagger_doc_generated.go +++ b/vendor/github.com/openshift/api/image/v1/types_swagger_doc_generated.go @@ -12,12 +12,12 @@ package v1 // AUTO-GENERATED FUNCTIONS START HERE var map_DockerImageReference = map[string]string{ - "": "DockerImageReference points to a Docker image.", - "Registry": "Registry is the registry that contains the Docker image", - "Namespace": "Namespace is the namespace that contains the Docker image", - "Name": "Name is the name of the Docker image", - "Tag": "Tag is which tag of the Docker image is being referenced", - "ID": "ID is the identifier for the Docker image", + "": "DockerImageReference points to a container image.", + "Registry": "Registry is the registry that contains the container image", + "Namespace": "Namespace is the namespace that contains the container image", + "Name": "Name is the name of the container image", + "Tag": "Tag is which tag of the container image is being referenced", + "ID": "ID is the identifier for the container image", } func (DockerImageReference) SwaggerDoc() map[string]string { @@ -25,7 +25,7 @@ func (DockerImageReference) SwaggerDoc() map[string]string { } var map_Image = map[string]string{ - "": "Image is an immutable representation of a Docker image and metadata at a point in time.", + "": "Image is an immutable representation of a container image and metadata at a point in time.", "metadata": "Standard object's metadata.", "dockerImageReference": "DockerImageReference is the string that can be used to pull this image.", "dockerImageMetadata": "DockerImageMetadata contains metadata about this image", @@ -135,7 +135,7 @@ func (ImageSignature) SwaggerDoc() map[string]string { } var map_ImageStream = map[string]string{ - "": "ImageStream stores a mapping of tags to images, metadata overrides that are applied when images are tagged in a stream, and an optional reference to a Docker image repository on a registry.", + "": "ImageStream stores a mapping of tags to images, metadata overrides that are applied when images are tagged in a stream, and an optional reference to a container image repository on a registry.", "metadata": "Standard object's metadata.", "spec": "Spec describes the desired state of this stream", "status": "Status describes the current state of this stream", @@ -156,7 +156,7 @@ func (ImageStreamImage) SwaggerDoc() map[string]string { } var map_ImageStreamImport = map[string]string{ - "": "The image stream import resource provides an easy way for a user to find and import Docker images from other Docker registries into the server. Individual images or an entire image repository may be imported, and users may choose to see the results of the import prior to tagging the resulting images into the specified image stream.\n\nThis API is intended for end-user tools that need to see the metadata of the image prior to import (for instance, to generate an application from it). Clients that know the desired image can continue to create spec.tags directly into their image streams.", + "": "The image stream import resource provides an easy way for a user to find and import container images from other container image registries into the server. Individual images or an entire image repository may be imported, and users may choose to see the results of the import prior to tagging the resulting images into the specified image stream.\n\nThis API is intended for end-user tools that need to see the metadata of the image prior to import (for instance, to generate an application from it). Clients that know the desired image can continue to create spec.tags directly into their image streams.", "metadata": "Standard object's metadata.", "spec": "Spec is a description of the images that the user wishes to import", "status": "Status is the the result of importing the image", @@ -169,7 +169,7 @@ func (ImageStreamImport) SwaggerDoc() map[string]string { var map_ImageStreamImportSpec = map[string]string{ "": "ImageStreamImportSpec defines what images should be imported.", "import": "Import indicates whether to perform an import - if so, the specified tags are set on the spec and status of the image stream defined by the type meta.", - "repository": "Repository is an optional import of an entire Docker image repository. A maximum limit on the number of tags imported this way is imposed by the server.", + "repository": "Repository is an optional import of an entire container image repository. A maximum limit on the number of tags imported this way is imposed by the server.", "images": "Images are a list of individual images to import.", } @@ -210,9 +210,9 @@ func (ImageStreamList) SwaggerDoc() map[string]string { } var map_ImageStreamMapping = map[string]string{ - "": "ImageStreamMapping represents a mapping from a single tag to a Docker image as well as the reference to the Docker image stream the image came from.", + "": "ImageStreamMapping represents a mapping from a single tag to a container image as well as the reference to the container image stream the image came from.", "metadata": "Standard object's metadata.", - "image": "Image is a Docker image.", + "image": "Image is a container image.", "tag": "Tag is a string value this image can be located with inside the stream.", } @@ -223,7 +223,7 @@ func (ImageStreamMapping) SwaggerDoc() map[string]string { var map_ImageStreamSpec = map[string]string{ "": "ImageStreamSpec represents options for ImageStreams.", "lookupPolicy": "lookupPolicy controls how other resources reference images within this namespace.", - "dockerImageRepository": "dockerImageRepository is optional, if specified this stream is backed by a Docker repository on this server Deprecated: This field is deprecated as of v3.7 and will be removed in a future release. Specify the source for the tags to be imported in each tag via the spec.tags.from reference instead.", + "dockerImageRepository": "dockerImageRepository is optional, if specified this stream is backed by a container repository on this server Deprecated: This field is deprecated as of v3.7 and will be removed in a future release. Specify the source for the tags to be imported in each tag via the spec.tags.from reference instead.", "tags": "tags map arbitrary string values to specific image locators", } @@ -278,8 +278,8 @@ func (NamedTagEventList) SwaggerDoc() map[string]string { } var map_RepositoryImportSpec = map[string]string{ - "": "RepositoryImportSpec describes a request to import images from a Docker image repository.", - "from": "From is the source for the image repository to import; only kind DockerImage and a name of a Docker image repository is allowed", + "": "RepositoryImportSpec describes a request to import images from a container image repository.", + "from": "From is the source for the image repository to import; only kind DockerImage and a name of a container image repository is allowed", "importPolicy": "ImportPolicy is the policy controlling how the image is imported", "referencePolicy": "ReferencePolicy defines how other components should consume the image", "includeManifest": "IncludeManifest determines if the manifest for each image is returned in the response", @@ -394,7 +394,7 @@ func (TagReference) SwaggerDoc() map[string]string { var map_TagReferencePolicy = map[string]string{ "": "TagReferencePolicy describes how pull-specs for images in this image stream tag are generated when image change triggers in deployment configs or builds are resolved. This allows the image stream author to control how images are accessed.", - "type": "Type determines how the image pull spec should be transformed when the image stream tag is used in deployment config triggers or new builds. The default value is `Source`, indicating the original location of the image should be used (if imported). The user may also specify `Local`, indicating that the pull spec should point to the integrated Docker registry and leverage the registry's ability to proxy the pull to an upstream registry. `Local` allows the credentials used to pull this image to be managed from the image stream's namespace, so others on the platform can access a remote image but have no access to the remote secret. It also allows the image layers to be mirrored into the local registry which the images can still be pulled even if the upstream registry is unavailable.", + "type": "Type determines how the image pull spec should be transformed when the image stream tag is used in deployment config triggers or new builds. The default value is `Source`, indicating the original location of the image should be used (if imported). The user may also specify `Local`, indicating that the pull spec should point to the integrated container image registry and leverage the registry's ability to proxy the pull to an upstream registry. `Local` allows the credentials used to pull this image to be managed from the image stream's namespace, so others on the platform can access a remote image but have no access to the remote secret. It also allows the image layers to be mirrored into the local registry which the images can still be pulled even if the upstream registry is unavailable.", } func (TagReferencePolicy) SwaggerDoc() map[string]string { diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go new file mode 100644 index 0000000000..6dbad4fc2a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/clientset.go @@ -0,0 +1,82 @@ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ConfigV1() configv1.ConfigV1Interface + // Deprecated: please explicitly pick a version if possible. + Config() configv1.ConfigV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + configV1 *configv1.ConfigV1Client +} + +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return c.configV1 +} + +// Deprecated: Config retrieves the default version of ConfigClient. +// Please explicitly pick a version. +func (c *Clientset) Config() configv1.ConfigV1Interface { + return c.configV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.configV1, err = configv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.configV1 = configv1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.configV1 = configv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go new file mode 100644 index 0000000000..0e0c2a8900 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..8e64843f81 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,66 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/openshift/client-go/config/clientset/versioned" + configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + fakeconfigv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +var _ clientset.Interface = &Clientset{} + +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} +} + +// Config retrieves the ConfigV1Client +func (c *Clientset) Config() configv1.ConfigV1Interface { + return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..3630ed1cd1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..65d7c8494c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/fake/register.go @@ -0,0 +1,38 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) +var parameterCodec = runtime.NewParameterCodec(scheme) + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + configv1.AddToScheme(scheme) +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..14db57a58f --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..f07ab02de5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/scheme/register.go @@ -0,0 +1,38 @@ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + configv1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(Scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + configv1.AddToScheme(scheme) +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go new file mode 100644 index 0000000000..6556ba43fd --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/authentication.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// AuthenticationsGetter has a method to return a AuthenticationInterface. +// A group's client should implement this interface. +type AuthenticationsGetter interface { + Authentications() AuthenticationInterface +} + +// AuthenticationInterface has methods to work with Authentication resources. +type AuthenticationInterface interface { + Create(*v1.Authentication) (*v1.Authentication, error) + Update(*v1.Authentication) (*v1.Authentication, error) + UpdateStatus(*v1.Authentication) (*v1.Authentication, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Authentication, error) + List(opts meta_v1.ListOptions) (*v1.AuthenticationList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Authentication, err error) + AuthenticationExpansion +} + +// authentications implements AuthenticationInterface +type authentications struct { + client rest.Interface +} + +// newAuthentications returns a Authentications +func newAuthentications(c *ConfigV1Client) *authentications { + return &authentications{ + client: c.RESTClient(), + } +} + +// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any. +func (c *authentications) Get(name string, options meta_v1.GetOptions) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Get(). + Resource("authentications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Authentications that match those selectors. +func (c *authentications) List(opts meta_v1.ListOptions) (result *v1.AuthenticationList, err error) { + result = &v1.AuthenticationList{} + err = c.client.Get(). + Resource("authentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authentications. +func (c *authentications) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("authentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *authentications) Create(authentication *v1.Authentication) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Post(). + Resource("authentications"). + Body(authentication). + Do(). + Into(result) + return +} + +// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *authentications) Update(authentication *v1.Authentication) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Put(). + Resource("authentications"). + Name(authentication.Name). + Body(authentication). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *authentications) UpdateStatus(authentication *v1.Authentication) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Put(). + Resource("authentications"). + Name(authentication.Name). + SubResource("status"). + Body(authentication). + Do(). + Into(result) + return +} + +// Delete takes name of the authentication and deletes it. Returns an error if one occurs. +func (c *authentications) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("authentications"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authentications) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("authentications"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched authentication. +func (c *authentications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Authentication, err error) { + result = &v1.Authentication{} + err = c.client.Patch(pt). + Resource("authentications"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go new file mode 100644 index 0000000000..e70c1a5f8b --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/build.go @@ -0,0 +1,131 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// BuildsGetter has a method to return a BuildInterface. +// A group's client should implement this interface. +type BuildsGetter interface { + Builds() BuildInterface +} + +// BuildInterface has methods to work with Build resources. +type BuildInterface interface { + Create(*v1.Build) (*v1.Build, error) + Update(*v1.Build) (*v1.Build, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Build, error) + List(opts meta_v1.ListOptions) (*v1.BuildList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Build, err error) + BuildExpansion +} + +// builds implements BuildInterface +type builds struct { + client rest.Interface +} + +// newBuilds returns a Builds +func newBuilds(c *ConfigV1Client) *builds { + return &builds{ + client: c.RESTClient(), + } +} + +// Get takes name of the build, and returns the corresponding build object, and an error if there is any. +func (c *builds) Get(name string, options meta_v1.GetOptions) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Get(). + Resource("builds"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Builds that match those selectors. +func (c *builds) List(opts meta_v1.ListOptions) (result *v1.BuildList, err error) { + result = &v1.BuildList{} + err = c.client.Get(). + Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested builds. +func (c *builds) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. +func (c *builds) Create(build *v1.Build) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Post(). + Resource("builds"). + Body(build). + Do(). + Into(result) + return +} + +// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. +func (c *builds) Update(build *v1.Build) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Put(). + Resource("builds"). + Name(build.Name). + Body(build). + Do(). + Into(result) + return +} + +// Delete takes name of the build and deletes it. Returns an error if one occurs. +func (c *builds) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("builds"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *builds) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("builds"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched build. +func (c *builds) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Build, err error) { + result = &v1.Build{} + err = c.client.Patch(pt). + Resource("builds"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go new file mode 100644 index 0000000000..ee505bb716 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusteroperator.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ClusterOperatorsGetter has a method to return a ClusterOperatorInterface. +// A group's client should implement this interface. +type ClusterOperatorsGetter interface { + ClusterOperators() ClusterOperatorInterface +} + +// ClusterOperatorInterface has methods to work with ClusterOperator resources. +type ClusterOperatorInterface interface { + Create(*v1.ClusterOperator) (*v1.ClusterOperator, error) + Update(*v1.ClusterOperator) (*v1.ClusterOperator, error) + UpdateStatus(*v1.ClusterOperator) (*v1.ClusterOperator, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ClusterOperator, error) + List(opts meta_v1.ListOptions) (*v1.ClusterOperatorList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterOperator, err error) + ClusterOperatorExpansion +} + +// clusterOperators implements ClusterOperatorInterface +type clusterOperators struct { + client rest.Interface +} + +// newClusterOperators returns a ClusterOperators +func newClusterOperators(c *ConfigV1Client) *clusterOperators { + return &clusterOperators{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. +func (c *clusterOperators) Get(name string, options meta_v1.GetOptions) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Get(). + Resource("clusteroperators"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. +func (c *clusterOperators) List(opts meta_v1.ListOptions) (result *v1.ClusterOperatorList, err error) { + result = &v1.ClusterOperatorList{} + err = c.client.Get(). + Resource("clusteroperators"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterOperators. +func (c *clusterOperators) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("clusteroperators"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *clusterOperators) Create(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Post(). + Resource("clusteroperators"). + Body(clusterOperator). + Do(). + Into(result) + return +} + +// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *clusterOperators) Update(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Put(). + Resource("clusteroperators"). + Name(clusterOperator.Name). + Body(clusterOperator). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *clusterOperators) UpdateStatus(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Put(). + Resource("clusteroperators"). + Name(clusterOperator.Name). + SubResource("status"). + Body(clusterOperator). + Do(). + Into(result) + return +} + +// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. +func (c *clusterOperators) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusteroperators"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterOperators) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("clusteroperators"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched clusterOperator. +func (c *clusterOperators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterOperator, err error) { + result = &v1.ClusterOperator{} + err = c.client.Patch(pt). + Resource("clusteroperators"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go new file mode 100644 index 0000000000..30e4adef6b --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/clusterversion.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ClusterVersionsGetter has a method to return a ClusterVersionInterface. +// A group's client should implement this interface. +type ClusterVersionsGetter interface { + ClusterVersions() ClusterVersionInterface +} + +// ClusterVersionInterface has methods to work with ClusterVersion resources. +type ClusterVersionInterface interface { + Create(*v1.ClusterVersion) (*v1.ClusterVersion, error) + Update(*v1.ClusterVersion) (*v1.ClusterVersion, error) + UpdateStatus(*v1.ClusterVersion) (*v1.ClusterVersion, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ClusterVersion, error) + List(opts meta_v1.ListOptions) (*v1.ClusterVersionList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterVersion, err error) + ClusterVersionExpansion +} + +// clusterVersions implements ClusterVersionInterface +type clusterVersions struct { + client rest.Interface +} + +// newClusterVersions returns a ClusterVersions +func newClusterVersions(c *ConfigV1Client) *clusterVersions { + return &clusterVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. +func (c *clusterVersions) Get(name string, options meta_v1.GetOptions) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Get(). + Resource("clusterversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. +func (c *clusterVersions) List(opts meta_v1.ListOptions) (result *v1.ClusterVersionList, err error) { + result = &v1.ClusterVersionList{} + err = c.client.Get(). + Resource("clusterversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterVersions. +func (c *clusterVersions) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("clusterversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *clusterVersions) Create(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Post(). + Resource("clusterversions"). + Body(clusterVersion). + Do(). + Into(result) + return +} + +// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *clusterVersions) Update(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Put(). + Resource("clusterversions"). + Name(clusterVersion.Name). + Body(clusterVersion). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *clusterVersions) UpdateStatus(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Put(). + Resource("clusterversions"). + Name(clusterVersion.Name). + SubResource("status"). + Body(clusterVersion). + Do(). + Into(result) + return +} + +// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. +func (c *clusterVersions) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterversions"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterVersions) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("clusterversions"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched clusterVersion. +func (c *clusterVersions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterVersion, err error) { + result = &v1.ClusterVersion{} + err = c.client.Patch(pt). + Resource("clusterversions"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go new file mode 100644 index 0000000000..4bcccbeb87 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/config_client.go @@ -0,0 +1,139 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + "github.com/openshift/client-go/config/clientset/versioned/scheme" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type ConfigV1Interface interface { + RESTClient() rest.Interface + AuthenticationsGetter + BuildsGetter + ClusterOperatorsGetter + ClusterVersionsGetter + ConsolesGetter + DNSsGetter + IdentityProvidersGetter + ImagesGetter + InfrastructuresGetter + IngressesGetter + NetworksGetter + OAuthsGetter + ProjectsGetter + SchedulingsGetter +} + +// ConfigV1Client is used to interact with features provided by the config.openshift.io group. +type ConfigV1Client struct { + restClient rest.Interface +} + +func (c *ConfigV1Client) Authentications() AuthenticationInterface { + return newAuthentications(c) +} + +func (c *ConfigV1Client) Builds() BuildInterface { + return newBuilds(c) +} + +func (c *ConfigV1Client) ClusterOperators() ClusterOperatorInterface { + return newClusterOperators(c) +} + +func (c *ConfigV1Client) ClusterVersions() ClusterVersionInterface { + return newClusterVersions(c) +} + +func (c *ConfigV1Client) Consoles() ConsoleInterface { + return newConsoles(c) +} + +func (c *ConfigV1Client) DNSs() DNSInterface { + return newDNSs(c) +} + +func (c *ConfigV1Client) IdentityProviders() IdentityProviderInterface { + return newIdentityProviders(c) +} + +func (c *ConfigV1Client) Images() ImageInterface { + return newImages(c) +} + +func (c *ConfigV1Client) Infrastructures() InfrastructureInterface { + return newInfrastructures(c) +} + +func (c *ConfigV1Client) Ingresses() IngressInterface { + return newIngresses(c) +} + +func (c *ConfigV1Client) Networks() NetworkInterface { + return newNetworks(c) +} + +func (c *ConfigV1Client) OAuths() OAuthInterface { + return newOAuths(c) +} + +func (c *ConfigV1Client) Projects() ProjectInterface { + return newProjects(c) +} + +func (c *ConfigV1Client) Schedulings() SchedulingInterface { + return newSchedulings(c) +} + +// NewForConfig creates a new ConfigV1Client for the given config. +func NewForConfig(c *rest.Config) (*ConfigV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ConfigV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ConfigV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ConfigV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ConfigV1Client for the given RESTClient. +func New(c rest.Interface) *ConfigV1Client { + return &ConfigV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ConfigV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go new file mode 100644 index 0000000000..b84013a6d3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/console.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ConsolesGetter has a method to return a ConsoleInterface. +// A group's client should implement this interface. +type ConsolesGetter interface { + Consoles() ConsoleInterface +} + +// ConsoleInterface has methods to work with Console resources. +type ConsoleInterface interface { + Create(*v1.Console) (*v1.Console, error) + Update(*v1.Console) (*v1.Console, error) + UpdateStatus(*v1.Console) (*v1.Console, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Console, error) + List(opts meta_v1.ListOptions) (*v1.ConsoleList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Console, err error) + ConsoleExpansion +} + +// consoles implements ConsoleInterface +type consoles struct { + client rest.Interface +} + +// newConsoles returns a Consoles +func newConsoles(c *ConfigV1Client) *consoles { + return &consoles{ + client: c.RESTClient(), + } +} + +// Get takes name of the console, and returns the corresponding console object, and an error if there is any. +func (c *consoles) Get(name string, options meta_v1.GetOptions) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Get(). + Resource("consoles"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Consoles that match those selectors. +func (c *consoles) List(opts meta_v1.ListOptions) (result *v1.ConsoleList, err error) { + result = &v1.ConsoleList{} + err = c.client.Get(). + Resource("consoles"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested consoles. +func (c *consoles) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("consoles"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any. +func (c *consoles) Create(console *v1.Console) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Post(). + Resource("consoles"). + Body(console). + Do(). + Into(result) + return +} + +// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any. +func (c *consoles) Update(console *v1.Console) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Put(). + Resource("consoles"). + Name(console.Name). + Body(console). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *consoles) UpdateStatus(console *v1.Console) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Put(). + Resource("consoles"). + Name(console.Name). + SubResource("status"). + Body(console). + Do(). + Into(result) + return +} + +// Delete takes name of the console and deletes it. Returns an error if one occurs. +func (c *consoles) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("consoles"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *consoles) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("consoles"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched console. +func (c *consoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Console, err error) { + result = &v1.Console{} + err = c.client.Patch(pt). + Resource("consoles"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go new file mode 100644 index 0000000000..2d83cd3285 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/dns.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// DNSsGetter has a method to return a DNSInterface. +// A group's client should implement this interface. +type DNSsGetter interface { + DNSs() DNSInterface +} + +// DNSInterface has methods to work with DNS resources. +type DNSInterface interface { + Create(*v1.DNS) (*v1.DNS, error) + Update(*v1.DNS) (*v1.DNS, error) + UpdateStatus(*v1.DNS) (*v1.DNS, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.DNS, error) + List(opts meta_v1.ListOptions) (*v1.DNSList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DNS, err error) + DNSExpansion +} + +// dNSs implements DNSInterface +type dNSs struct { + client rest.Interface +} + +// newDNSs returns a DNSs +func newDNSs(c *ConfigV1Client) *dNSs { + return &dNSs{ + client: c.RESTClient(), + } +} + +// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any. +func (c *dNSs) Get(name string, options meta_v1.GetOptions) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Get(). + Resource("dnss"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DNSs that match those selectors. +func (c *dNSs) List(opts meta_v1.ListOptions) (result *v1.DNSList, err error) { + result = &v1.DNSList{} + err = c.client.Get(). + Resource("dnss"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dNSs. +func (c *dNSs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("dnss"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *dNSs) Create(dNS *v1.DNS) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Post(). + Resource("dnss"). + Body(dNS). + Do(). + Into(result) + return +} + +// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *dNSs) Update(dNS *v1.DNS) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Put(). + Resource("dnss"). + Name(dNS.Name). + Body(dNS). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *dNSs) UpdateStatus(dNS *v1.DNS) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Put(). + Resource("dnss"). + Name(dNS.Name). + SubResource("status"). + Body(dNS). + Do(). + Into(result) + return +} + +// Delete takes name of the dNS and deletes it. Returns an error if one occurs. +func (c *dNSs) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("dnss"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dNSs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("dnss"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched dNS. +func (c *dNSs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DNS, err error) { + result = &v1.DNS{} + err = c.client.Patch(pt). + Resource("dnss"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go new file mode 100644 index 0000000000..225e6b2be3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go new file mode 100644 index 0000000000..2b5ba4c8e4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/doc.go @@ -0,0 +1,4 @@ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go new file mode 100644 index 0000000000..564af7e200 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_authentication.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAuthentications implements AuthenticationInterface +type FakeAuthentications struct { + Fake *FakeConfigV1 +} + +var authenticationsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "authentications"} + +var authenticationsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Authentication"} + +// Get takes name of the authentication, and returns the corresponding authentication object, and an error if there is any. +func (c *FakeAuthentications) Get(name string, options v1.GetOptions) (result *config_v1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authenticationsResource, name), &config_v1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Authentication), err +} + +// List takes label and field selectors, and returns the list of Authentications that match those selectors. +func (c *FakeAuthentications) List(opts v1.ListOptions) (result *config_v1.AuthenticationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authenticationsResource, authenticationsKind, opts), &config_v1.AuthenticationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.AuthenticationList{ListMeta: obj.(*config_v1.AuthenticationList).ListMeta} + for _, item := range obj.(*config_v1.AuthenticationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested authentications. +func (c *FakeAuthentications) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authenticationsResource, opts)) +} + +// Create takes the representation of a authentication and creates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *FakeAuthentications) Create(authentication *config_v1.Authentication) (result *config_v1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authenticationsResource, authentication), &config_v1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Authentication), err +} + +// Update takes the representation of a authentication and updates it. Returns the server's representation of the authentication, and an error, if there is any. +func (c *FakeAuthentications) Update(authentication *config_v1.Authentication) (result *config_v1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authenticationsResource, authentication), &config_v1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Authentication), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAuthentications) UpdateStatus(authentication *config_v1.Authentication) (*config_v1.Authentication, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(authenticationsResource, "status", authentication), &config_v1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Authentication), err +} + +// Delete takes name of the authentication and deletes it. Returns an error if one occurs. +func (c *FakeAuthentications) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(authenticationsResource, name), &config_v1.Authentication{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthentications) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authenticationsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.AuthenticationList{}) + return err +} + +// Patch applies the patch and returns the patched authentication. +func (c *FakeAuthentications) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Authentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authenticationsResource, name, data, subresources...), &config_v1.Authentication{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Authentication), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go new file mode 100644 index 0000000000..629d9d748b --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_build.go @@ -0,0 +1,104 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBuilds implements BuildInterface +type FakeBuilds struct { + Fake *FakeConfigV1 +} + +var buildsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "builds"} + +var buildsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Build"} + +// Get takes name of the build, and returns the corresponding build object, and an error if there is any. +func (c *FakeBuilds) Get(name string, options v1.GetOptions) (result *config_v1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(buildsResource, name), &config_v1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Build), err +} + +// List takes label and field selectors, and returns the list of Builds that match those selectors. +func (c *FakeBuilds) List(opts v1.ListOptions) (result *config_v1.BuildList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(buildsResource, buildsKind, opts), &config_v1.BuildList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.BuildList{ListMeta: obj.(*config_v1.BuildList).ListMeta} + for _, item := range obj.(*config_v1.BuildList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested builds. +func (c *FakeBuilds) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(buildsResource, opts)) +} + +// Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. +func (c *FakeBuilds) Create(build *config_v1.Build) (result *config_v1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(buildsResource, build), &config_v1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Build), err +} + +// Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. +func (c *FakeBuilds) Update(build *config_v1.Build) (result *config_v1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(buildsResource, build), &config_v1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Build), err +} + +// Delete takes name of the build and deletes it. Returns an error if one occurs. +func (c *FakeBuilds) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(buildsResource, name), &config_v1.Build{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBuilds) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(buildsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.BuildList{}) + return err +} + +// Patch applies the patch and returns the patched build. +func (c *FakeBuilds) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Build, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(buildsResource, name, data, subresources...), &config_v1.Build{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Build), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go new file mode 100644 index 0000000000..49bc4c61d0 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusteroperator.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterOperators implements ClusterOperatorInterface +type FakeClusterOperators struct { + Fake *FakeConfigV1 +} + +var clusteroperatorsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "clusteroperators"} + +var clusteroperatorsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "ClusterOperator"} + +// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. +func (c *FakeClusterOperators) Get(name string, options v1.GetOptions) (result *config_v1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusteroperatorsResource, name), &config_v1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterOperator), err +} + +// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. +func (c *FakeClusterOperators) List(opts v1.ListOptions) (result *config_v1.ClusterOperatorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusteroperatorsResource, clusteroperatorsKind, opts), &config_v1.ClusterOperatorList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.ClusterOperatorList{ListMeta: obj.(*config_v1.ClusterOperatorList).ListMeta} + for _, item := range obj.(*config_v1.ClusterOperatorList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterOperators. +func (c *FakeClusterOperators) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusteroperatorsResource, opts)) +} + +// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *FakeClusterOperators) Create(clusterOperator *config_v1.ClusterOperator) (result *config_v1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusteroperatorsResource, clusterOperator), &config_v1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterOperator), err +} + +// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. +func (c *FakeClusterOperators) Update(clusterOperator *config_v1.ClusterOperator) (result *config_v1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusteroperatorsResource, clusterOperator), &config_v1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterOperator), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterOperators) UpdateStatus(clusterOperator *config_v1.ClusterOperator) (*config_v1.ClusterOperator, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusteroperatorsResource, "status", clusterOperator), &config_v1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterOperator), err +} + +// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. +func (c *FakeClusterOperators) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusteroperatorsResource, name), &config_v1.ClusterOperator{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterOperators) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusteroperatorsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.ClusterOperatorList{}) + return err +} + +// Patch applies the patch and returns the patched clusterOperator. +func (c *FakeClusterOperators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.ClusterOperator, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusteroperatorsResource, name, data, subresources...), &config_v1.ClusterOperator{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterOperator), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go new file mode 100644 index 0000000000..f505d10444 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_clusterversion.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterVersions implements ClusterVersionInterface +type FakeClusterVersions struct { + Fake *FakeConfigV1 +} + +var clusterversionsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "clusterversions"} + +var clusterversionsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "ClusterVersion"} + +// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. +func (c *FakeClusterVersions) Get(name string, options v1.GetOptions) (result *config_v1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterversionsResource, name), &config_v1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterVersion), err +} + +// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. +func (c *FakeClusterVersions) List(opts v1.ListOptions) (result *config_v1.ClusterVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterversionsResource, clusterversionsKind, opts), &config_v1.ClusterVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.ClusterVersionList{ListMeta: obj.(*config_v1.ClusterVersionList).ListMeta} + for _, item := range obj.(*config_v1.ClusterVersionList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterVersions. +func (c *FakeClusterVersions) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterversionsResource, opts)) +} + +// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *FakeClusterVersions) Create(clusterVersion *config_v1.ClusterVersion) (result *config_v1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterversionsResource, clusterVersion), &config_v1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterVersion), err +} + +// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. +func (c *FakeClusterVersions) Update(clusterVersion *config_v1.ClusterVersion) (result *config_v1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterversionsResource, clusterVersion), &config_v1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterVersion), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterVersions) UpdateStatus(clusterVersion *config_v1.ClusterVersion) (*config_v1.ClusterVersion, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusterversionsResource, "status", clusterVersion), &config_v1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterVersion), err +} + +// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. +func (c *FakeClusterVersions) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clusterversionsResource, name), &config_v1.ClusterVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterVersions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterversionsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.ClusterVersionList{}) + return err +} + +// Patch applies the patch and returns the patched clusterVersion. +func (c *FakeClusterVersions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.ClusterVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, name, data, subresources...), &config_v1.ClusterVersion{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.ClusterVersion), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go new file mode 100644 index 0000000000..0467ad555d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_config_client.go @@ -0,0 +1,76 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeConfigV1 struct { + *testing.Fake +} + +func (c *FakeConfigV1) Authentications() v1.AuthenticationInterface { + return &FakeAuthentications{c} +} + +func (c *FakeConfigV1) Builds() v1.BuildInterface { + return &FakeBuilds{c} +} + +func (c *FakeConfigV1) ClusterOperators() v1.ClusterOperatorInterface { + return &FakeClusterOperators{c} +} + +func (c *FakeConfigV1) ClusterVersions() v1.ClusterVersionInterface { + return &FakeClusterVersions{c} +} + +func (c *FakeConfigV1) Consoles() v1.ConsoleInterface { + return &FakeConsoles{c} +} + +func (c *FakeConfigV1) DNSs() v1.DNSInterface { + return &FakeDNSs{c} +} + +func (c *FakeConfigV1) IdentityProviders() v1.IdentityProviderInterface { + return &FakeIdentityProviders{c} +} + +func (c *FakeConfigV1) Images() v1.ImageInterface { + return &FakeImages{c} +} + +func (c *FakeConfigV1) Infrastructures() v1.InfrastructureInterface { + return &FakeInfrastructures{c} +} + +func (c *FakeConfigV1) Ingresses() v1.IngressInterface { + return &FakeIngresses{c} +} + +func (c *FakeConfigV1) Networks() v1.NetworkInterface { + return &FakeNetworks{c} +} + +func (c *FakeConfigV1) OAuths() v1.OAuthInterface { + return &FakeOAuths{c} +} + +func (c *FakeConfigV1) Projects() v1.ProjectInterface { + return &FakeProjects{c} +} + +func (c *FakeConfigV1) Schedulings() v1.SchedulingInterface { + return &FakeSchedulings{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeConfigV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go new file mode 100644 index 0000000000..5c60b237b4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_console.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeConsoles implements ConsoleInterface +type FakeConsoles struct { + Fake *FakeConfigV1 +} + +var consolesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "consoles"} + +var consolesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Console"} + +// Get takes name of the console, and returns the corresponding console object, and an error if there is any. +func (c *FakeConsoles) Get(name string, options v1.GetOptions) (result *config_v1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(consolesResource, name), &config_v1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Console), err +} + +// List takes label and field selectors, and returns the list of Consoles that match those selectors. +func (c *FakeConsoles) List(opts v1.ListOptions) (result *config_v1.ConsoleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(consolesResource, consolesKind, opts), &config_v1.ConsoleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.ConsoleList{ListMeta: obj.(*config_v1.ConsoleList).ListMeta} + for _, item := range obj.(*config_v1.ConsoleList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested consoles. +func (c *FakeConsoles) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(consolesResource, opts)) +} + +// Create takes the representation of a console and creates it. Returns the server's representation of the console, and an error, if there is any. +func (c *FakeConsoles) Create(console *config_v1.Console) (result *config_v1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(consolesResource, console), &config_v1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Console), err +} + +// Update takes the representation of a console and updates it. Returns the server's representation of the console, and an error, if there is any. +func (c *FakeConsoles) Update(console *config_v1.Console) (result *config_v1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(consolesResource, console), &config_v1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Console), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeConsoles) UpdateStatus(console *config_v1.Console) (*config_v1.Console, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(consolesResource, "status", console), &config_v1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Console), err +} + +// Delete takes name of the console and deletes it. Returns an error if one occurs. +func (c *FakeConsoles) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(consolesResource, name), &config_v1.Console{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConsoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(consolesResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.ConsoleList{}) + return err +} + +// Patch applies the patch and returns the patched console. +func (c *FakeConsoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Console, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(consolesResource, name, data, subresources...), &config_v1.Console{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Console), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go new file mode 100644 index 0000000000..64946e73d5 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_dns.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDNSs implements DNSInterface +type FakeDNSs struct { + Fake *FakeConfigV1 +} + +var dnssResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "dnss"} + +var dnssKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "DNS"} + +// Get takes name of the dNS, and returns the corresponding dNS object, and an error if there is any. +func (c *FakeDNSs) Get(name string, options v1.GetOptions) (result *config_v1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dnssResource, name), &config_v1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.DNS), err +} + +// List takes label and field selectors, and returns the list of DNSs that match those selectors. +func (c *FakeDNSs) List(opts v1.ListOptions) (result *config_v1.DNSList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dnssResource, dnssKind, opts), &config_v1.DNSList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.DNSList{ListMeta: obj.(*config_v1.DNSList).ListMeta} + for _, item := range obj.(*config_v1.DNSList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested dNSs. +func (c *FakeDNSs) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dnssResource, opts)) +} + +// Create takes the representation of a dNS and creates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *FakeDNSs) Create(dNS *config_v1.DNS) (result *config_v1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dnssResource, dNS), &config_v1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.DNS), err +} + +// Update takes the representation of a dNS and updates it. Returns the server's representation of the dNS, and an error, if there is any. +func (c *FakeDNSs) Update(dNS *config_v1.DNS) (result *config_v1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dnssResource, dNS), &config_v1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.DNS), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDNSs) UpdateStatus(dNS *config_v1.DNS) (*config_v1.DNS, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(dnssResource, "status", dNS), &config_v1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.DNS), err +} + +// Delete takes name of the dNS and deletes it. Returns an error if one occurs. +func (c *FakeDNSs) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(dnssResource, name), &config_v1.DNS{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDNSs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dnssResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.DNSList{}) + return err +} + +// Patch applies the patch and returns the patched dNS. +func (c *FakeDNSs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.DNS, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dnssResource, name, data, subresources...), &config_v1.DNS{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.DNS), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_identityprovider.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_identityprovider.go new file mode 100644 index 0000000000..dca823fb96 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_identityprovider.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeIdentityProviders implements IdentityProviderInterface +type FakeIdentityProviders struct { + Fake *FakeConfigV1 +} + +var identityprovidersResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "identityproviders"} + +var identityprovidersKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "IdentityProvider"} + +// Get takes name of the identityProvider, and returns the corresponding identityProvider object, and an error if there is any. +func (c *FakeIdentityProviders) Get(name string, options v1.GetOptions) (result *config_v1.IdentityProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(identityprovidersResource, name), &config_v1.IdentityProvider{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.IdentityProvider), err +} + +// List takes label and field selectors, and returns the list of IdentityProviders that match those selectors. +func (c *FakeIdentityProviders) List(opts v1.ListOptions) (result *config_v1.IdentityProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(identityprovidersResource, identityprovidersKind, opts), &config_v1.IdentityProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.IdentityProviderList{ListMeta: obj.(*config_v1.IdentityProviderList).ListMeta} + for _, item := range obj.(*config_v1.IdentityProviderList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested identityProviders. +func (c *FakeIdentityProviders) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(identityprovidersResource, opts)) +} + +// Create takes the representation of a identityProvider and creates it. Returns the server's representation of the identityProvider, and an error, if there is any. +func (c *FakeIdentityProviders) Create(identityProvider *config_v1.IdentityProvider) (result *config_v1.IdentityProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(identityprovidersResource, identityProvider), &config_v1.IdentityProvider{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.IdentityProvider), err +} + +// Update takes the representation of a identityProvider and updates it. Returns the server's representation of the identityProvider, and an error, if there is any. +func (c *FakeIdentityProviders) Update(identityProvider *config_v1.IdentityProvider) (result *config_v1.IdentityProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(identityprovidersResource, identityProvider), &config_v1.IdentityProvider{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.IdentityProvider), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeIdentityProviders) UpdateStatus(identityProvider *config_v1.IdentityProvider) (*config_v1.IdentityProvider, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(identityprovidersResource, "status", identityProvider), &config_v1.IdentityProvider{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.IdentityProvider), err +} + +// Delete takes name of the identityProvider and deletes it. Returns an error if one occurs. +func (c *FakeIdentityProviders) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(identityprovidersResource, name), &config_v1.IdentityProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIdentityProviders) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(identityprovidersResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.IdentityProviderList{}) + return err +} + +// Patch applies the patch and returns the patched identityProvider. +func (c *FakeIdentityProviders) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.IdentityProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(identityprovidersResource, name, data, subresources...), &config_v1.IdentityProvider{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.IdentityProvider), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go new file mode 100644 index 0000000000..9b2e364fed --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_image.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeImages implements ImageInterface +type FakeImages struct { + Fake *FakeConfigV1 +} + +var imagesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "images"} + +var imagesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Image"} + +// Get takes name of the image, and returns the corresponding image object, and an error if there is any. +func (c *FakeImages) Get(name string, options v1.GetOptions) (result *config_v1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(imagesResource, name), &config_v1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Image), err +} + +// List takes label and field selectors, and returns the list of Images that match those selectors. +func (c *FakeImages) List(opts v1.ListOptions) (result *config_v1.ImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(imagesResource, imagesKind, opts), &config_v1.ImageList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.ImageList{ListMeta: obj.(*config_v1.ImageList).ListMeta} + for _, item := range obj.(*config_v1.ImageList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested images. +func (c *FakeImages) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(imagesResource, opts)) +} + +// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any. +func (c *FakeImages) Create(image *config_v1.Image) (result *config_v1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(imagesResource, image), &config_v1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Image), err +} + +// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any. +func (c *FakeImages) Update(image *config_v1.Image) (result *config_v1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(imagesResource, image), &config_v1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Image), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeImages) UpdateStatus(image *config_v1.Image) (*config_v1.Image, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(imagesResource, "status", image), &config_v1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Image), err +} + +// Delete takes name of the image and deletes it. Returns an error if one occurs. +func (c *FakeImages) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(imagesResource, name), &config_v1.Image{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeImages) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(imagesResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.ImageList{}) + return err +} + +// Patch applies the patch and returns the patched image. +func (c *FakeImages) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Image, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(imagesResource, name, data, subresources...), &config_v1.Image{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Image), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go new file mode 100644 index 0000000000..351fac1c48 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_infrastructure.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeInfrastructures implements InfrastructureInterface +type FakeInfrastructures struct { + Fake *FakeConfigV1 +} + +var infrastructuresResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "infrastructures"} + +var infrastructuresKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Infrastructure"} + +// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any. +func (c *FakeInfrastructures) Get(name string, options v1.GetOptions) (result *config_v1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(infrastructuresResource, name), &config_v1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Infrastructure), err +} + +// List takes label and field selectors, and returns the list of Infrastructures that match those selectors. +func (c *FakeInfrastructures) List(opts v1.ListOptions) (result *config_v1.InfrastructureList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(infrastructuresResource, infrastructuresKind, opts), &config_v1.InfrastructureList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.InfrastructureList{ListMeta: obj.(*config_v1.InfrastructureList).ListMeta} + for _, item := range obj.(*config_v1.InfrastructureList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested infrastructures. +func (c *FakeInfrastructures) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(infrastructuresResource, opts)) +} + +// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *FakeInfrastructures) Create(infrastructure *config_v1.Infrastructure) (result *config_v1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(infrastructuresResource, infrastructure), &config_v1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Infrastructure), err +} + +// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *FakeInfrastructures) Update(infrastructure *config_v1.Infrastructure) (result *config_v1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(infrastructuresResource, infrastructure), &config_v1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Infrastructure), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeInfrastructures) UpdateStatus(infrastructure *config_v1.Infrastructure) (*config_v1.Infrastructure, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(infrastructuresResource, "status", infrastructure), &config_v1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Infrastructure), err +} + +// Delete takes name of the infrastructure and deletes it. Returns an error if one occurs. +func (c *FakeInfrastructures) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(infrastructuresResource, name), &config_v1.Infrastructure{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInfrastructures) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(infrastructuresResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.InfrastructureList{}) + return err +} + +// Patch applies the patch and returns the patched infrastructure. +func (c *FakeInfrastructures) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Infrastructure, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(infrastructuresResource, name, data, subresources...), &config_v1.Infrastructure{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Infrastructure), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go new file mode 100644 index 0000000000..861caec96d --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_ingress.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeIngresses implements IngressInterface +type FakeIngresses struct { + Fake *FakeConfigV1 +} + +var ingressesResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "ingresses"} + +var ingressesKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Ingress"} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *config_v1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ingressesResource, name), &config_v1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Ingress), err +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *FakeIngresses) List(opts v1.ListOptions) (result *config_v1.IngressList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ingressesResource, ingressesKind, opts), &config_v1.IngressList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.IngressList{ListMeta: obj.(*config_v1.IngressList).ListMeta} + for _, item := range obj.(*config_v1.IngressList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested ingresses. +func (c *FakeIngresses) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ingressesResource, opts)) +} + +// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *FakeIngresses) Create(ingress *config_v1.Ingress) (result *config_v1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ingressesResource, ingress), &config_v1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Ingress), err +} + +// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *FakeIngresses) Update(ingress *config_v1.Ingress) (result *config_v1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ingressesResource, ingress), &config_v1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Ingress), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeIngresses) UpdateStatus(ingress *config_v1.Ingress) (*config_v1.Ingress, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(ingressesResource, "status", ingress), &config_v1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Ingress), err +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *FakeIngresses) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(ingressesResource, name), &config_v1.Ingress{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ingressesResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.IngressList{}) + return err +} + +// Patch applies the patch and returns the patched ingress. +func (c *FakeIngresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ingressesResource, name, data, subresources...), &config_v1.Ingress{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Ingress), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go new file mode 100644 index 0000000000..88eabd4921 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_network.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworks implements NetworkInterface +type FakeNetworks struct { + Fake *FakeConfigV1 +} + +var networksResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "networks"} + +var networksKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Network"} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *FakeNetworks) Get(name string, options v1.GetOptions) (result *config_v1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(networksResource, name), &config_v1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Network), err +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *FakeNetworks) List(opts v1.ListOptions) (result *config_v1.NetworkList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(networksResource, networksKind, opts), &config_v1.NetworkList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.NetworkList{ListMeta: obj.(*config_v1.NetworkList).ListMeta} + for _, item := range obj.(*config_v1.NetworkList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested networks. +func (c *FakeNetworks) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(networksResource, opts)) +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Create(network *config_v1.Network) (result *config_v1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(networksResource, network), &config_v1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Network), err +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *FakeNetworks) Update(network *config_v1.Network) (result *config_v1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(networksResource, network), &config_v1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Network), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNetworks) UpdateStatus(network *config_v1.Network) (*config_v1.Network, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(networksResource, "status", network), &config_v1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Network), err +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *FakeNetworks) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(networksResource, name), &config_v1.Network{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(networksResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.NetworkList{}) + return err +} + +// Patch applies the patch and returns the patched network. +func (c *FakeNetworks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Network, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(networksResource, name, data, subresources...), &config_v1.Network{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Network), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go new file mode 100644 index 0000000000..9d018dfe7c --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_oauth.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeOAuths implements OAuthInterface +type FakeOAuths struct { + Fake *FakeConfigV1 +} + +var oauthsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "oauths"} + +var oauthsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "OAuth"} + +// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any. +func (c *FakeOAuths) Get(name string, options v1.GetOptions) (result *config_v1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(oauthsResource, name), &config_v1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.OAuth), err +} + +// List takes label and field selectors, and returns the list of OAuths that match those selectors. +func (c *FakeOAuths) List(opts v1.ListOptions) (result *config_v1.OAuthList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(oauthsResource, oauthsKind, opts), &config_v1.OAuthList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.OAuthList{ListMeta: obj.(*config_v1.OAuthList).ListMeta} + for _, item := range obj.(*config_v1.OAuthList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested oAuths. +func (c *FakeOAuths) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(oauthsResource, opts)) +} + +// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *FakeOAuths) Create(oAuth *config_v1.OAuth) (result *config_v1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(oauthsResource, oAuth), &config_v1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.OAuth), err +} + +// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *FakeOAuths) Update(oAuth *config_v1.OAuth) (result *config_v1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(oauthsResource, oAuth), &config_v1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.OAuth), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeOAuths) UpdateStatus(oAuth *config_v1.OAuth) (*config_v1.OAuth, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(oauthsResource, "status", oAuth), &config_v1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.OAuth), err +} + +// Delete takes name of the oAuth and deletes it. Returns an error if one occurs. +func (c *FakeOAuths) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(oauthsResource, name), &config_v1.OAuth{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOAuths) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(oauthsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.OAuthList{}) + return err +} + +// Patch applies the patch and returns the patched oAuth. +func (c *FakeOAuths) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.OAuth, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(oauthsResource, name, data, subresources...), &config_v1.OAuth{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.OAuth), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go new file mode 100644 index 0000000000..09d3b95351 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_project.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjects implements ProjectInterface +type FakeProjects struct { + Fake *FakeConfigV1 +} + +var projectsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "projects"} + +var projectsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Project"} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *FakeProjects) Get(name string, options v1.GetOptions) (result *config_v1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(projectsResource, name), &config_v1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Project), err +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *FakeProjects) List(opts v1.ListOptions) (result *config_v1.ProjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &config_v1.ProjectList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.ProjectList{ListMeta: obj.(*config_v1.ProjectList).ListMeta} + for _, item := range obj.(*config_v1.ProjectList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *FakeProjects) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(projectsResource, opts)) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Create(project *config_v1.Project) (result *config_v1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(projectsResource, project), &config_v1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Project), err +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Update(project *config_v1.Project) (result *config_v1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(projectsResource, project), &config_v1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Project), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjects) UpdateStatus(project *config_v1.Project) (*config_v1.Project, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(projectsResource, "status", project), &config_v1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Project), err +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *FakeProjects) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(projectsResource, name), &config_v1.Project{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjects) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(projectsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.ProjectList{}) + return err +} + +// Patch applies the patch and returns the patched project. +func (c *FakeProjects) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(projectsResource, name, data, subresources...), &config_v1.Project{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Project), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduling.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduling.go new file mode 100644 index 0000000000..9b9891bdb1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/fake/fake_scheduling.go @@ -0,0 +1,115 @@ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + config_v1 "github.com/openshift/api/config/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSchedulings implements SchedulingInterface +type FakeSchedulings struct { + Fake *FakeConfigV1 +} + +var schedulingsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "schedulings"} + +var schedulingsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "Scheduling"} + +// Get takes name of the scheduling, and returns the corresponding scheduling object, and an error if there is any. +func (c *FakeSchedulings) Get(name string, options v1.GetOptions) (result *config_v1.Scheduling, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(schedulingsResource, name), &config_v1.Scheduling{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Scheduling), err +} + +// List takes label and field selectors, and returns the list of Schedulings that match those selectors. +func (c *FakeSchedulings) List(opts v1.ListOptions) (result *config_v1.SchedulingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(schedulingsResource, schedulingsKind, opts), &config_v1.SchedulingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &config_v1.SchedulingList{ListMeta: obj.(*config_v1.SchedulingList).ListMeta} + for _, item := range obj.(*config_v1.SchedulingList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested schedulings. +func (c *FakeSchedulings) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(schedulingsResource, opts)) +} + +// Create takes the representation of a scheduling and creates it. Returns the server's representation of the scheduling, and an error, if there is any. +func (c *FakeSchedulings) Create(scheduling *config_v1.Scheduling) (result *config_v1.Scheduling, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(schedulingsResource, scheduling), &config_v1.Scheduling{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Scheduling), err +} + +// Update takes the representation of a scheduling and updates it. Returns the server's representation of the scheduling, and an error, if there is any. +func (c *FakeSchedulings) Update(scheduling *config_v1.Scheduling) (result *config_v1.Scheduling, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(schedulingsResource, scheduling), &config_v1.Scheduling{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Scheduling), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSchedulings) UpdateStatus(scheduling *config_v1.Scheduling) (*config_v1.Scheduling, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(schedulingsResource, "status", scheduling), &config_v1.Scheduling{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Scheduling), err +} + +// Delete takes name of the scheduling and deletes it. Returns an error if one occurs. +func (c *FakeSchedulings) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(schedulingsResource, name), &config_v1.Scheduling{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSchedulings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(schedulingsResource, listOptions) + + _, err := c.Fake.Invokes(action, &config_v1.SchedulingList{}) + return err +} + +// Patch applies the patch and returns the patched scheduling. +func (c *FakeSchedulings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *config_v1.Scheduling, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(schedulingsResource, name, data, subresources...), &config_v1.Scheduling{}) + if obj == nil { + return nil, err + } + return obj.(*config_v1.Scheduling), err +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go new file mode 100644 index 0000000000..8c7bd34765 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/generated_expansion.go @@ -0,0 +1,31 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type AuthenticationExpansion interface{} + +type BuildExpansion interface{} + +type ClusterOperatorExpansion interface{} + +type ClusterVersionExpansion interface{} + +type ConsoleExpansion interface{} + +type DNSExpansion interface{} + +type IdentityProviderExpansion interface{} + +type ImageExpansion interface{} + +type InfrastructureExpansion interface{} + +type IngressExpansion interface{} + +type NetworkExpansion interface{} + +type OAuthExpansion interface{} + +type ProjectExpansion interface{} + +type SchedulingExpansion interface{} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/identityprovider.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/identityprovider.go new file mode 100644 index 0000000000..589aea9bd4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/identityprovider.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IdentityProvidersGetter has a method to return a IdentityProviderInterface. +// A group's client should implement this interface. +type IdentityProvidersGetter interface { + IdentityProviders() IdentityProviderInterface +} + +// IdentityProviderInterface has methods to work with IdentityProvider resources. +type IdentityProviderInterface interface { + Create(*v1.IdentityProvider) (*v1.IdentityProvider, error) + Update(*v1.IdentityProvider) (*v1.IdentityProvider, error) + UpdateStatus(*v1.IdentityProvider) (*v1.IdentityProvider, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.IdentityProvider, error) + List(opts meta_v1.ListOptions) (*v1.IdentityProviderList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.IdentityProvider, err error) + IdentityProviderExpansion +} + +// identityProviders implements IdentityProviderInterface +type identityProviders struct { + client rest.Interface +} + +// newIdentityProviders returns a IdentityProviders +func newIdentityProviders(c *ConfigV1Client) *identityProviders { + return &identityProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the identityProvider, and returns the corresponding identityProvider object, and an error if there is any. +func (c *identityProviders) Get(name string, options meta_v1.GetOptions) (result *v1.IdentityProvider, err error) { + result = &v1.IdentityProvider{} + err = c.client.Get(). + Resource("identityproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IdentityProviders that match those selectors. +func (c *identityProviders) List(opts meta_v1.ListOptions) (result *v1.IdentityProviderList, err error) { + result = &v1.IdentityProviderList{} + err = c.client.Get(). + Resource("identityproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested identityProviders. +func (c *identityProviders) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("identityproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a identityProvider and creates it. Returns the server's representation of the identityProvider, and an error, if there is any. +func (c *identityProviders) Create(identityProvider *v1.IdentityProvider) (result *v1.IdentityProvider, err error) { + result = &v1.IdentityProvider{} + err = c.client.Post(). + Resource("identityproviders"). + Body(identityProvider). + Do(). + Into(result) + return +} + +// Update takes the representation of a identityProvider and updates it. Returns the server's representation of the identityProvider, and an error, if there is any. +func (c *identityProviders) Update(identityProvider *v1.IdentityProvider) (result *v1.IdentityProvider, err error) { + result = &v1.IdentityProvider{} + err = c.client.Put(). + Resource("identityproviders"). + Name(identityProvider.Name). + Body(identityProvider). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *identityProviders) UpdateStatus(identityProvider *v1.IdentityProvider) (result *v1.IdentityProvider, err error) { + result = &v1.IdentityProvider{} + err = c.client.Put(). + Resource("identityproviders"). + Name(identityProvider.Name). + SubResource("status"). + Body(identityProvider). + Do(). + Into(result) + return +} + +// Delete takes name of the identityProvider and deletes it. Returns an error if one occurs. +func (c *identityProviders) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("identityproviders"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *identityProviders) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("identityproviders"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched identityProvider. +func (c *identityProviders) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.IdentityProvider, err error) { + result = &v1.IdentityProvider{} + err = c.client.Patch(pt). + Resource("identityproviders"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go new file mode 100644 index 0000000000..ff8597c2a8 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/image.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ImagesGetter has a method to return a ImageInterface. +// A group's client should implement this interface. +type ImagesGetter interface { + Images() ImageInterface +} + +// ImageInterface has methods to work with Image resources. +type ImageInterface interface { + Create(*v1.Image) (*v1.Image, error) + Update(*v1.Image) (*v1.Image, error) + UpdateStatus(*v1.Image) (*v1.Image, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Image, error) + List(opts meta_v1.ListOptions) (*v1.ImageList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Image, err error) + ImageExpansion +} + +// images implements ImageInterface +type images struct { + client rest.Interface +} + +// newImages returns a Images +func newImages(c *ConfigV1Client) *images { + return &images{ + client: c.RESTClient(), + } +} + +// Get takes name of the image, and returns the corresponding image object, and an error if there is any. +func (c *images) Get(name string, options meta_v1.GetOptions) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Get(). + Resource("images"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Images that match those selectors. +func (c *images) List(opts meta_v1.ListOptions) (result *v1.ImageList, err error) { + result = &v1.ImageList{} + err = c.client.Get(). + Resource("images"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested images. +func (c *images) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("images"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a image and creates it. Returns the server's representation of the image, and an error, if there is any. +func (c *images) Create(image *v1.Image) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Post(). + Resource("images"). + Body(image). + Do(). + Into(result) + return +} + +// Update takes the representation of a image and updates it. Returns the server's representation of the image, and an error, if there is any. +func (c *images) Update(image *v1.Image) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Put(). + Resource("images"). + Name(image.Name). + Body(image). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *images) UpdateStatus(image *v1.Image) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Put(). + Resource("images"). + Name(image.Name). + SubResource("status"). + Body(image). + Do(). + Into(result) + return +} + +// Delete takes name of the image and deletes it. Returns an error if one occurs. +func (c *images) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("images"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *images) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("images"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched image. +func (c *images) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Image, err error) { + result = &v1.Image{} + err = c.client.Patch(pt). + Resource("images"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go new file mode 100644 index 0000000000..b30f03e8e3 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/infrastructure.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// InfrastructuresGetter has a method to return a InfrastructureInterface. +// A group's client should implement this interface. +type InfrastructuresGetter interface { + Infrastructures() InfrastructureInterface +} + +// InfrastructureInterface has methods to work with Infrastructure resources. +type InfrastructureInterface interface { + Create(*v1.Infrastructure) (*v1.Infrastructure, error) + Update(*v1.Infrastructure) (*v1.Infrastructure, error) + UpdateStatus(*v1.Infrastructure) (*v1.Infrastructure, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Infrastructure, error) + List(opts meta_v1.ListOptions) (*v1.InfrastructureList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Infrastructure, err error) + InfrastructureExpansion +} + +// infrastructures implements InfrastructureInterface +type infrastructures struct { + client rest.Interface +} + +// newInfrastructures returns a Infrastructures +func newInfrastructures(c *ConfigV1Client) *infrastructures { + return &infrastructures{ + client: c.RESTClient(), + } +} + +// Get takes name of the infrastructure, and returns the corresponding infrastructure object, and an error if there is any. +func (c *infrastructures) Get(name string, options meta_v1.GetOptions) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Get(). + Resource("infrastructures"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Infrastructures that match those selectors. +func (c *infrastructures) List(opts meta_v1.ListOptions) (result *v1.InfrastructureList, err error) { + result = &v1.InfrastructureList{} + err = c.client.Get(). + Resource("infrastructures"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested infrastructures. +func (c *infrastructures) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("infrastructures"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a infrastructure and creates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *infrastructures) Create(infrastructure *v1.Infrastructure) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Post(). + Resource("infrastructures"). + Body(infrastructure). + Do(). + Into(result) + return +} + +// Update takes the representation of a infrastructure and updates it. Returns the server's representation of the infrastructure, and an error, if there is any. +func (c *infrastructures) Update(infrastructure *v1.Infrastructure) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Put(). + Resource("infrastructures"). + Name(infrastructure.Name). + Body(infrastructure). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *infrastructures) UpdateStatus(infrastructure *v1.Infrastructure) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Put(). + Resource("infrastructures"). + Name(infrastructure.Name). + SubResource("status"). + Body(infrastructure). + Do(). + Into(result) + return +} + +// Delete takes name of the infrastructure and deletes it. Returns an error if one occurs. +func (c *infrastructures) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("infrastructures"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *infrastructures) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("infrastructures"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched infrastructure. +func (c *infrastructures) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Infrastructure, err error) { + result = &v1.Infrastructure{} + err = c.client.Patch(pt). + Resource("infrastructures"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go new file mode 100644 index 0000000000..5b66b9c69a --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/ingress.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// IngressesGetter has a method to return a IngressInterface. +// A group's client should implement this interface. +type IngressesGetter interface { + Ingresses() IngressInterface +} + +// IngressInterface has methods to work with Ingress resources. +type IngressInterface interface { + Create(*v1.Ingress) (*v1.Ingress, error) + Update(*v1.Ingress) (*v1.Ingress, error) + UpdateStatus(*v1.Ingress) (*v1.Ingress, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Ingress, error) + List(opts meta_v1.ListOptions) (*v1.IngressList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Ingress, err error) + IngressExpansion +} + +// ingresses implements IngressInterface +type ingresses struct { + client rest.Interface +} + +// newIngresses returns a Ingresses +func newIngresses(c *ConfigV1Client) *ingresses { + return &ingresses{ + client: c.RESTClient(), + } +} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *ingresses) Get(name string, options meta_v1.GetOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Get(). + Resource("ingresses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) List(opts meta_v1.ListOptions) (result *v1.IngressList, err error) { + result = &v1.IngressList{} + err = c.client.Get(). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ingresses. +func (c *ingresses) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *ingresses) Create(ingress *v1.Ingress) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Post(). + Resource("ingresses"). + Body(ingress). + Do(). + Into(result) + return +} + +// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. +func (c *ingresses) Update(ingress *v1.Ingress) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Resource("ingresses"). + Name(ingress.Name). + Body(ingress). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *ingresses) UpdateStatus(ingress *v1.Ingress) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Resource("ingresses"). + Name(ingress.Name). + SubResource("status"). + Body(ingress). + Do(). + Into(result) + return +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *ingresses) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("ingresses"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ingresses) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("ingresses"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched ingress. +func (c *ingresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Patch(pt). + Resource("ingresses"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go new file mode 100644 index 0000000000..7d50be2d13 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/network.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// NetworksGetter has a method to return a NetworkInterface. +// A group's client should implement this interface. +type NetworksGetter interface { + Networks() NetworkInterface +} + +// NetworkInterface has methods to work with Network resources. +type NetworkInterface interface { + Create(*v1.Network) (*v1.Network, error) + Update(*v1.Network) (*v1.Network, error) + UpdateStatus(*v1.Network) (*v1.Network, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Network, error) + List(opts meta_v1.ListOptions) (*v1.NetworkList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Network, err error) + NetworkExpansion +} + +// networks implements NetworkInterface +type networks struct { + client rest.Interface +} + +// newNetworks returns a Networks +func newNetworks(c *ConfigV1Client) *networks { + return &networks{ + client: c.RESTClient(), + } +} + +// Get takes name of the network, and returns the corresponding network object, and an error if there is any. +func (c *networks) Get(name string, options meta_v1.GetOptions) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Get(). + Resource("networks"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Networks that match those selectors. +func (c *networks) List(opts meta_v1.ListOptions) (result *v1.NetworkList, err error) { + result = &v1.NetworkList{} + err = c.client.Get(). + Resource("networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networks. +func (c *networks) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("networks"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. +func (c *networks) Create(network *v1.Network) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Post(). + Resource("networks"). + Body(network). + Do(). + Into(result) + return +} + +// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. +func (c *networks) Update(network *v1.Network) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Put(). + Resource("networks"). + Name(network.Name). + Body(network). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *networks) UpdateStatus(network *v1.Network) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Put(). + Resource("networks"). + Name(network.Name). + SubResource("status"). + Body(network). + Do(). + Into(result) + return +} + +// Delete takes name of the network and deletes it. Returns an error if one occurs. +func (c *networks) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("networks"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networks) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("networks"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched network. +func (c *networks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Network, err error) { + result = &v1.Network{} + err = c.client.Patch(pt). + Resource("networks"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go new file mode 100644 index 0000000000..d6c227bfc4 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/oauth.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// OAuthsGetter has a method to return a OAuthInterface. +// A group's client should implement this interface. +type OAuthsGetter interface { + OAuths() OAuthInterface +} + +// OAuthInterface has methods to work with OAuth resources. +type OAuthInterface interface { + Create(*v1.OAuth) (*v1.OAuth, error) + Update(*v1.OAuth) (*v1.OAuth, error) + UpdateStatus(*v1.OAuth) (*v1.OAuth, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.OAuth, error) + List(opts meta_v1.ListOptions) (*v1.OAuthList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.OAuth, err error) + OAuthExpansion +} + +// oAuths implements OAuthInterface +type oAuths struct { + client rest.Interface +} + +// newOAuths returns a OAuths +func newOAuths(c *ConfigV1Client) *oAuths { + return &oAuths{ + client: c.RESTClient(), + } +} + +// Get takes name of the oAuth, and returns the corresponding oAuth object, and an error if there is any. +func (c *oAuths) Get(name string, options meta_v1.GetOptions) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Get(). + Resource("oauths"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OAuths that match those selectors. +func (c *oAuths) List(opts meta_v1.ListOptions) (result *v1.OAuthList, err error) { + result = &v1.OAuthList{} + err = c.client.Get(). + Resource("oauths"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested oAuths. +func (c *oAuths) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("oauths"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a oAuth and creates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *oAuths) Create(oAuth *v1.OAuth) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Post(). + Resource("oauths"). + Body(oAuth). + Do(). + Into(result) + return +} + +// Update takes the representation of a oAuth and updates it. Returns the server's representation of the oAuth, and an error, if there is any. +func (c *oAuths) Update(oAuth *v1.OAuth) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Put(). + Resource("oauths"). + Name(oAuth.Name). + Body(oAuth). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *oAuths) UpdateStatus(oAuth *v1.OAuth) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Put(). + Resource("oauths"). + Name(oAuth.Name). + SubResource("status"). + Body(oAuth). + Do(). + Into(result) + return +} + +// Delete takes name of the oAuth and deletes it. Returns an error if one occurs. +func (c *oAuths) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("oauths"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *oAuths) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("oauths"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched oAuth. +func (c *oAuths) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.OAuth, err error) { + result = &v1.OAuth{} + err = c.client.Patch(pt). + Resource("oauths"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go new file mode 100644 index 0000000000..0161002ff2 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/project.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ProjectsGetter has a method to return a ProjectInterface. +// A group's client should implement this interface. +type ProjectsGetter interface { + Projects() ProjectInterface +} + +// ProjectInterface has methods to work with Project resources. +type ProjectInterface interface { + Create(*v1.Project) (*v1.Project, error) + Update(*v1.Project) (*v1.Project, error) + UpdateStatus(*v1.Project) (*v1.Project, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Project, error) + List(opts meta_v1.ListOptions) (*v1.ProjectList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Project, err error) + ProjectExpansion +} + +// projects implements ProjectInterface +type projects struct { + client rest.Interface +} + +// newProjects returns a Projects +func newProjects(c *ConfigV1Client) *projects { + return &projects{ + client: c.RESTClient(), + } +} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *projects) Get(name string, options meta_v1.GetOptions) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Get(). + Resource("projects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *projects) List(opts meta_v1.ListOptions) (result *v1.ProjectList, err error) { + result = &v1.ProjectList{} + err = c.client.Get(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *projects) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Create(project *v1.Project) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Post(). + Resource("projects"). + Body(project). + Do(). + Into(result) + return +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Update(project *v1.Project) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Put(). + Resource("projects"). + Name(project.Name). + Body(project). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *projects) UpdateStatus(project *v1.Project) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Put(). + Resource("projects"). + Name(project.Name). + SubResource("status"). + Body(project). + Do(). + Into(result) + return +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *projects) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("projects"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projects) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("projects"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched project. +func (c *projects) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Project, err error) { + result = &v1.Project{} + err = c.client.Patch(pt). + Resource("projects"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduling.go b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduling.go new file mode 100644 index 0000000000..398c76bd13 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/clientset/versioned/typed/config/v1/scheduling.go @@ -0,0 +1,147 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/openshift/api/config/v1" + scheme "github.com/openshift/client-go/config/clientset/versioned/scheme" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// SchedulingsGetter has a method to return a SchedulingInterface. +// A group's client should implement this interface. +type SchedulingsGetter interface { + Schedulings() SchedulingInterface +} + +// SchedulingInterface has methods to work with Scheduling resources. +type SchedulingInterface interface { + Create(*v1.Scheduling) (*v1.Scheduling, error) + Update(*v1.Scheduling) (*v1.Scheduling, error) + UpdateStatus(*v1.Scheduling) (*v1.Scheduling, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Scheduling, error) + List(opts meta_v1.ListOptions) (*v1.SchedulingList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Scheduling, err error) + SchedulingExpansion +} + +// schedulings implements SchedulingInterface +type schedulings struct { + client rest.Interface +} + +// newSchedulings returns a Schedulings +func newSchedulings(c *ConfigV1Client) *schedulings { + return &schedulings{ + client: c.RESTClient(), + } +} + +// Get takes name of the scheduling, and returns the corresponding scheduling object, and an error if there is any. +func (c *schedulings) Get(name string, options meta_v1.GetOptions) (result *v1.Scheduling, err error) { + result = &v1.Scheduling{} + err = c.client.Get(). + Resource("schedulings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Schedulings that match those selectors. +func (c *schedulings) List(opts meta_v1.ListOptions) (result *v1.SchedulingList, err error) { + result = &v1.SchedulingList{} + err = c.client.Get(). + Resource("schedulings"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested schedulings. +func (c *schedulings) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("schedulings"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a scheduling and creates it. Returns the server's representation of the scheduling, and an error, if there is any. +func (c *schedulings) Create(scheduling *v1.Scheduling) (result *v1.Scheduling, err error) { + result = &v1.Scheduling{} + err = c.client.Post(). + Resource("schedulings"). + Body(scheduling). + Do(). + Into(result) + return +} + +// Update takes the representation of a scheduling and updates it. Returns the server's representation of the scheduling, and an error, if there is any. +func (c *schedulings) Update(scheduling *v1.Scheduling) (result *v1.Scheduling, err error) { + result = &v1.Scheduling{} + err = c.client.Put(). + Resource("schedulings"). + Name(scheduling.Name). + Body(scheduling). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + +func (c *schedulings) UpdateStatus(scheduling *v1.Scheduling) (result *v1.Scheduling, err error) { + result = &v1.Scheduling{} + err = c.client.Put(). + Resource("schedulings"). + Name(scheduling.Name). + SubResource("status"). + Body(scheduling). + Do(). + Into(result) + return +} + +// Delete takes name of the scheduling and deletes it. Returns an error if one occurs. +func (c *schedulings) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Resource("schedulings"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *schedulings) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Resource("schedulings"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched scheduling. +func (c *schedulings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Scheduling, err error) { + result = &v1.Scheduling{} + err = c.client.Patch(pt). + Resource("schedulings"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} 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/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/identityprovider.go b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/identityprovider.go new file mode 100644 index 0000000000..60d09b4073 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/identityprovider.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" +) + +// IdentityProviderInformer provides access to a shared informer and lister for +// IdentityProviders. +type IdentityProviderInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.IdentityProviderLister +} + +type identityProviderInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIdentityProviderInformer constructs a new informer for IdentityProvider 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 NewIdentityProviderInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIdentityProviderInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIdentityProviderInformer constructs a new informer for IdentityProvider 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 NewFilteredIdentityProviderInformer(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().IdentityProviders().List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ConfigV1().IdentityProviders().Watch(options) + }, + }, + &config_v1.IdentityProvider{}, + resyncPeriod, + indexers, + ) +} + +func (f *identityProviderInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIdentityProviderInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *identityProviderInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&config_v1.IdentityProvider{}, f.defaultInformer) +} + +func (f *identityProviderInformer) Lister() v1.IdentityProviderLister { + return v1.NewIdentityProviderLister(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..05653a8cdc --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/config/v1/interface.go @@ -0,0 +1,120 @@ +// 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 { + // 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 + // IdentityProviders returns a IdentityProviderInformer. + IdentityProviders() IdentityProviderInformer + // 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 + // 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} +} + +// 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} +} + +// IdentityProviders returns a IdentityProviderInformer. +func (v *version) IdentityProviders() IdentityProviderInformer { + return &identityProviderInformer{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} +} + +// 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/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..edbb6135d1 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/informers/externalversions/generic.go @@ -0,0 +1,72 @@ +// 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("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("identityproviders"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().IdentityProviders().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("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/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..f8fa6f8e2e --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/expansion_generated.go @@ -0,0 +1,59 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// 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{} + +// IdentityProviderListerExpansion allows custom methods to be added to +// IdentityProviderLister. +type IdentityProviderListerExpansion 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{} + +// 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/identityprovider.go b/vendor/github.com/openshift/client-go/config/listers/config/v1/identityprovider.go new file mode 100644 index 0000000000..0869b87bd7 --- /dev/null +++ b/vendor/github.com/openshift/client-go/config/listers/config/v1/identityprovider.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" +) + +// IdentityProviderLister helps list IdentityProviders. +type IdentityProviderLister interface { + // List lists all IdentityProviders in the indexer. + List(selector labels.Selector) (ret []*v1.IdentityProvider, err error) + // Get retrieves the IdentityProvider from the index for a given name. + Get(name string) (*v1.IdentityProvider, error) + IdentityProviderListerExpansion +} + +// identityProviderLister implements the IdentityProviderLister interface. +type identityProviderLister struct { + indexer cache.Indexer +} + +// NewIdentityProviderLister returns a new IdentityProviderLister. +func NewIdentityProviderLister(indexer cache.Indexer) IdentityProviderLister { + return &identityProviderLister{indexer: indexer} +} + +// List lists all IdentityProviders in the indexer. +func (s *identityProviderLister) List(selector labels.Selector) (ret []*v1.IdentityProvider, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.IdentityProvider)) + }) + return ret, err +} + +// Get retrieves the IdentityProvider from the index for a given name. +func (s *identityProviderLister) Get(name string) (*v1.IdentityProvider, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("identityprovider"), name) + } + return obj.(*v1.IdentityProvider), nil +} 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/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 +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go b/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go new file mode 100644 index 0000000000..9f20152e45 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package validation contains generic api type validation functions. +package validation // import "k8s.io/apimachinery/pkg/api/validation" diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go b/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go new file mode 100644 index 0000000000..348cdc0873 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/generic.go @@ -0,0 +1,85 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "strings" + + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +const IsNegativeErrorMsg string = `must be greater than or equal to 0` + +// ValidateNameFunc validates that the provided name is valid for a given resource type. +// Not all resources have the same validation rules for names. Prefix is true +// if the name will have a value appended to it. If the name is not valid, +// this returns a list of descriptions of individual characteristics of the +// value that were not valid. Otherwise this returns an empty list or nil. +type ValidateNameFunc func(name string, prefix bool) []string + +// NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain. +func NameIsDNSSubdomain(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Subdomain(name) +} + +// NameIsDNSLabel is a ValidateNameFunc for names that must be a DNS 1123 label. +func NameIsDNSLabel(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Label(name) +} + +// NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label. +func NameIsDNS1035Label(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1035Label(name) +} + +// ValidateNamespaceName can be used to check whether the given namespace name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateNamespaceName = NameIsDNSLabel + +// ValidateServiceAccountName can be used to check whether the given service account name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateServiceAccountName = NameIsDNSSubdomain + +// maskTrailingDash replaces the final character of a string with a subdomain safe +// value if is a dash. +func maskTrailingDash(name string) string { + if strings.HasSuffix(name, "-") { + return name[:len(name)-2] + "a" + } + return name +} + +// Validates that given value is not negative. +func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if value < 0 { + allErrs = append(allErrs, field.Invalid(fldPath, value, IsNegativeErrorMsg)) + } + return allErrs +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go new file mode 100644 index 0000000000..44b9b16006 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/validation/objectmeta.go @@ -0,0 +1,308 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + "fmt" + "strings" + + apiequality "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +const FieldImmutableErrorMsg string = `field is immutable` + +const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB + +// BannedOwners is a black list of object that are not allowed to be owners. +var BannedOwners = map[schema.GroupVersionKind]struct{}{ + {Group: "", Version: "v1", Kind: "Event"}: {}, +} + +// ValidateClusterName can be used to check whether the given cluster name is valid. +var ValidateClusterName = NameIsDNS1035Label + +// ValidateAnnotations validates that a set of annotations are correctly defined. +func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + var totalSize int64 + for k, v := range annotations { + for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) { + allErrs = append(allErrs, field.Invalid(fldPath, k, msg)) + } + totalSize += (int64)(len(k)) + (int64)(len(v)) + } + if totalSize > (int64)(totalAnnotationSizeLimitB) { + allErrs = append(allErrs, field.TooLong(fldPath, "", totalAnnotationSizeLimitB)) + } + return allErrs +} + +func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind) + // gvk.Group is empty for the legacy group. + if len(gvk.Version) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVersion"), ownerReference.APIVersion, "version must not be empty")) + } + if len(gvk.Kind) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ownerReference.Kind, "kind must not be empty")) + } + if len(ownerReference.Name) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ownerReference.Name, "name must not be empty")) + } + if len(ownerReference.UID) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "uid must not be empty")) + } + if _, ok := BannedOwners[gvk]; ok { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk))) + } + return allErrs +} + +func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + controllerName := "" + for _, ref := range ownerReferences { + allErrs = append(allErrs, validateOwnerReference(ref, fldPath)...) + if ref.Controller != nil && *ref.Controller { + if controllerName != "" { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReferences, + fmt.Sprintf("Only one reference can have Controller set to true. Found \"true\" in references for %v and %v", controllerName, ref.Name))) + } else { + controllerName = ref.Name + } + } + } + return allErrs +} + +// Validate finalizer names +func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsQualifiedName(stringValue) { + allErrs = append(allErrs, field.Invalid(fldPath, stringValue, msg)) + } + + return allErrs +} + +func ValidateNoNewFinalizers(newFinalizers []string, oldFinalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + extra := sets.NewString(newFinalizers...).Difference(sets.NewString(oldFinalizers...)) + if len(extra) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath, fmt.Sprintf("no new finalizers can be added if the object is being deleted, found new finalizers %#v", extra.List()))) + } + return allErrs +} + +func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if !apiequality.Semantic.DeepEqual(oldVal, newVal) { + allErrs = append(allErrs, field.Invalid(fldPath, newVal, FieldImmutableErrorMsg)) + } + return allErrs +} + +// ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + metadata, err := meta.Accessor(objMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, objMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessor(metadata, requiresNamespace, nameFn, fldPath) +} + +// ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMetaAccessor(meta metav1.Object, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + + if len(meta.GetGenerateName()) != 0 { + for _, msg := range nameFn(meta.GetGenerateName(), true) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generateName"), meta.GetGenerateName(), msg)) + } + } + // If the generated name validates, but the calculated value does not, it's a problem with generation, and we + // report it here. This may confuse users, but indicates a programming bug and still must be validated. + // If there are multiple fields out of which one is required then add an or as a separator + if len(meta.GetName()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("name"), "name or generateName is required")) + } else { + for _, msg := range nameFn(meta.GetName(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), meta.GetName(), msg)) + } + } + if requiresNamespace { + if len(meta.GetNamespace()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("namespace"), "")) + } else { + for _, msg := range ValidateNamespaceName(meta.GetNamespace(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), meta.GetNamespace(), msg)) + } + } + } else { + if len(meta.GetNamespace()) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "not allowed on this type")) + } + } + if len(meta.GetClusterName()) != 0 { + for _, msg := range ValidateClusterName(meta.GetClusterName(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("clusterName"), meta.GetClusterName(), msg)) + } + } + allErrs = append(allErrs, ValidateNonnegativeField(meta.GetGeneration(), fldPath.Child("generation"))...) + allErrs = append(allErrs, v1validation.ValidateLabels(meta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(meta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(meta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + allErrs = append(allErrs, ValidateInitializers(meta.GetInitializers(), fldPath.Child("initializers"))...) + allErrs = append(allErrs, ValidateFinalizers(meta.GetFinalizers(), fldPath.Child("finalizers"))...) + return allErrs +} + +func ValidateInitializers(initializers *metav1.Initializers, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if initializers == nil { + return allErrs + } + for i, initializer := range initializers.Pending { + allErrs = append(allErrs, validation.IsFullyQualifiedName(fldPath.Child("pending").Index(i).Child("name"), initializer.Name)...) + } + allErrs = append(allErrs, validateInitializersResult(initializers.Result, fldPath.Child("result"))...) + return allErrs +} + +func validateInitializersResult(result *metav1.Status, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + if result == nil { + return allErrs + } + switch result.Status { + case metav1.StatusFailure: + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("status"), result.Status, "must be 'Failure'")) + } + return allErrs +} + +// ValidateFinalizers tests if the finalizers name are valid, and if there are conflicting finalizers. +func ValidateFinalizers(finalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + hasFinalizerOrphanDependents := false + hasFinalizerDeleteDependents := false + for _, finalizer := range finalizers { + allErrs = append(allErrs, ValidateFinalizerName(finalizer, fldPath)...) + if finalizer == metav1.FinalizerOrphanDependents { + hasFinalizerOrphanDependents = true + } + if finalizer == metav1.FinalizerDeleteDependents { + hasFinalizerDeleteDependents = true + } + } + if hasFinalizerDeleteDependents && hasFinalizerOrphanDependents { + allErrs = append(allErrs, field.Invalid(fldPath, finalizers, fmt.Sprintf("finalizer %s and %s cannot be both set", metav1.FinalizerOrphanDependents, metav1.FinalizerDeleteDependents))) + } + return allErrs +} + +// ValidateObjectMetaUpdate validates an object's metadata when updated +func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { + newMetadata, err := meta.Accessor(newMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, newMeta, err.Error())) + return allErrs + } + oldMetadata, err := meta.Accessor(oldMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, oldMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessorUpdate(newMetadata, oldMetadata, fldPath) +} + +func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // Finalizers cannot be added if the object is already being deleted. + if oldMeta.GetDeletionTimestamp() != nil { + allErrs = append(allErrs, ValidateNoNewFinalizers(newMeta.GetFinalizers(), oldMeta.GetFinalizers(), fldPath.Child("finalizers"))...) + } + + // Reject updates that don't specify a resource version + if len(newMeta.GetResourceVersion()) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceVersion"), newMeta.GetResourceVersion(), "must be specified for an update")) + } + + // Generation shouldn't be decremented + if newMeta.GetGeneration() < oldMeta.GetGeneration() { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generation"), newMeta.GetGeneration(), "must not be decremented")) + } + + allErrs = append(allErrs, ValidateInitializersUpdate(newMeta.GetInitializers(), oldMeta.GetInitializers(), fldPath.Child("initializers"))...) + + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetName(), oldMeta.GetName(), fldPath.Child("name"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetNamespace(), oldMeta.GetNamespace(), fldPath.Child("namespace"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetUID(), oldMeta.GetUID(), fldPath.Child("uid"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetCreationTimestamp(), oldMeta.GetCreationTimestamp(), fldPath.Child("creationTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionTimestamp(), oldMeta.GetDeletionTimestamp(), fldPath.Child("deletionTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionGracePeriodSeconds(), oldMeta.GetDeletionGracePeriodSeconds(), fldPath.Child("deletionGracePeriodSeconds"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetClusterName(), oldMeta.GetClusterName(), fldPath.Child("clusterName"))...) + + allErrs = append(allErrs, v1validation.ValidateLabels(newMeta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(newMeta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(newMeta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + + return allErrs +} + +// ValidateInitializersUpdate checks the update of the metadata initializers field +func ValidateInitializersUpdate(newInit, oldInit *metav1.Initializers, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + switch { + case oldInit == nil && newInit != nil: + // Initializers may not be set on new objects + allErrs = append(allErrs, field.Invalid(fldPath, nil, "field is immutable once initialization has completed")) + case oldInit != nil && newInit == nil: + // this is a valid transition and means initialization was successful + case oldInit != nil && newInit != nil: + // validate changes to initializers + switch { + case oldInit.Result == nil && newInit.Result != nil: + // setting a result is allowed + allErrs = append(allErrs, validateInitializersResult(newInit.Result, fldPath.Child("result"))...) + case oldInit.Result != nil: + // setting Result implies permanent failure, and all future updates will be prevented + allErrs = append(allErrs, ValidateImmutableField(newInit.Result, oldInit.Result, fldPath.Child("result"))...) + default: + // leaving the result nil is allowed + } + } + return allErrs +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go new file mode 100644 index 0000000000..96e5f42b73 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go @@ -0,0 +1,90 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package validation + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +func ValidateLabelSelector(ps *metav1.LabelSelector, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if ps == nil { + return allErrs + } + allErrs = append(allErrs, ValidateLabels(ps.MatchLabels, fldPath.Child("matchLabels"))...) + for i, expr := range ps.MatchExpressions { + allErrs = append(allErrs, ValidateLabelSelectorRequirement(expr, fldPath.Child("matchExpressions").Index(i))...) + } + return allErrs +} + +func ValidateLabelSelectorRequirement(sr metav1.LabelSelectorRequirement, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + switch sr.Operator { + case metav1.LabelSelectorOpIn, metav1.LabelSelectorOpNotIn: + if len(sr.Values) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("values"), "must be specified when `operator` is 'In' or 'NotIn'")) + } + case metav1.LabelSelectorOpExists, metav1.LabelSelectorOpDoesNotExist: + if len(sr.Values) > 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("values"), "may not be specified when `operator` is 'Exists' or 'DoesNotExist'")) + } + default: + allErrs = append(allErrs, field.Invalid(fldPath.Child("operator"), sr.Operator, "not a valid selector operator")) + } + allErrs = append(allErrs, ValidateLabelName(sr.Key, fldPath.Child("key"))...) + return allErrs +} + +// ValidateLabelName validates that the label name is correctly defined. +func ValidateLabelName(labelName string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsQualifiedName(labelName) { + allErrs = append(allErrs, field.Invalid(fldPath, labelName, msg)) + } + return allErrs +} + +// ValidateLabels validates that a set of labels are correctly defined. +func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for k, v := range labels { + allErrs = append(allErrs, ValidateLabelName(k, fldPath)...) + for _, msg := range validation.IsValidLabelValue(v) { + allErrs = append(allErrs, field.Invalid(fldPath, v, msg)) + } + } + return allErrs +} + +func ValidateDeleteOptions(options *metav1.DeleteOptions) field.ErrorList { + allErrs := field.ErrorList{} + if options.OrphanDependents != nil && options.PropagationPolicy != nil { + allErrs = append(allErrs, field.Invalid(field.NewPath("propagationPolicy"), options.PropagationPolicy, "orphanDependents and deletionPropagation cannot be both set")) + } + if options.PropagationPolicy != nil && + *options.PropagationPolicy != metav1.DeletePropagationForeground && + *options.PropagationPolicy != metav1.DeletePropagationBackground && + *options.PropagationPolicy != metav1.DeletePropagationOrphan { + allErrs = append(allErrs, field.NotSupported(field.NewPath("propagationPolicy"), options.PropagationPolicy, []string{string(metav1.DeletePropagationForeground), string(metav1.DeletePropagationBackground), string(metav1.DeletePropagationOrphan), "nil"})) + } + return allErrs +} + +const UninitializedStatusUpdateErrorMsg string = `must not update status when the object is uninitialized` From 9519fc437302c930cb67337a711eb6ab534a7869 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 18 Nov 2018 22:10:46 -0500 Subject: [PATCH 2/4] crd: Set ClusterOperator to cluster scoped The CO is cluster scoped so that users can run `oc get clusteroperators` and to make it clear it's cluster scoped. --- ...0000_00_cluster-version-operator_01_clusteroperator.crd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml b/install/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml index 7a471a0d0d..44b986a83f 100644 --- a/install/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml +++ b/install/0000_00_cluster-version-operator_01_clusteroperator.crd.yaml @@ -26,7 +26,7 @@ spec: listKind: ClusterOperatorList plural: clusteroperators singular: clusteroperator - scope: Namespaced + scope: Cluster subresources: status: {} version: v1 From 286641de684ba585ae076898bd933858bbb2e58d Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Thu, 15 Nov 2018 14:12:14 -0500 Subject: [PATCH 3/4] api: Update to objects from openshift/api ClusterVersion/ClusterOperator moved to the openshift/api repo, with minor changes that are vendored back here. This is the reaction PR. The major differences in what went upstream: * ClusterOperator is now cluster scoped * ClusterVersion deserialization doesn't check UID or URL deserialization, which needs to be handled in by the operator anyway (subsequent commit) * ClusterVersion URL is not a pointer, suggestion was to create a new field which controls update behavior such as `updateMode: ` where Retrieve might be the default. --- cmd/start.go | 8 +- docs/dev/clusteroperator.md | 4 +- lib/resourceapply/cv.go | 10 +- lib/resourcemerge/cv.go | 13 +- lib/resourcemerge/os.go | 30 +- pkg/apis/apis.go | 7 - pkg/apis/config.openshift.io/v1/cluster_id.go | 30 - .../config.openshift.io/v1/clusterversion.go | 9 - pkg/apis/config.openshift.io/v1/register.go | 45 -- pkg/apis/config.openshift.io/v1/types.go | 155 ----- pkg/apis/config.openshift.io/v1/url.go | 22 - .../v1/zz_generated.deepcopy.go | 179 ----- .../v1/register.go | 45 -- .../operatorstatus.openshift.io/v1/types.go | 106 --- .../v1/zz_generated.deepcopy.go | 127 ---- pkg/autoupdate/autoupdate.go | 20 +- pkg/autoupdate/autoupdate_test.go | 2 +- pkg/cvo/availableupdates.go | 45 +- pkg/cvo/cvo.go | 62 +- pkg/cvo/cvo_test.go | 621 +++++++++--------- pkg/cvo/internal/generic.go | 2 +- pkg/cvo/internal/operatorstatus.go | 28 +- pkg/cvo/metrics.go | 19 +- pkg/cvo/metrics_test.go | 65 +- pkg/cvo/status.go | 115 ++-- pkg/cvo/sync.go | 21 +- pkg/cvo/sync_test.go | 6 +- pkg/cvo/updatepayload.go | 10 +- .../clientset/versioned/clientset.go | 120 ---- pkg/generated/clientset/versioned/doc.go | 20 - .../versioned/fake/clientset_generated.go | 94 --- pkg/generated/clientset/versioned/fake/doc.go | 20 - .../clientset/versioned/fake/register.go | 56 -- .../clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 56 -- .../config.openshift.io/v1/clusterversion.go | 163 ----- .../v1/config.openshift.io_client.go | 90 --- .../typed/config.openshift.io/v1/doc.go | 20 - .../typed/config.openshift.io/v1/fake/doc.go | 20 - .../v1/fake/fake_clusterversion.go | 131 ---- .../fake/fake_config.openshift.io_client.go | 40 -- .../v1/generated_expansion.go | 21 - .../v1/clusteroperator.go | 174 ----- .../operatorstatus.openshift.io/v1/doc.go | 20 - .../v1/fake/doc.go | 20 - .../v1/fake/fake_clusteroperator.go | 140 ---- ...fake_operatorstatus.openshift.io_client.go | 40 -- .../v1/generated_expansion.go | 21 - .../v1/operatorstatus.openshift.io_client.go | 90 --- .../config.openshift.io/interface.go | 46 -- .../config.openshift.io/v1/clusterversion.go | 88 --- .../config.openshift.io/v1/interface.go | 45 -- .../informers/externalversions/factory.go | 186 ------ .../informers/externalversions/generic.go | 67 -- .../internalinterfaces/factory_interfaces.go | 38 -- .../operatorstatus.openshift.io/interface.go | 46 -- .../v1/clusteroperator.go | 89 --- .../v1/interface.go | 45 -- .../config.openshift.io/v1/clusterversion.go | 65 -- .../v1/expansion_generated.go | 23 - .../v1/clusteroperator.go | 94 --- .../v1/expansion_generated.go | 27 - 62 files changed, 547 insertions(+), 3494 deletions(-) delete mode 100644 pkg/apis/apis.go delete mode 100644 pkg/apis/config.openshift.io/v1/cluster_id.go delete mode 100644 pkg/apis/config.openshift.io/v1/clusterversion.go delete mode 100644 pkg/apis/config.openshift.io/v1/register.go delete mode 100644 pkg/apis/config.openshift.io/v1/types.go delete mode 100644 pkg/apis/config.openshift.io/v1/url.go delete mode 100644 pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go delete mode 100644 pkg/apis/operatorstatus.openshift.io/v1/register.go delete mode 100644 pkg/apis/operatorstatus.openshift.io/v1/types.go delete mode 100644 pkg/apis/operatorstatus.openshift.io/v1/zz_generated.deepcopy.go delete mode 100644 pkg/generated/clientset/versioned/clientset.go delete mode 100644 pkg/generated/clientset/versioned/doc.go delete mode 100644 pkg/generated/clientset/versioned/fake/clientset_generated.go delete mode 100644 pkg/generated/clientset/versioned/fake/doc.go delete mode 100644 pkg/generated/clientset/versioned/fake/register.go delete mode 100644 pkg/generated/clientset/versioned/scheme/doc.go delete mode 100644 pkg/generated/clientset/versioned/scheme/register.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/clusterversion.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_clusterversion.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go delete mode 100644 pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/clusteroperator.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/doc.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/doc.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_clusteroperator.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_operatorstatus.openshift.io_client.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/generated_expansion.go delete mode 100644 pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/operatorstatus.openshift.io_client.go delete mode 100644 pkg/generated/informers/externalversions/config.openshift.io/interface.go delete mode 100644 pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go delete mode 100644 pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go delete mode 100644 pkg/generated/informers/externalversions/factory.go delete mode 100644 pkg/generated/informers/externalversions/generic.go delete mode 100644 pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go delete mode 100644 pkg/generated/informers/externalversions/operatorstatus.openshift.io/interface.go delete mode 100644 pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/clusteroperator.go delete mode 100644 pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/interface.go delete mode 100644 pkg/generated/listers/config.openshift.io/v1/clusterversion.go delete mode 100644 pkg/generated/listers/config.openshift.io/v1/expansion_generated.go delete mode 100644 pkg/generated/listers/operatorstatus.openshift.io/v1/clusteroperator.go delete mode 100644 pkg/generated/listers/operatorstatus.openshift.io/v1/expansion_generated.go diff --git a/cmd/start.go b/cmd/start.go index 19c78cdef5..5332a50c2f 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -9,10 +9,10 @@ import ( "github.com/golang/glog" "github.com/google/uuid" + clientset "github.com/openshift/client-go/config/clientset/versioned" + informers "github.com/openshift/client-go/config/informers/externalversions" "github.com/openshift/cluster-version-operator/pkg/autoupdate" "github.com/openshift/cluster-version-operator/pkg/cvo" - clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - informers "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions" "github.com/openshift/cluster-version-operator/pkg/version" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cobra" @@ -253,7 +253,7 @@ func startControllers(ctx *controllerContext) error { overrideDirectory, ctx.ResyncPeriod(), ctx.InformerFactory.Config().V1().ClusterVersions(), - ctx.InformerFactory.Operatorstatus().V1().ClusterOperators(), + ctx.InformerFactory.Config().V1().ClusterOperators(), ctx.ClientBuilder.RestConfig(), ctx.ClientBuilder.ClientOrDie(componentName), ctx.ClientBuilder.KubeClientOrDie(componentName), @@ -264,7 +264,7 @@ func startControllers(ctx *controllerContext) error { go autoupdate.New( componentNamespace, componentName, ctx.InformerFactory.Config().V1().ClusterVersions(), - ctx.InformerFactory.Operatorstatus().V1().ClusterOperators(), + ctx.InformerFactory.Config().V1().ClusterOperators(), ctx.ClientBuilder.ClientOrDie(componentName), ctx.ClientBuilder.KubeClientOrDie(componentName), ).Run(2, ctx.Stop) diff --git a/docs/dev/clusteroperator.md b/docs/dev/clusteroperator.md index f3def1e229..5a067205bd 100644 --- a/docs/dev/clusteroperator.md +++ b/docs/dev/clusteroperator.md @@ -2,7 +2,7 @@ The ClusterOperator is a custom resource object which holds the current state of an operator. This object is used by operators to convey their state to the rest of the cluster. -Ref: [godoc](https://godoc.org/github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1#ClusterOperator) for more info on the ClusterOperator type. +Ref: [godoc](https://godoc.org/github.com/openshift/api/config/v1#ClusterOperator) for more info on the ClusterOperator type. ## Why I want ClusterOperator Custom Resource in /manifests @@ -58,4 +58,4 @@ The operator should report a version which indicates the components that it is a ### Conditions -Refer [the godocs](https://godoc.org/github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1#ClusterStatusConditionType) for conditions. +Refer [the godocs](https://godoc.org/github.com/openshift/api/config/v1#ClusterStatusConditionType) for conditions. diff --git a/lib/resourceapply/cv.go b/lib/resourceapply/cv.go index 88d0db3d93..7b45b329c6 100644 --- a/lib/resourceapply/cv.go +++ b/lib/resourceapply/cv.go @@ -1,16 +1,16 @@ package resourceapply import ( + configv1 "github.com/openshift/api/config/v1" + configclientv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - cvclientv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" - cvlistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/config.openshift.io/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" ) -func ApplyClusterVersion(client cvclientv1.ClusterVersionsGetter, required *cvv1.ClusterVersion) (*cvv1.ClusterVersion, bool, error) { +func ApplyClusterVersion(client configclientv1.ClusterVersionsGetter, required *configv1.ClusterVersion) (*configv1.ClusterVersion, bool, error) { existing, err := client.ClusterVersions().Get(required.Name, metav1.GetOptions{}) if errors.IsNotFound(err) { actual, err := client.ClusterVersions().Create(required) @@ -30,7 +30,7 @@ func ApplyClusterVersion(client cvclientv1.ClusterVersionsGetter, required *cvv1 return actual, true, err } -func ApplyClusterVersionFromCache(lister cvlistersv1.ClusterVersionLister, client cvclientv1.ClusterVersionsGetter, required *cvv1.ClusterVersion) (*cvv1.ClusterVersion, bool, error) { +func ApplyClusterVersionFromCache(lister configlistersv1.ClusterVersionLister, client configclientv1.ClusterVersionsGetter, required *configv1.ClusterVersion) (*configv1.ClusterVersion, bool, error) { obj, err := lister.Get(required.Name) if errors.IsNotFound(err) { actual, err := client.ClusterVersions().Create(required) diff --git a/lib/resourcemerge/cv.go b/lib/resourcemerge/cv.go index 059cd62f42..0322532613 100644 --- a/lib/resourcemerge/cv.go +++ b/lib/resourcemerge/cv.go @@ -1,20 +1,15 @@ package resourcemerge import ( - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" + configv1 "github.com/openshift/api/config/v1" "k8s.io/apimachinery/pkg/api/equality" ) -func EnsureClusterVersion(modified *bool, existing *cvv1.ClusterVersion, required cvv1.ClusterVersion) { +func EnsureClusterVersion(modified *bool, existing *configv1.ClusterVersion, required configv1.ClusterVersion) { EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) if !equality.Semantic.DeepEqual(existing.Spec.Upstream, required.Spec.Upstream) { *modified = true - if required.Spec.Upstream != nil { - copied := *required.Spec.Upstream - existing.Spec.Upstream = &copied - } else { - existing.Spec.Upstream = nil - } + existing.Spec.Upstream = required.Spec.Upstream } if existing.Spec.Channel != required.Spec.Channel { *modified = true @@ -36,7 +31,7 @@ func EnsureClusterVersion(modified *bool, existing *cvv1.ClusterVersion, require } } -func EnsureClusterVersionStatus(modified *bool, existing *cvv1.ClusterVersion, required cvv1.ClusterVersion) { +func EnsureClusterVersionStatus(modified *bool, existing *configv1.ClusterVersion, required configv1.ClusterVersion) { if !equality.Semantic.DeepEqual(existing.Status, required.Status) { *modified = true existing.Status = *required.Status.DeepCopy() diff --git a/lib/resourcemerge/os.go b/lib/resourcemerge/os.go index c1035c90c3..2939ba7657 100644 --- a/lib/resourcemerge/os.go +++ b/lib/resourcemerge/os.go @@ -6,15 +6,15 @@ import ( "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" + configv1 "github.com/openshift/api/config/v1" ) -func EnsureClusterOperatorStatus(modified *bool, existing *osv1.ClusterOperator, required osv1.ClusterOperator) { +func EnsureClusterOperatorStatus(modified *bool, existing *configv1.ClusterOperator, required configv1.ClusterOperator) { EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) ensureClusterOperatorStatus(modified, &existing.Status, required.Status) } -func ensureClusterOperatorStatus(modified *bool, existing *osv1.ClusterOperatorStatus, required osv1.ClusterOperatorStatus) { +func ensureClusterOperatorStatus(modified *bool, existing *configv1.ClusterOperatorStatus, required configv1.ClusterOperatorStatus) { if !equality.Semantic.DeepEqual(existing.Conditions, required.Conditions) { *modified = true existing.Conditions = required.Conditions @@ -33,9 +33,9 @@ func ensureClusterOperatorStatus(modified *bool, existing *osv1.ClusterOperatorS } } -func SetOperatorStatusCondition(conditions *[]osv1.ClusterOperatorStatusCondition, newCondition osv1.ClusterOperatorStatusCondition) { +func SetOperatorStatusCondition(conditions *[]configv1.ClusterOperatorStatusCondition, newCondition configv1.ClusterOperatorStatusCondition) { if conditions == nil { - conditions = &[]osv1.ClusterOperatorStatusCondition{} + conditions = &[]configv1.ClusterOperatorStatusCondition{} } existingCondition := FindOperatorStatusCondition(*conditions, newCondition.Type) if existingCondition == nil { @@ -53,11 +53,11 @@ func SetOperatorStatusCondition(conditions *[]osv1.ClusterOperatorStatusConditio existingCondition.Message = newCondition.Message } -func RemoveOperatorStatusCondition(conditions *[]osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType) { +func RemoveOperatorStatusCondition(conditions *[]configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType) { if conditions == nil { - conditions = &[]osv1.ClusterOperatorStatusCondition{} + conditions = &[]configv1.ClusterOperatorStatusCondition{} } - newConditions := []osv1.ClusterOperatorStatusCondition{} + newConditions := []configv1.ClusterOperatorStatusCondition{} for _, condition := range *conditions { if condition.Type != conditionType { newConditions = append(newConditions, condition) @@ -67,7 +67,7 @@ func RemoveOperatorStatusCondition(conditions *[]osv1.ClusterOperatorStatusCondi *conditions = newConditions } -func FindOperatorStatusCondition(conditions []osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType) *osv1.ClusterOperatorStatusCondition { +func FindOperatorStatusCondition(conditions []configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType) *configv1.ClusterOperatorStatusCondition { for i := range conditions { if conditions[i].Type == conditionType { return &conditions[i] @@ -77,15 +77,15 @@ func FindOperatorStatusCondition(conditions []osv1.ClusterOperatorStatusConditio return nil } -func IsOperatorStatusConditionTrue(conditions []osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType) bool { - return IsOperatorStatusConditionPresentAndEqual(conditions, conditionType, osv1.ConditionTrue) +func IsOperatorStatusConditionTrue(conditions []configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType) bool { + return IsOperatorStatusConditionPresentAndEqual(conditions, conditionType, configv1.ConditionTrue) } -func IsOperatorStatusConditionFalse(conditions []osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType) bool { - return IsOperatorStatusConditionPresentAndEqual(conditions, conditionType, osv1.ConditionFalse) +func IsOperatorStatusConditionFalse(conditions []configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType) bool { + return IsOperatorStatusConditionPresentAndEqual(conditions, conditionType, configv1.ConditionFalse) } -func IsOperatorStatusConditionPresentAndEqual(conditions []osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType, status osv1.ConditionStatus) bool { +func IsOperatorStatusConditionPresentAndEqual(conditions []configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType, status configv1.ConditionStatus) bool { for _, condition := range conditions { if condition.Type == conditionType { return condition.Status == status @@ -94,7 +94,7 @@ func IsOperatorStatusConditionPresentAndEqual(conditions []osv1.ClusterOperatorS return false } -func IsOperatorStatusConditionNotIn(conditions []osv1.ClusterOperatorStatusCondition, conditionType osv1.ClusterStatusConditionType, status ...osv1.ConditionStatus) bool { +func IsOperatorStatusConditionNotIn(conditions []configv1.ClusterOperatorStatusCondition, conditionType configv1.ClusterStatusConditionType, status ...configv1.ConditionStatus) bool { for _, condition := range conditions { if condition.Type == conditionType { for _, s := range status { diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go deleted file mode 100644 index c4cdcaea1c..0000000000 --- a/pkg/apis/apis.go +++ /dev/null @@ -1,7 +0,0 @@ -package apis - -// ClusterVersionGroupName defines the API group for clusterversion. -const ClusterVersionGroupName = "config.openshift.io" - -// OperatorStatusGroupName defines the API group for operatorstatus. -const OperatorStatusGroupName = "operatorstatus.openshift.io" diff --git a/pkg/apis/config.openshift.io/v1/cluster_id.go b/pkg/apis/config.openshift.io/v1/cluster_id.go deleted file mode 100644 index 33fe9cf07a..0000000000 --- a/pkg/apis/config.openshift.io/v1/cluster_id.go +++ /dev/null @@ -1,30 +0,0 @@ -package v1 - -import ( - "encoding/json" - "fmt" - - "github.com/google/uuid" -) - -// UnmarshalJSON unmarshals RFC4122 uuid from string. -func (cid *ClusterID) UnmarshalJSON(b []byte) error { - var strid string - if err := json.Unmarshal(b, &strid); err != nil { - return err - } - - uid, err := uuid.Parse(strid) - if err != nil { - return err - } - if uid.Variant() != uuid.RFC4122 { - return fmt.Errorf("invalid ClusterID %q, must be an RFC4122-variant UUID: found %s", strid, uid.Variant()) - } - if uid.Version() != 4 { - return fmt.Errorf("Invalid ClusterID %q, must be a version-4 UUID: found %s", strid, uid.Version()) - } - - *cid = ClusterID(uid.String()) - return nil -} diff --git a/pkg/apis/config.openshift.io/v1/clusterversion.go b/pkg/apis/config.openshift.io/v1/clusterversion.go deleted file mode 100644 index a9585325ac..0000000000 --- a/pkg/apis/config.openshift.io/v1/clusterversion.go +++ /dev/null @@ -1,9 +0,0 @@ -package v1 - -import ( - "fmt" -) - -func (c ClusterVersion) String() string { - return fmt.Sprintf("{ Upstream: %v Channel: %s ClusterID: %s }", c.Spec.Upstream, c.Spec.Channel, c.Spec.ClusterID) -} diff --git a/pkg/apis/config.openshift.io/v1/register.go b/pkg/apis/config.openshift.io/v1/register.go deleted file mode 100644 index fc7869ee0c..0000000000 --- a/pkg/apis/config.openshift.io/v1/register.go +++ /dev/null @@ -1,45 +0,0 @@ -package v1 - -import ( - "github.com/openshift/cluster-version-operator/pkg/apis" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: apis.ClusterVersionGroupName, Version: "v1"} - -// Resource takes an unqualified resource and returns a Group qualified -// GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder is the scheme builder for ClusterVersionOperator's types. - SchemeBuilder runtime.SchemeBuilder - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is the function alias for AddtoScheme. - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of - // the generated functions takes place in the generated files. The - // separation makes the code compile even when the generated files are - // missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ClusterVersion{}, - &ClusterVersionList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/config.openshift.io/v1/types.go b/pkg/apis/config.openshift.io/v1/types.go deleted file mode 100644 index 2eb3ae4650..0000000000 --- a/pkg/apis/config.openshift.io/v1/types.go +++ /dev/null @@ -1,155 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" -) - -// ClusterVersionList is a list of ClusterVersion resources. -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ClusterVersionList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []ClusterVersion `json:"items"` -} - -// ClusterVersion is the configuration for the ClusterVersionOperator. This is where -// parameters related to automatic updates can be set. -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ClusterVersion struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec is the desired state of the cluster version - the operator will work - // to ensure that the desired version is applied to the cluster. - Spec ClusterVersionSpec `json:"spec"` - // Status contains information about the available updates and any in-progress - // updates. - Status ClusterVersionStatus `json:"status"` -} - -// ClusterVersionSpec is the desired version state of the cluster. It includes -// the version the cluster should be at, how the cluster is identified, and -// where the cluster should look for version updates. -// +k8s:deepcopy-gen=true -type ClusterVersionSpec struct { - // ClusterID uniquely identifies this cluster. This is expected to be - // an RFC4122 UUID value (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx in - // hexadecimal values). This is a required field. - ClusterID ClusterID `json:"clusterID"` - - // DesiredUpdate is an optional field that indicates the desired value of - // the cluster version. Setting this value will trigger an upgrade (if - // the current version does not match the desired version). The set of - // recommended update values is listed as part of available updates in - // status, and setting values outside that range may cause the upgrade - // to fail. - // - // If an upgrade fails the operator will halt and report status - // about the failing component. Setting the desired update value back to - // the previous version will cause a rollback to be attempted. Not all - // rollbacks will succeed. - // - // +optional - DesiredUpdate *Update `json:"desiredUpdate"` - - // Upstream may be used to specify the preferred update server. By default - // it will use the appropriate update server for the cluster and region. - // - // +optional - Upstream *URL `json:"upstream"` - // Channel is an identifier for explicitly requesting that a non-default - // set of updates be applied to this cluster. The default channel will be - // contain stable updates that are appropriate for production clusters. - // - // +optional - Channel string `json:"channel"` - - // Overrides is list of overides for components that are managed by - // cluster version operator. Marking a component unmanaged will prevent - // the operator from creating or updating the object. - // +optional - Overrides []ComponentOverride `json:"overrides,omitempty"` -} - -// ClusterVersionStatus reports the status of the cluster versioning, -// including any upgrades that are in progress. The current field will -// be set to whichever version the cluster is reconciling to, and the -// conditions array will report whether the update succeeded, is in -// progress, or is failing. -// +k8s:deepcopy-gen=true -type ClusterVersionStatus struct { - // current is the version that the cluster will be reconciled to. This - // value may be empty during cluster startup, and then will be set whenever - // a new update is being applied. Use the conditions array to know whether - // the update is complete. - Current Update `json:"current"` - - // generation reports which version of the spec is being processed. - // If this value is not equal to metadata.generation, then the - // current and conditions fields have not yet been updated to reflect - // the latest request. - Generation int64 `json:"generation"` - - // versionHash is a fingerprint of the content that the cluster will be - // updated with. It is used by the operator to avoid unnecessary work - // and is for internal use only. - VersionHash string `json:"versionHash"` - - // conditions provides information about the cluster version. The condition - // "Available" is set to true if the desiredUpdate has been reached. The - // condition "Progressing" is set to true if an update is being applied. - // The condition "Failing" is set to true if an update is currently blocked - // by a temporary or permanent error. Conditions are only valid for the - // current desiredUpdate when metadata.generation is equal to - // status.generation. - Conditions []osv1.ClusterOperatorStatusCondition `json:"conditions"` - - // AvailableUpdates contains the list of updates that are appropriate - // for this cluster. This list may be empty if no updates are recommended, - // if the update service is unavailable, or if an invalid channel has - // been specified. - AvailableUpdates []Update `json:"availableUpdates"` -} - -// ClusterID is string RFC4122 uuid. -type ClusterID string - -// ComponentOverride allows overriding cluster version operator's behavior -// for a component. -// +k8s:deepcopy-gen=true -type ComponentOverride struct { - // Kind should match the TypeMeta.Kind for object. - Kind string `json:"kind"` - - // The Namespace and Name for the component. - Namespace string `json:"namespace"` - Name string `json:"name"` - - // Unmanaged controls if cluster version operator should stop managing. - // Default: false - Unmanaged bool `json:"unmanaged"` -} - -// URL is a thin wrapper around string that ensures the string is a valid URL. -type URL string - -// Update represents a release of the ClusterVersionOperator, referenced by the -// Payload member. -// +k8s:deepcopy-gen=true -type Update struct { - Version string `json:"version"` - Payload string `json:"payload"` -} - -// RetrievedUpdates reports whether available updates have been retrieved from -// the upstream update server. The condition is Unknown before retrieval, False -// if the updates could not be retrieved or recently failed, or True if the -// availableUpdates field is accurate and recent. -const RetrievedUpdates osv1.ClusterStatusConditionType = "RetrievedUpdates" diff --git a/pkg/apis/config.openshift.io/v1/url.go b/pkg/apis/config.openshift.io/v1/url.go deleted file mode 100644 index 82bc804e25..0000000000 --- a/pkg/apis/config.openshift.io/v1/url.go +++ /dev/null @@ -1,22 +0,0 @@ -package v1 - -import ( - "encoding/json" - "net/url" -) - -// UnmarshalJSON unmarshals a URL, ensuring that it is valid. -func (u *URL) UnmarshalJSON(data []byte) error { - var raw string - if err := json.Unmarshal(data, &raw); err != nil { - return err - } - - if _, err := url.Parse(raw); err != nil { - return err - } - - *u = URL(raw) - - return nil -} diff --git a/pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go b/pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go deleted file mode 100644 index 07f9ca423e..0000000000 --- a/pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,179 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - operatorstatusopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterVersion) DeepCopyInto(out *ClusterVersion) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersion. -func (in *ClusterVersion) DeepCopy() *ClusterVersion { - if in == nil { - return nil - } - out := new(ClusterVersion) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterVersion) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterVersionList) DeepCopyInto(out *ClusterVersionList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterVersion, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionList. -func (in *ClusterVersionList) DeepCopy() *ClusterVersionList { - if in == nil { - return nil - } - out := new(ClusterVersionList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterVersionList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterVersionSpec) DeepCopyInto(out *ClusterVersionSpec) { - *out = *in - if in.DesiredUpdate != nil { - in, out := &in.DesiredUpdate, &out.DesiredUpdate - *out = new(Update) - **out = **in - } - if in.Upstream != nil { - in, out := &in.Upstream, &out.Upstream - *out = new(URL) - **out = **in - } - if in.Overrides != nil { - in, out := &in.Overrides, &out.Overrides - *out = make([]ComponentOverride, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionSpec. -func (in *ClusterVersionSpec) DeepCopy() *ClusterVersionSpec { - if in == nil { - return nil - } - out := new(ClusterVersionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterVersionStatus) DeepCopyInto(out *ClusterVersionStatus) { - *out = *in - out.Current = in.Current - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]operatorstatusopenshiftiov1.ClusterOperatorStatusCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AvailableUpdates != nil { - in, out := &in.AvailableUpdates, &out.AvailableUpdates - *out = make([]Update, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVersionStatus. -func (in *ClusterVersionStatus) DeepCopy() *ClusterVersionStatus { - if in == nil { - return nil - } - out := new(ClusterVersionStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ComponentOverride) DeepCopyInto(out *ComponentOverride) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentOverride. -func (in *ComponentOverride) DeepCopy() *ComponentOverride { - if in == nil { - return nil - } - out := new(ComponentOverride) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Update) DeepCopyInto(out *Update) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Update. -func (in *Update) DeepCopy() *Update { - if in == nil { - return nil - } - out := new(Update) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/operatorstatus.openshift.io/v1/register.go b/pkg/apis/operatorstatus.openshift.io/v1/register.go deleted file mode 100644 index c3d1c82e00..0000000000 --- a/pkg/apis/operatorstatus.openshift.io/v1/register.go +++ /dev/null @@ -1,45 +0,0 @@ -package v1 - -import ( - "github.com/openshift/cluster-version-operator/pkg/apis" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: apis.OperatorStatusGroupName, Version: "v1"} - -// Resource takes an unqualified resource and returns a Group qualified -// GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder is the scheme builder for ClusterVersionOperator's types. - SchemeBuilder runtime.SchemeBuilder - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - localSchemeBuilder = &SchemeBuilder - // AddToScheme is the function alias for AddtoScheme. - AddToScheme = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of - // the generated functions takes place in the generated files. The - // separation makes the code compile even when the generated files are - // missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &ClusterOperator{}, - &ClusterOperatorList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/operatorstatus.openshift.io/v1/types.go b/pkg/apis/operatorstatus.openshift.io/v1/types.go deleted file mode 100644 index 75083bfad2..0000000000 --- a/pkg/apis/operatorstatus.openshift.io/v1/types.go +++ /dev/null @@ -1,106 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -// ClusterOperatorList is a list of OperatorStatus resources. -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ClusterOperatorList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []ClusterOperator `json:"items"` -} - -// ClusterOperator is the Custom Resource object which holds the current state -// of an operator. This object is used by operators to convey their state to -// the rest of the cluster. -// +genclient -// +k8s:deepcopy-gen=true -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type ClusterOperator struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata"` - - // Spec hold the intent of how this operator should behave. - Spec ClusterOperatorSpec `json:"spec"` - - // status holds the information about the state of an operator. It is consistent with status information across - // the kube ecosystem. - Status ClusterOperatorStatus `json:"status"` -} - -// ClusterOperatorSpec is empty for now, but you could imagine holding information like "pause". -type ClusterOperatorSpec struct { -} - -// ClusterOperatorStatus provides information about the status of the operator. -// +k8s:deepcopy-gen=true -type ClusterOperatorStatus struct { - // conditions describes the state of the operator's reconciliation functionality. - // +patchMergeKey=type - // +patchStrategy=merge - Conditions []ClusterOperatorStatusCondition `json:"conditions"` - - // version indicates which version of the operator updated the current - // status object. - Version string `json:"version"` - - // extension contains any additional status information specific to the - // operator which owns this status object. - Extension runtime.RawExtension `json:"extension,omitempty"` -} - -type ConditionStatus string - -// These are valid condition statuses. "ConditionTrue" means a resource is in the condition. -// "ConditionFalse" means a resource is not in the condition. "ConditionUnknown" means kubernetes -// can't decide if a resource is in the condition or not. In the future, we could add other -// intermediate conditions, e.g. ConditionDegraded. -const ( - ConditionTrue ConditionStatus = "True" - ConditionFalse ConditionStatus = "False" - ConditionUnknown ConditionStatus = "Unknown" -) - -// ClusterOperatorStatusCondition represents the state of the operator's -// reconciliation functionality. -// +k8s:deepcopy-gen=true -type ClusterOperatorStatusCondition struct { - // type specifies the state of the operator's reconciliation functionality. - Type ClusterStatusConditionType `json:"type"` - - // Status of the condition, one of True, False, Unknown. - Status ConditionStatus `json:"status"` - - // LastTransitionTime is the time of the last update to the current status object. - LastTransitionTime metav1.Time `json:"lastTransitionTime"` - - // reason is the reason for the condition's last transition. Reasons are CamelCase - Reason string `json:"reason,omitempty"` - - // message provides additional information about the current condition. - // This is only to be consumed by humans. - Message string `json:"message,omitempty"` -} - -// ClusterStatusConditionType is the state of the operator's reconciliation functionality. -type ClusterStatusConditionType string - -const ( - // OperatorAvailable indicates that the binary maintained by the operator (eg: openshift-apiserver for the - // openshift-apiserver-operator), is functional and available in the cluster. - OperatorAvailable ClusterStatusConditionType = "Available" - - // OperatorProgressing indicates that the operator is actively making changes to the binary maintained by the - // operator (eg: openshift-apiserver for the openshift-apiserver-operator). - OperatorProgressing ClusterStatusConditionType = "Progressing" - - // OperatorFailing indicates that the operator has encountered an error that is preventing it from working properly. - // The binary maintained by the operator (eg: openshift-apiserver for the openshift-apiserver-operator) may still be - // available, but the user intent cannot be fulfilled. - OperatorFailing ClusterStatusConditionType = "Failing" -) diff --git a/pkg/apis/operatorstatus.openshift.io/v1/zz_generated.deepcopy.go b/pkg/apis/operatorstatus.openshift.io/v1/zz_generated.deepcopy.go deleted file mode 100644 index 400e0e54b6..0000000000 --- a/pkg/apis/operatorstatus.openshift.io/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,127 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package v1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterOperator) DeepCopyInto(out *ClusterOperator) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperator. -func (in *ClusterOperator) DeepCopy() *ClusterOperator { - if in == nil { - return nil - } - out := new(ClusterOperator) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterOperator) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterOperatorList) DeepCopyInto(out *ClusterOperatorList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterOperator, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorList. -func (in *ClusterOperatorList) DeepCopy() *ClusterOperatorList { - if in == nil { - return nil - } - out := new(ClusterOperatorList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterOperatorList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterOperatorStatus) DeepCopyInto(out *ClusterOperatorStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]ClusterOperatorStatusCondition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Extension.DeepCopyInto(&out.Extension) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorStatus. -func (in *ClusterOperatorStatus) DeepCopy() *ClusterOperatorStatus { - if in == nil { - return nil - } - out := new(ClusterOperatorStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterOperatorStatusCondition) DeepCopyInto(out *ClusterOperatorStatusCondition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterOperatorStatusCondition. -func (in *ClusterOperatorStatusCondition) DeepCopy() *ClusterOperatorStatusCondition { - if in == nil { - return nil - } - out := new(ClusterOperatorStatusCondition) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index e06c4ffe12..7110c225d5 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -8,14 +8,12 @@ import ( "github.com/blang/semver" "github.com/golang/glog" + "github.com/openshift/api/config/v1" + clientset "github.com/openshift/client-go/config/clientset/versioned" + "github.com/openshift/client-go/config/clientset/versioned/scheme" + configinformersv1 "github.com/openshift/client-go/config/informers/externalversions/config/v1" + configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" "github.com/openshift/cluster-version-operator/lib/resourceapply" - "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" - cvinformersv1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/config.openshift.io/v1" - osinformersv1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1" - cvlistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/config.openshift.io/v1" - oslistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/operatorstatus.openshift.io/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -47,8 +45,8 @@ type Controller struct { syncHandler func(key string) error statusSyncHandler func(key string) error - cvLister cvlistersv1.ClusterVersionLister - clusterOperatorLister oslistersv1.ClusterOperatorLister + cvLister configlistersv1.ClusterVersionLister + clusterOperatorLister configlistersv1.ClusterOperatorLister cvListerSynced cache.InformerSynced operatorStatusSynced cache.InformerSynced @@ -60,8 +58,8 @@ type Controller struct { // New returns a new autoupdate controller. func New( namespace, name string, - cvInformer cvinformersv1.ClusterVersionInformer, - clusterOperatorInformer osinformersv1.ClusterOperatorInformer, + cvInformer configinformersv1.ClusterVersionInformer, + clusterOperatorInformer configinformersv1.ClusterOperatorInformer, client clientset.Interface, kubeClient kubernetes.Interface, ) *Controller { diff --git a/pkg/autoupdate/autoupdate_test.go b/pkg/autoupdate/autoupdate_test.go index 19861fa0b6..6aca8aa9dd 100644 --- a/pkg/autoupdate/autoupdate_test.go +++ b/pkg/autoupdate/autoupdate_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" + "github.com/openshift/api/config/v1" ) func TestNextUpdate(t *testing.T) { diff --git a/pkg/cvo/availableupdates.go b/pkg/cvo/availableupdates.go index acf4103ee2..c4aef79889 100644 --- a/pkg/cvo/availableupdates.go +++ b/pkg/cvo/availableupdates.go @@ -12,19 +12,18 @@ import ( "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + configv1 "github.com/openshift/api/config/v1" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" "github.com/openshift/cluster-version-operator/pkg/cincinnati" ) // syncAvailableUpdates attempts to retrieve the latest updates and update the status of the ClusterVersion // object. It will set the RetrievedUpdates condition. Updates are only checked if it has been more than // the minimumUpdateCheckInterval since the last check. -func (optr *Operator) syncAvailableUpdates(config *cvv1.ClusterVersion) error { - upstream := optr.defaultUpstreamServer - if config.Spec.Upstream != nil { - upstream = string(*config.Spec.Upstream) +func (optr *Operator) syncAvailableUpdates(config *configv1.ClusterVersion) error { + upstream := string(config.Spec.Upstream) + if len(upstream) == 0 { + upstream = optr.defaultUpstreamServer } channel := config.Spec.Channel @@ -53,15 +52,15 @@ type availableUpdates struct { At time.Time - Updates []cvv1.Update - Condition osv1.ClusterOperatorStatusCondition + Updates []configv1.Update + Condition configv1.ClusterOperatorStatusCondition } func (u *availableUpdates) RecentlyChanged(interval time.Duration) bool { return u.At.After(time.Now().Add(-interval)) } -func (u *availableUpdates) NeedsUpdate(original *cvv1.ClusterVersion) *cvv1.ClusterVersion { +func (u *availableUpdates) NeedsUpdate(original *configv1.ClusterVersion) *configv1.ClusterVersion { if u == nil { return nil } @@ -95,17 +94,17 @@ func (optr *Operator) getAvailableUpdates() *availableUpdates { return optr.availableUpdates } -func calculateAvailableUpdatesStatus(clusterID, upstream, channel, version string) ([]cvv1.Update, osv1.ClusterOperatorStatusCondition) { +func calculateAvailableUpdatesStatus(clusterID, upstream, channel, version string) ([]configv1.Update, configv1.ClusterOperatorStatusCondition) { if len(upstream) == 0 { - return nil, osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "NoUpstream", + return nil, configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "NoUpstream", Message: "No upstream server has been set to retrieve updates.", } } if len(version) == 0 { - return nil, osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "NoCurrentVersion", + return nil, configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "NoCurrentVersion", Message: "The cluster version does not have a semantic version assigned and cannot calculate valid upgrades.", } } @@ -113,8 +112,8 @@ func calculateAvailableUpdatesStatus(clusterID, upstream, channel, version strin currentVersion, err := semver.Parse(version) if err != nil { glog.V(2).Infof("Unable to parse current semantic version %q: %v", version, err) - return nil, osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "InvalidCurrentVersion", + return nil, configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "InvalidCurrentVersion", Message: "The current cluster version is not a valid semantic version and cannot be used to calculate upgrades.", } } @@ -122,23 +121,23 @@ func calculateAvailableUpdatesStatus(clusterID, upstream, channel, version strin updates, err := checkForUpdate(clusterID, upstream, channel, currentVersion) if err != nil { glog.V(2).Infof("Upstream server %s could not return available updates: %v", upstream, err) - return nil, osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "RemoteFailed", + return nil, configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "RemoteFailed", Message: fmt.Sprintf("Unable to retrieve available updates: %v", err), } } - var cvoUpdates []cvv1.Update + var cvoUpdates []configv1.Update for _, update := range updates { - cvoUpdates = append(cvoUpdates, cvv1.Update{ + cvoUpdates = append(cvoUpdates, configv1.Update{ Version: update.Version.String(), Payload: update.Payload, }) } - return cvoUpdates, osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionTrue, + return cvoUpdates, configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, LastTransitionTime: metav1.Now(), } diff --git a/pkg/cvo/cvo.go b/pkg/cvo/cvo.go index f18db4d173..a828d987fc 100644 --- a/pkg/cvo/cvo.go +++ b/pkg/cvo/cvo.go @@ -23,15 +23,12 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" + configv1 "github.com/openshift/api/config/v1" + clientset "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" "github.com/openshift/cluster-version-operator/lib/resourceapply" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - cvinformersv1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/config.openshift.io/v1" - osinformersv1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1" - cvlistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/config.openshift.io/v1" - oslistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/operatorstatus.openshift.io/v1" ) const ( @@ -44,7 +41,7 @@ const ( ) // ownerKind contains the schema.GroupVersionKind for type that owns objects managed by CVO. -var ownerKind = cvv1.SchemeGroupVersion.WithKind("ClusterVersion") +var ownerKind = configv1.SchemeGroupVersion.WithKind("ClusterVersion") // Operator defines cluster version operator. The CVO attempts to reconcile the appropriate payload // onto the cluster, writing status to the ClusterVersion object as it goes. A background loop @@ -88,7 +85,7 @@ type Operator struct { eventRecorder record.EventRecorder // updatePayloadHandler allows unit tests to inject arbitrary payload errors - updatePayloadHandler func(config *cvv1.ClusterVersion, payload *updatePayload) error + updatePayloadHandler func(config *configv1.ClusterVersion, payload *updatePayload) error // minimumUpdateCheckInterval is the minimum duration to check for updates from // the upstream. @@ -97,10 +94,12 @@ type Operator struct { payloadDir string // defaultUpstreamServer is intended for testing. defaultUpstreamServer string + // syncBackoff allows the tests to use a quicker backoff + syncBackoff wait.Backoff - cvLister cvlistersv1.ClusterVersionLister + cvLister configlistersv1.ClusterVersionLister cvListerSynced cache.InformerSynced - clusterOperatorLister oslistersv1.ClusterOperatorLister + clusterOperatorLister configlistersv1.ClusterOperatorLister clusterOperatorSynced cache.InformerSynced // queue tracks applying updates to a cluster. @@ -125,8 +124,8 @@ func New( releaseImage string, overridePayloadDir string, minimumInterval time.Duration, - cvInformer cvinformersv1.ClusterVersionInformer, - clusterOperatorInformer osinformersv1.ClusterOperatorInformer, + cvInformer configinformersv1.ClusterVersionInformer, + clusterOperatorInformer configinformersv1.ClusterOperatorInformer, restConfig *rest.Config, client clientset.Interface, kubeClient kubernetes.Interface, @@ -145,6 +144,11 @@ func New( minimumUpdateCheckInterval: minimumInterval, payloadDir: overridePayloadDir, defaultUpstreamServer: "http://localhost:8080/graph", + syncBackoff: wait.Backoff{ + Duration: time.Second * 10, + Factor: 1.3, + Steps: 3, + }, restConfig: restConfig, client: client, @@ -235,7 +239,7 @@ func (optr *Operator) worker(queue workqueue.RateLimitingInterface, syncHandler } } -type syncFailingStatusFunc func(config *cvv1.ClusterVersion, err error) error +type syncFailingStatusFunc func(config *configv1.ClusterVersion, err error) error func processNextWorkItem(queue workqueue.RateLimitingInterface, syncHandler func(string) error, syncFailingStatus syncFailingStatusFunc) bool { key, quit := queue.Get() @@ -296,7 +300,7 @@ func (optr *Operator) sync(key string) error { // when we're up to date, limit how frequently we check the payload availableAndUpdated := original.Status.Generation == original.Generation && - resourcemerge.IsOperatorStatusConditionTrue(original.Status.Conditions, osv1.OperatorAvailable) + resourcemerge.IsOperatorStatusConditionTrue(original.Status.Conditions, configv1.OperatorAvailable) hasRecentlySynced := availableAndUpdated && optr.hasRecentlySynced() if hasRecentlySynced { glog.V(4).Infof("Cluster version has been recently synced and no new changes detected") @@ -315,7 +319,7 @@ func (optr *Operator) sync(key string) error { return err } - update := cvv1.Update{ + update := configv1.Update{ Version: payload.releaseVersion, Payload: payload.releaseImage, } @@ -385,7 +389,7 @@ func (optr *Operator) setLastSyncAt(t time.Time) { // isOlderThanLastUpdate returns true if the cluster version is older than // the last update we saw. -func (optr *Operator) isOlderThanLastUpdate(config *cvv1.ClusterVersion) bool { +func (optr *Operator) isOlderThanLastUpdate(config *configv1.ClusterVersion) bool { i, err := strconv.ParseInt(config.ResourceVersion, 10, 64) if err != nil { return false @@ -397,7 +401,7 @@ func (optr *Operator) isOlderThanLastUpdate(config *cvv1.ClusterVersion) bool { // rememberLastUpdate records the most recent resource version we // have seen from the server for cluster versions. -func (optr *Operator) rememberLastUpdate(config *cvv1.ClusterVersion) { +func (optr *Operator) rememberLastUpdate(config *configv1.ClusterVersion) { if config == nil { return } @@ -410,7 +414,7 @@ func (optr *Operator) rememberLastUpdate(config *cvv1.ClusterVersion) { optr.lastResourceVersion = i } -func (optr *Operator) getOrCreateClusterVersion() (*cvv1.ClusterVersion, bool, error) { +func (optr *Operator) getOrCreateClusterVersion() (*configv1.ClusterVersion, bool, error) { obj, err := optr.cvLister.Get(optr.name) if err == nil { return obj, false, nil @@ -418,10 +422,10 @@ func (optr *Operator) getOrCreateClusterVersion() (*cvv1.ClusterVersion, bool, e if !apierrors.IsNotFound(err) { return nil, false, err } - var upstream *cvv1.URL + var upstream configv1.URL if len(optr.defaultUpstreamServer) > 0 { - u := cvv1.URL(optr.defaultUpstreamServer) - upstream = &u + u := configv1.URL(optr.defaultUpstreamServer) + upstream = u } channel := "fast" id, _ := uuid.NewRandom() @@ -433,14 +437,14 @@ func (optr *Operator) getOrCreateClusterVersion() (*cvv1.ClusterVersion, bool, e } // XXX: generate ClusterVersion from options calculated above. - config := &cvv1.ClusterVersion{ + config := &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: optr.name, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Upstream: upstream, Channel: channel, - ClusterID: cvv1.ClusterID(id.String()), + ClusterID: configv1.ClusterID(id.String()), }, } @@ -452,7 +456,7 @@ func (optr *Operator) getOrCreateClusterVersion() (*cvv1.ClusterVersion, bool, e } // versionString returns a string describing the current version. -func (optr *Operator) currentVersionString(config *cvv1.ClusterVersion) string { +func (optr *Operator) currentVersionString(config *configv1.ClusterVersion) string { if s := config.Status.Current.Version; len(s) > 0 { return s } @@ -469,7 +473,7 @@ func (optr *Operator) currentVersionString(config *cvv1.ClusterVersion) string { } // versionString returns a string describing the desired version. -func (optr *Operator) desiredVersionString(config *cvv1.ClusterVersion) string { +func (optr *Operator) desiredVersionString(config *configv1.ClusterVersion) string { var s string if v := config.Spec.DesiredUpdate; v != nil { if len(v.Payload) > 0 { @@ -486,8 +490,8 @@ func (optr *Operator) desiredVersionString(config *cvv1.ClusterVersion) string { } // currentVersion returns an update object describing the current known cluster version. -func (optr *Operator) currentVersion() cvv1.Update { - return cvv1.Update{ +func (optr *Operator) currentVersion() configv1.Update { + return configv1.Update{ Version: optr.releaseVersion, Payload: optr.releaseImage, } diff --git a/pkg/cvo/cvo_test.go b/pkg/cvo/cvo_test.go index 0818e7b925..2980907141 100644 --- a/pkg/cvo/cvo_test.go +++ b/pkg/cvo/cvo_test.go @@ -27,11 +27,9 @@ import ( "k8s.io/client-go/util/workqueue" "github.com/google/uuid" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/fake" - oslistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/operatorstatus.openshift.io/v1" + configv1 "github.com/openshift/api/config/v1" + clientset "github.com/openshift/client-go/config/clientset/versioned" + "github.com/openshift/client-go/config/clientset/versioned/fake" apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" apiextclientv1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1" ) @@ -40,15 +38,15 @@ type clientCVLister struct { client clientset.Interface } -func (c *clientCVLister) Get(name string) (*cvv1.ClusterVersion, error) { +func (c *clientCVLister) Get(name string) (*configv1.ClusterVersion, error) { return c.client.Config().ClusterVersions().Get(name, metav1.GetOptions{}) } -func (c *clientCVLister) List(selector labels.Selector) (ret []*cvv1.ClusterVersion, err error) { +func (c *clientCVLister) List(selector labels.Selector) (ret []*configv1.ClusterVersion, err error) { list, err := c.client.Config().ClusterVersions().List(metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { return nil, err } - var items []*cvv1.ClusterVersion + var items []*configv1.ClusterVersion for i := range list.Items { items = append(items, &list.Items[i]) } @@ -57,23 +55,17 @@ func (c *clientCVLister) List(selector labels.Selector) (ret []*cvv1.ClusterVers type clientCOLister struct { client clientset.Interface - ns string } -func (c *clientCOLister) ClusterOperators(namespace string) oslistersv1.ClusterOperatorNamespaceLister { - copied := *c - copied.ns = namespace - return &copied +func (c *clientCOLister) Get(name string) (*configv1.ClusterOperator, error) { + return c.client.Config().ClusterOperators().Get(name, metav1.GetOptions{}) } -func (c *clientCOLister) Get(name string) (*osv1.ClusterOperator, error) { - return c.client.Operatorstatus().ClusterOperators(c.ns).Get(name, metav1.GetOptions{}) -} -func (c *clientCOLister) List(selector labels.Selector) (ret []*osv1.ClusterOperator, err error) { - list, err := c.client.Operatorstatus().ClusterOperators(c.ns).List(metav1.ListOptions{LabelSelector: selector.String()}) +func (c *clientCOLister) List(selector labels.Selector) (ret []*configv1.ClusterOperator, err error) { + list, err := c.client.Config().ClusterOperators().List(metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { return nil, err } - var items []*osv1.ClusterOperator + var items []*configv1.ClusterOperator for i := range list.Items { items = append(items, &list.Items[i]) } @@ -82,13 +74,13 @@ func (c *clientCOLister) List(selector labels.Selector) (ret []*osv1.ClusterOper type cvLister struct { Err error - Items []*cvv1.ClusterVersion + Items []*configv1.ClusterVersion } -func (r *cvLister) List(selector labels.Selector) (ret []*cvv1.ClusterVersion, err error) { +func (r *cvLister) List(selector labels.Selector) (ret []*configv1.ClusterVersion, err error) { return r.Items, r.Err } -func (r *cvLister) Get(name string) (*cvv1.ClusterVersion, error) { +func (r *cvLister) Get(name string) (*configv1.ClusterVersion, error) { for _, s := range r.Items { if s.Name == name { return s, nil @@ -99,27 +91,16 @@ func (r *cvLister) Get(name string) (*cvv1.ClusterVersion, error) { type coLister struct { Err error - Items []*osv1.ClusterOperator + Items []*configv1.ClusterOperator } -func (r *coLister) List(selector labels.Selector) (ret []*osv1.ClusterOperator, err error) { +func (r *coLister) List(selector labels.Selector) (ret []*configv1.ClusterOperator, err error) { return r.Items, r.Err } -func (r *coLister) ClusterOperators(namespace string) oslistersv1.ClusterOperatorNamespaceLister { - return &nsClusterOperatorLister{r: r, ns: namespace} -} - -type nsClusterOperatorLister struct { - r *coLister - ns string -} -func (r *nsClusterOperatorLister) List(selector labels.Selector) (ret []*osv1.ClusterOperator, err error) { - return r.r.Items, r.r.Err -} -func (r *nsClusterOperatorLister) Get(name string) (*osv1.ClusterOperator, error) { - for _, s := range r.r.Items { - if s.Name == name && r.ns == s.Namespace { +func (r *coLister) Get(name string) (*configv1.ClusterOperator, error) { + for _, s := range r.Items { + if s.Name == name { return s, nil } } @@ -248,11 +229,11 @@ func TestOperator_sync(t *testing.T) { } expectGet(t, act[0], "clusterversions", "", "default") expectGet(t, act[1], "clusterversions", "", "default") - expectCreate(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectCreate(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, }) @@ -267,23 +248,23 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Working towards 4.0.1"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards 4.0.1"}, }, }, }, @@ -296,43 +277,43 @@ func TestOperator_sync(t *testing.T) { t.Fatalf("unknown actions: %d %#v", len(act), act) } expectGet(t, act[0], "clusterversions", "", "default") - expectUpdateStatus(t, act[1], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "Unable to apply 4.0.1: the contents of the update are invalid"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "Unable to apply 4.0.1: the contents of the update are invalid"}, }, }, }) - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "0.0.1-abc", Payload: "payload/image:v4.0.1", }, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }) @@ -346,27 +327,27 @@ func TestOperator_sync(t *testing.T) { releaseImage: "payload/image:v4.0.1", namespace: "test", name: "default", - updatePayloadHandler: func(config *cvv1.ClusterVersion, payload *updatePayload) error { + updatePayloadHandler: func(config *configv1.ClusterVersion, payload *updatePayload) error { return fmt.Errorf("injected error") }, client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Working towards 4.0.1"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards 4.0.1"}, }, }, }, @@ -385,44 +366,44 @@ func TestOperator_sync(t *testing.T) { } expectGet(t, act[0], "clusterversions", "", "default") expectGet(t, act[1], "clusterversions", "", "default") - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, }, }, }) expectGet(t, act[3], "clusterversions", "", "default") - expectUpdateStatus(t, act[4], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[4], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "0.0.1-abc", Payload: "payload/image:v4.0.1", }, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Message: "injected error"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Unable to apply 4.0.1: injected error"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Message: "injected error"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Unable to apply 4.0.1: injected error"}, }, }, }) @@ -437,11 +418,11 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, }, @@ -460,44 +441,44 @@ func TestOperator_sync(t *testing.T) { } expectGet(t, act[0], "clusterversions", "", "default") expectGet(t, act[1], "clusterversions", "", "default") - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, }, }, }) expectGet(t, act[3], "clusterversions", "", "default") - expectUpdateStatus(t, act[4], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[4], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "0.0.1-abc", Payload: "payload/image:v4.0.1", }, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }) @@ -512,21 +493,21 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, }, }, }, @@ -545,44 +526,44 @@ func TestOperator_sync(t *testing.T) { } expectGet(t, act[0], "clusterversions", "", "default") expectGet(t, act[1], "clusterversions", "", "default") - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "4.0.1", Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue, Message: "unable to apply object"}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Message: "unable to apply object"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Unable to apply 4.0.1: unable to apply object"}, }, }, }) expectGet(t, act[3], "clusterversions", "", "default") - expectUpdateStatus(t, act[4], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[4], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Version: "0.0.1-abc", Payload: "payload/image:v4.0.1", }, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }) @@ -596,13 +577,13 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, }, @@ -615,45 +596,45 @@ func TestOperator_sync(t *testing.T) { t.Fatalf("unknown actions: %d %#v", len(act), act) } expectGet(t, act[0], "clusterversions", "", "default") - expectUpdateStatus(t, act[1], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - Upstream: pointerURL("http://localhost:8080/graph"), + Spec: configv1.ClusterVersionSpec{ + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, VersionHash: "", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, }, }, }) - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - Upstream: pointerURL("http://localhost:8080/graph"), + Spec: configv1.ClusterVersionSpec{ + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", // loads the version from the payload on disk Version: "0.0.1-abc", }, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }) @@ -669,22 +650,22 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ + Status: configv1.ClusterVersionStatus{ Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }, @@ -704,22 +685,22 @@ func TestOperator_sync(t *testing.T) { content: content1, init: func(optr *Operator) { client := &fake.Clientset{} - obj := &cvv1.ClusterVersion{ + obj := &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ + Status: configv1.ClusterVersionStatus{ Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, }, }, } @@ -728,7 +709,7 @@ func TestOperator_sync(t *testing.T) { return true, obj.DeepCopy(), nil } if action.GetVerb() == "update" && action.GetSubresource() == "status" { - update := action.(ktesting.UpdateAction).GetObject().(*cvv1.ClusterVersion) + update := action.(ktesting.UpdateAction).GetObject().(*configv1.ClusterVersion) obj.Status = update.Status rv, _ := strconv.Atoi(update.ResourceVersion) obj.ResourceVersion = strconv.Itoa(rv + 1) @@ -747,13 +728,13 @@ func TestOperator_sync(t *testing.T) { availableUpdates: &availableUpdates{ Upstream: "http://localhost:8080/graph", Channel: "fast", - Updates: []cvv1.Update{ + Updates: []configv1.Update{ {Version: "4.0.2", Payload: "test/image:1"}, {Version: "4.0.3", Payload: "test/image:2"}, }, - Condition: osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionTrue, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, }, }, }, @@ -764,28 +745,28 @@ func TestOperator_sync(t *testing.T) { t.Fatalf("unknown actions: %d %#v", len(act), act) } expectGet(t, act[0], "clusterversions", "", "default") - expectUpdateStatus(t, act[1], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - AvailableUpdates: []cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + AvailableUpdates: []configv1.Update{ {Version: "4.0.2", Payload: "test/image:1"}, {Version: "4.0.3", Payload: "test/image:2"}, }, - Current: cvv1.Update{Payload: "payload/image:v4.0.1"}, + Current: configv1.Update{Payload: "payload/image:v4.0.1"}, Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: cvv1.RetrievedUpdates, Status: osv1.ConditionTrue}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionTrue}, }, }, }) @@ -799,28 +780,28 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", // loads the version from the payload on disk Version: "0.0.1-abc", }, VersionHash: "y_Kc5IQiIyU=", Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }, @@ -843,28 +824,28 @@ func TestOperator_sync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ + Spec: configv1.ClusterVersionSpec{ ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: pointerURL("http://localhost:8080/graph"), + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", // loads the version from the payload on disk Version: "0.0.1-abc", }, VersionHash: "unknown_hash", Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }, @@ -877,49 +858,49 @@ func TestOperator_sync(t *testing.T) { t.Fatalf("unknown actions: %d %#v", len(act), act) } expectGet(t, act[0], "clusterversions", "", "default") - expectUpdateStatus(t, act[1], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ - Upstream: pointerURL("http://localhost:8080/graph"), + Spec: configv1.ClusterVersionSpec{ + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, Generation: 2, VersionHash: "unknown_hash", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, }, }, }) - expectUpdateStatus(t, act[2], "clusterversions", "", &cvv1.ClusterVersion{ + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ - Upstream: pointerURL("http://localhost:8080/graph"), + Spec: configv1.ClusterVersionSpec{ + Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", // loads the version from the payload on disk Version: "0.0.1-abc", }, Generation: 2, VersionHash: "y_Kc5IQiIyU=", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, }, }, }) @@ -934,7 +915,7 @@ func TestOperator_sync(t *testing.T) { } optr.cvLister = &clientCVLister{client: optr.client} if optr.updatePayloadHandler == nil { - optr.updatePayloadHandler = func(config *cvv1.ClusterVersion, payload *updatePayload) error { + optr.updatePayloadHandler = func(config *configv1.ClusterVersion, payload *updatePayload) error { return nil } } @@ -985,7 +966,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { }, }, { - name: "report an error condition when no current version is set", + name: "report an error condition when no upstream is set", handler: func(w http.ResponseWriter, req *http.Request) { http.Error(w, "bad things", http.StatusInternalServerError) }, @@ -995,16 +976,55 @@ func TestOperator_availableUpdatesSync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + }, + }, + }, + ), + }, + wantUpdates: &availableUpdates{ + Upstream: "", + Channel: "fast", + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionFalse, + Reason: "NoUpstream", + Message: "No upstream server has been set to retrieve updates.", + }, + }, + }, + { + name: "report an error condition when no current version is set", + handler: func(w http.ResponseWriter, req *http.Request) { + http.Error(w, "bad things", http.StatusInternalServerError) + }, + optr: Operator{ + defaultUpstreamServer: "http://localhost:8080/graph", + releaseVersion: "", + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + client: fake.NewSimpleClientset( + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - ClusterID: cvv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, }, @@ -1014,9 +1034,9 @@ func TestOperator_availableUpdatesSync(t *testing.T) { wantUpdates: &availableUpdates{ Upstream: "", Channel: "fast", - Condition: osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionFalse, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionFalse, Reason: "NoCurrentVersion", Message: "The cluster version does not have a semantic version assigned and cannot calculate valid upgrades.", }, @@ -1028,27 +1048,28 @@ func TestOperator_availableUpdatesSync(t *testing.T) { http.Error(w, "bad things", http.StatusInternalServerError) }, optr: Operator{ - releaseVersion: "4.0.1", - releaseImage: "payload/image:v4.0.1", - namespace: "test", - name: "default", + defaultUpstreamServer: "http://localhost:8080/graph", + releaseVersion: "4.0.1", + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - ClusterID: cvv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse}, }, }, }, @@ -1057,9 +1078,9 @@ func TestOperator_availableUpdatesSync(t *testing.T) { wantUpdates: &availableUpdates{ Upstream: "", Channel: "fast", - Condition: osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionFalse, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error", }, @@ -1071,28 +1092,29 @@ func TestOperator_availableUpdatesSync(t *testing.T) { fmt.Fprintf(w, "{}") }, optr: Operator{ - releaseVersion: "4.0.1", - releaseImage: "payload/image:v4.0.1", - namespace: "test", - name: "default", + defaultUpstreamServer: "http://localhost:8080/graph", + releaseVersion: "4.0.1", + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - ClusterID: cvv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse}, - {Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, }, }, }, @@ -1101,9 +1123,9 @@ func TestOperator_availableUpdatesSync(t *testing.T) { wantUpdates: &availableUpdates{ Upstream: "", Channel: "fast", - Condition: osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionTrue, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, }, }, }, @@ -1126,28 +1148,29 @@ func TestOperator_availableUpdatesSync(t *testing.T) { `) }, optr: Operator{ - releaseVersion: "4.0.1", - releaseImage: "payload/image:v4.0.1", - namespace: "test", - name: "default", + defaultUpstreamServer: "http://localhost:8080/graph", + releaseVersion: "4.0.1", + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, - Spec: cvv1.ClusterVersionSpec{ - ClusterID: cvv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse}, - {Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, }, }, }, @@ -1156,13 +1179,13 @@ func TestOperator_availableUpdatesSync(t *testing.T) { wantUpdates: &availableUpdates{ Upstream: "", Channel: "fast", - Updates: []cvv1.Update{ + Updates: []configv1.Update{ {Version: "4.0.2-prerelease", Payload: "some.other.registry/payload/image:v4.0.2"}, {Version: "4.0.2", Payload: "payload/image:v4.0.2"}, }, - Condition: osv1.ClusterOperatorStatusCondition{ - Type: cvv1.RetrievedUpdates, - Status: osv1.ConditionTrue, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, }, }, }, @@ -1185,25 +1208,25 @@ func TestOperator_availableUpdatesSync(t *testing.T) { namespace: "test", name: "default", client: fake.NewSimpleClientset( - &cvv1.ClusterVersion{ + &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, - Spec: cvv1.ClusterVersionSpec{ - ClusterID: cvv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), Channel: "fast", }, - Status: cvv1.ClusterVersionStatus{ - Current: cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ Payload: "payload/image:v4.0.1", }, Generation: 2, - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionFalse}, - {Type: osv1.OperatorProgressing, Status: osv1.ConditionFalse}, - {Type: cvv1.RetrievedUpdates, Status: osv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying payload/image:v4.0.1"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, Reason: "RemoteFailed", Message: "Unable to retrieve available updates: unexpected HTTP status: 500 Internal Server Error"}, }, }, }, @@ -1221,9 +1244,12 @@ func TestOperator_availableUpdatesSync(t *testing.T) { if tt.handler != nil { s := httptest.NewServer(http.HandlerFunc(tt.handler)) defer s.Close() - if len(optr.defaultUpstreamServer) == 0 { + if optr.defaultUpstreamServer == "http://localhost:8080/graph" { optr.defaultUpstreamServer = s.URL } + if optr.availableUpdates != nil && optr.availableUpdates.Upstream == "http://localhost:8080/graph" { + optr.availableUpdates.Upstream = s.URL + } } old := optr.availableUpdates @@ -1243,7 +1269,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { } if optr.availableUpdates != nil { - if optr.availableUpdates.Upstream == optr.defaultUpstreamServer { + if optr.availableUpdates.Upstream == optr.defaultUpstreamServer && len(optr.defaultUpstreamServer) > 0 { optr.availableUpdates.Upstream = "" } optr.availableUpdates.Condition.LastTransitionTime = metav1.Time{} @@ -1321,17 +1347,17 @@ func expectMutation(t *testing.T, a ktesting.Action, verb string, resource, subr switch at := a.(type) { case ktesting.CreateAction: // default autogenerated cluster ID - if in, ok := obj.(*cvv1.ClusterVersion); ok { + if in, ok := obj.(*configv1.ClusterVersion); ok { if in.Spec.ClusterID == "" { - in.Spec.ClusterID = at.GetObject().(*cvv1.ClusterVersion).Spec.ClusterID + in.Spec.ClusterID = at.GetObject().(*configv1.ClusterVersion).Spec.ClusterID } } - if in, ok := at.GetObject().(*osv1.ClusterOperator); ok { + if in, ok := at.GetObject().(*configv1.ClusterOperator); ok { for i := range in.Status.Conditions { in.Status.Conditions[i].LastTransitionTime.Time = time.Time{} } } - if in, ok := at.GetObject().(*cvv1.ClusterVersion); ok { + if in, ok := at.GetObject().(*configv1.ClusterVersion); ok { for i := range in.Status.Conditions { in.Status.Conditions[i].LastTransitionTime.Time = time.Time{} } @@ -1348,8 +1374,3 @@ func expectMutation(t *testing.T, a ktesting.Action, verb string, resource, subr t.Fatalf("unknown verb %T", a) } } - -func pointerURL(url string) *cvv1.URL { - u := cvv1.URL(url) - return &u -} diff --git a/pkg/cvo/internal/generic.go b/pkg/cvo/internal/generic.go index f015c4f112..de2462c8a1 100644 --- a/pkg/cvo/internal/generic.go +++ b/pkg/cvo/internal/generic.go @@ -13,10 +13,10 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/rest" + "github.com/openshift/client-go/config/clientset/versioned/scheme" "github.com/openshift/cluster-version-operator/lib" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" "github.com/openshift/cluster-version-operator/pkg/cvo/internal/dynamicclient" - "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" ) // readUnstructuredV1OrDie reads operatorstatus object from bytes. Panics on error. diff --git a/pkg/cvo/internal/operatorstatus.go b/pkg/cvo/internal/operatorstatus.go index 711d407369..0f0eda9b7c 100644 --- a/pkg/cvo/internal/operatorstatus.go +++ b/pkg/cvo/internal/operatorstatus.go @@ -12,10 +12,10 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" + configv1 "github.com/openshift/api/config/v1" + configclientv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" "github.com/openshift/cluster-version-operator/lib" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - osclientv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1" ) var ( @@ -26,32 +26,32 @@ var ( ) func init() { - if err := osv1.AddToScheme(osScheme); err != nil { + if err := configv1.AddToScheme(osScheme); err != nil { panic(err) } - osMapper.RegisterGVK(osv1.SchemeGroupVersion.WithKind("ClusterOperator"), newClusterOperatorBuilder) + osMapper.RegisterGVK(configv1.SchemeGroupVersion.WithKind("ClusterOperator"), newClusterOperatorBuilder) osMapper.AddToMap(resourcebuilder.Mapper) } // readClusterOperatorV1OrDie reads clusteroperator object from bytes. Panics on error. -func readClusterOperatorV1OrDie(objBytes []byte) *osv1.ClusterOperator { - requiredObj, err := runtime.Decode(osCodecs.UniversalDecoder(osv1.SchemeGroupVersion), objBytes) +func readClusterOperatorV1OrDie(objBytes []byte) *configv1.ClusterOperator { + requiredObj, err := runtime.Decode(osCodecs.UniversalDecoder(configv1.SchemeGroupVersion), objBytes) if err != nil { panic(err) } - return requiredObj.(*osv1.ClusterOperator) + return requiredObj.(*configv1.ClusterOperator) } type clusterOperatorBuilder struct { - client *osclientv1.OperatorstatusV1Client + client configclientv1.ConfigV1Interface raw []byte modifier resourcebuilder.MetaV1ObjectModifierFunc } func newClusterOperatorBuilder(config *rest.Config, m lib.Manifest) resourcebuilder.Interface { return &clusterOperatorBuilder{ - client: osclientv1.NewForConfigOrDie(config), + client: configclientv1.NewForConfigOrDie(config), raw: m.Raw, } } @@ -75,9 +75,9 @@ const ( osPollTimeout = 1 * time.Minute ) -func waitForOperatorStatusToBeDone(client osclientv1.ClusterOperatorsGetter, os *osv1.ClusterOperator) error { +func waitForOperatorStatusToBeDone(client configclientv1.ClusterOperatorsGetter, os *configv1.ClusterOperator) error { return wait.Poll(osPollInternal, osPollTimeout, func() (bool, error) { - eos, err := client.ClusterOperators(os.Namespace).Get(os.Name, metav1.GetOptions{}) + eos, err := client.ClusterOperators().Get(os.Name, metav1.GetOptions{}) if err != nil { return false, err } @@ -93,11 +93,11 @@ func waitForOperatorStatusToBeDone(client osclientv1.ClusterOperatorsGetter, os failing := true for _, condition := range eos.Status.Conditions { switch { - case condition.Type == osv1.OperatorAvailable && condition.Status == osv1.ConditionTrue: + case condition.Type == configv1.OperatorAvailable && condition.Status == configv1.ConditionTrue: available = true - case condition.Type == osv1.OperatorProgressing && condition.Status == osv1.ConditionFalse: + case condition.Type == configv1.OperatorProgressing && condition.Status == configv1.ConditionFalse: progressing = false - case condition.Type == osv1.OperatorFailing && condition.Status == osv1.ConditionFalse: + case condition.Type == configv1.OperatorFailing && condition.Status == configv1.ConditionFalse: failing = false } } diff --git a/pkg/cvo/metrics.go b/pkg/cvo/metrics.go index 26b4d33cd0..be5f54ec7f 100644 --- a/pkg/cvo/metrics.go +++ b/pkg/cvo/metrics.go @@ -1,9 +1,8 @@ package cvo import ( + configv1 "github.com/openshift/api/config/v1" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" "github.com/prometheus/client_golang/prometheus" "k8s.io/apimachinery/pkg/labels" ) @@ -73,7 +72,7 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) { ch <- g if cv, err := m.optr.cvLister.Get(m.optr.name); err == nil { // output cluster version - failing := resourcemerge.IsOperatorStatusConditionTrue(cv.Status.Conditions, osv1.OperatorFailing) + failing := resourcemerge.IsOperatorStatusConditionTrue(cv.Status.Conditions, configv1.OperatorFailing) if update := cv.Spec.DesiredUpdate; update != nil && update.Payload != current.Payload { g := m.version.WithLabelValues("update", update.Version, update.Payload) g.Set(1) @@ -90,10 +89,10 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) { ch <- g } - if cv.Spec.Upstream != nil || len(cv.Status.AvailableUpdates) > 0 || resourcemerge.IsOperatorStatusConditionTrue(cv.Status.Conditions, cvv1.RetrievedUpdates) { + if len(cv.Spec.Upstream) > 0 || len(cv.Status.AvailableUpdates) > 0 || resourcemerge.IsOperatorStatusConditionTrue(cv.Status.Conditions, configv1.RetrievedUpdates) { upstream := "" - if cv.Spec.Upstream != nil { - upstream = string(*cv.Spec.Upstream) + if len(cv.Spec.Upstream) > 0 { + upstream = string(cv.Spec.Upstream) } g := m.availableUpdates.WithLabelValues(upstream, cv.Spec.Channel) g.Set(float64(len(cv.Status.AvailableUpdates))) @@ -105,8 +104,8 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) { operators, _ := m.optr.clusterOperatorLister.List(labels.Everything()) for _, op := range operators { g := m.clusterOperatorUp.WithLabelValues(op.Namespace, op.Name, op.Status.Version) - failing := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, osv1.OperatorFailing) - available := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, osv1.OperatorAvailable) + failing := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, configv1.OperatorFailing) + available := resourcemerge.IsOperatorStatusConditionTrue(op.Status.Conditions, configv1.OperatorAvailable) if available && !failing { g.Set(1) } else { @@ -114,11 +113,11 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) { } ch <- g for _, condition := range op.Status.Conditions { - if condition.Status == osv1.ConditionUnknown { + if condition.Status == configv1.ConditionUnknown { continue } g := m.clusterOperatorConditions.WithLabelValues(op.Namespace, op.Name, string(condition.Type)) - if condition.Status == osv1.ConditionTrue { + if condition.Status == configv1.ConditionTrue { g.Set(1) } else { g.Set(0) diff --git a/pkg/cvo/metrics_test.go b/pkg/cvo/metrics_test.go index 36317ffff8..98e54ff34b 100644 --- a/pkg/cvo/metrics_test.go +++ b/pkg/cvo/metrics_test.go @@ -3,8 +3,7 @@ package cvo import ( "testing" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" + configv1 "github.com/openshift/api/config/v1" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,16 +32,16 @@ func Test_operatorMetrics_Collect(t *testing.T) { name: "collects cluster operator status failure", optr: &Operator{ clusterOperatorLister: &coLister{ - Items: []*osv1.ClusterOperator{ + Items: []*configv1.ClusterOperator{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Status: osv1.ClusterOperatorStatus{ + Status: configv1.ClusterOperatorStatus{ Version: "10.1.5-1", - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue}, - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue}, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue}, }, }, }, @@ -63,17 +62,17 @@ func Test_operatorMetrics_Collect(t *testing.T) { name: "collects cluster operator status custom", optr: &Operator{ clusterOperatorLister: &coLister{ - Items: []*osv1.ClusterOperator{ + Items: []*configv1.ClusterOperator{ { ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "test", }, - Status: osv1.ClusterOperatorStatus{ - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorAvailable, Status: osv1.ConditionTrue}, - {Type: osv1.ClusterStatusConditionType("Custom"), Status: osv1.ConditionFalse}, - {Type: osv1.ClusterStatusConditionType("Unknown"), Status: osv1.ConditionUnknown}, + Status: configv1.ClusterOperatorStatus{ + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue}, + {Type: configv1.ClusterStatusConditionType("Custom"), Status: configv1.ConditionFalse}, + {Type: configv1.ClusterStatusConditionType("Unknown"), Status: configv1.ConditionUnknown}, }, }, }, @@ -95,13 +94,13 @@ func Test_operatorMetrics_Collect(t *testing.T) { optr: &Operator{ name: "test", cvLister: &cvLister{ - Items: []*cvv1.ClusterVersion{ + Items: []*configv1.ClusterVersion{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Status: cvv1.ClusterVersionStatus{ - AvailableUpdates: []cvv1.Update{ + Status: configv1.ClusterVersionStatus{ + AvailableUpdates: []configv1.Update{ {Version: "1.0.1"}, {Version: "1.0.2"}, }, @@ -123,14 +122,14 @@ func Test_operatorMetrics_Collect(t *testing.T) { optr: &Operator{ name: "test", cvLister: &cvLister{ - Items: []*cvv1.ClusterVersion{ + Items: []*configv1.ClusterVersion{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Status: cvv1.ClusterVersionStatus{ - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: cvv1.RetrievedUpdates, Status: osv1.ConditionTrue}, + Status: configv1.ClusterVersionStatus{ + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionTrue}, }, }, }, @@ -152,13 +151,13 @@ func Test_operatorMetrics_Collect(t *testing.T) { releaseImage: "test/image:1", name: "test", cvLister: &cvLister{ - Items: []*cvv1.ClusterVersion{ + Items: []*configv1.ClusterVersion{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Spec: cvv1.ClusterVersionSpec{ - DesiredUpdate: &cvv1.Update{Version: "1.0.0", Payload: "test/image:2"}, + Spec: configv1.ClusterVersionSpec{ + DesiredUpdate: &configv1.Update{Version: "1.0.0", Payload: "test/image:2"}, }, }, }, @@ -179,17 +178,17 @@ func Test_operatorMetrics_Collect(t *testing.T) { releaseImage: "test/image:1", name: "test", cvLister: &cvLister{ - Items: []*cvv1.ClusterVersion{ + Items: []*configv1.ClusterVersion{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Spec: cvv1.ClusterVersionSpec{ - DesiredUpdate: &cvv1.Update{Version: "1.0.0", Payload: "test/image:2"}, + Spec: configv1.ClusterVersionSpec{ + DesiredUpdate: &configv1.Update{Version: "1.0.0", Payload: "test/image:2"}, }, - Status: cvv1.ClusterVersionStatus{ - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue}, + Status: configv1.ClusterVersionStatus{ + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue}, }, }, }, @@ -213,14 +212,14 @@ func Test_operatorMetrics_Collect(t *testing.T) { releaseImage: "test/image:1", name: "test", cvLister: &cvLister{ - Items: []*cvv1.ClusterVersion{ + Items: []*configv1.ClusterVersion{ { ObjectMeta: metav1.ObjectMeta{ Name: "test", }, - Status: cvv1.ClusterVersionStatus{ - Conditions: []osv1.ClusterOperatorStatusCondition{ - {Type: osv1.OperatorFailing, Status: osv1.ConditionTrue}, + Status: configv1.ClusterVersionStatus{ + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue}, }, }, }, diff --git a/pkg/cvo/status.go b/pkg/cvo/status.go index effb1e3112..16f8277c91 100644 --- a/pkg/cvo/status.go +++ b/pkg/cvo/status.go @@ -7,13 +7,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + configv1 "github.com/openshift/api/config/v1" + configclientv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - osv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - cvclientv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" ) -func (optr *Operator) syncAvailableUpdatesStatus(original *cvv1.ClusterVersion) (bool, error) { +func (optr *Operator) syncAvailableUpdatesStatus(original *configv1.ClusterVersion) (bool, error) { config := optr.getAvailableUpdates().NeedsUpdate(original) if config == nil { return false, nil @@ -26,7 +25,7 @@ func (optr *Operator) syncAvailableUpdatesStatus(original *cvv1.ClusterVersion) return updated != nil && updated.ResourceVersion != original.ResourceVersion, err } -func (optr *Operator) syncProgressingStatus(config *cvv1.ClusterVersion) error { +func (optr *Operator) syncProgressingStatus(config *configv1.ClusterVersion) error { original := config.DeepCopy() config.Status.Generation = config.Generation @@ -35,28 +34,28 @@ func (optr *Operator) syncProgressingStatus(config *cvv1.ClusterVersion) error { now := metav1.Now() // clear the available condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse, LastTransitionTime: now}) + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse, LastTransitionTime: now}) // preserve the most recent failing condition - if resourcemerge.IsOperatorStatusConditionNotIn(config.Status.Conditions, osv1.OperatorFailing, osv1.ConditionTrue) { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{Type: osv1.OperatorFailing, Status: osv1.ConditionFalse, LastTransitionTime: now}) + if resourcemerge.IsOperatorStatusConditionNotIn(config.Status.Conditions, configv1.OperatorFailing, configv1.ConditionTrue) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorFailing, Status: configv1.ConditionFalse, LastTransitionTime: now}) } // set progressing with an accurate summary message - if c := resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, osv1.OperatorFailing); c != nil && c.Status == osv1.ConditionTrue { + if c := resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, configv1.OperatorFailing); c != nil && c.Status == configv1.ConditionTrue { reason := c.Reason msg := summaryForReason(reason) - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, Reason: reason, Message: fmt.Sprintf("Unable to apply %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, }) } else { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, Message: fmt.Sprintf("Working towards %s", optr.desiredVersionString(config)), LastTransitionTime: now, }) @@ -68,7 +67,7 @@ func (optr *Operator) syncProgressingStatus(config *cvv1.ClusterVersion) error { return err } -func (optr *Operator) syncAvailableStatus(config *cvv1.ClusterVersion, current cvv1.Update, versionHash string) error { +func (optr *Operator) syncAvailableStatus(config *configv1.ClusterVersion, current configv1.Update, versionHash string) error { original := config.DeepCopy() config.Status.Current = current @@ -79,21 +78,21 @@ func (optr *Operator) syncAvailableStatus(config *cvv1.ClusterVersion, current c version := optr.currentVersionString(config) // set the available condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorAvailable, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorAvailable, + Status: configv1.ConditionTrue, Message: fmt.Sprintf("Done applying %s", version), LastTransitionTime: now, }) // clear the failure condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{Type: osv1.OperatorFailing, Status: osv1.ConditionFalse, LastTransitionTime: now}) + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorFailing, Status: configv1.ConditionFalse, LastTransitionTime: now}) // clear the progressing condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionFalse, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, Message: fmt.Sprintf("Cluster version is %s", version), LastTransitionTime: now, @@ -104,7 +103,7 @@ func (optr *Operator) syncAvailableStatus(config *cvv1.ClusterVersion, current c return err } -func (optr *Operator) syncPayloadFailingStatus(original *cvv1.ClusterVersion, err error) error { +func (optr *Operator) syncPayloadFailingStatus(original *configv1.ClusterVersion, err error) error { config := original.DeepCopy() config.Status.Generation = config.Generation @@ -121,27 +120,27 @@ func (optr *Operator) syncPayloadFailingStatus(original *cvv1.ClusterVersion, er // leave the available condition alone // set the failing condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorFailing, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorFailing, + Status: configv1.ConditionTrue, Reason: reason, Message: err.Error(), LastTransitionTime: now, }) // update the progressing condition message to indicate there is an error - if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, osv1.OperatorProgressing) { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionTrue, + if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, configv1.OperatorProgressing) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, Reason: reason, Message: fmt.Sprintf("Unable to apply %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, }) } else { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionFalse, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, Reason: reason, Message: fmt.Sprintf("Error while reconciling %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, @@ -153,7 +152,7 @@ func (optr *Operator) syncPayloadFailingStatus(original *cvv1.ClusterVersion, er return err } -func (optr *Operator) syncUpdateFailingStatus(original *cvv1.ClusterVersion, err error) error { +func (optr *Operator) syncUpdateFailingStatus(original *configv1.ClusterVersion, err error) error { config := original.DeepCopy() config.Status.Generation = config.Generation @@ -168,30 +167,30 @@ func (optr *Operator) syncUpdateFailingStatus(original *cvv1.ClusterVersion, err } // clear the available condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse, LastTransitionTime: now}) + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse, LastTransitionTime: now}) // set the failing condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorFailing, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorFailing, + Status: configv1.ConditionTrue, Reason: reason, Message: err.Error(), LastTransitionTime: now, }) // update the progressing condition message to indicate there is an error - if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, osv1.OperatorProgressing) { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionTrue, + if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, configv1.OperatorProgressing) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, Reason: reason, Message: fmt.Sprintf("Unable to apply %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, }) } else { - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, - Status: osv1.ConditionFalse, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, Reason: reason, Message: fmt.Sprintf("Error while reconciling %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, @@ -208,7 +207,7 @@ func (optr *Operator) syncUpdateFailingStatus(original *cvv1.ClusterVersion, err // from the cache (instead of clearing the status). // if ierr is nil, return nil // if ierr is not nil, update OperatorStatus as Failing and return ierr -func (optr *Operator) syncFailingStatus(config *cvv1.ClusterVersion, ierr error) error { +func (optr *Operator) syncFailingStatus(config *configv1.ClusterVersion, ierr error) error { if ierr == nil { return nil } @@ -218,7 +217,7 @@ func (optr *Operator) syncFailingStatus(config *cvv1.ClusterVersion, ierr error) config, _ = optr.cvLister.Get(optr.name) } if config == nil { - config = &cvv1.ClusterVersion{ + config = &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: optr.name, }, @@ -233,23 +232,23 @@ func (optr *Operator) syncFailingStatus(config *cvv1.ClusterVersion, ierr error) msg := fmt.Sprintf("Error ensuring the cluster version is up to date: %v", ierr) // clear the available condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{Type: osv1.OperatorAvailable, Status: osv1.ConditionFalse, LastTransitionTime: now}) + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse, LastTransitionTime: now}) // reset the failing message - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorFailing, - Status: osv1.ConditionTrue, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorFailing, + Status: configv1.ConditionTrue, Message: ierr.Error(), LastTransitionTime: now, }) // preserve the status of the existing progressing condition - progressingStatus := osv1.ConditionFalse - if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, osv1.OperatorProgressing) { - progressingStatus = osv1.ConditionTrue + progressingStatus := configv1.ConditionFalse + if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, configv1.OperatorProgressing) { + progressingStatus = configv1.ConditionTrue } - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, osv1.ClusterOperatorStatusCondition{ - Type: osv1.OperatorProgressing, + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, Status: progressingStatus, Message: msg, LastTransitionTime: now, @@ -268,7 +267,7 @@ func (optr *Operator) syncFailingStatus(config *cvv1.ClusterVersion, ierr error) // object does not change. The method will retry a conflict by retrieving the latest live // version and updating the metadata of required. required is modified if the object on // the server is newer. -func applyClusterVersionStatus(client cvclientv1.ClusterVersionsGetter, required, original *cvv1.ClusterVersion) (*cvv1.ClusterVersion, error) { +func applyClusterVersionStatus(client configclientv1.ClusterVersionsGetter, required, original *configv1.ClusterVersion) (*configv1.ClusterVersion, error) { if original != nil && equality.Semantic.DeepEqual(&original.Status, &required.Status) { return required, nil } diff --git a/pkg/cvo/sync.go b/pkg/cvo/sync.go index ac355d8296..c4696e5810 100644 --- a/pkg/cvo/sync.go +++ b/pkg/cvo/sync.go @@ -3,7 +3,6 @@ package cvo import ( "fmt" "strings" - "time" "github.com/golang/glog" "github.com/pkg/errors" @@ -14,9 +13,9 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" + configv1 "github.com/openshift/api/config/v1" "github.com/openshift/cluster-version-operator/lib" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" "github.com/openshift/cluster-version-operator/pkg/cvo/internal" ) @@ -37,7 +36,7 @@ var requeueOnErrorCauseToCheck = map[string]func(error) bool{ } // loadUpdatePayload reads the payload from disk or remote, as necessary. -func (optr *Operator) loadUpdatePayload(config *cvv1.ClusterVersion) (*updatePayload, error) { +func (optr *Operator) loadUpdatePayload(config *configv1.ClusterVersion) (*updatePayload, error) { payloadDir, err := optr.updatePayloadDir(config) if err != nil { return nil, err @@ -50,7 +49,7 @@ func (optr *Operator) loadUpdatePayload(config *cvv1.ClusterVersion) (*updatePay } // syncUpdatePayload applies the manifests in the payload to the cluster. -func (optr *Operator) syncUpdatePayload(config *cvv1.ClusterVersion, payload *updatePayload) error { +func (optr *Operator) syncUpdatePayload(config *configv1.ClusterVersion, payload *updatePayload) error { version := payload.releaseVersion if len(version) == 0 { version = payload.releaseImage @@ -64,6 +63,7 @@ func (optr *Operator) syncUpdatePayload(config *cvv1.ClusterVersion, payload *up index: i + 1, total: total, manifest: &payload.manifests[i], + backoff: optr.syncBackoff, }) } @@ -100,6 +100,7 @@ type syncTask struct { total int manifest *lib.Manifest requeued int + backoff wait.Backoff } func (st *syncTask) String() string { @@ -112,11 +113,7 @@ func (st *syncTask) String() string { func (st *syncTask) Run(version string, rc *rest.Config) error { var lastErr error - if err := wait.ExponentialBackoff(wait.Backoff{ - Duration: time.Second * 10, - Factor: 1.3, - Steps: 3, - }, func() (bool, error) { + if err := wait.ExponentialBackoff(st.backoff, func() (bool, error) { // build resource builder for manifest var b resourcebuilder.Interface var err error @@ -268,7 +265,7 @@ func summaryForReason(reason string) string { } // getOverrideForManifest returns the override and true when override exists for manifest. -func getOverrideForManifest(overrides []cvv1.ComponentOverride, manifest *lib.Manifest) (cvv1.ComponentOverride, bool) { +func getOverrideForManifest(overrides []configv1.ComponentOverride, manifest *lib.Manifest) (configv1.ComponentOverride, bool) { for idx, ov := range overrides { kind, namespace, name := manifest.GVK.Kind, manifest.Object().GetNamespace(), manifest.Object().GetName() if ov.Kind == kind && @@ -277,10 +274,10 @@ func getOverrideForManifest(overrides []cvv1.ComponentOverride, manifest *lib.Ma return overrides[idx], true } } - return cvv1.ComponentOverride{}, false + return configv1.ComponentOverride{}, false } -func ownerRefModifier(config *cvv1.ClusterVersion) resourcebuilder.MetaV1ObjectModifierFunc { +func ownerRefModifier(config *configv1.ClusterVersion) resourcebuilder.MetaV1ObjectModifierFunc { oref := metav1.NewControllerRef(config, ownerKind) return func(obj metav1.Object) { obj.SetOwnerReferences([]metav1.OwnerReference{*oref}) diff --git a/pkg/cvo/sync_test.go b/pkg/cvo/sync_test.go index 3c713c0885..9daf5908d3 100644 --- a/pkg/cvo/sync_test.go +++ b/pkg/cvo/sync_test.go @@ -10,11 +10,12 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" + configv1 "github.com/openshift/api/config/v1" "github.com/openshift/cluster-version-operator/lib" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" ) func TestHasRequeueOnErrorAnnotation(t *testing.T) { @@ -353,7 +354,8 @@ func TestSyncUpdatePayload(t *testing.T) { up := &updatePayload{releaseImage: "test", releaseVersion: "v0.0.0", manifests: manifests} op := &Operator{} - config := &cvv1.ClusterVersion{} + op.syncBackoff = wait.Backoff{Steps: 3} + config := &configv1.ClusterVersion{} r := &recorder{} testMapper := resourcebuilder.NewResourceMapper() testMapper.RegisterGVK(schema.GroupVersionKind{"test.cvo.io", "v1", "TestA"}, newTestBuilder(r, test.reactors)) diff --git a/pkg/cvo/updatepayload.go b/pkg/cvo/updatepayload.go index aaa51eddaf..8106dd21e5 100644 --- a/pkg/cvo/updatepayload.go +++ b/pkg/cvo/updatepayload.go @@ -23,7 +23,7 @@ import ( "github.com/openshift/cluster-version-operator/lib" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" "github.com/openshift/cluster-version-operator/lib/resourceread" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" + configv1 "github.com/openshift/api/config/v1" ) type updatePayload struct { @@ -162,7 +162,7 @@ func (optr *Operator) baseDirectory() string { return optr.payloadDir } -func (optr *Operator) updatePayloadDir(config *cvv1.ClusterVersion) (string, error) { +func (optr *Operator) updatePayloadDir(config *configv1.ClusterVersion) (string, error) { tdir, err := optr.targetUpdatePayloadDir(config) if err != nil { return "", &updateError{ @@ -176,7 +176,7 @@ func (optr *Operator) updatePayloadDir(config *cvv1.ClusterVersion) (string, err return optr.baseDirectory(), nil } -func (optr *Operator) targetUpdatePayloadDir(config *cvv1.ClusterVersion) (string, error) { +func (optr *Operator) targetUpdatePayloadDir(config *configv1.ClusterVersion) (string, error) { if !isTargetSet(config.Spec.DesiredUpdate) { return "", nil } @@ -223,7 +223,7 @@ func validateUpdatePayload(dir string) error { return nil } -func (optr *Operator) fetchUpdatePayloadToDir(dir string, config *cvv1.ClusterVersion) error { +func (optr *Operator) fetchUpdatePayloadToDir(dir string, config *configv1.ClusterVersion) error { if config.Spec.DesiredUpdate == nil { return fmt.Errorf("cannot fetch payload for empty desired update") } @@ -307,7 +307,7 @@ func copyPayloadCmd(tdir string) string { return fmt.Sprintf("%s && %s", cvoCmd, releaseCmd) } -func isTargetSet(desired *cvv1.Update) bool { +func isTargetSet(desired *configv1.Update) bool { return desired != nil && desired.Payload != "" && desired.Version != "" } diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go deleted file mode 100644 index d488a09244..0000000000 --- a/pkg/generated/clientset/versioned/clientset.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - configv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" - operatorstatusv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - ConfigV1() configv1.ConfigV1Interface - // Deprecated: please explicitly pick a version if possible. - Config() configv1.ConfigV1Interface - OperatorstatusV1() operatorstatusv1.OperatorstatusV1Interface - // Deprecated: please explicitly pick a version if possible. - Operatorstatus() operatorstatusv1.OperatorstatusV1Interface -} - -// Clientset contains the clients for groups. Each group has exactly one -// version included in a Clientset. -type Clientset struct { - *discovery.DiscoveryClient - configV1 *configv1.ConfigV1Client - operatorstatusV1 *operatorstatusv1.OperatorstatusV1Client -} - -// ConfigV1 retrieves the ConfigV1Client -func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { - return c.configV1 -} - -// Deprecated: Config retrieves the default version of ConfigClient. -// Please explicitly pick a version. -func (c *Clientset) Config() configv1.ConfigV1Interface { - return c.configV1 -} - -// OperatorstatusV1 retrieves the OperatorstatusV1Client -func (c *Clientset) OperatorstatusV1() operatorstatusv1.OperatorstatusV1Interface { - return c.operatorstatusV1 -} - -// Deprecated: Operatorstatus retrieves the default version of OperatorstatusClient. -// Please explicitly pick a version. -func (c *Clientset) Operatorstatus() operatorstatusv1.OperatorstatusV1Interface { - return c.operatorstatusV1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - var cs Clientset - var err error - cs.configV1, err = configv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - cs.operatorstatusV1, err = operatorstatusv1.NewForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - var cs Clientset - cs.configV1 = configv1.NewForConfigOrDie(c) - cs.operatorstatusV1 = operatorstatusv1.NewForConfigOrDie(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) - return &cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.configV1 = configv1.New(c) - cs.operatorstatusV1 = operatorstatusv1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go deleted file mode 100644 index 41721ca52d..0000000000 --- a/pkg/generated/clientset/versioned/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated clientset. -package versioned diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 0c703a6273..0000000000 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - configv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" - fakeconfigv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake" - operatorstatusv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1" - fakeoperatorstatusv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -var _ clientset.Interface = &Clientset{} - -// ConfigV1 retrieves the ConfigV1Client -func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { - return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} -} - -// Config retrieves the ConfigV1Client -func (c *Clientset) Config() configv1.ConfigV1Interface { - return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} -} - -// OperatorstatusV1 retrieves the OperatorstatusV1Client -func (c *Clientset) OperatorstatusV1() operatorstatusv1.OperatorstatusV1Interface { - return &fakeoperatorstatusv1.FakeOperatorstatusV1{Fake: &c.Fake} -} - -// Operatorstatus retrieves the OperatorstatusV1Client -func (c *Clientset) Operatorstatus() operatorstatusv1.OperatorstatusV1Interface { - return &fakeoperatorstatusv1.FakeOperatorstatusV1{Fake: &c.Fake} -} diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e71670..0000000000 --- a/pkg/generated/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go deleted file mode 100644 index 1121d7d0d6..0000000000 --- a/pkg/generated/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - configv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - operatorstatusv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - configv1.AddToScheme(scheme) - operatorstatusv1.AddToScheme(scheme) -} diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc3756168..0000000000 --- a/pkg/generated/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go deleted file mode 100644 index 507cdddc01..0000000000 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - configv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - operatorstatusv1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -func AddToScheme(scheme *runtime.Scheme) { - configv1.AddToScheme(scheme) - operatorstatusv1.AddToScheme(scheme) -} diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/clusterversion.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/clusterversion.go deleted file mode 100644 index e4b239a46c..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/clusterversion.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - scheme "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ClusterVersionsGetter has a method to return a ClusterVersionInterface. -// A group's client should implement this interface. -type ClusterVersionsGetter interface { - ClusterVersions() ClusterVersionInterface -} - -// ClusterVersionInterface has methods to work with ClusterVersion resources. -type ClusterVersionInterface interface { - Create(*v1.ClusterVersion) (*v1.ClusterVersion, error) - Update(*v1.ClusterVersion) (*v1.ClusterVersion, error) - UpdateStatus(*v1.ClusterVersion) (*v1.ClusterVersion, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterVersion, error) - List(opts metav1.ListOptions) (*v1.ClusterVersionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterVersion, err error) - ClusterVersionExpansion -} - -// clusterVersions implements ClusterVersionInterface -type clusterVersions struct { - client rest.Interface -} - -// newClusterVersions returns a ClusterVersions -func newClusterVersions(c *ConfigV1Client) *clusterVersions { - return &clusterVersions{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. -func (c *clusterVersions) Get(name string, options metav1.GetOptions) (result *v1.ClusterVersion, err error) { - result = &v1.ClusterVersion{} - err = c.client.Get(). - Resource("clusterversions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. -func (c *clusterVersions) List(opts metav1.ListOptions) (result *v1.ClusterVersionList, err error) { - result = &v1.ClusterVersionList{} - err = c.client.Get(). - Resource("clusterversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterVersions. -func (c *clusterVersions) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("clusterversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. -func (c *clusterVersions) Create(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { - result = &v1.ClusterVersion{} - err = c.client.Post(). - Resource("clusterversions"). - Body(clusterVersion). - Do(). - Into(result) - return -} - -// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. -func (c *clusterVersions) Update(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { - result = &v1.ClusterVersion{} - err = c.client.Put(). - Resource("clusterversions"). - Name(clusterVersion.Name). - Body(clusterVersion). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusterVersions) UpdateStatus(clusterVersion *v1.ClusterVersion) (result *v1.ClusterVersion, err error) { - result = &v1.ClusterVersion{} - err = c.client.Put(). - Resource("clusterversions"). - Name(clusterVersion.Name). - SubResource("status"). - Body(clusterVersion). - Do(). - Into(result) - return -} - -// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. -func (c *clusterVersions) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterversions"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterVersions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Resource("clusterversions"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched clusterVersion. -func (c *clusterVersions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterVersion, err error) { - result = &v1.ClusterVersion{} - err = c.client.Patch(pt). - Resource("clusterversions"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go deleted file mode 100644 index 95d8b4223a..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type ConfigV1Interface interface { - RESTClient() rest.Interface - ClusterVersionsGetter -} - -// ConfigV1Client is used to interact with features provided by the config.openshift.io group. -type ConfigV1Client struct { - restClient rest.Interface -} - -func (c *ConfigV1Client) ClusterVersions() ClusterVersionInterface { - return newClusterVersions(c) -} - -// NewForConfig creates a new ConfigV1Client for the given config. -func NewForConfig(c *rest.Config) (*ConfigV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &ConfigV1Client{client}, nil -} - -// NewForConfigOrDie creates a new ConfigV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ConfigV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ConfigV1Client for the given RESTClient. -func New(c rest.Interface) *ConfigV1Client { - return &ConfigV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ConfigV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go deleted file mode 100644 index 3af5d054f1..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go deleted file mode 100644 index 16f4439906..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_clusterversion.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_clusterversion.go deleted file mode 100644 index 024a3113c4..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_clusterversion.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - configopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeClusterVersions implements ClusterVersionInterface -type FakeClusterVersions struct { - Fake *FakeConfigV1 -} - -var clusterversionsResource = schema.GroupVersionResource{Group: "config.openshift.io", Version: "v1", Resource: "clusterversions"} - -var clusterversionsKind = schema.GroupVersionKind{Group: "config.openshift.io", Version: "v1", Kind: "ClusterVersion"} - -// Get takes name of the clusterVersion, and returns the corresponding clusterVersion object, and an error if there is any. -func (c *FakeClusterVersions) Get(name string, options v1.GetOptions) (result *configopenshiftiov1.ClusterVersion, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterversionsResource, name), &configopenshiftiov1.ClusterVersion{}) - if obj == nil { - return nil, err - } - return obj.(*configopenshiftiov1.ClusterVersion), err -} - -// List takes label and field selectors, and returns the list of ClusterVersions that match those selectors. -func (c *FakeClusterVersions) List(opts v1.ListOptions) (result *configopenshiftiov1.ClusterVersionList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterversionsResource, clusterversionsKind, opts), &configopenshiftiov1.ClusterVersionList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &configopenshiftiov1.ClusterVersionList{ListMeta: obj.(*configopenshiftiov1.ClusterVersionList).ListMeta} - for _, item := range obj.(*configopenshiftiov1.ClusterVersionList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterVersions. -func (c *FakeClusterVersions) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterversionsResource, opts)) -} - -// Create takes the representation of a clusterVersion and creates it. Returns the server's representation of the clusterVersion, and an error, if there is any. -func (c *FakeClusterVersions) Create(clusterVersion *configopenshiftiov1.ClusterVersion) (result *configopenshiftiov1.ClusterVersion, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterversionsResource, clusterVersion), &configopenshiftiov1.ClusterVersion{}) - if obj == nil { - return nil, err - } - return obj.(*configopenshiftiov1.ClusterVersion), err -} - -// Update takes the representation of a clusterVersion and updates it. Returns the server's representation of the clusterVersion, and an error, if there is any. -func (c *FakeClusterVersions) Update(clusterVersion *configopenshiftiov1.ClusterVersion) (result *configopenshiftiov1.ClusterVersion, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterversionsResource, clusterVersion), &configopenshiftiov1.ClusterVersion{}) - if obj == nil { - return nil, err - } - return obj.(*configopenshiftiov1.ClusterVersion), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterVersions) UpdateStatus(clusterVersion *configopenshiftiov1.ClusterVersion) (*configopenshiftiov1.ClusterVersion, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(clusterversionsResource, "status", clusterVersion), &configopenshiftiov1.ClusterVersion{}) - if obj == nil { - return nil, err - } - return obj.(*configopenshiftiov1.ClusterVersion), err -} - -// Delete takes name of the clusterVersion and deletes it. Returns an error if one occurs. -func (c *FakeClusterVersions) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(clusterversionsResource, name), &configopenshiftiov1.ClusterVersion{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterVersions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterversionsResource, listOptions) - - _, err := c.Fake.Invokes(action, &configopenshiftiov1.ClusterVersionList{}) - return err -} - -// Patch applies the patch and returns the patched clusterVersion. -func (c *FakeClusterVersions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *configopenshiftiov1.ClusterVersion, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterversionsResource, name, data, subresources...), &configopenshiftiov1.ClusterVersion{}) - if obj == nil { - return nil, err - } - return obj.(*configopenshiftiov1.ClusterVersion), err -} diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go deleted file mode 100644 index 10a33b4f04..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeConfigV1 struct { - *testing.Fake -} - -func (c *FakeConfigV1) ClusterVersions() v1.ClusterVersionInterface { - return &FakeClusterVersions{c} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeConfigV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go deleted file mode 100644 index ecfcd70d7b..0000000000 --- a/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ClusterVersionExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/clusteroperator.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/clusteroperator.go deleted file mode 100644 index 5694c3f747..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/clusteroperator.go +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - scheme "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// ClusterOperatorsGetter has a method to return a ClusterOperatorInterface. -// A group's client should implement this interface. -type ClusterOperatorsGetter interface { - ClusterOperators(namespace string) ClusterOperatorInterface -} - -// ClusterOperatorInterface has methods to work with ClusterOperator resources. -type ClusterOperatorInterface interface { - Create(*v1.ClusterOperator) (*v1.ClusterOperator, error) - Update(*v1.ClusterOperator) (*v1.ClusterOperator, error) - UpdateStatus(*v1.ClusterOperator) (*v1.ClusterOperator, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterOperator, error) - List(opts metav1.ListOptions) (*v1.ClusterOperatorList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterOperator, err error) - ClusterOperatorExpansion -} - -// clusterOperators implements ClusterOperatorInterface -type clusterOperators struct { - client rest.Interface - ns string -} - -// newClusterOperators returns a ClusterOperators -func newClusterOperators(c *OperatorstatusV1Client, namespace string) *clusterOperators { - return &clusterOperators{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. -func (c *clusterOperators) Get(name string, options metav1.GetOptions) (result *v1.ClusterOperator, err error) { - result = &v1.ClusterOperator{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteroperators"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. -func (c *clusterOperators) List(opts metav1.ListOptions) (result *v1.ClusterOperatorList, err error) { - result = &v1.ClusterOperatorList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteroperators"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterOperators. -func (c *clusterOperators) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("clusteroperators"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. -func (c *clusterOperators) Create(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { - result = &v1.ClusterOperator{} - err = c.client.Post(). - Namespace(c.ns). - Resource("clusteroperators"). - Body(clusterOperator). - Do(). - Into(result) - return -} - -// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. -func (c *clusterOperators) Update(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { - result = &v1.ClusterOperator{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusteroperators"). - Name(clusterOperator.Name). - Body(clusterOperator). - Do(). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusterOperators) UpdateStatus(clusterOperator *v1.ClusterOperator) (result *v1.ClusterOperator, err error) { - result = &v1.ClusterOperator{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusteroperators"). - Name(clusterOperator.Name). - SubResource("status"). - Body(clusterOperator). - Do(). - Into(result) - return -} - -// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. -func (c *clusterOperators) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteroperators"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterOperators) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteroperators"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched clusterOperator. -func (c *clusterOperators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterOperator, err error) { - result = &v1.ClusterOperator{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("clusteroperators"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/doc.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/doc.go deleted file mode 100644 index 3af5d054f1..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1 diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/doc.go deleted file mode 100644 index 16f4439906..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_clusteroperator.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_clusteroperator.go deleted file mode 100644 index 4f3079510f..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_clusteroperator.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - operatorstatusopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeClusterOperators implements ClusterOperatorInterface -type FakeClusterOperators struct { - Fake *FakeOperatorstatusV1 - ns string -} - -var clusteroperatorsResource = schema.GroupVersionResource{Group: "operatorstatus.openshift.io", Version: "v1", Resource: "clusteroperators"} - -var clusteroperatorsKind = schema.GroupVersionKind{Group: "operatorstatus.openshift.io", Version: "v1", Kind: "ClusterOperator"} - -// Get takes name of the clusterOperator, and returns the corresponding clusterOperator object, and an error if there is any. -func (c *FakeClusterOperators) Get(name string, options v1.GetOptions) (result *operatorstatusopenshiftiov1.ClusterOperator, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(clusteroperatorsResource, c.ns, name), &operatorstatusopenshiftiov1.ClusterOperator{}) - - if obj == nil { - return nil, err - } - return obj.(*operatorstatusopenshiftiov1.ClusterOperator), err -} - -// List takes label and field selectors, and returns the list of ClusterOperators that match those selectors. -func (c *FakeClusterOperators) List(opts v1.ListOptions) (result *operatorstatusopenshiftiov1.ClusterOperatorList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(clusteroperatorsResource, clusteroperatorsKind, c.ns, opts), &operatorstatusopenshiftiov1.ClusterOperatorList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &operatorstatusopenshiftiov1.ClusterOperatorList{ListMeta: obj.(*operatorstatusopenshiftiov1.ClusterOperatorList).ListMeta} - for _, item := range obj.(*operatorstatusopenshiftiov1.ClusterOperatorList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterOperators. -func (c *FakeClusterOperators) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(clusteroperatorsResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterOperator and creates it. Returns the server's representation of the clusterOperator, and an error, if there is any. -func (c *FakeClusterOperators) Create(clusterOperator *operatorstatusopenshiftiov1.ClusterOperator) (result *operatorstatusopenshiftiov1.ClusterOperator, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(clusteroperatorsResource, c.ns, clusterOperator), &operatorstatusopenshiftiov1.ClusterOperator{}) - - if obj == nil { - return nil, err - } - return obj.(*operatorstatusopenshiftiov1.ClusterOperator), err -} - -// Update takes the representation of a clusterOperator and updates it. Returns the server's representation of the clusterOperator, and an error, if there is any. -func (c *FakeClusterOperators) Update(clusterOperator *operatorstatusopenshiftiov1.ClusterOperator) (result *operatorstatusopenshiftiov1.ClusterOperator, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(clusteroperatorsResource, c.ns, clusterOperator), &operatorstatusopenshiftiov1.ClusterOperator{}) - - if obj == nil { - return nil, err - } - return obj.(*operatorstatusopenshiftiov1.ClusterOperator), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterOperators) UpdateStatus(clusterOperator *operatorstatusopenshiftiov1.ClusterOperator) (*operatorstatusopenshiftiov1.ClusterOperator, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(clusteroperatorsResource, "status", c.ns, clusterOperator), &operatorstatusopenshiftiov1.ClusterOperator{}) - - if obj == nil { - return nil, err - } - return obj.(*operatorstatusopenshiftiov1.ClusterOperator), err -} - -// Delete takes name of the clusterOperator and deletes it. Returns an error if one occurs. -func (c *FakeClusterOperators) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(clusteroperatorsResource, c.ns, name), &operatorstatusopenshiftiov1.ClusterOperator{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterOperators) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(clusteroperatorsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &operatorstatusopenshiftiov1.ClusterOperatorList{}) - return err -} - -// Patch applies the patch and returns the patched clusterOperator. -func (c *FakeClusterOperators) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *operatorstatusopenshiftiov1.ClusterOperator, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clusteroperatorsResource, c.ns, name, data, subresources...), &operatorstatusopenshiftiov1.ClusterOperator{}) - - if obj == nil { - return nil, err - } - return obj.(*operatorstatusopenshiftiov1.ClusterOperator), err -} diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_operatorstatus.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_operatorstatus.openshift.io_client.go deleted file mode 100644 index 835fcddc6d..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/fake/fake_operatorstatus.openshift.io_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeOperatorstatusV1 struct { - *testing.Fake -} - -func (c *FakeOperatorstatusV1) ClusterOperators(namespace string) v1.ClusterOperatorInterface { - return &FakeClusterOperators{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeOperatorstatusV1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/generated_expansion.go deleted file mode 100644 index 468407f3f9..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -type ClusterOperatorExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/operatorstatus.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/operatorstatus.openshift.io_client.go deleted file mode 100644 index c6bba1f4bf..0000000000 --- a/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1/operatorstatus.openshift.io_client.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/scheme" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - rest "k8s.io/client-go/rest" -) - -type OperatorstatusV1Interface interface { - RESTClient() rest.Interface - ClusterOperatorsGetter -} - -// OperatorstatusV1Client is used to interact with features provided by the operatorstatus.openshift.io group. -type OperatorstatusV1Client struct { - restClient rest.Interface -} - -func (c *OperatorstatusV1Client) ClusterOperators(namespace string) ClusterOperatorInterface { - return newClusterOperators(c, namespace) -} - -// NewForConfig creates a new OperatorstatusV1Client for the given config. -func NewForConfig(c *rest.Config) (*OperatorstatusV1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientFor(&config) - if err != nil { - return nil, err - } - return &OperatorstatusV1Client{client}, nil -} - -// NewForConfigOrDie creates a new OperatorstatusV1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *OperatorstatusV1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new OperatorstatusV1Client for the given RESTClient. -func New(c rest.Interface) *OperatorstatusV1Client { - return &OperatorstatusV1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *OperatorstatusV1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/generated/informers/externalversions/config.openshift.io/interface.go b/pkg/generated/informers/externalversions/config.openshift.io/interface.go deleted file mode 100644 index 4eae2797ea..0000000000 --- a/pkg/generated/informers/externalversions/config.openshift.io/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package config - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/config.openshift.io/v1" - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/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/pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go b/pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go deleted file mode 100644 index d422bfdc49..0000000000 --- a/pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - time "time" - - configopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - versioned "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/config.openshift.io/v1" - metav1 "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 metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigV1().ClusterVersions().List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ConfigV1().ClusterVersions().Watch(options) - }, - }, - &configopenshiftiov1.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(&configopenshiftiov1.ClusterVersion{}, f.defaultInformer) -} - -func (f *clusterVersionInformer) Lister() v1.ClusterVersionLister { - return v1.NewClusterVersionLister(f.Informer().GetIndexer()) -} diff --git a/pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go b/pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go deleted file mode 100644 index c4f2680540..0000000000 --- a/pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ClusterVersions returns a ClusterVersionInformer. - ClusterVersions() ClusterVersionInformer -} - -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} -} - -// ClusterVersions returns a ClusterVersionInformer. -func (v *version) ClusterVersions() ClusterVersionInformer { - return &clusterVersionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go deleted file mode 100644 index 1ff5002ab0..0000000000 --- a/pkg/generated/informers/externalversions/factory.go +++ /dev/null @@ -1,186 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - versioned "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - configopenshiftio "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/config.openshift.io" - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" - operatorstatusopenshiftio "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/operatorstatus.openshift.io" - 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() configopenshiftio.Interface - Operatorstatus() operatorstatusopenshiftio.Interface -} - -func (f *sharedInformerFactory) Config() configopenshiftio.Interface { - return configopenshiftio.New(f, f.namespace, f.tweakListOptions) -} - -func (f *sharedInformerFactory) Operatorstatus() operatorstatusopenshiftio.Interface { - return operatorstatusopenshiftio.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go deleted file mode 100644 index d247828251..0000000000 --- a/pkg/generated/informers/externalversions/generic.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - v1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" - operatorstatusopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/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("clusterversions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Config().V1().ClusterVersions().Informer()}, nil - - // Group=operatorstatus.openshift.io, Version=v1 - case operatorstatusopenshiftiov1.SchemeGroupVersion.WithResource("clusteroperators"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Operatorstatus().V1().ClusterOperators().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 17c6c9220b..0000000000 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - versioned "github.com/openshift/cluster-version-operator/pkg/generated/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/pkg/generated/informers/externalversions/operatorstatus.openshift.io/interface.go b/pkg/generated/informers/externalversions/operatorstatus.openshift.io/interface.go deleted file mode 100644 index b7437c8b6a..0000000000 --- a/pkg/generated/informers/externalversions/operatorstatus.openshift.io/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package operatorstatus - -import ( - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1" -) - -// 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/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/clusteroperator.go b/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/clusteroperator.go deleted file mode 100644 index 1f27e4aedc..0000000000 --- a/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/clusteroperator.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - time "time" - - operatorstatusopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/v1" - versioned "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/operatorstatus.openshift.io/v1" - metav1 "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 - namespace string -} - -// 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, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredClusterOperatorInformer(client, namespace, 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, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.OperatorstatusV1().ClusterOperators(namespace).List(options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.OperatorstatusV1().ClusterOperators(namespace).Watch(options) - }, - }, - &operatorstatusopenshiftiov1.ClusterOperator{}, - resyncPeriod, - indexers, - ) -} - -func (f *clusterOperatorInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredClusterOperatorInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *clusterOperatorInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&operatorstatusopenshiftiov1.ClusterOperator{}, f.defaultInformer) -} - -func (f *clusterOperatorInformer) Lister() v1.ClusterOperatorLister { - return v1.NewClusterOperatorLister(f.Informer().GetIndexer()) -} diff --git a/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/interface.go b/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/interface.go deleted file mode 100644 index ff746d7bbd..0000000000 --- a/pkg/generated/informers/externalversions/operatorstatus.openshift.io/v1/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - internalinterfaces "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // ClusterOperators returns a ClusterOperatorInformer. - ClusterOperators() ClusterOperatorInformer -} - -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} -} - -// ClusterOperators returns a ClusterOperatorInformer. -func (v *version) ClusterOperators() ClusterOperatorInformer { - return &clusterOperatorInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/generated/listers/config.openshift.io/v1/clusterversion.go b/pkg/generated/listers/config.openshift.io/v1/clusterversion.go deleted file mode 100644 index 07d1bd8b1d..0000000000 --- a/pkg/generated/listers/config.openshift.io/v1/clusterversion.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/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/pkg/generated/listers/config.openshift.io/v1/expansion_generated.go b/pkg/generated/listers/config.openshift.io/v1/expansion_generated.go deleted file mode 100644 index e167b56ebb..0000000000 --- a/pkg/generated/listers/config.openshift.io/v1/expansion_generated.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -// ClusterVersionListerExpansion allows custom methods to be added to -// ClusterVersionLister. -type ClusterVersionListerExpansion interface{} diff --git a/pkg/generated/listers/operatorstatus.openshift.io/v1/clusteroperator.go b/pkg/generated/listers/operatorstatus.openshift.io/v1/clusteroperator.go deleted file mode 100644 index 7595953829..0000000000 --- a/pkg/generated/listers/operatorstatus.openshift.io/v1/clusteroperator.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/operatorstatus.openshift.io/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) - // ClusterOperators returns an object that can list and get ClusterOperators. - ClusterOperators(namespace string) ClusterOperatorNamespaceLister - 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 -} - -// ClusterOperators returns an object that can list and get ClusterOperators. -func (s *clusterOperatorLister) ClusterOperators(namespace string) ClusterOperatorNamespaceLister { - return clusterOperatorNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// ClusterOperatorNamespaceLister helps list and get ClusterOperators. -type ClusterOperatorNamespaceLister interface { - // List lists all ClusterOperators in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.ClusterOperator, err error) - // Get retrieves the ClusterOperator from the indexer for a given namespace and name. - Get(name string) (*v1.ClusterOperator, error) - ClusterOperatorNamespaceListerExpansion -} - -// clusterOperatorNamespaceLister implements the ClusterOperatorNamespaceLister -// interface. -type clusterOperatorNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ClusterOperators in the indexer for a given namespace. -func (s clusterOperatorNamespaceLister) List(selector labels.Selector) (ret []*v1.ClusterOperator, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterOperator)) - }) - return ret, err -} - -// Get retrieves the ClusterOperator from the indexer for a given namespace and name. -func (s clusterOperatorNamespaceLister) Get(name string) (*v1.ClusterOperator, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + 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/pkg/generated/listers/operatorstatus.openshift.io/v1/expansion_generated.go b/pkg/generated/listers/operatorstatus.openshift.io/v1/expansion_generated.go deleted file mode 100644 index db80edbb8b..0000000000 --- a/pkg/generated/listers/operatorstatus.openshift.io/v1/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -// ClusterOperatorListerExpansion allows custom methods to be added to -// ClusterOperatorLister. -type ClusterOperatorListerExpansion interface{} - -// ClusterOperatorNamespaceListerExpansion allows custom methods to be added to -// ClusterOperatorNamespaceLister. -type ClusterOperatorNamespaceListerExpansion interface{} From ab4d84a021c38fea5e5973287e1f5580928907c1 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 18 Nov 2018 22:11:00 -0500 Subject: [PATCH 4/4] cvo: Validate the CVO prior to acting on it The CVO needs to perform some minimum sanity checking on incoming input and communicate to users when it is blocked. The previous mechanism of rejecting the CV on deserialization is only partial validation and doesn't cover all scenarios. In the future we may want to have the CVO register as an admission webhook for its own resource. Add validation immediately after the CVO loads the object from the cache, verifying that the object that we see has no errors. If it does, write an Invalid condition to the status and reset the Progressing condition, then clear the invalid fields so that the sync loop doesn't act on them. Simplify initial status setting by having the initial status check normalize the object status for a set of conditions, including available updates. This reduces the complexity of the CVO main loop slightly. --- lib/validation/validation.go | 66 +++++ pkg/cvo/availableupdates.go | 9 + pkg/cvo/cvo.go | 50 ++-- pkg/cvo/cvo_test.go | 500 ++++++++++++++++++++++++++++++----- pkg/cvo/status.go | 110 +++++++- 5 files changed, 634 insertions(+), 101 deletions(-) create mode 100644 lib/validation/validation.go diff --git a/lib/validation/validation.go b/lib/validation/validation.go new file mode 100644 index 0000000000..0ed9b64d5e --- /dev/null +++ b/lib/validation/validation.go @@ -0,0 +1,66 @@ +package validation + +import ( + "net/url" + "strings" + + "github.com/blang/semver" + "github.com/google/uuid" + + apivalidation "k8s.io/apimachinery/pkg/api/validation" + "k8s.io/apimachinery/pkg/util/validation/field" + + configv1 "github.com/openshift/api/config/v1" +) + +func ValidateClusterVersion(config *configv1.ClusterVersion) field.ErrorList { + errs := apivalidation.ValidateObjectMeta(&config.ObjectMeta, false, apivalidation.NameIsDNS1035Label, nil) + + if len(config.Spec.Upstream) > 0 { + if _, err := url.Parse(string(config.Spec.Upstream)); err != nil { + errs = append(errs, field.Invalid(field.NewPath("spec", "upstream"), config.Spec.Upstream, "must be a valid URL or empty")) + } + } + if len(config.Spec.ClusterID) > 0 { + id, _ := uuid.Parse(string(config.Spec.ClusterID)) + switch { + case id.Variant() != uuid.RFC4122: + errs = append(errs, field.Invalid(field.NewPath("spec", "clusterID"), config.Spec.ClusterID, "must be an RFC4122-variant UUID")) + case id.Version() != 4: + errs = append(errs, field.Invalid(field.NewPath("spec", "clusterID"), config.Spec.ClusterID, "must be a version-4 UUID")) + } + } + if u := config.Spec.DesiredUpdate; u != nil { + switch { + case len(u.Version) == 0 && len(u.Payload) == 0: + errs = append(errs, field.Required(field.NewPath("spec", "desiredUpdate", "version"), "must specify version or payload")) + case len(u.Version) > 0 && !validSemVer(u.Version): + errs = append(errs, field.Invalid(field.NewPath("spec", "desiredUpdate", "version"), u.Version, "must be a semantic version (1.2.3[-...])")) + } + } + return errs +} + +func ClearInvalidFields(config *configv1.ClusterVersion, errs field.ErrorList) *configv1.ClusterVersion { + if len(errs) == 0 { + return config + } + copied := config.DeepCopy() + for _, err := range errs { + switch { + case strings.HasPrefix(err.Field, "spec.desiredUpdate."): + copied.Spec.DesiredUpdate = nil + case err.Field == "spec.upstream": + // TODO: invalid means, don't fetch updates + copied.Spec.Upstream = "" + case err.Field == "spec.clusterID": + copied.Spec.ClusterID = "" + } + } + return copied +} + +func validSemVer(version string) bool { + _, err := semver.Parse(version) + return err == nil +} diff --git a/pkg/cvo/availableupdates.go b/pkg/cvo/availableupdates.go index c4aef79889..9c0314adf7 100644 --- a/pkg/cvo/availableupdates.go +++ b/pkg/cvo/availableupdates.go @@ -21,8 +21,10 @@ import ( // object. It will set the RetrievedUpdates condition. Updates are only checked if it has been more than // the minimumUpdateCheckInterval since the last check. func (optr *Operator) syncAvailableUpdates(config *configv1.ClusterVersion) error { + usedDefaultUpstream := false upstream := string(config.Spec.Upstream) if len(upstream) == 0 { + usedDefaultUpstream = true upstream = optr.defaultUpstreamServer } channel := config.Spec.Channel @@ -35,6 +37,10 @@ func (optr *Operator) syncAvailableUpdates(config *configv1.ClusterVersion) erro } updates, condition := calculateAvailableUpdatesStatus(string(config.Spec.ClusterID), upstream, channel, optr.releaseVersion) + + if usedDefaultUpstream { + upstream = "" + } optr.setAvailableUpdates(&availableUpdates{ Upstream: upstream, Channel: config.Spec.Channel, @@ -64,6 +70,9 @@ func (u *availableUpdates) NeedsUpdate(original *configv1.ClusterVersion) *confi if u == nil { return nil } + if u.Upstream != string(original.Spec.Upstream) || u.Channel != original.Spec.Channel { + return nil + } if equality.Semantic.DeepEqual(u.Updates, original.Status.AvailableUpdates) && equality.Semantic.DeepEqual(u.Condition, resourcemerge.FindOperatorStatusCondition(original.Status.Conditions, u.Condition.Type)) { return nil diff --git a/pkg/cvo/cvo.go b/pkg/cvo/cvo.go index a828d987fc..874ef87779 100644 --- a/pkg/cvo/cvo.go +++ b/pkg/cvo/cvo.go @@ -29,6 +29,7 @@ import ( configlistersv1 "github.com/openshift/client-go/config/listers/config/v1" "github.com/openshift/cluster-version-operator/lib/resourceapply" "github.com/openshift/cluster-version-operator/lib/resourcemerge" + "github.com/openshift/cluster-version-operator/lib/validation" ) const ( @@ -278,26 +279,19 @@ func (optr *Operator) sync(key string) error { glog.V(4).Infof("Finished syncing cluster version %q (%v)", key, time.Since(startTime)) }() - // ensure the cluster version exists - original, created, err := optr.getOrCreateClusterVersion() + // ensure the cluster version exists, that the object is valid, and that + // all initial conditions are set. + original, changed, err := optr.getOrCreateClusterVersion() if err != nil { return err } - if created || optr.isOlderThanLastUpdate(original) { + if changed { + glog.V(4).Infof("Cluster version changed, waiting for newer event") return nil } glog.V(3).Infof("ClusterVersion: %#v", original) - // sync any available updates to status - if ok, err := optr.syncAvailableUpdatesStatus(original); ok { - if err == nil { - glog.V(4).Infof("Updating available updates onto status") - return nil - } - glog.Errorf("Unable to sync available updates to the cluster version: %v", err) - } - // when we're up to date, limit how frequently we check the payload availableAndUpdated := original.Status.Generation == original.Generation && resourcemerge.IsOperatorStatusConditionTrue(original.Status.Conditions, configv1.OperatorAvailable) @@ -365,6 +359,9 @@ func (optr *Operator) availableUpdatesSync(key string) error { if err != nil { return err } + if errs := validation.ValidateClusterVersion(config); len(errs) > 0 { + return nil + } return optr.syncAvailableUpdates(config) } @@ -417,24 +414,35 @@ func (optr *Operator) rememberLastUpdate(config *configv1.ClusterVersion) { func (optr *Operator) getOrCreateClusterVersion() (*configv1.ClusterVersion, bool, error) { obj, err := optr.cvLister.Get(optr.name) if err == nil { - return obj, false, nil + // if we are waiting to see a newer cached version, just exit + if optr.isOlderThanLastUpdate(obj) { + return nil, true, nil + } + + // ensure that the object we do have is valid + errs := validation.ValidateClusterVersion(obj) + changed, err := optr.syncInitialObjectStatus(obj, errs) + if err != nil { + return nil, false, err + } + + // for fields that have meaning that are incomplete, clear them + // prevents us from loading clearly malformed payloads + obj = validation.ClearInvalidFields(obj, errs) + + return obj, changed, nil } + if !apierrors.IsNotFound(err) { return nil, false, err } + var upstream configv1.URL if len(optr.defaultUpstreamServer) > 0 { u := configv1.URL(optr.defaultUpstreamServer) upstream = u } - channel := "fast" id, _ := uuid.NewRandom() - if id.Variant() != uuid.RFC4122 { - return nil, false, fmt.Errorf("invalid %q, must be an RFC4122-variant UUID: found %s", id, id.Variant()) - } - if id.Version() != 4 { - return nil, false, fmt.Errorf("Invalid %q, must be a version-4 UUID: found %s", id, id.Version()) - } // XXX: generate ClusterVersion from options calculated above. config := &configv1.ClusterVersion{ @@ -443,7 +451,7 @@ func (optr *Operator) getOrCreateClusterVersion() (*configv1.ClusterVersion, boo }, Spec: configv1.ClusterVersionSpec{ Upstream: upstream, - Channel: channel, + Channel: "fast", ClusterID: configv1.ClusterID(id.String()), }, } diff --git a/pkg/cvo/cvo_test.go b/pkg/cvo/cvo_test.go index 2980907141..b999f94d35 100644 --- a/pkg/cvo/cvo_test.go +++ b/pkg/cvo/cvo_test.go @@ -26,6 +26,7 @@ import ( ktesting "k8s.io/client-go/testing" "k8s.io/client-go/util/workqueue" + "github.com/golang/glog" "github.com/google/uuid" configv1 "github.com/openshift/api/config/v1" clientset "github.com/openshift/client-go/config/clientset/versioned" @@ -173,6 +174,8 @@ func (c *fakeApiExtClient) Patch(name string, pt types.PatchType, data []byte, s } func TestOperator_sync(t *testing.T) { + id := uuid.Must(uuid.NewRandom()).String() + content1 := map[string]interface{}{ "manifests": map[string]interface{}{}, "release-manifests": map[string]interface{}{ @@ -247,7 +250,7 @@ func TestOperator_sync(t *testing.T) { releaseImage: "payload/image:v4.0.1", namespace: "test", name: "default", - client: fake.NewSimpleClientset( + client: fakeClientsetWithUpdates( &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", @@ -265,6 +268,7 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards 4.0.1"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }, @@ -294,12 +298,14 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, {Type: configv1.OperatorFailing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "unable to apply object"}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Reason: "UpdatePayloadIntegrity", Message: "Unable to apply 4.0.1: the contents of the update are invalid"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }) expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ - Name: "default", + Name: "default", + ResourceVersion: "1", }, Spec: configv1.ClusterVersionSpec{ Channel: "fast", @@ -314,6 +320,7 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }) @@ -570,35 +577,35 @@ func TestOperator_sync(t *testing.T) { }, }, { - name: "status no-op", + name: "set initial status conditions", content: content1, optr: Operator{ releaseImage: "payload/image:v4.0.1", namespace: "test", name: "default", - client: fake.NewSimpleClientset( - &configv1.ClusterVersion{ - ObjectMeta: metav1.ObjectMeta{ - Name: "default", - }, - Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: configv1.URL("http://localhost:8080/graph"), - Channel: "fast", - }, + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", }, - ), + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: configv1.URL("http://localhost:8080/graph"), + Channel: "fast", + }, + }), }, wantActions: func(t *testing.T, optr *Operator) { f := optr.client.(*fake.Clientset) act := f.Actions() - if len(act) != 3 { + if len(act) != 2 { t.Fatalf("unknown actions: %d %#v", len(act), act) } expectGet(t, act[0], "clusterversions", "", "default") expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ - Name: "default", + Name: "default", + ResourceVersion: "1", }, Spec: configv1.ClusterVersionSpec{ Upstream: configv1.URL("http://localhost:8080/graph"), @@ -612,13 +619,55 @@ func TestOperator_sync(t *testing.T) { Conditions: []configv1.ClusterOperatorStatusCondition{ {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, - {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Initializing, will work towards payload/image:v4.0.1"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }) - expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ + }, + }, + { + name: "after initial status is set, set reconciling and hash", + content: content1, + optr: Operator{ + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ - Name: "default", + Name: "default", + ResourceVersion: "1", + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: configv1.URL("http://localhost:8080/graph"), + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + }, + VersionHash: "", + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + }, + }, + }), + }, + wantActions: func(t *testing.T, optr *Operator) { + f := optr.client.(*fake.Clientset) + act := f.Actions() + if len(act) != 2 { + t.Fatalf("unknown actions: %d %#v", len(act), act) + } + expectGet(t, act[0], "clusterversions", "", "default") + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", }, Spec: configv1.ClusterVersionSpec{ Upstream: configv1.URL("http://localhost:8080/graph"), @@ -635,6 +684,7 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }) @@ -647,25 +697,31 @@ func TestOperator_sync(t *testing.T) { minimumUpdateCheckInterval: 1 * time.Minute, lastSyncAt: time.Now(), releaseImage: "payload/image:v4.0.1", + releaseVersion: "0.0.1-abc", namespace: "test", name: "default", - client: fake.NewSimpleClientset( + client: fakeClientsetWithUpdates( &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", + ClusterID: configv1.ClusterID(id), Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + Version: "0.0.1-abc", + }, Generation: 2, Conditions: []configv1.ClusterOperatorStatusCondition{ {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }, @@ -683,15 +739,31 @@ func TestOperator_sync(t *testing.T) { { name: "new available updates, version is live and was recently synced, sync", content: content1, - init: func(optr *Operator) { - client := &fake.Clientset{} - obj := &configv1.ClusterVersion{ + optr: Operator{ + minimumUpdateCheckInterval: 1 * time.Minute, + lastSyncAt: time.Now(), + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + availableUpdates: &availableUpdates{ + Upstream: "http://localhost:8080/graph", + Channel: "fast", + Updates: []configv1.Update{ + {Version: "4.0.2", Payload: "test/image:1"}, + {Version: "4.0.3", Payload: "test/image:2"}, + }, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, + }, + }, + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", + ClusterID: configv1.ClusterID(id), Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, @@ -701,32 +773,57 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, + }), + }, + wantActions: func(t *testing.T, optr *Operator) { + f := optr.client.(*fake.Clientset) + act := f.Actions() + if len(act) != 2 { + t.Fatalf("unknown actions: %d %#v", len(act), act) } - client.AddReactor("*", "*", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) { - if action.GetVerb() == "get" { - return true, obj.DeepCopy(), nil - } - if action.GetVerb() == "update" && action.GetSubresource() == "status" { - update := action.(ktesting.UpdateAction).GetObject().(*configv1.ClusterVersion) - obj.Status = update.Status - rv, _ := strconv.Atoi(update.ResourceVersion) - obj.ResourceVersion = strconv.Itoa(rv + 1) - return true, obj.DeepCopy(), nil - } - return false, nil, fmt.Errorf("unrecognized") + expectGet(t, act[0], "clusterversions", "", "default") + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + Generation: 2, + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: configv1.URL("http://localhost:8080/graph"), + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + AvailableUpdates: []configv1.Update{ + {Version: "4.0.2", Payload: "test/image:1"}, + {Version: "4.0.3", Payload: "test/image:2"}, + }, + Current: configv1.Update{Payload: "payload/image:v4.0.1"}, + Generation: 2, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionTrue}, + }, + }, }) - optr.client = client }, + }, + { + name: "new available updates for the default upstream URL, client has no upstream", + content: content1, optr: Operator{ minimumUpdateCheckInterval: 1 * time.Minute, lastSyncAt: time.Now(), releaseImage: "payload/image:v4.0.1", namespace: "test", name: "default", + defaultUpstreamServer: "http://localhost:8080/graph", availableUpdates: &availableUpdates{ - Upstream: "http://localhost:8080/graph", + Upstream: "", Channel: "fast", Updates: []configv1.Update{ {Version: "4.0.2", Payload: "test/image:1"}, @@ -737,6 +834,26 @@ func TestOperator_sync(t *testing.T) { Status: configv1.ConditionTrue, }, }, + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + Generation: 2, + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: "", + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Generation: 2, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + }, + }, + }), }, wantActions: func(t *testing.T, optr *Operator) { f := optr.client.(*fake.Clientset) @@ -751,8 +868,8 @@ func TestOperator_sync(t *testing.T) { Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", - Upstream: configv1.URL("http://localhost:8080/graph"), + ClusterID: configv1.ClusterID(id), + Upstream: "", Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -772,21 +889,94 @@ func TestOperator_sync(t *testing.T) { }) }, }, + { + name: "new available updates but for a different channel", + content: content1, + optr: Operator{ + minimumUpdateCheckInterval: 1 * time.Minute, + lastSyncAt: time.Now(), + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + availableUpdates: &availableUpdates{ + Upstream: "http://localhost:8080/graph", + Channel: "fast", + Updates: []configv1.Update{ + {Version: "4.0.2", Payload: "test/image:1"}, + {Version: "4.0.3", Payload: "test/image:2"}, + }, + Condition: configv1.ClusterOperatorStatusCondition{ + Type: configv1.RetrievedUpdates, + Status: configv1.ConditionTrue, + }, + }, + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + Generation: 2, + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: configv1.URL("http://localhost:8080/graph"), + Channel: "", + }, + Status: configv1.ClusterVersionStatus{ + Generation: 2, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + }, + }, + }), + }, + wantActions: func(t *testing.T, optr *Operator) { + f := optr.client.(*fake.Clientset) + act := f.Actions() + if len(act) != 2 { + t.Fatalf("unknown actions: %d %#v", len(act), act) + } + expectGet(t, act[0], "clusterversions", "", "default") + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + Generation: 2, + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: configv1.ClusterID(id), + Upstream: configv1.URL("http://localhost:8080/graph"), + Channel: "", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{Payload: "payload/image:v4.0.1"}, + Generation: 2, + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + }, + }, + }) + }, + }, { name: "payload hash matches content hash, act as reconcile, no need to apply", content: content1, optr: Operator{ - releaseImage: "payload/image:v4.0.1", - namespace: "test", - name: "default", - client: fake.NewSimpleClientset( + releaseImage: "payload/image:v4.0.1", + releaseVersion: "0.0.1-abc", + namespace: "test", + name: "default", + client: fakeClientsetWithUpdates( &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Name: "default", Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", + ClusterID: configv1.ClusterID(id), Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, @@ -802,6 +992,7 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }, @@ -820,9 +1011,10 @@ func TestOperator_sync(t *testing.T) { name: "payload hash does not match content hash, act as reconcile, no need to apply", content: content1, optr: Operator{ - releaseImage: "payload/image:v4.0.1", - namespace: "test", - name: "default", + releaseImage: "payload/image:v4.0.1", + releaseVersion: "0.0.1-abc", + namespace: "test", + name: "default", client: fake.NewSimpleClientset( &configv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ @@ -830,7 +1022,7 @@ func TestOperator_sync(t *testing.T) { Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: "abcdef01-0000-1111-2222-0123456789abcdef", + ClusterID: configv1.ClusterID(id), Upstream: configv1.URL("http://localhost:8080/graph"), Channel: "fast", }, @@ -846,6 +1038,7 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }, @@ -870,13 +1063,15 @@ func TestOperator_sync(t *testing.T) { Status: configv1.ClusterVersionStatus{ Current: configv1.Update{ Payload: "payload/image:v4.0.1", + Version: "0.0.1-abc", }, Generation: 2, VersionHash: "unknown_hash", Conditions: []configv1.ClusterOperatorStatusCondition{ {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, - {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards payload/image:v4.0.1"}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Message: "Working towards 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, }, }, }) @@ -901,6 +1096,155 @@ func TestOperator_sync(t *testing.T) { {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Message: "Cluster version is 0.0.1-abc"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + }, + }, + }) + }, + }, + + { + name: "detect invalid cluster version", + content: content1, + optr: Operator{ + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: "not-valid-cluster-id", + Upstream: configv1.URL("#%GG"), + Channel: "fast", + }, + }), + }, + wantActions: func(t *testing.T, optr *Operator) { + f := optr.client.(*fake.Clientset) + act := f.Actions() + if len(act) != 2 { + t.Fatalf("unknown actions: %d %#v", len(act), act) + } + expectGet(t, act[0], "clusterversions", "", "default") + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: "not-valid-cluster-id", + Upstream: configv1.URL("#%GG"), + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + }, + VersionHash: "", + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Reason: "InvalidClusterVersion", Message: "Stopped at payload/image:v4.0.1: the cluster version is invalid"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + {Type: ClusterVersionInvalid, Status: configv1.ConditionTrue, Reason: "InvalidClusterVersion", Message: "The cluster version is invalid:\n* spec.upstream: Invalid value: \"#%GG\": must be a valid URL or empty\n* spec.clusterID: Invalid value: \"not-valid-cluster-id\": must be an RFC4122-variant UUID\n"}, + }, + }, + }) + }, + }, + + { + name: "invalid cluster version should not block initial sync", + content: content1, + optr: Operator{ + releaseImage: "payload/image:v4.0.1", + namespace: "test", + name: "default", + client: fakeClientsetWithUpdates(&configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", + }, + Spec: configv1.ClusterVersionSpec{ + ClusterID: "not-valid-cluster-id", + Upstream: configv1.URL("#%GG"), + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + }, + VersionHash: "", + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Reason: "InvalidClusterVersion", Message: "Stopped at payload/image:v4.0.1: the cluster version is invalid"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + {Type: ClusterVersionInvalid, Status: configv1.ConditionTrue, Reason: "InvalidClusterVersion", Message: "The cluster version is invalid:\n* spec.upstream: Invalid value: \"#%GG\": must be a valid URL or empty\n* spec.clusterID: Invalid value: \"not-valid-cluster-id\": must be an RFC4122-variant UUID\n"}, + }, + }, + }), + }, + wantActions: func(t *testing.T, optr *Operator) { + f := optr.client.(*fake.Clientset) + act := f.Actions() + if len(act) != 3 { + t.Fatalf("unknown actions: %d %#v", len(act), act) + } + expectGet(t, act[0], "clusterversions", "", "default") + expectUpdateStatus(t, act[1], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "1", + }, + Spec: configv1.ClusterVersionSpec{ + // fields are cleared when passed to the client (although server will ignore spec changes) + ClusterID: "", + Upstream: configv1.URL(""), + + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + }, + VersionHash: "", + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionTrue, Reason: "", Message: "Reconciling payload/image:v4.0.1: the cluster version is invalid"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + {Type: ClusterVersionInvalid, Status: configv1.ConditionTrue, Reason: "InvalidClusterVersion", Message: "The cluster version is invalid:\n* spec.upstream: Invalid value: \"#%GG\": must be a valid URL or empty\n* spec.clusterID: Invalid value: \"not-valid-cluster-id\": must be an RFC4122-variant UUID\n"}, + }, + }, + }) + expectUpdateStatus(t, act[2], "clusterversions", "", &configv1.ClusterVersion{ + ObjectMeta: metav1.ObjectMeta{ + Name: "default", + ResourceVersion: "2", + }, + Spec: configv1.ClusterVersionSpec{ + // fields are cleared when passed to the client (although server will ignore spec changes) + ClusterID: "", + Upstream: configv1.URL(""), + + Channel: "fast", + }, + Status: configv1.ClusterVersionStatus{ + Current: configv1.Update{ + Payload: "payload/image:v4.0.1", + Version: "0.0.1-abc", + }, + VersionHash: "y_Kc5IQiIyU=", + Conditions: []configv1.ClusterOperatorStatusCondition{ + {Type: configv1.OperatorAvailable, Status: configv1.ConditionTrue, Message: "Done applying 0.0.1-abc"}, + {Type: configv1.OperatorFailing, Status: configv1.ConditionFalse}, + {Type: configv1.OperatorProgressing, Status: configv1.ConditionFalse, Reason: "InvalidClusterVersion", Message: "Stopped at 0.0.1-abc: the cluster version is invalid"}, + {Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse}, + {Type: ClusterVersionInvalid, Status: configv1.ConditionTrue, Reason: "InvalidClusterVersion", Message: "The cluster version is invalid:\n* spec.upstream: Invalid value: \"#%GG\": must be a valid URL or empty\n* spec.clusterID: Invalid value: \"not-valid-cluster-id\": must be an RFC4122-variant UUID\n"}, }, }, }) @@ -947,6 +1291,8 @@ func TestOperator_sync(t *testing.T) { } func TestOperator_availableUpdatesSync(t *testing.T) { + id := uuid.Must(uuid.NewRandom()).String() + tests := []struct { name string key string @@ -981,7 +1327,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Name: "default", }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1020,7 +1366,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Name: "default", }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1032,7 +1378,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { ), }, wantUpdates: &availableUpdates{ - Upstream: "", + Upstream: "", Channel: "fast", Condition: configv1.ClusterOperatorStatusCondition{ Type: configv1.RetrievedUpdates, @@ -1059,7 +1405,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Name: "default", }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1076,7 +1422,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { ), }, wantUpdates: &availableUpdates{ - Upstream: "", + Upstream: "", Channel: "fast", Condition: configv1.ClusterOperatorStatusCondition{ Type: configv1.RetrievedUpdates, @@ -1103,7 +1449,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Name: "default", }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1121,7 +1467,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { ), }, wantUpdates: &availableUpdates{ - Upstream: "", + Upstream: "", Channel: "fast", Condition: configv1.ClusterOperatorStatusCondition{ Type: configv1.RetrievedUpdates, @@ -1159,7 +1505,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Name: "default", }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1177,7 +1523,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { ), }, wantUpdates: &availableUpdates{ - Upstream: "", + Upstream: "", Channel: "fast", Updates: []configv1.Update{ {Version: "4.0.2-prerelease", Payload: "some.other.registry/payload/image:v4.0.2"}, @@ -1214,7 +1560,7 @@ func TestOperator_availableUpdatesSync(t *testing.T) { Generation: 2, }, Spec: configv1.ClusterVersionSpec{ - ClusterID: configv1.ClusterID(uuid.Must(uuid.NewRandom()).String()), + ClusterID: configv1.ClusterID(id), Channel: "fast", }, Status: configv1.ClusterVersionStatus{ @@ -1346,18 +1692,19 @@ func expectMutation(t *testing.T, a ktesting.Action, verb string, resource, subr } switch at := a.(type) { case ktesting.CreateAction: + expect, actual := obj.(runtime.Object).DeepCopyObject(), at.GetObject() // default autogenerated cluster ID - if in, ok := obj.(*configv1.ClusterVersion); ok { + if in, ok := expect.(*configv1.ClusterVersion); ok { if in.Spec.ClusterID == "" { - in.Spec.ClusterID = at.GetObject().(*configv1.ClusterVersion).Spec.ClusterID + in.Spec.ClusterID = actual.(*configv1.ClusterVersion).Spec.ClusterID } } - if in, ok := at.GetObject().(*configv1.ClusterOperator); ok { + if in, ok := actual.(*configv1.ClusterOperator); ok { for i := range in.Status.Conditions { in.Status.Conditions[i].LastTransitionTime.Time = time.Time{} } } - if in, ok := at.GetObject().(*configv1.ClusterVersion); ok { + if in, ok := actual.(*configv1.ClusterVersion); ok { for i := range in.Status.Conditions { in.Status.Conditions[i].LastTransitionTime.Time = time.Time{} } @@ -1367,10 +1714,29 @@ func expectMutation(t *testing.T, a ktesting.Action, verb string, resource, subr if e != a { t.Fatalf("unexpected action: %#v", at) } - if !reflect.DeepEqual(obj, at.GetObject()) { - t.Fatalf("unexpected object: %s", diff.ObjectReflectDiff(obj, at.GetObject())) + if !reflect.DeepEqual(expect, actual) { + t.Fatalf("unexpected object: %s", diff.ObjectReflectDiff(expect, actual)) } default: t.Fatalf("unknown verb %T", a) } } + +func fakeClientsetWithUpdates(obj *configv1.ClusterVersion) *fake.Clientset { + client := &fake.Clientset{} + client.AddReactor("*", "*", func(action ktesting.Action) (handled bool, ret runtime.Object, err error) { + if action.GetVerb() == "get" { + return true, obj.DeepCopy(), nil + } + if action.GetVerb() == "update" && action.GetSubresource() == "status" { + update := action.(ktesting.UpdateAction).GetObject().(*configv1.ClusterVersion) + obj.Status = update.Status + rv, _ := strconv.Atoi(update.ResourceVersion) + obj.ResourceVersion = strconv.Itoa(rv + 1) + glog.V(5).Infof("updated object to %#v", obj) + return true, obj.DeepCopy(), nil + } + return false, nil, fmt.Errorf("unrecognized") + }) + return client +} diff --git a/pkg/cvo/status.go b/pkg/cvo/status.go index 16f8277c91..9d414de165 100644 --- a/pkg/cvo/status.go +++ b/pkg/cvo/status.go @@ -1,8 +1,11 @@ package cvo import ( + "bytes" "fmt" + "k8s.io/apimachinery/pkg/util/validation/field" + "k8s.io/apimachinery/pkg/api/equality" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -12,16 +15,81 @@ import ( "github.com/openshift/cluster-version-operator/lib/resourcemerge" ) -func (optr *Operator) syncAvailableUpdatesStatus(original *configv1.ClusterVersion) (bool, error) { - config := optr.getAvailableUpdates().NeedsUpdate(original) - if config == nil { - return false, nil - } +// ClusterVersionInvalid indicates that the cluster version has an error that prevents the server from +// taking action. The cluster version operator will only reconcile the current state as long as this +// condition is set. +const ClusterVersionInvalid configv1.ClusterStatusConditionType = "Invalid" + +// syncInitialObjectStatus ensures that every known condition is either set or primed. errs is a list of +// known validation errors for the cluster version. +func (optr *Operator) syncInitialObjectStatus(original *configv1.ClusterVersion, errs field.ErrorList) (bool, error) { + config := original.DeepCopy() config.Status.Current = optr.currentVersion() + if updated := optr.getAvailableUpdates().NeedsUpdate(config); updated != nil { + config = updated + } + + now := metav1.Now() + + // ensure the initial state of all conditions is set + if resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, configv1.OperatorAvailable) == nil { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorAvailable, Status: configv1.ConditionFalse, LastTransitionTime: now}) + } + if resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, configv1.OperatorFailing) == nil { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorFailing, Status: configv1.ConditionFalse, LastTransitionTime: now}) + } + // We default towards progressing because we know we will at least need to sync + if resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, configv1.OperatorProgressing) == nil { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, + Message: fmt.Sprintf("Initializing, will work towards %s", optr.desiredVersionString(config)), + LastTransitionTime: now, + }) + } + // other conditions + if resourcemerge.FindOperatorStatusCondition(config.Status.Conditions, configv1.RetrievedUpdates) == nil { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.RetrievedUpdates, Status: configv1.ConditionFalse, LastTransitionTime: now}) + } + + // update the invalid condition + if len(errs) > 0 { + buf := &bytes.Buffer{} + if len(errs) == 1 { + fmt.Fprintf(buf, "The cluster version is invalid: %s", errs[0].Error()) + } else { + fmt.Fprintf(buf, "The cluster version is invalid:\n") + for _, err := range errs { + fmt.Fprintf(buf, "* %s\n", err.Error()) + } + } + reason := "InvalidClusterVersion" + + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: ClusterVersionInvalid, + Status: configv1.ConditionTrue, + Reason: reason, + Message: buf.String(), + LastTransitionTime: now, + }) + + if !resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, configv1.OperatorFailing) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, + Reason: reason, + Message: fmt.Sprintf("Stopped at %s: the cluster version is invalid", optr.desiredVersionString(config)), + LastTransitionTime: now, + }) + } + + } else { + resourcemerge.RemoveOperatorStatusCondition(&config.Status.Conditions, ClusterVersionInvalid) + } - // only report change if we actually updated the server updated, err := applyClusterVersionStatus(optr.client.ConfigV1(), config, original) + optr.rememberLastUpdate(updated) return updated != nil && updated.ResourceVersion != original.ResourceVersion, err } @@ -52,6 +120,13 @@ func (optr *Operator) syncProgressingStatus(config *configv1.ClusterVersion) err Message: fmt.Sprintf("Unable to apply %s: %s", optr.desiredVersionString(config), msg), LastTransitionTime: now, }) + } else if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, ClusterVersionInvalid) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionTrue, + Message: fmt.Sprintf("Reconciling %s: the cluster version is invalid", optr.desiredVersionString(config)), + LastTransitionTime: now, + }) } else { resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ Type: configv1.OperatorProgressing, @@ -59,7 +134,6 @@ func (optr *Operator) syncProgressingStatus(config *configv1.ClusterVersion) err Message: fmt.Sprintf("Working towards %s", optr.desiredVersionString(config)), LastTransitionTime: now, }) - } updated, err := applyClusterVersionStatus(optr.client.ConfigV1(), config, original) @@ -90,13 +164,23 @@ func (optr *Operator) syncAvailableStatus(config *configv1.ClusterVersion, curre resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{Type: configv1.OperatorFailing, Status: configv1.ConditionFalse, LastTransitionTime: now}) // clear the progressing condition - resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ - Type: configv1.OperatorProgressing, - Status: configv1.ConditionFalse, - Message: fmt.Sprintf("Cluster version is %s", version), + if resourcemerge.IsOperatorStatusConditionTrue(config.Status.Conditions, ClusterVersionInvalid) { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, + Reason: "InvalidClusterVersion", + Message: fmt.Sprintf("Stopped at %s: the cluster version is invalid", optr.desiredVersionString(config)), + LastTransitionTime: now, + }) + } else { + resourcemerge.SetOperatorStatusCondition(&config.Status.Conditions, configv1.ClusterOperatorStatusCondition{ + Type: configv1.OperatorProgressing, + Status: configv1.ConditionFalse, + Message: fmt.Sprintf("Cluster version is %s", version), - LastTransitionTime: now, - }) + LastTransitionTime: now, + }) + } updated, err := applyClusterVersionStatus(optr.client.ConfigV1(), config, original) optr.rememberLastUpdate(updated)