diff --git a/cmd/start.go b/cmd/start.go index cc7e6d19f0..1efb686877 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -231,7 +231,7 @@ func startControllers(ctx *controllerContext) error { startOpts.nodeName, componentNamespace, componentName, rootOpts.releaseImage, - ctx.InformerFactory.Clusterversion().V1().CVOConfigs(), + ctx.InformerFactory.Config().V1().ClusterVersions(), ctx.InformerFactory.Operatorstatus().V1().ClusterOperators(), ctx.APIExtInformerFactory.Apiextensions().V1beta1().CustomResourceDefinitions(), ctx.KubeInformerFactory.Apps().V1().Deployments(), @@ -244,7 +244,7 @@ func startControllers(ctx *controllerContext) error { if startOpts.enableAutoUpdate { go autoupdate.New( componentNamespace, componentName, - ctx.InformerFactory.Clusterversion().V1().CVOConfigs(), + ctx.InformerFactory.Config().V1().ClusterVersions(), ctx.InformerFactory.Operatorstatus().V1().ClusterOperators(), ctx.ClientBuilder.ClientOrDie(componentName), ctx.ClientBuilder.KubeClientOrDie(componentName), diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 8586c51405..2e1cdf1972 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -6,5 +6,5 @@ ${PROJECT_ROOT}/vendor/k8s.io/code-generator/generate-groups.sh \ all \ github.com/openshift/cluster-version-operator/pkg/generated \ github.com/openshift/cluster-version-operator/pkg/apis \ - "clusterversion.openshift.io:v1 operatorstatus.openshift.io:v1" \ + "config.openshift.io:v1 operatorstatus.openshift.io:v1" \ $@ \ diff --git a/install/0000_00_cluster-version-operator_01_cvoconfig.crd.yaml b/install/0000_00_cluster-version-operator_01_cvoconfig.crd.yaml index c9f65274ea..5d6e7ff443 100644 --- a/install/0000_00_cluster-version-operator_01_cvoconfig.crd.yaml +++ b/install/0000_00_cluster-version-operator_01_cvoconfig.crd.yaml @@ -2,10 +2,10 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: # name must match the spec fields below, and be in the form: . - name: cvoconfigs.clusterversion.openshift.io + name: clusterversions.config.openshift.io spec: # group name to use for REST API: /apis// - group: clusterversion.openshift.io + group: config.openshift.io # list of versions supported by this CustomResourceDefinition versions: - name: v1 @@ -20,8 +20,8 @@ spec: status: {} names: # plural name to be used in the URL: /apis/// - plural: cvoconfigs + plural: clusterversions # singular name to be used as an alias on the CLI and for display - singular: cvoconfig + singular: clusterversion # kind is normally the CamelCased singular type. Your resource manifests use this. - kind: CVOConfig + kind: ClusterVersion diff --git a/lib/resourceapply/cv.go b/lib/resourceapply/cv.go index f4168c71ca..fa9e6ab41b 100644 --- a/lib/resourceapply/cv.go +++ b/lib/resourceapply/cv.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/openshift/cluster-version-operator/lib/resourcemerge" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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/clusterversion.openshift.io/v1" + cvclientv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/config.openshift.io/v1" osclientv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/operatorstatus.openshift.io/v1" - cvlistersv1 "github.com/openshift/cluster-version-operator/pkg/generated/listers/clusterversion.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" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -63,10 +63,10 @@ func ApplyOperatorStatusFromCache(lister oslistersv1.ClusterOperatorLister, clie return actual, true, err } -func ApplyCVOConfig(client cvclientv1.CVOConfigsGetter, required *cvv1.CVOConfig) (*cvv1.CVOConfig, bool, error) { - existing, err := client.CVOConfigs(required.Namespace).Get(required.Name, metav1.GetOptions{}) +func ApplyClusterVersion(client cvclientv1.ClusterVersionsGetter, required *cvv1.ClusterVersion) (*cvv1.ClusterVersion, bool, error) { + existing, err := client.ClusterVersions(required.Namespace).Get(required.Name, metav1.GetOptions{}) if errors.IsNotFound(err) { - actual, err := client.CVOConfigs(required.Namespace).Create(required) + actual, err := client.ClusterVersions(required.Namespace).Create(required) return actual, true, err } if err != nil { @@ -74,19 +74,19 @@ func ApplyCVOConfig(client cvclientv1.CVOConfigsGetter, required *cvv1.CVOConfig } modified := pointer.BoolPtr(false) - resourcemerge.EnsureCVOConfig(modified, existing, *required) + resourcemerge.EnsureClusterVersion(modified, existing, *required) if !*modified { return existing, false, nil } - actual, err := client.CVOConfigs(required.Namespace).Update(existing) + actual, err := client.ClusterVersions(required.Namespace).Update(existing) return actual, true, err } -func ApplyCVOConfigFromCache(lister cvlistersv1.CVOConfigLister, client cvclientv1.CVOConfigsGetter, required *cvv1.CVOConfig) (*cvv1.CVOConfig, bool, error) { - obj, err := lister.CVOConfigs(required.Namespace).Get(required.Name) +func ApplyClusterVersionFromCache(lister cvlistersv1.ClusterVersionLister, client cvclientv1.ClusterVersionsGetter, required *cvv1.ClusterVersion) (*cvv1.ClusterVersion, bool, error) { + obj, err := lister.ClusterVersions(required.Namespace).Get(required.Name) if errors.IsNotFound(err) { - actual, err := client.CVOConfigs(required.Namespace).Create(required) + actual, err := client.ClusterVersions(required.Namespace).Create(required) return actual, true, err } if err != nil { @@ -94,14 +94,14 @@ func ApplyCVOConfigFromCache(lister cvlistersv1.CVOConfigLister, client cvclient } // Don't want to mutate cache. - existing := new(cvv1.CVOConfig) + existing := new(cvv1.ClusterVersion) obj.DeepCopyInto(existing) modified := pointer.BoolPtr(false) - resourcemerge.EnsureCVOConfig(modified, existing, *required) + resourcemerge.EnsureClusterVersion(modified, existing, *required) if !*modified { return existing, false, nil } - actual, err := client.CVOConfigs(required.Namespace).Update(existing) + actual, err := client.ClusterVersions(required.Namespace).Update(existing) return actual, true, err } diff --git a/lib/resourcemerge/cv.go b/lib/resourcemerge/cv.go index a5cf7a59d9..f99f6685d4 100644 --- a/lib/resourcemerge/cv.go +++ b/lib/resourcemerge/cv.go @@ -1,10 +1,10 @@ package resourcemerge import ( - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" ) -func EnsureCVOConfig(modified *bool, existing *cvv1.CVOConfig, required cvv1.CVOConfig) { +func EnsureClusterVersion(modified *bool, existing *cvv1.ClusterVersion, required cvv1.ClusterVersion) { EnsureObjectMeta(modified, &existing.ObjectMeta, required.ObjectMeta) if existing.Upstream != required.Upstream { *modified = true diff --git a/pkg/apis/apis.go b/pkg/apis/apis.go index 01ba749f35..c4cdcaea1c 100644 --- a/pkg/apis/apis.go +++ b/pkg/apis/apis.go @@ -1,7 +1,7 @@ package apis // ClusterVersionGroupName defines the API group for clusterversion. -const ClusterVersionGroupName = "clusterversion.openshift.io" +const ClusterVersionGroupName = "config.openshift.io" // OperatorStatusGroupName defines the API group for operatorstatus. const OperatorStatusGroupName = "operatorstatus.openshift.io" diff --git a/pkg/apis/clusterversion.openshift.io/v1/cluster_id.go b/pkg/apis/config.openshift.io/v1/cluster_id.go similarity index 100% rename from pkg/apis/clusterversion.openshift.io/v1/cluster_id.go rename to pkg/apis/config.openshift.io/v1/cluster_id.go diff --git a/pkg/apis/clusterversion.openshift.io/v1/cvoconfig.go b/pkg/apis/config.openshift.io/v1/clusterversion.go similarity index 61% rename from pkg/apis/clusterversion.openshift.io/v1/cvoconfig.go rename to pkg/apis/config.openshift.io/v1/clusterversion.go index a3461ebd22..230627bc5b 100644 --- a/pkg/apis/clusterversion.openshift.io/v1/cvoconfig.go +++ b/pkg/apis/config.openshift.io/v1/clusterversion.go @@ -6,23 +6,23 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) -// DeepCopyObject copies the CVOConfig into an Object. This doesn't actually +// DeepCopyObject copies the ClusterVersion into an Object. This doesn't actually // require a deep copy, but the code generator (and Go itself) isn't advanced // enough to determine that. -func (c *CVOConfig) DeepCopyObject() runtime.Object { +func (c *ClusterVersion) DeepCopyObject() runtime.Object { out := *c c.ObjectMeta.DeepCopyInto(&out.ObjectMeta) return &out } -// DeepCopyInto copies the CVOConfig into another CVOConfig. This doesn't +// DeepCopyInto copies the ClusterVersion into another ClusterVersion. This doesn't // actually require a deep copy, but the code generator (and Go itself) isn't // advanced enough to determine that. -func (c *CVOConfig) DeepCopyInto(out *CVOConfig) { +func (c *ClusterVersion) DeepCopyInto(out *ClusterVersion) { *out = *c c.ObjectMeta.DeepCopyInto(&out.ObjectMeta) } -func (c CVOConfig) String() string { +func (c ClusterVersion) String() string { return fmt.Sprintf("{ Upstream: %s Channel: %s ClusterID: %s }", c.Upstream, c.Channel, c.ClusterID) } diff --git a/pkg/apis/clusterversion.openshift.io/v1/register.go b/pkg/apis/config.openshift.io/v1/register.go similarity index 96% rename from pkg/apis/clusterversion.openshift.io/v1/register.go rename to pkg/apis/config.openshift.io/v1/register.go index 28b3fc5e8f..8853699f77 100644 --- a/pkg/apis/clusterversion.openshift.io/v1/register.go +++ b/pkg/apis/config.openshift.io/v1/register.go @@ -36,7 +36,8 @@ func init() { // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &CVOConfig{}, + &ClusterVersion{}, + &ClusterVersionList{}, &CVOStatus{}, ) diff --git a/pkg/apis/clusterversion.openshift.io/v1/types.go b/pkg/apis/config.openshift.io/v1/types.go similarity index 88% rename from pkg/apis/clusterversion.openshift.io/v1/types.go rename to pkg/apis/config.openshift.io/v1/types.go index 8722423f82..e2f0196a4d 100644 --- a/pkg/apis/clusterversion.openshift.io/v1/types.go +++ b/pkg/apis/config.openshift.io/v1/types.go @@ -4,20 +4,20 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// CVOConfigList is a list of CVOConfig resources. +// ClusterVersionList is a list of ClusterVersion resources. // +k8s:deepcopy-gen=true // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -type CVOConfigList struct { +type ClusterVersionList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` - Items []CVOConfig `json:"items"` + Items []ClusterVersion `json:"items"` } -// CVOConfig is the configuration for the ClusterVersionOperator. This is where +// ClusterVersion is the configuration for the ClusterVersionOperator. This is where // parameters related to automatic updates can be set. // +genclient -type CVOConfig struct { +type ClusterVersion struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/clusterversion.openshift.io/v1/url.go b/pkg/apis/config.openshift.io/v1/url.go similarity index 100% rename from pkg/apis/clusterversion.openshift.io/v1/url.go rename to pkg/apis/config.openshift.io/v1/url.go diff --git a/pkg/apis/clusterversion.openshift.io/v1/zz_generated.deepcopy.go b/pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go similarity index 87% rename from pkg/apis/clusterversion.openshift.io/v1/zz_generated.deepcopy.go rename to pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go index 528644fb7c..6d0af440da 100644 --- a/pkg/apis/clusterversion.openshift.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/config.openshift.io/v1/zz_generated.deepcopy.go @@ -25,32 +25,30 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CVOConfigList) DeepCopyInto(out *CVOConfigList) { +func (in *CVOStatus) DeepCopyInto(out *CVOStatus) { *out = *in out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CVOConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + 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 CVOConfigList. -func (in *CVOConfigList) DeepCopy() *CVOConfigList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CVOStatus. +func (in *CVOStatus) DeepCopy() *CVOStatus { if in == nil { return nil } - out := new(CVOConfigList) + out := new(CVOStatus) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CVOConfigList) DeepCopyObject() runtime.Object { +func (in *CVOStatus) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -58,30 +56,32 @@ func (in *CVOConfigList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CVOStatus) DeepCopyInto(out *CVOStatus) { +func (in *ClusterVersionList) DeepCopyInto(out *ClusterVersionList) { *out = *in out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.AvailableUpdates != nil { - in, out := &in.AvailableUpdates, &out.AvailableUpdates - *out = make([]Update, len(*in)) - copy(*out, *in) + 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 CVOStatus. -func (in *CVOStatus) DeepCopy() *CVOStatus { +// 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(CVOStatus) + out := new(ClusterVersionList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CVOStatus) DeepCopyObject() runtime.Object { +func (in *ClusterVersionList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index 8689bbdf96..ada38cd5b3 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -9,12 +9,12 @@ import ( "github.com/golang/glog" "github.com/openshift/cluster-version-operator/lib/resourceapply" - "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + "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/clusterversion.openshift.io/v1" + 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/clusterversion.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" @@ -38,7 +38,7 @@ const ( // Controller defines autoupdate controller. type Controller struct { - // namespace and name are used to find the CVOConfig, ClusterOperator. + // namespace and name are used to find the ClusterVersion, ClusterOperator. namespace, name string client clientset.Interface @@ -46,7 +46,7 @@ type Controller struct { syncHandler func(key string) error - cvoConfigLister cvlistersv1.CVOConfigLister + cvoConfigLister cvlistersv1.ClusterVersionLister clusterOperatorLister oslistersv1.ClusterOperatorLister cvoConfigListerSynced cache.InformerSynced @@ -59,7 +59,7 @@ type Controller struct { // New returns a new autoupdate controller. func New( namespace, name string, - cvoConfigInformer cvinformersv1.CVOConfigInformer, + cvoConfigInformer cvinformersv1.ClusterVersionInformer, clusterOperatorInformer osinformersv1.ClusterOperatorInformer, client clientset.Interface, kubeClient kubernetes.Interface, @@ -177,9 +177,9 @@ func (ctrl *Controller) sync(key string) error { return err } - cvoconfig, err := ctrl.cvoConfigLister.CVOConfigs(namespace).Get(name) + clusterversion, err := ctrl.cvoConfigLister.ClusterVersions(namespace).Get(name) if errors.IsNotFound(err) { - glog.V(2).Infof("CVOConfig %v has been deleted", key) + glog.V(2).Infof("ClusterVersion %v has been deleted", key) return nil } if err != nil { @@ -189,8 +189,8 @@ func (ctrl *Controller) sync(key string) error { // Deep-copy otherwise we are mutating our cache. // TODO: Deep-copy only when needed. ops := operatorstatus.DeepCopy() - config := new(v1.CVOConfig) - cvoconfig.DeepCopyInto(config) + config := new(v1.ClusterVersion) + clusterversion.DeepCopyInto(config) obji, _, err := scheme.Codecs.UniversalDecoder().Decode(ops.Status.Extension.Raw, nil, &v1.CVOStatus{}) if err != nil { @@ -207,9 +207,9 @@ func (ctrl *Controller) sync(key string) error { up := nextUpdate(cvoststatus.AvailableUpdates) config.DesiredUpdate = up - _, updated, err := resourceapply.ApplyCVOConfigFromCache(ctrl.cvoConfigLister, ctrl.client.ClusterversionV1(), config) + _, updated, err := resourceapply.ApplyClusterVersionFromCache(ctrl.cvoConfigLister, ctrl.client.ConfigV1(), config) if updated { - glog.Info("Auto Update set to %s", up) + glog.Infof("Auto Update set to %s", up) } return err } diff --git a/pkg/autoupdate/autoupdate_test.go b/pkg/autoupdate/autoupdate_test.go index 06df2178b7..19861fa0b6 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/clusterversion.openshift.io/v1" + "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" ) func TestNextUpdate(t *testing.T) { diff --git a/pkg/cvo/cvo.go b/pkg/cvo/cvo.go index e41da786b1..7d8c3fbf08 100644 --- a/pkg/cvo/cvo.go +++ b/pkg/cvo/cvo.go @@ -25,11 +25,11 @@ import ( "k8s.io/client-go/util/workqueue" "github.com/openshift/cluster-version-operator/lib/resourceapply" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.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/clusterversion.openshift.io/v1" + 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/clusterversion.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" ) @@ -43,13 +43,13 @@ const ( ) // ownerKind contains the schema.GroupVersionKind for type that owns objects managed by CVO. -var ownerKind = cvv1.SchemeGroupVersion.WithKind("CVOConfig") +var ownerKind = cvv1.SchemeGroupVersion.WithKind("ClusterVersion") // Operator defines cluster version operator. type Operator struct { // nodename allows CVO to sync fetchPayload to same node as itself. nodename string - // namespace and name are used to find the CVOConfig, OperatorStatus. + // namespace and name are used to find the ClusterVersion, OperatorStatus. namespace, name string // releaseImage allows templating CVO deployment manifest. releaseImage string @@ -68,7 +68,7 @@ type Operator struct { crdLister apiextlistersv1beta1.CustomResourceDefinitionLister deployLister appslisterv1.DeploymentLister - cvoConfigLister cvlistersv1.CVOConfigLister + cvoConfigLister cvlistersv1.ClusterVersionLister crdListerSynced cache.InformerSynced deployListerSynced cache.InformerSynced cvoConfigListerSynced cache.InformerSynced @@ -82,7 +82,7 @@ func New( nodename string, namespace, name string, releaseImage string, - cvoConfigInformer cvinformersv1.CVOConfigInformer, + cvoConfigInformer cvinformersv1.ClusterVersionInformer, clusterOperatorInformer osinformersv1.ClusterOperatorInformer, crdInformer apiextinformersv1beta1.CustomResourceDefinitionInformer, deployInformer appsinformersv1.DeploymentInformer, @@ -200,7 +200,7 @@ func (optr *Operator) sync(key string) error { glog.V(4).Infof("Finished syncing operator %q (%v)", key, time.Since(startTime)) }() - // We always run this to make sure CVOConfig can be synced. + // We always run this to make sure ClusterVersion can be synced. if err := optr.syncCustomResourceDefinitions(); err != nil { return err } @@ -210,8 +210,8 @@ func (optr *Operator) sync(key string) error { return err } - var obj *cvv1.CVOConfig - obj, err = optr.cvoConfigLister.CVOConfigs(namespace).Get(name) + var obj *cvv1.ClusterVersion + obj, err = optr.cvoConfigLister.ClusterVersions(namespace).Get(name) if apierrors.IsNotFound(err) { obj, err = optr.getConfig() } @@ -219,7 +219,7 @@ func (optr *Operator) sync(key string) error { return err } - config := &cvv1.CVOConfig{} + config := &cvv1.ClusterVersion{} obj.DeepCopyInto(config) if err := optr.syncProgressingStatus(config); err != nil { @@ -246,7 +246,7 @@ func (optr *Operator) sync(key string) error { return optr.syncAvailableStatus(config) } -func (optr *Operator) getConfig() (*cvv1.CVOConfig, error) { +func (optr *Operator) getConfig() (*cvv1.ClusterVersion, error) { upstream := cvv1.URL("http://localhost:8080/graph") channel := "fast" id, _ := uuid.NewRandom() @@ -257,8 +257,8 @@ func (optr *Operator) getConfig() (*cvv1.CVOConfig, error) { return nil, fmt.Errorf("Invalid %q, must be a version-4 UUID: found %s", id, id.Version()) } - // XXX: generate CVOConfig from options calculated above. - config := &cvv1.CVOConfig{ + // XXX: generate ClusterVersion from options calculated above. + config := &cvv1.ClusterVersion{ ObjectMeta: metav1.ObjectMeta{ Namespace: optr.namespace, Name: optr.name, @@ -268,6 +268,6 @@ func (optr *Operator) getConfig() (*cvv1.CVOConfig, error) { ClusterID: cvv1.ClusterID(id.String()), } - actual, _, err := resourceapply.ApplyCVOConfigFromCache(optr.cvoConfigLister, optr.client.ClusterversionV1(), config) + actual, _, err := resourceapply.ApplyClusterVersionFromCache(optr.cvoConfigLister, optr.client.ConfigV1(), config) return actual, err } diff --git a/pkg/cvo/status.go b/pkg/cvo/status.go index c10d15ee80..abec73390e 100644 --- a/pkg/cvo/status.go +++ b/pkg/cvo/status.go @@ -10,13 +10,13 @@ import ( "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/clusterversion.openshift.io/v1" + 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" "github.com/openshift/cluster-version-operator/pkg/version" ) -func (optr *Operator) syncProgressingStatus(config *cvv1.CVOConfig) error { +func (optr *Operator) syncProgressingStatus(config *cvv1.ClusterVersion) error { var cvoUpdates []cvv1.Update if updates, err := checkForUpdate(*config); err == nil { for _, update := range updates { @@ -53,7 +53,7 @@ func (optr *Operator) syncProgressingStatus(config *cvv1.CVOConfig) error { return err } -func (optr *Operator) syncAvailableStatus(config *cvv1.CVOConfig) error { +func (optr *Operator) syncAvailableStatus(config *cvv1.ClusterVersion) error { var cvoUpdates []cvv1.Update if updates, err := checkForUpdate(*config); err == nil { for _, update := range updates { @@ -122,7 +122,7 @@ func (optr *Operator) syncDegradedStatus(ierr error) error { return ierr } -func checkForUpdate(config cvv1.CVOConfig) ([]cincinnati.Update, error) { +func checkForUpdate(config cvv1.ClusterVersion) ([]cincinnati.Update, error) { uuid, err := uuid.Parse(string(config.ClusterID)) if err != nil { return nil, err diff --git a/pkg/cvo/sync.go b/pkg/cvo/sync.go index dfbf68ddfa..18bdfbce76 100644 --- a/pkg/cvo/sync.go +++ b/pkg/cvo/sync.go @@ -14,11 +14,11 @@ import ( "github.com/openshift/cluster-version-operator/lib/resourceapply" "github.com/openshift/cluster-version-operator/lib/resourcebuilder" "github.com/openshift/cluster-version-operator/pkg/apis" - cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" "github.com/openshift/cluster-version-operator/pkg/cvo/internal" ) -func (optr *Operator) syncUpdatePayload(config *cvv1.CVOConfig, payload *updatePayload) error { +func (optr *Operator) syncUpdatePayload(config *cvv1.ClusterVersion, payload *updatePayload) error { for _, manifest := range payload.manifests { taskName := fmt.Sprintf("(%s) %s/%s", manifest.GVK.String(), manifest.Object().GetNamespace(), manifest.Object().GetName()) glog.V(4).Infof("Running sync for %s", taskName) @@ -75,7 +75,7 @@ func getOverrideForManifest(overrides []cvv1.ComponentOverride, manifest lib.Man return cvv1.ComponentOverride{}, false } -func ownerRefModifier(config *cvv1.CVOConfig) resourcebuilder.MetaV1ObjectModifierFunc { +func ownerRefModifier(config *cvv1.ClusterVersion) resourcebuilder.MetaV1ObjectModifierFunc { oref := metav1.NewControllerRef(config, ownerKind) return func(obj metav1.Object) { obj.SetOwnerReferences([]metav1.OwnerReference{*oref}) diff --git a/pkg/cvo/updatepayload.go b/pkg/cvo/updatepayload.go index ff2f0371ec..d45c06680e 100644 --- a/pkg/cvo/updatepayload.go +++ b/pkg/cvo/updatepayload.go @@ -20,7 +20,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/clusterversion.openshift.io/v1" + cvv1 "github.com/openshift/cluster-version-operator/pkg/apis/config.openshift.io/v1" ) type updatePayload struct { @@ -126,7 +126,7 @@ func loadUpdatePayload(dir, releaseImage string) (*updatePayload, error) { }, nil } -func (optr *Operator) updatePayloadDir(config *cvv1.CVOConfig) (string, error) { +func (optr *Operator) updatePayloadDir(config *cvv1.ClusterVersion) (string, error) { ret := defaultUpdatePayloadDir tdir, err := optr.targetUpdatePayloadDir(config) if err != nil { @@ -138,7 +138,7 @@ func (optr *Operator) updatePayloadDir(config *cvv1.CVOConfig) (string, error) { return ret, nil } -func (optr *Operator) targetUpdatePayloadDir(config *cvv1.CVOConfig) (string, error) { +func (optr *Operator) targetUpdatePayloadDir(config *cvv1.ClusterVersion) (string, error) { if !isTargetSet(config.DesiredUpdate) { return "", nil } @@ -185,7 +185,7 @@ func validateUpdatePayload(dir string) error { return nil } -func (optr *Operator) fetchUpdatePayloadToDir(dir string, config *cvv1.CVOConfig) error { +func (optr *Operator) fetchUpdatePayloadToDir(dir string, config *cvv1.ClusterVersion) error { var ( version = config.DesiredUpdate.Version payload = config.DesiredUpdate.Payload diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index aa1c984bed..d488a09244 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -19,7 +19,7 @@ limitations under the License. package versioned import ( - clusterversionv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1" + 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" @@ -28,9 +28,9 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - ClusterversionV1() clusterversionv1.ClusterversionV1Interface + ConfigV1() configv1.ConfigV1Interface // Deprecated: please explicitly pick a version if possible. - Clusterversion() clusterversionv1.ClusterversionV1Interface + Config() configv1.ConfigV1Interface OperatorstatusV1() operatorstatusv1.OperatorstatusV1Interface // Deprecated: please explicitly pick a version if possible. Operatorstatus() operatorstatusv1.OperatorstatusV1Interface @@ -40,19 +40,19 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - clusterversionV1 *clusterversionv1.ClusterversionV1Client + configV1 *configv1.ConfigV1Client operatorstatusV1 *operatorstatusv1.OperatorstatusV1Client } -// ClusterversionV1 retrieves the ClusterversionV1Client -func (c *Clientset) ClusterversionV1() clusterversionv1.ClusterversionV1Interface { - return c.clusterversionV1 +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return c.configV1 } -// Deprecated: Clusterversion retrieves the default version of ClusterversionClient. +// Deprecated: Config retrieves the default version of ConfigClient. // Please explicitly pick a version. -func (c *Clientset) Clusterversion() clusterversionv1.ClusterversionV1Interface { - return c.clusterversionV1 +func (c *Clientset) Config() configv1.ConfigV1Interface { + return c.configV1 } // OperatorstatusV1 retrieves the OperatorstatusV1Client @@ -82,7 +82,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.clusterversionV1, err = clusterversionv1.NewForConfig(&configShallowCopy) + cs.configV1, err = configv1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -102,7 +102,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.clusterversionV1 = clusterversionv1.NewForConfigOrDie(c) + cs.configV1 = configv1.NewForConfigOrDie(c) cs.operatorstatusV1 = operatorstatusv1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) @@ -112,7 +112,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.clusterversionV1 = clusterversionv1.New(c) + cs.configV1 = configv1.New(c) cs.operatorstatusV1 = operatorstatusv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 6711c2983d..0c703a6273 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -20,8 +20,8 @@ package fake import ( clientset "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - clusterversionv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1" - fakeclusterversionv1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake" + 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" @@ -73,14 +73,14 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// ClusterversionV1 retrieves the ClusterversionV1Client -func (c *Clientset) ClusterversionV1() clusterversionv1.ClusterversionV1Interface { - return &fakeclusterversionv1.FakeClusterversionV1{Fake: &c.Fake} +// ConfigV1 retrieves the ConfigV1Client +func (c *Clientset) ConfigV1() configv1.ConfigV1Interface { + return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} } -// Clusterversion retrieves the ClusterversionV1Client -func (c *Clientset) Clusterversion() clusterversionv1.ClusterversionV1Interface { - return &fakeclusterversionv1.FakeClusterversionV1{Fake: &c.Fake} +// Config retrieves the ConfigV1Client +func (c *Clientset) Config() configv1.ConfigV1Interface { + return &fakeconfigv1.FakeConfigV1{Fake: &c.Fake} } // OperatorstatusV1 retrieves the OperatorstatusV1Client diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 0d0ca9258a..1121d7d0d6 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - clusterversionv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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" @@ -51,6 +51,6 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { - clusterversionv1.AddToScheme(scheme) + configv1.AddToScheme(scheme) operatorstatusv1.AddToScheme(scheme) } diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 5eac8f0ea4..507cdddc01 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - clusterversionv1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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" @@ -51,6 +51,6 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { - clusterversionv1.AddToScheme(scheme) + configv1.AddToScheme(scheme) operatorstatusv1.AddToScheme(scheme) } diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/cvoconfig.go b/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/cvoconfig.go deleted file mode 100644 index 09341398dd..0000000000 --- a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/cvoconfig.go +++ /dev/null @@ -1,157 +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/clusterversion.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" -) - -// CVOConfigsGetter has a method to return a CVOConfigInterface. -// A group's client should implement this interface. -type CVOConfigsGetter interface { - CVOConfigs(namespace string) CVOConfigInterface -} - -// CVOConfigInterface has methods to work with CVOConfig resources. -type CVOConfigInterface interface { - Create(*v1.CVOConfig) (*v1.CVOConfig, error) - Update(*v1.CVOConfig) (*v1.CVOConfig, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.CVOConfig, error) - List(opts metav1.ListOptions) (*v1.CVOConfigList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CVOConfig, err error) - CVOConfigExpansion -} - -// cVOConfigs implements CVOConfigInterface -type cVOConfigs struct { - client rest.Interface - ns string -} - -// newCVOConfigs returns a CVOConfigs -func newCVOConfigs(c *ClusterversionV1Client, namespace string) *cVOConfigs { - return &cVOConfigs{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the cVOConfig, and returns the corresponding cVOConfig object, and an error if there is any. -func (c *cVOConfigs) Get(name string, options metav1.GetOptions) (result *v1.CVOConfig, err error) { - result = &v1.CVOConfig{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cvoconfigs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CVOConfigs that match those selectors. -func (c *cVOConfigs) List(opts metav1.ListOptions) (result *v1.CVOConfigList, err error) { - result = &v1.CVOConfigList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cvoconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cVOConfigs. -func (c *cVOConfigs) Watch(opts metav1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("cvoconfigs"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a cVOConfig and creates it. Returns the server's representation of the cVOConfig, and an error, if there is any. -func (c *cVOConfigs) Create(cVOConfig *v1.CVOConfig) (result *v1.CVOConfig, err error) { - result = &v1.CVOConfig{} - err = c.client.Post(). - Namespace(c.ns). - Resource("cvoconfigs"). - Body(cVOConfig). - Do(). - Into(result) - return -} - -// Update takes the representation of a cVOConfig and updates it. Returns the server's representation of the cVOConfig, and an error, if there is any. -func (c *cVOConfigs) Update(cVOConfig *v1.CVOConfig) (result *v1.CVOConfig, err error) { - result = &v1.CVOConfig{} - err = c.client.Put(). - Namespace(c.ns). - Resource("cvoconfigs"). - Name(cVOConfig.Name). - Body(cVOConfig). - Do(). - Into(result) - return -} - -// Delete takes name of the cVOConfig and deletes it. Returns an error if one occurs. -func (c *cVOConfigs) Delete(name string, options *metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("cvoconfigs"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cVOConfigs) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("cvoconfigs"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched cVOConfig. -func (c *cVOConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CVOConfig, err error) { - result = &v1.CVOConfig{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("cvoconfigs"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_cvoconfig.go b/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_cvoconfig.go deleted file mode 100644 index fb2c49114d..0000000000 --- a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_cvoconfig.go +++ /dev/null @@ -1,128 +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 ( - clusterversionopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.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" -) - -// FakeCVOConfigs implements CVOConfigInterface -type FakeCVOConfigs struct { - Fake *FakeClusterversionV1 - ns string -} - -var cvoconfigsResource = schema.GroupVersionResource{Group: "clusterversion.openshift.io", Version: "v1", Resource: "cvoconfigs"} - -var cvoconfigsKind = schema.GroupVersionKind{Group: "clusterversion.openshift.io", Version: "v1", Kind: "CVOConfig"} - -// Get takes name of the cVOConfig, and returns the corresponding cVOConfig object, and an error if there is any. -func (c *FakeCVOConfigs) Get(name string, options v1.GetOptions) (result *clusterversionopenshiftiov1.CVOConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(cvoconfigsResource, c.ns, name), &clusterversionopenshiftiov1.CVOConfig{}) - - if obj == nil { - return nil, err - } - return obj.(*clusterversionopenshiftiov1.CVOConfig), err -} - -// List takes label and field selectors, and returns the list of CVOConfigs that match those selectors. -func (c *FakeCVOConfigs) List(opts v1.ListOptions) (result *clusterversionopenshiftiov1.CVOConfigList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(cvoconfigsResource, cvoconfigsKind, c.ns, opts), &clusterversionopenshiftiov1.CVOConfigList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &clusterversionopenshiftiov1.CVOConfigList{ListMeta: obj.(*clusterversionopenshiftiov1.CVOConfigList).ListMeta} - for _, item := range obj.(*clusterversionopenshiftiov1.CVOConfigList).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 cVOConfigs. -func (c *FakeCVOConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(cvoconfigsResource, c.ns, opts)) - -} - -// Create takes the representation of a cVOConfig and creates it. Returns the server's representation of the cVOConfig, and an error, if there is any. -func (c *FakeCVOConfigs) Create(cVOConfig *clusterversionopenshiftiov1.CVOConfig) (result *clusterversionopenshiftiov1.CVOConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(cvoconfigsResource, c.ns, cVOConfig), &clusterversionopenshiftiov1.CVOConfig{}) - - if obj == nil { - return nil, err - } - return obj.(*clusterversionopenshiftiov1.CVOConfig), err -} - -// Update takes the representation of a cVOConfig and updates it. Returns the server's representation of the cVOConfig, and an error, if there is any. -func (c *FakeCVOConfigs) Update(cVOConfig *clusterversionopenshiftiov1.CVOConfig) (result *clusterversionopenshiftiov1.CVOConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(cvoconfigsResource, c.ns, cVOConfig), &clusterversionopenshiftiov1.CVOConfig{}) - - if obj == nil { - return nil, err - } - return obj.(*clusterversionopenshiftiov1.CVOConfig), err -} - -// Delete takes name of the cVOConfig and deletes it. Returns an error if one occurs. -func (c *FakeCVOConfigs) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(cvoconfigsResource, c.ns, name), &clusterversionopenshiftiov1.CVOConfig{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeCVOConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(cvoconfigsResource, c.ns, listOptions) - - _, err := c.Fake.Invokes(action, &clusterversionopenshiftiov1.CVOConfigList{}) - return err -} - -// Patch applies the patch and returns the patched cVOConfig. -func (c *FakeCVOConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *clusterversionopenshiftiov1.CVOConfig, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cvoconfigsResource, c.ns, name, data, subresources...), &clusterversionopenshiftiov1.CVOConfig{}) - - if obj == nil { - return nil, err - } - return obj.(*clusterversionopenshiftiov1.CVOConfig), err -} 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 new file mode 100644 index 0000000000..8cb9057b78 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/clusterversion.go @@ -0,0 +1,157 @@ +/* +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(namespace string) ClusterVersionInterface +} + +// ClusterVersionInterface has methods to work with ClusterVersion resources. +type ClusterVersionInterface interface { + Create(*v1.ClusterVersion) (*v1.ClusterVersion, error) + Update(*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 + ns string +} + +// newClusterVersions returns a ClusterVersions +func newClusterVersions(c *ConfigV1Client, namespace string) *clusterVersions { + return &clusterVersions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + Resource("clusterversions"). + Name(clusterVersion.Name). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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). + Namespace(c.ns). + Resource("clusterversions"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/clusterversion.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go similarity index 63% rename from pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/clusterversion.openshift.io_client.go rename to pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go index 688c49229e..ae306ee06a 100644 --- a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/clusterversion.openshift.io_client.go +++ b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/config.openshift.io_client.go @@ -19,28 +19,28 @@ limitations under the License. package v1 import ( - v1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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 ClusterversionV1Interface interface { +type ConfigV1Interface interface { RESTClient() rest.Interface - CVOConfigsGetter + ClusterVersionsGetter } -// ClusterversionV1Client is used to interact with features provided by the clusterversion.openshift.io group. -type ClusterversionV1Client struct { +// ConfigV1Client is used to interact with features provided by the config.openshift.io group. +type ConfigV1Client struct { restClient rest.Interface } -func (c *ClusterversionV1Client) CVOConfigs(namespace string) CVOConfigInterface { - return newCVOConfigs(c, namespace) +func (c *ConfigV1Client) ClusterVersions(namespace string) ClusterVersionInterface { + return newClusterVersions(c, namespace) } -// NewForConfig creates a new ClusterversionV1Client for the given config. -func NewForConfig(c *rest.Config) (*ClusterversionV1Client, error) { +// 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 @@ -49,12 +49,12 @@ func NewForConfig(c *rest.Config) (*ClusterversionV1Client, error) { if err != nil { return nil, err } - return &ClusterversionV1Client{client}, nil + return &ConfigV1Client{client}, nil } -// NewForConfigOrDie creates a new ClusterversionV1Client for the given config and +// NewForConfigOrDie creates a new ConfigV1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ClusterversionV1Client { +func NewForConfigOrDie(c *rest.Config) *ConfigV1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -62,9 +62,9 @@ func NewForConfigOrDie(c *rest.Config) *ClusterversionV1Client { return client } -// New creates a new ClusterversionV1Client for the given RESTClient. -func New(c rest.Interface) *ClusterversionV1Client { - return &ClusterversionV1Client{c} +// New creates a new ConfigV1Client for the given RESTClient. +func New(c rest.Interface) *ConfigV1Client { + return &ConfigV1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -82,7 +82,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *ClusterversionV1Client) RESTClient() rest.Interface { +func (c *ConfigV1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/doc.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go similarity index 100% rename from pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/doc.go rename to pkg/generated/clientset/versioned/typed/config.openshift.io/v1/doc.go diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go similarity index 100% rename from pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/doc.go rename to pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/doc.go 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 new file mode 100644 index 0000000000..dc540b17e4 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_clusterversion.go @@ -0,0 +1,128 @@ +/* +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 + ns string +} + +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.NewGetAction(clusterversionsResource, c.ns, 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.NewListAction(clusterversionsResource, clusterversionsKind, c.ns, 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.NewWatchAction(clusterversionsResource, c.ns, 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.NewCreateAction(clusterversionsResource, c.ns, 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.NewUpdateAction(clusterversionsResource, c.ns, 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.NewDeleteAction(clusterversionsResource, c.ns, name), &configopenshiftiov1.ClusterVersion{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterVersions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusterversionsResource, c.ns, 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.NewPatchSubresourceAction(clusterversionsResource, c.ns, name, data, subresources...), &configopenshiftiov1.ClusterVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*configopenshiftiov1.ClusterVersion), err +} diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_clusterversion.openshift.io_client.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go similarity index 77% rename from pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_clusterversion.openshift.io_client.go rename to pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go index 19be76a048..7b4fbc074d 100644 --- a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/fake/fake_clusterversion.openshift.io_client.go +++ b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/fake/fake_config.openshift.io_client.go @@ -19,22 +19,22 @@ limitations under the License. package fake import ( - v1 "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1" + 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 FakeClusterversionV1 struct { +type FakeConfigV1 struct { *testing.Fake } -func (c *FakeClusterversionV1) CVOConfigs(namespace string) v1.CVOConfigInterface { - return &FakeCVOConfigs{c, namespace} +func (c *FakeConfigV1) ClusterVersions(namespace string) v1.ClusterVersionInterface { + return &FakeClusterVersions{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeClusterversionV1) RESTClient() rest.Interface { +func (c *FakeConfigV1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go similarity index 93% rename from pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/generated_expansion.go rename to pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go index 2bfe462f8c..ecfcd70d7b 100644 --- a/pkg/generated/clientset/versioned/typed/clusterversion.openshift.io/v1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/config.openshift.io/v1/generated_expansion.go @@ -18,4 +18,4 @@ limitations under the License. package v1 -type CVOConfigExpansion interface{} +type ClusterVersionExpansion interface{} diff --git a/pkg/generated/informers/externalversions/clusterversion.openshift.io/interface.go b/pkg/generated/informers/externalversions/config.openshift.io/interface.go similarity index 94% rename from pkg/generated/informers/externalversions/clusterversion.openshift.io/interface.go rename to pkg/generated/informers/externalversions/config.openshift.io/interface.go index 53a8b57fa6..4eae2797ea 100644 --- a/pkg/generated/informers/externalversions/clusterversion.openshift.io/interface.go +++ b/pkg/generated/informers/externalversions/config.openshift.io/interface.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package clusterversion +package config import ( - v1 "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/clusterversion.openshift.io/v1" + 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" ) diff --git a/pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/cvoconfig.go b/pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go similarity index 54% rename from pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/cvoconfig.go rename to pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go index 03cfe8b1a0..828ff5d357 100644 --- a/pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/cvoconfig.go +++ b/pkg/generated/informers/externalversions/config.openshift.io/v1/clusterversion.go @@ -21,69 +21,69 @@ package v1 import ( time "time" - clusterversionopenshiftiov1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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/clusterversion.openshift.io/v1" + 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" ) -// CVOConfigInformer provides access to a shared informer and lister for -// CVOConfigs. -type CVOConfigInformer interface { +// ClusterVersionInformer provides access to a shared informer and lister for +// ClusterVersions. +type ClusterVersionInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.CVOConfigLister + Lister() v1.ClusterVersionLister } -type cVOConfigInformer struct { +type clusterVersionInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } -// NewCVOConfigInformer constructs a new informer for CVOConfig type. +// 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 NewCVOConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredCVOConfigInformer(client, namespace, resyncPeriod, indexers, nil) +func NewClusterVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterVersionInformer(client, namespace, resyncPeriod, indexers, nil) } -// NewFilteredCVOConfigInformer constructs a new informer for CVOConfig type. +// 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 NewFilteredCVOConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredClusterVersionInformer(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.ClusterversionV1().CVOConfigs(namespace).List(options) + return client.ConfigV1().ClusterVersions(namespace).List(options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ClusterversionV1().CVOConfigs(namespace).Watch(options) + return client.ConfigV1().ClusterVersions(namespace).Watch(options) }, }, - &clusterversionopenshiftiov1.CVOConfig{}, + &configopenshiftiov1.ClusterVersion{}, resyncPeriod, indexers, ) } -func (f *cVOConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredCVOConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *clusterVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterVersionInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *cVOConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&clusterversionopenshiftiov1.CVOConfig{}, f.defaultInformer) +func (f *clusterVersionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&configopenshiftiov1.ClusterVersion{}, f.defaultInformer) } -func (f *cVOConfigInformer) Lister() v1.CVOConfigLister { - return v1.NewCVOConfigLister(f.Informer().GetIndexer()) +func (f *clusterVersionInformer) Lister() v1.ClusterVersionLister { + return v1.NewClusterVersionLister(f.Informer().GetIndexer()) } diff --git a/pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/interface.go b/pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go similarity index 80% rename from pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/interface.go rename to pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go index a74d23fedd..bd8cd88d89 100644 --- a/pkg/generated/informers/externalversions/clusterversion.openshift.io/v1/interface.go +++ b/pkg/generated/informers/externalversions/config.openshift.io/v1/interface.go @@ -24,8 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // CVOConfigs returns a CVOConfigInformer. - CVOConfigs() CVOConfigInformer + // ClusterVersions returns a ClusterVersionInformer. + ClusterVersions() ClusterVersionInformer } type version struct { @@ -39,7 +39,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// CVOConfigs returns a CVOConfigInformer. -func (v *version) CVOConfigs() CVOConfigInformer { - return &cVOConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +// ClusterVersions returns a ClusterVersionInformer. +func (v *version) ClusterVersions() ClusterVersionInformer { + return &clusterVersionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index b68a1b306c..1ff5002ab0 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -24,7 +24,7 @@ import ( time "time" versioned "github.com/openshift/cluster-version-operator/pkg/generated/clientset/versioned" - clusterversionopenshiftio "github.com/openshift/cluster-version-operator/pkg/generated/informers/externalversions/clusterversion.openshift.io" + 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" @@ -173,12 +173,12 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Clusterversion() clusterversionopenshiftio.Interface + Config() configopenshiftio.Interface Operatorstatus() operatorstatusopenshiftio.Interface } -func (f *sharedInformerFactory) Clusterversion() clusterversionopenshiftio.Interface { - return clusterversionopenshiftio.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Config() configopenshiftio.Interface { + return configopenshiftio.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Operatorstatus() operatorstatusopenshiftio.Interface { diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 9430f3e8aa..d247828251 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1 "github.com/openshift/cluster-version-operator/pkg/apis/clusterversion.openshift.io/v1" + 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" @@ -53,9 +53,9 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=clusterversion.openshift.io, Version=v1 - case v1.SchemeGroupVersion.WithResource("cvoconfigs"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Clusterversion().V1().CVOConfigs().Informer()}, nil + // 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"): diff --git a/pkg/generated/listers/clusterversion.openshift.io/v1/cvoconfig.go b/pkg/generated/listers/clusterversion.openshift.io/v1/cvoconfig.go deleted file mode 100644 index 2f4c2c49ab..0000000000 --- a/pkg/generated/listers/clusterversion.openshift.io/v1/cvoconfig.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/clusterversion.openshift.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// CVOConfigLister helps list CVOConfigs. -type CVOConfigLister interface { - // List lists all CVOConfigs in the indexer. - List(selector labels.Selector) (ret []*v1.CVOConfig, err error) - // CVOConfigs returns an object that can list and get CVOConfigs. - CVOConfigs(namespace string) CVOConfigNamespaceLister - CVOConfigListerExpansion -} - -// cVOConfigLister implements the CVOConfigLister interface. -type cVOConfigLister struct { - indexer cache.Indexer -} - -// NewCVOConfigLister returns a new CVOConfigLister. -func NewCVOConfigLister(indexer cache.Indexer) CVOConfigLister { - return &cVOConfigLister{indexer: indexer} -} - -// List lists all CVOConfigs in the indexer. -func (s *cVOConfigLister) List(selector labels.Selector) (ret []*v1.CVOConfig, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CVOConfig)) - }) - return ret, err -} - -// CVOConfigs returns an object that can list and get CVOConfigs. -func (s *cVOConfigLister) CVOConfigs(namespace string) CVOConfigNamespaceLister { - return cVOConfigNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// CVOConfigNamespaceLister helps list and get CVOConfigs. -type CVOConfigNamespaceLister interface { - // List lists all CVOConfigs in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.CVOConfig, err error) - // Get retrieves the CVOConfig from the indexer for a given namespace and name. - Get(name string) (*v1.CVOConfig, error) - CVOConfigNamespaceListerExpansion -} - -// cVOConfigNamespaceLister implements the CVOConfigNamespaceLister -// interface. -type cVOConfigNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CVOConfigs in the indexer for a given namespace. -func (s cVOConfigNamespaceLister) List(selector labels.Selector) (ret []*v1.CVOConfig, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CVOConfig)) - }) - return ret, err -} - -// Get retrieves the CVOConfig from the indexer for a given namespace and name. -func (s cVOConfigNamespaceLister) Get(name string) (*v1.CVOConfig, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("cvoconfig"), name) - } - return obj.(*v1.CVOConfig), nil -} diff --git a/pkg/generated/listers/config.openshift.io/v1/clusterversion.go b/pkg/generated/listers/config.openshift.io/v1/clusterversion.go new file mode 100644 index 0000000000..8a1b3e44f0 --- /dev/null +++ b/pkg/generated/listers/config.openshift.io/v1/clusterversion.go @@ -0,0 +1,94 @@ +/* +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) + // ClusterVersions returns an object that can list and get ClusterVersions. + ClusterVersions(namespace string) ClusterVersionNamespaceLister + 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 +} + +// ClusterVersions returns an object that can list and get ClusterVersions. +func (s *clusterVersionLister) ClusterVersions(namespace string) ClusterVersionNamespaceLister { + return clusterVersionNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ClusterVersionNamespaceLister helps list and get ClusterVersions. +type ClusterVersionNamespaceLister interface { + // List lists all ClusterVersions in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.ClusterVersion, err error) + // Get retrieves the ClusterVersion from the indexer for a given namespace and name. + Get(name string) (*v1.ClusterVersion, error) + ClusterVersionNamespaceListerExpansion +} + +// clusterVersionNamespaceLister implements the ClusterVersionNamespaceLister +// interface. +type clusterVersionNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ClusterVersions in the indexer for a given namespace. +func (s clusterVersionNamespaceLister) List(selector labels.Selector) (ret []*v1.ClusterVersion, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterVersion)) + }) + return ret, err +} + +// Get retrieves the ClusterVersion from the indexer for a given namespace and name. +func (s clusterVersionNamespaceLister) Get(name string) (*v1.ClusterVersion, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + 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/clusterversion.openshift.io/v1/expansion_generated.go b/pkg/generated/listers/config.openshift.io/v1/expansion_generated.go similarity index 66% rename from pkg/generated/listers/clusterversion.openshift.io/v1/expansion_generated.go rename to pkg/generated/listers/config.openshift.io/v1/expansion_generated.go index 9d8ddf7b1a..98470c2183 100644 --- a/pkg/generated/listers/clusterversion.openshift.io/v1/expansion_generated.go +++ b/pkg/generated/listers/config.openshift.io/v1/expansion_generated.go @@ -18,10 +18,10 @@ limitations under the License. package v1 -// CVOConfigListerExpansion allows custom methods to be added to -// CVOConfigLister. -type CVOConfigListerExpansion interface{} +// ClusterVersionListerExpansion allows custom methods to be added to +// ClusterVersionLister. +type ClusterVersionListerExpansion interface{} -// CVOConfigNamespaceListerExpansion allows custom methods to be added to -// CVOConfigNamespaceLister. -type CVOConfigNamespaceListerExpansion interface{} +// ClusterVersionNamespaceListerExpansion allows custom methods to be added to +// ClusterVersionNamespaceLister. +type ClusterVersionNamespaceListerExpansion interface{}